This repository was archived by the owner on Dec 7, 2021. It is now read-only.
This repository was archived by the owner on Dec 7, 2021. It is now read-only.
SummedOp: equals should capture sums of matrices #1095
Closed
Description
What is the expected enhancement?
>>> from qiskit.aqua.operators import MatrixOp
>>> op = MatrixOp([[1, 0], [0, 0]])
>>> (2 * op) == (op + op)
False # should be True
This is done for PauliOp
s as part of #1059 but should be extended to MatrixOp
s.
One possible implementation is to adapt SummedOp.collapse_summands
to sum up all MatrixOp
s to one.