cuquantum.densitymat.tensor_product¶
- cuquantum.densitymat.tensor_product(*operands: Tuple[Union[ElementaryOperator, numpy.ndarray, cupy.ndarray, Tuple[Union[numpy.ndarray, cupy.ndarray], Callback]], Sequence[int], Optional[Sequence[bool]]], coeff: Union[numbers.Number, numpy.ndarray, cupy.ndarray, Callback, Tuple[numbers.Number, Callback], Tuple[Union[numpy.ndarray, cupy.ndarray], Callback]] = 1, batch_size: int = 1, dtype: Optional[str] = None) OperatorTerm[source]¶
Return an
OperatorTermfrom 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), wheredualis optional.tensorcontains the numerical data of the elementary operator and an optional callback function providing the tensor data. Accepted inputs fortensorareSubclass of
ElementaryOperator, i.e.DenseOperatorandMultidiagonalOperatorNDArrayType, which will be converted to aDenseOperatorTuple[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 casedtypeis required.batch_size – Batch size of coefficient
coeff, needs to be specified only ifcoeffis aCallback.
- Returns
An
OperatorTermconstructed from the tensor product of elementary operators.