cuquantum.densitymat.OperatorTerm¶
- class cuquantum.densitymat.OperatorTerm(dtype: Optional[str] = None)[source]¶
Operator term consisting of tensor products of elementary operators.
An
OperatorTermcontaining a tensor product of elementary operators can be obtained from the free functiontensor_product(). Sums of more than a single product are obtained by in-place (+=) or out-of-place addition (+) ofOperatorTermobjects.- Parameters
dtype – Numeric data type of the underlying elementary operators’ data. Defaults to
Noneand will be inferred from the appended tensor products of elementary operators.
Note
Scalar operators, for which no product is appended, require specification of
dtypeat construction.
Methods
- __add__(other: OperatorTerm) OperatorTerm[source]¶
Return a new
OperatorTermequal to the sum of thisOperatorTermand anotherOperatorTerm.
- __iadd__(other: OperatorTerm) OperatorTerm[source]¶
Inplace add another
OperatorTerminto thisOperatorTerm.
- __init__(dtype: Optional[str] = None)[source]¶
Initialize an operator term consisting of tensor products of elementary operators.
- __mul__(other: Union[numbers.Number, Callable, OperatorTerm]) OperatorTerm[source]¶
Multiply this
OperatorTermwith a number, callable or anotherOperatorTermon the left.
- __rmul__(other: Union[numbers.Number, Callable, OperatorTerm]) OperatorTerm[source]¶
Multiply this
OperatorTermwith a number, callable or anotherOperatorTermon the right.
- dag() OperatorTerm[source]¶
Return a new
OperatorTermequal to the complex conjugate of thisOperatorTerm.Warning
A error will be raised if the
OperatorTermcontains tensor products of elementary operators acting on both bra and ket modes at the same time.
- dual() OperatorTerm[source]¶
Return a new
OperatorTermwith duality reversed.
Attributes
- dtype¶
Data type of this
OperatorTerm.
- hilbert_space_dims¶
Hilbert space dimensions of this
OperatorTerm.