code: def pretty_print(self, decimal_digits=2):
          
          outcome_dict = {}
          qubit_num = len(self)
          pp_string = ""
          for index, amplitude in enumerate(self.amplitudes):
              outcome = get_bitstring_from_index(index, qubit_num)
              amplitude = round(amplitude.real, decimal_digits) + \
                  round(amplitude.imag, decimal_digits) * 1.j
              if amplitude != 0.:
                  outcome_dict[outcome] = amplitude
                  pp_string += str(amplitude) + "|{}> + ".format(outcome)
          if len(pp_string) >= 3:
              pp_string = pp_string[:-3]  # remove the dangling + if it is there
          return pp_string
docs: Returns a string repr of the wavefunction, ignoring all outcomes with approximately zero
          amplitude (up to a certain number of decimal digits) and rounding the amplitudes to
          decimal_digits.
  
          :param int decimal_digits: The number of digits to truncate to.
          :return: A dict with outcomes as keys and complex amplitudes as values.
          :rtype: str