def pretty_print_probabilities(self, decimal_digits=2):
        """
        Prints outcome probabilities, ignoring all outcomes with approximately zero probabilities
        (up to a certain number of decimal digits) and rounding the probabilities to decimal_digits.

        :param int decimal_digits: The number of digits to truncate to.
        :return: A dict with outcomes as keys and probabilities as values.
        :rtype: dict
        """
        outcome_dict = {}
        qubit_num = len(self)
        for index, amplitude in enumerate(self.amplitudes):
            outcome = get_bitstring_from_index(index, qubit_num)
            prob = round(abs(amplitude) ** 2, decimal_digits)
            if prob != 0.:
                outcome_dict[outcome] = prob
        return outcome_dict
def pretty_print_probabilities ( self , decimal_digits = 2 ) : outcome_dict = { } qubit_num = len ( self ) for index , amplitude in enumerate ( self . amplitudes ) : outcome = get_bitstring_from_index ( index , qubit_num ) prob = round ( abs ( amplitude ) ** 2 , decimal_digits ) if prob != 0. : outcome_dict [ outcome ] = prob return outcome_dict
Prints outcome probabilities, ignoring all outcomes with approximately zero probabilities
        (up to a certain number of decimal digits) and rounding the probabilities to decimal_digits.

        :param int decimal_digits: The number of digits to truncate to.
        :return: A dict with outcomes as keys and probabilities as values.
        :rtype: dict