From b31b596ed2c6c8f06e694db048ed300cbeaae3e2 Mon Sep 17 00:00:00 2001 From: "Christopher J. Wood" Date: Mon, 3 Jun 2024 11:06:01 -0400 Subject: [PATCH] Fixup Base Error --- qiskit_aer/noise/errors/base_quantum_error.py | 8 +------- qiskit_aer/noise/errors/quantum_error.py | 6 ++++++ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/qiskit_aer/noise/errors/base_quantum_error.py b/qiskit_aer/noise/errors/base_quantum_error.py index 8a4658e1fe..61057ddd3a 100644 --- a/qiskit_aer/noise/errors/base_quantum_error.py +++ b/qiskit_aer/noise/errors/base_quantum_error.py @@ -35,13 +35,7 @@ def _repr_name(self) -> str: def __repr__(self): """Display QuantumError.""" - return f"<{self._repr_name}>" - - def __eq__(self, other): - """Test if two QuantumErrors are equal as SuperOps""" - if not isinstance(other, BaseQuantumError): - return False - return self.to_quantumchannel() == other.to_quantumchannel() + return f"<{self._repr_name()}>" def __hash__(self): return hash(self._id) diff --git a/qiskit_aer/noise/errors/quantum_error.py b/qiskit_aer/noise/errors/quantum_error.py index 4ab5adfc6c..5e3a324ee2 100644 --- a/qiskit_aer/noise/errors/quantum_error.py +++ b/qiskit_aer/noise/errors/quantum_error.py @@ -219,6 +219,12 @@ def __str__(self): output += f"\n P({j}) = {pair[0]}, Circuit = \n{pair[1]}" return output + def __eq__(self, other): + """Test if two QuantumErrors are equal as SuperOps""" + if not isinstance(other, BaseQuantumError): + return False + return self.to_quantumchannel() == other.to_quantumchannel() + @property def size(self): """Return the number of error circuit."""