def __copy__(self):
    cls = self.__class__
    copied_op = cls.__new__(cls)
    copied_op.data = self.data.copy()
    copied_op._wires = self.wires
    copied_op._name = self._name
    if hasattr(self, '_inverse'):
        copied_op._inverse = self._inverse
    return copied_op
def __copy__(self):
    cls = self.__class__
    copied_op = cls.__new__(cls)
    copied_op.data = self.data.copy()
    copied_op._wires = self.wires
    copied_op._name = self._name
    if hasattr(self, '_inverse'):
        copied_op._inverse = self._inverse
    return copied_op