qnet.convert.to_qutip module¶
Conversion of QNET expressions to qutip objects.
Summary¶
Functions:
SLH_to_qutip |
Generate and return QuTiP representation matrices for the Hamiltonian and the collapse operators. |
convert_to_qutip |
Convert a QNET expression to a qutip object |
__all__
: SLH_to_qutip
, convert_to_qutip
Reference¶
-
qnet.convert.to_qutip.
convert_to_qutip
(expr, full_space=None, mapping=None)[source]¶ Convert a QNET expression to a qutip object
Parameters: - expr – a QNET expression
- full_space (HilbertSpace) – The
Hilbert space in which expr is defined. If not given,
expr.space
is used. The Hilbert space must have a well-defined basis. - mapping (dict) – A mapping of any (sub-)expression to either a quip.Qobj directly, or to a callable that will convert the expression into a qutip.Qobj. Useful for e.g. supplying objects for symbols
Raises: ValueError
– if expr is not in full_space, or if expr cannot be converted.
-
qnet.convert.to_qutip.
SLH_to_qutip
(slh, full_space=None, time_symbol=None, convert_as='pyfunc')[source]¶ Generate and return QuTiP representation matrices for the Hamiltonian and the collapse operators. Any inhomogeneities in the Lindblad operators (resulting from coherent drives) will be moved into the Hamiltonian, cf.
move_drive_to_H()
.Parameters: - slh (SLH) – The SLH object from which to generate the qutip data
- full_space (HilbertSpace or None) – The Hilbert space in which to represent the operators. If None, the space of shl will be used
- time_symbol (
sympy.Symbol
or None) – The symbol (if any) expressing time dependence (usually ‘t’) - convert_as (str) – How to express time dependencies to qutip. Must be ‘pyfunc’ or ‘str’
Returns: tuple
(H, [L1, L2, ...])
as numerical qutip.Qobj representations, whereH
and eachL
may be a nested list to express time dependence, e.g.H = [H0, [H1, eps_t]]
, whereH0
andH1
are of type qutip.Qobj, andeps_t
is either a string (convert_as='str'
) or a function (convert_as='pyfunc'
)Raises: AlgebraError
– If the Hilbert space (slh.space or full_space) is invalid for numerical conversion