ScalarOp.compose¶
- ScalarOp.compose(other, qargs=None, front=False)[source]¶
Return the composed operator.
- Parameters
other (BaseOperator) – an operator object.
qargs (list or None) – 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].
- Returns
The operator self @ other.
- Return type
BaseOperator
- Raises
QiskitError – if other has incompatible dimensions for specified subsystems.
- Additional Information:
Composition (
@
) is defined as left matrix multiplication for matrix operators. That is thatA @ B
is equal toB * A
. Settingfront=True
returns right matrix multiplicationA * B
and is equivalent to thedot()
method.