Don't call `reduce` on `CircuitOp` before printing
The `reduce` method mutates an instance of `CircuitOp`. It is called
in the method `__str__`. It should be called explicitly. This PR
removes the call in `__str__`.
Closes
@@ -153,7 +153,7 @@ class CircuitOp(PrimitiveOp):
return np.round(unitary * self.coeff, decimals=EVAL_SIG_DIGITS)
def __str__(self) -> str:
- qc = self.reduce().to_circuit() # type: ignore
+ qc = self.to_circuit() # type: ignore
prim_str = str(qc.draw(output='text'))
if self.coeff == 1.0:
return prim_str
