src/quantuminspire/qiskit/backend_qx.py
def __validate_number_of_clbits(self, experiment: QasmQobjExperiment) -> None:
        """ Checks whether the number of classical bits has a value cQASM can support.

            1. When number of classical bits is less than 1 an error is raised.
            2. When binary controlled gates are used and the number of classical registers > number of classical
            registers an error is raised.
                When using binary controlled gates in Qiskit, we can have something like:
                q = QuantumRegister(2)
                c = ClassicalRegister(4)
                circuit = QuantumCircuit(q, c)
                circuit.h(q[0]).c_if(c, 15)

                Because cQASM has the same number of classical registers as qubits (2 in this case),
                this circuit cannot be translated to valid cQASM.

        Args:
            experiment: The experiment with gate operations and header.

        Raises:
            QisKitBackendError: When the value is not correct.
        """
        number_of_clbits = experiment.header.memory_slots
        if number_of_clbits < 1:
            raise QisKitBackendError("Invalid amount of classical bits ({})!".format(number_of_clbits))

        if BaseBackend.configuration(self).conditional:
            number_of_qubits = experiment.header.n_qubits
            if number_of_clbits > number_of_qubits:
                # no problem when there are no conditional gate operations
                for instruction in experiment.instructions:
                    if hasattr(instruction, 'conditional'):
                        raise QisKitBackendError("Number of classical bits must be less than or equal to the"
                                                 " number of qubits when using conditional gate operations")
 Checks whether the number of classical bits has a value cQASM can support.

            1. When number of classical bits is less than 1 an error is raised.
            2. When binary controlled gates are used and the number of classical registers > number of classical
            registers an error is raised.
                When using binary controlled gates in Qiskit, we can have something like:
                q = QuantumRegister(2)
                c = ClassicalRegister(4)
                circuit = QuantumCircuit(q, c)
                circuit.h(q[0]).c_if(c, 15)

                Because cQASM has the same number of classical registers as qubits (2 in this case),
                this circuit cannot be translated to valid cQASM.

        Args:
            experiment: The experiment with gate operations and header.

        Raises:
            QisKitBackendError: When the value is not correct.
        
Checks whether the number of classical bits has a value cQASM can support.
1. When number of classical bits is less than 1 an error is raised.
2. When binary controlled gates are used and the number of classical registers > number of classical
registers an error is raised.

Because cQASM has the same number of classical registers as qubits (2 in this case),
this circuit cannot be translated to valid cQASM.
Checks whether the number of classical bits has a value cQASM can support . 1 . When number of classical bits is less than 1 an error is raised . 2 . When binary controlled gates are used and the number of classical registers > number of classical registers an error is raised . Because cQASM has the same number of classical registers as qubits ( 2 in this case ) this circuit cannot be translated to valid cQASM .
def __validate_number_of_clbits(self, experiment: QasmQobjExperiment) -> None:
        number_of_clbits = experiment.header.memory_slots
        if number_of_clbits < 1:
            raise QisKitBackendError("Invalid amount of classical bits ({})!".format(number_of_clbits))
        if BaseBackend.configuration(self).conditional:
            number_of_qubits = experiment.header.n_qubits
            if number_of_clbits > number_of_qubits:
                for instruction in experiment.instructions:
                    if hasattr(instruction, 'conditional'):
                        raise QisKitBackendError("Number of classical bits must be less than or equal to the"
                                                 " number of qubits when using conditional gate operations")
def __validate_number_of_clbits ( self , experiment : QasmQobjExperiment ) -> None : number_of_clbits = experiment . header . memory_slots if number_of_clbits < 1 : raise QisKitBackendError ( "Invalid amount of classical bits ({})!" . format ( number_of_clbits ) ) if BaseBackend . configuration ( self ) . conditional : number_of_qubits = experiment . header . n_qubits if number_of_clbits > number_of_qubits : for instruction in experiment . instructions : if hasattr ( instruction , 'conditional' ) : raise QisKitBackendError ( "Number of classical bits must be less than or equal to the" " number of qubits when using conditional gate operations" )
Checks whether the number of classical bits has a value cQASM can support.
Checks whether the number of classical bits has a value cQASM can support .
""" Checks whether the number of classical bits has a value cQASM can support.

            1. When number of classical bits is less than 1 an error is raised.
            2. When binary controlled gates are used and the number of classical registers > number of classical
            registers an error is raised.
                When using binary controlled gates in Qiskit, we can have something like:
                q = QuantumRegister(2)
                c = ClassicalRegister(4)
                circuit = QuantumCircuit(q, c)
                circuit.h(q[0]).c_if(c, 15)

                Because cQASM has the same number of classical registers as qubits (2 in this case),
                this circuit cannot be translated to valid cQASM.

        Args:
            experiment: The experiment with gate operations and header.

        Raises:
            QisKitBackendError: When the value is not correct.
        """ # no problem when there are no conditional gate operations
When the value is not correct.
When the value is not correct .
QisKitBackendError
self
experiment
QasmQobjExperiment
The experiment with gate operations and header.
The experiment with gate operations and header .