Skip to content

Add entanglement entropy operator #1024

Description

@HaroldErbin

The entanglement entropy obtained by tracing the partition function over a set of sites is a natural operator to compute. Would it be possible to add it to pulser.backend ?

Here is the Qutip code I have been using:

def vn_entropy(state: Qobj, sites=None) -> float:
    """
    Compute von Neumann entropy by tracing over specified sites.

    By default, this traces over half of the spin sites.
    """

    state = state.unit()

    state.dims = cast(list, state.dims)
    L = len(state.dims[0])

    if sites is None:
        sites = list(range(L // 2))

    return qutip.entropy_vn(state.ptrace(sites))

entropy = np.array([vn_entropy(state) for state in results.states])

It would be great to have an equivalent that could be computed during the time evolution. Would you have a solution based on a callback or something else meanwhile?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions