qiskit.opflow.list_ops.SummedOp.equals¶
-
SummedOp.
equals
(other)[source]¶ Check if other is equal to self.
Note
This is not a mathematical check for equality. If
self
andother
implement the same operation but differ in the representation (e.g. different type of summands)equals
will evaluate toFalse
.- Parameters
other (
OperatorBase
) – The other operator to check for equality.- Return type
bool
- Returns
True, if other and self are equal, otherwise False.
Examples
>>> from qiskit.opflow import X, Z >>> 2 * X == X + X True >>> X + Z == Z + X True