qalgebra.convert.to_qutip module

Conversion of QAlgebra expressions to qutip objects.

Summary

Functions:

convert_to_qutip

Convert a QAlgebra expression to a qutip object

__all__: convert_to_qutip

Reference

qalgebra.convert.to_qutip.convert_to_qutip(expr, full_space=None, mapping=None)[source]

Convert a QAlgebra expression to a qutip object

Parameters
  • expr – a QAlgebra 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.