Skip to main content

OperatorProduct

Represents a product of operators without scalar coefficients. For products with coefficients (e.g., 2.0*X(0)*Y(1)), use OperatorSum instead. Create instances using the operator_prod() factory function.

Factories

operator_prod() -> OperatorProduct

Creates an empty OperatorProduct.

Returns

A new empty OperatorProduct.

Example

var my_prod = operator_prod()  # Creates empty OperatorProduct

operator_prod(const Operator op) -> OperatorProduct

Creates an OperatorProduct from a single operator.

Parameters

  • op: The operator to include in the product.

Returns

A new OperatorProduct containing the operator.

Example

var my_prod = operator_prod(X(0))  # Creates OperatorProduct with single operator

operator_prod(const OperatorProduct op_prod) -> OperatorProduct

Creates an OperatorProduct from an existing OperatorProduct.

Parameters

Returns

A new OperatorProduct.

Example

var my_prod = operator_prod(X(0) * Y(2))  # Creates OperatorProduct

Symbols

NameDescription
*=Multiplies this product by another operator, appending the operator to the product.
=Assigns an Operator to this OperatorProduct, replacing any existing content.
[]Accesses the entries of the product and returns the operator at specified index.