qiskit/unroll/_jsonbackend.py
def _add_condition(self):
        """Check for a condition (self.creg) and add fields if necessary.

        Fields are added to the last operation in the circuit.
        """
        if self.creg is not None:
            mask = 0
            for cbit, index in self._cbit_order_internal.items():
                if cbit[0] == self.creg:
                    mask |= (1 << index)
                # Would be nicer to zero pad the mask, but we
                # need to know the total number of cbits.
                # format_spec = "{0:#0{%d}X}" % number_of_clbits
                # format_spec.format(mask)
                conditional = {
                    'type': "equals",
                    'mask': "0x%X" % mask,
                    'val': "0x%X" % self.cval
                }
            self.circuit['instructions'][-1]['conditional'] = conditional
Check for a condition (self.creg) and add fields if necessary.

        Fields are added to the last operation in the circuit.
        
Check for a condition (self.creg) and add fields if necessary.
Fields are added to the last operation in the circuit.
Check for a condition ( self . creg ) and add fields if necessary . Fields are added to the last operation in the circuit .
def _add_condition(self):
        if self.creg is not None:
            mask = 0
            for cbit, index in self._cbit_order_internal.items():
                if cbit[0] == self.creg:
                    mask |= (1 << index)
                conditional = {
                    'type': "equals",
                    'mask': "0x%X" % mask,
                    'val': "0x%X" % self.cval
                }
            self.circuit['instructions'][-1]['conditional'] = conditional
def _add_condition ( self ) : if self . creg is not None : mask = 0 for cbit , index in self . _cbit_order_internal . items ( ) : if cbit [ 0 ] == self . creg : mask |= ( 1 << index ) conditional = { 'type' : "equals" , 'mask' : "0x%X" % mask , 'val' : "0x%X" % self . cval } self . circuit [ 'instructions' ] [ - 1 ] [ 'conditional' ] = conditional
Check for a condition (self.creg) and add fields if necessary.
Check for a condition ( self . creg ) and add fields if necessary .
"""Check for a condition (self.creg) and add fields if necessary.

        Fields are added to the last operation in the circuit.
        """ # Would be nicer to zero pad the mask, but we # need to know the total number of cbits. # format_spec = "{0:#0{%d}X}" % number_of_clbits # format_spec.format(mask)
self