Skip to content

Commit

Permalink
Fixup Base Error
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseclectic committed Jun 3, 2024
1 parent f2603b9 commit b31b596
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 1 addition & 7 deletions qiskit_aer/noise/errors/base_quantum_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions qiskit_aer/noise/errors/quantum_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down

0 comments on commit b31b596

Please sign in to comment.