qalgebra.convert.to_sympy_matrix module¶
Conversion of QAlgebra expressions to sympy matrices. For small Hilbert spaces, this facilitates some analytic treatments, such as decomposition into a basis.
Summary¶
Functions:
Creation operator for a Hilbert space of dimension n, as an instance of sympy.Matrix |
|
|
|
Convert a QAlgebra expression to an explicit |
__all__
: convert_to_sympy_matrix
Reference¶
-
qalgebra.convert.to_sympy_matrix.
convert_to_sympy_matrix
(expr, full_space=None)[source]¶ Convert a QAlgebra expression to an explicit
n x n
instance of sympy.Matrix, wheren
is the dimension of full_space. The entries of the matrix may contain symbols.- 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.
- Raises
BasisNotSetError – if full_space does not have a defined basis
ValueError – if expr is not in full_space, or if expr cannot be converted.