qcheff.models.spin_chain.utils

Module Contents

Classes

DegenerateSpinChain

Describes a degenerate spin chain of size N. All qubits have the same frequency = 1 with nearest ne ighbor coupling strength J (in units of frequency) and next-nearest neighbor coupling strength g (in units of frequency).

Functions

create_degen_chain

Creates a spin chain with given parameters.

embed_operator

Identity wrapping for the appropriate operator

QuTiP_level_labels

Returns strings showing labels for each level in the preferred ordering in QuTiP.

QuTiP_drift_ham_degen_chain

Creates a QuTiP drift Hamiltonian given a chain. Energies are measured in units of omega.

QuTiP_chain_prodstate

Returns an initial state of the given label for a product state.

QuTiP_chain_prodstate_index

Returns an initial state of the given label for a product state.

QuTiP_total_ham_degen_chain

Creates a QuTiP total driven Hamiltonian given a chain. Energies are measured in units of omega. Times are measured in units of pi/omega.

simulate_chain_dynamics

Simulates chain dynamics and plots Pauli operator expectation values.

setup_magnus_chain_example

state_transfer_infidelity

API

class DegenerateSpinChain

Describes a degenerate spin chain of size N. All qubits have the same frequency = 1 with nearest ne ighbor coupling strength J (in units of frequency) and next-nearest neighbor coupling strength g (in units of frequency).

chain_size: int

None

nearest_couping: float

None

next_nearest_couping: float

None

create_degen_chain(N: int = 3, J: float = 0.05, g: float = 0.005)

Creates a spin chain with given parameters.

N: int, default 3 size of chain

J: float, default 1/20 NN coupling strength

g: float, default 1/200 NNN coupling strength. The default value is 1/10 the default value for J.

embed_operator(op: qutip.Qobj, pos: int, ntrunc: int, nsystems: int)

Identity wrapping for the appropriate operator

op: qt.Qobj The operator to be wrapped. Ideally, it should have dimensions=ntrunc

pos: int The position of the operator

ntrunc: int The truncation level of all operators

nsystems: int The total number of systems Should be larger than pos.

QuTiP_level_labels(chain: qcheff.models.spin_chain.utils.DegenerateSpinChain)

Returns strings showing labels for each level in the preferred ordering in QuTiP.

QuTiP_drift_ham_degen_chain(chain: qcheff.models.spin_chain.utils.DegenerateSpinChain)

Creates a QuTiP drift Hamiltonian given a chain. Energies are measured in units of omega.

QuTiP_chain_prodstate(chain_size: int, state_label: tuple[int, ...])

Returns an initial state of the given label for a product state.

QuTiP_chain_prodstate_index(chain_size: int, state_index: int)

Returns an initial state of the given label for a product state.

QuTiP_total_ham_degen_chain(chain: qcheff.models.spin_chain.utils.DegenerateSpinChain, tlist: numpy.ndarray, xdrive: numpy.ndarray, ydrive: numpy.ndarray)

Creates a QuTiP total driven Hamiltonian given a chain. Energies are measured in units of omega. Times are measured in units of pi/omega.

Two drives must be provided as arrays. For simplicity, we assume the maximum drive strength is 1 (in units of omega).

simulate_chain_dynamics(chain: qcheff.models.spin_chain.utils.DegenerateSpinChain, tlist: numpy.ndarray, Hsim: qutip.Qobj | qutip.QobjEvo, psi0: qutip.Qobj, plot=None)

Simulates chain dynamics and plots Pauli operator expectation values.

setup_magnus_chain_example(pulse_coeffs: collections.abc.Sequence[float], **kwargs)
state_transfer_infidelity(**kwargs)