prod(*ops, do_queue=True, id=None)¶
Construct an operator which represents the generalized product of the operators provided.
The generalized product operation represents both the tensor product as well as matrix composition. This can be resolved naturally from the wires that the given operators act on.
ops (tuple[Operator]) – The operators we would like to multiply
- Keyword Arguments
do_queue (bool) – determines if the product operator will be queued. Default is True.
id (str or None) – id for the product operator. Default is None.
the operator representing the product.
- Return type
>>> prod_op = prod(qml.PauliX(0), qml.PauliZ(0)) >>> prod_op PauliX(wires=) @ PauliZ(wires=) >>> prod_op.matrix() array([[ 0, -1], [ 1, 0]])
- What is PennyLane?
- Quantum circuits
- Gradients and training
- Quantum operators
- Inspecting circuits
- Compiling circuits
- Quantum Chemistry