qiskit.quantum_info.Operator.compose¶
- Operator.compose(other, qargs=None, front=False)[ソース]¶
Return the operator composition with another Operator.
- パラメータ
other (Operator) – a Operator object.
qargs (list or None) – Optional, a list of subsystem positions to apply other on. If None apply on all subsystems (default: None).
front (bool) – If True compose using right operator multiplication, instead of left multiplication [default: False].
- 戻り値
The composed Operator.
- 戻り値の型
- 例外
QiskitError – if other cannot be converted to an operator, or has incompatible dimensions for specified subsystems.
注釈
Composition (
&
) by default is defined as left matrix multiplication for matrix operators, while@
(equivalent todot()
) is defined as right matrix multiplication. That is thatA & B == A.compose(B)
is equivalent toB @ A == B.dot(A)
whenA
andB
are of the same type.Setting the
front=True
kwarg changes this to right matrix multiplication and is equivalent to thedot()
methodA.dot(B) == A.compose(B, front=True)
.