qiskit/releasenotes/notes/0.12/operator-dot-fd90e7e5ad99ff...

26 lines
1.2 KiB
YAML

---
features:
- |
Added a new abstract method
:meth:`qiskit.quantum_info.Operator.dot` to
the abstract ``BaseOperator`` class, so it is included for all
implementations of that abstract
class, including :class:`qiskit.quantum_info.Operator` and
``QuantumChannel`` (e.g., :class:`qiskit.quantum_info.Choi`)
objects. This method returns the right operator multiplication
``a.dot(b)`` :math:`= a \cdot b`. This is equivalent to
calling the operator
:meth:`qiskit.quantum_info.Operator.compose` method with the kwarg
``front`` set to ``True``.
upgrade:
- |
Changed :class:`qiskit.quantum_info.Operator` magic methods so that
``__mul__`` (which gets executed by python's multiplication operation,
if the left hand side of the operation has it defined) implements right
matrix multiplication (i.e. :meth:`qiskit.quantum_info.Operator.dot`), and
``__rmul__`` (which gets executed by python's multiplication operation
from the right hand side of the operation if the left does not have
``__mul__`` defined) implements scalar multiplication (i.e.
:meth:`qiskit.quantum_info.Operator.multiply`). Previously both methods
implemented scalar multiplication.