def __eq__(self, other):
if type(self) is not type(other) orself.name != other.name orself.num_qubits != other.num_qubits orself.num_clbits != other.num_clbits orself.definition != other.definition:<EOL><INDENT>return False<EOL><DEDENT>for self_param, other_param in zip_longest(self.params, other.params):<EOL><INDENT>if self_param == other_param:<EOL><INDENT>continue<EOL><DEDENT>try:<EOL><INDENT>if numpy.isclose(float(self_param), float(other_param),<EOL>atol=_CUTOFF_PRECISION):<EOL><INDENT>continue<EOL><DEDENT><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT>return False<EOL><DEDENT>return True<EOL>
Two instructions are the same if they have the same name,
        same dimensions, and same params.

        Args:
            other (instruction): other instruction

        Returns:
            bool: are self and other equal.