tensor_product#
-
cuquantum.
densitymat. tensor_product( - *operands: Tuple[ElementaryOperator | ndarray | ndarray | Tuple[ndarray | ndarray, Callback], Sequence[int], Sequence[bool] | None],
- coeff: Number | ndarray | ndarray | Callback | Tuple[Number, Callback] | Tuple[ndarray | ndarray, Callback] = 1,
- batch_size: int = 1,
- dtype: str | None = None,
Return an
OperatorTerm
from a tensor product of elementary operators.- Parameters:
operands –
Operands in the tensor product. Each operand is a tuple of length 2 or 3 of the form
(tensor, modes, dual)
, wheredual
is optional.tensor
contains the numerical data of the elementary operator and an optional callback function providing the tensor data. Accepted inputs fortensor
areSubclass of
ElementaryOperator
, i.e.DenseOperator
andMultidiagonalOperator
NDArrayType
, which will be converted to aDenseOperator
Tuple[NDArrayType, Callable]
, which will be passed to the initializer ofDenseOperator
coeff – Coefficient(s) associated with this
OperatorTerm
.dtype – Data type of this
OperatorTerm
. Default value is inferred from input operands unless this function returns a scalarOperatorTerm
, in which casedtype
is required.batch_size – Batch size of coefficient
coeff
, needs to be specified only ifcoeff
is aCallback
.
- Returns:
An
OperatorTerm
constructed from the tensor product of elementary operators.