src/quantuminspire/qiskit/backend_qx.py
def __convert_histogram(result: Dict[str, Any], measurements: Dict[str, Any]) -> Obj:
        """ The quantum inspire backend always uses full state projection. The SDK user
            can measure not all qubits and change the combined classical bits. This function
            converts the result to a histogram output that represents the probabilities
            measured with the classical bits.

        Args:
            result: The result output from the quantum inspire backend with full-
                    state projection histogram output.
            measurements: The dictionary contains a measured qubits/classical bits map (list) and the
                          number of classical bits (int).

        Returns:
            The resulting full state histogram with probabilities.
        """
        output_histogram_probabilities: Dict[str, float] = defaultdict(lambda: 0)
        number_of_qubits = result['number_of_qubits']
        state_probability: Dict[str, float] = result['histogram']
        for qubit_register, probability in state_probability.items():
            classical_state_hex = QuantumInspireBackend.__qubit_to_classical_hex(qubit_register, measurements,
                                                                                 number_of_qubits)
            output_histogram_probabilities[classical_state_hex] += probability

        sorted_histogram_probabilities: List[Tuple[str, float]] = sorted(output_histogram_probabilities.items(),
                                                                         key=lambda kv: int(kv[0], 16))
        full_state_histogram_obj = OrderedDict(sorted_histogram_probabilities)
        return Obj.from_dict(full_state_histogram_obj)
 The quantum inspire backend always uses full state projection. The SDK user
            can measure not all qubits and change the combined classical bits. This function
            converts the result to a histogram output that represents the probabilities
            measured with the classical bits.

        Args:
            result: The result output from the quantum inspire backend with full-
                    state projection histogram output.
            measurements: The dictionary contains a measured qubits/classical bits map (list) and the
                          number of classical bits (int).

        Returns:
            The resulting full state histogram with probabilities.
        
The quantum inspire backend always uses full state projection. The SDK user
can measure not all qubits and change the combined classical bits. This function
converts the result to a histogram output that represents the probabilities
measured with the classical bits.
The quantum inspire backend always uses full state projection . The SDK user can measure not all qubits and change the combined classical bits . This function converts the result to a histogram output that represents the probabilities measured with the classical bits .
def __convert_histogram(result: Dict[str, Any], measurements: Dict[str, Any]) -> Obj:
        output_histogram_probabilities: Dict[str, float] = defaultdict(lambda: 0)
        number_of_qubits = result['number_of_qubits']
        state_probability: Dict[str, float] = result['histogram']
        for qubit_register, probability in state_probability.items():
            classical_state_hex = QuantumInspireBackend.__qubit_to_classical_hex(qubit_register, measurements,
                                                                                 number_of_qubits)
            output_histogram_probabilities[classical_state_hex] += probability
        sorted_histogram_probabilities: List[Tuple[str, float]] = sorted(output_histogram_probabilities.items(),
                                                                         key=lambda kv: int(kv[0], 16))
        full_state_histogram_obj = OrderedDict(sorted_histogram_probabilities)
        return Obj.from_dict(full_state_histogram_obj)
def __convert_histogram ( result : Dict [ str , Any ] , measurements : Dict [ str , Any ] ) -> Obj : output_histogram_probabilities : Dict [ str , float ] = defaultdict ( lambda : 0 ) number_of_qubits = result [ 'number_of_qubits' ] state_probability : Dict [ str , float ] = result [ 'histogram' ] for qubit_register , probability in state_probability . items ( ) : classical_state_hex = QuantumInspireBackend . __qubit_to_classical_hex ( qubit_register , measurements , number_of_qubits ) output_histogram_probabilities [ classical_state_hex ] += probability sorted_histogram_probabilities : List [ Tuple [ str , float ] ] = sorted ( output_histogram_probabilities . items ( ) , key = lambda kv : int ( kv [ 0 ] , 16 ) ) full_state_histogram_obj = OrderedDict ( sorted_histogram_probabilities ) return Obj . from_dict ( full_state_histogram_obj )
The quantum inspire backend always uses full state projection.
The quantum inspire backend always uses full state projection .
""" The quantum inspire backend always uses full state projection. The SDK user
            can measure not all qubits and change the combined classical bits. This function
            converts the result to a histogram output that represents the probabilities
            measured with the classical bits.

        Args:
            result: The result output from the quantum inspire backend with full-
                    state projection histogram output.
            measurements: The dictionary contains a measured qubits/classical bits map (list) and the
                          number of classical bits (int).

        Returns:
            The resulting full state histogram with probabilities.
        """
The resulting full state histogram with probabilities.
The resulting full state histogram with probabilities .
result
Dict[str, Any]
The result output from the quantum inspire backend with full
state projection histogram output.
The result output from the quantum inspire backend with full state projection histogram output .
measurements
Dict[str, Any]
The dictionary contains a measured qubits/classical bits map (list) and the
number of classical bits (int).
The dictionary contains a measured qubits / classical bits map ( list ) and the number of classical bits ( int ) .