qcheff.magnus.magnus_time_evolution

Module Contents

Classes

MagnusTimeEvol

MagnusTimeEvolDense

MagnusTimeEvolSparseLazy

Sparse version of MagnusTimeEvol. This version uses a lazy approach.

API

class MagnusTimeEvol
tlist: qcheff.operators.qcheff_array

None

drift_ham: qcheff.operators.qcheffOperatorMatrix

None

control_sigs: qcheff.operators.qcheff_array

None

control_hams: collections.abc.Sequence[qcheff.operators.qcheffOperatorMatrix]

None

dims: tuple[int, int]

‘field(…)’

dt: float

‘field(…)’

tlims: tuple[float, float]

‘field(…)’

num_controls: int

‘field(…)’

expm: collections.abc.Callable

‘field(…)’

update_control_sigs(control_sigs: qcheff.operators.qcheff_array) None

Update the control_sigs array.

Parameters

control_sigs : np.ndarray or cp.ndarray The new control_sigs array. Must have the same shape as the current control_sigs array.

Raises

ValueError If the shape of the new array does not match the current array.

abstractmethod magnus_hamiltonians(**kwargs) qcheff.operators.qcheff_array | collections.abc.Generator[qcheff.operators.qcheff_array, None, None]
abstractmethod magnus_propagators(**kwargs) qcheff.operators.qcheff_array | collections.abc.Generator[qcheff.operators.qcheff_array, None, None]
evolve(init_state: qcheff.operators.qcheff_array, **kwargs) collections.abc.Generator[qcheff.operators.qcheff_array, None, None]

Evolve the initial state using the Magnus expansion.

Parameters

init_state : qcheff_array The initial state to evolve. **kwargs : dict Additional keyword arguments for the evolution.

Yields

qcheff_array The state at the end of each interval.

class MagnusTimeEvolDense

Bases: qcheff.magnus.magnus_time_evolution.MagnusTimeEvol

magnus_hamiltonians(**kwargs) qcheff.operators.qcheff_array

Compute the Magnus Hamiltonians.

Parameters

**kwargs : dict Additional keyword arguments for the computation.

Returns

qcheff_array The computed Magnus Hamiltonians.

Raises

ValueError If both or neither of num_intervals and points_per_interval are provided.

magnus_propagators(**kwargs) qcheff.operators.qcheff_array

Compute the Magnus propagators.

Parameters

**kwargs : dict Additional keyword arguments for the computation.

Returns

qcheff_array The computed Magnus propagators.

class MagnusTimeEvolSparseLazy

Bases: qcheff.magnus.magnus_time_evolution.MagnusTimeEvol

Sparse version of MagnusTimeEvol. This version uses a lazy approach.

tlist: qcheff.operators.qcheff_array

None

drift_ham: qcheff.operators.sparse_operator.SparseOperator

None

control_sigs: qcheff.operators.qcheff_array

None

control_hams: collections.abc.Sequence[qcheff.operators.sparse_operator.SparseOperator]

None

magnus_hamiltonians(**kwargs) collections.abc.Generator[qcheff.operators.sparse_operator.SparseOperator, None, None]

Compute the Magnus Hamiltonians lazily.

Parameters

**kwargs : dict Additional keyword arguments for the computation.

Yields

qcheff_array The computed Magnus Hamiltonians.

Raises

ValueError If both or neither of num_intervals and points_per_interval are provided.

magnus_propagators(**kwargs) collections.abc.Generator[qcheff.operators.qcheff_array, None, None]

Compute the Magnus propagators lazily.

Parameters

**kwargs : dict Additional keyword arguments for the computation.

Yields

qcheff_array The computed Magnus propagators.