code: def _core_qft(qubits: List[int], coeff: int) -> Program:
      
      
      q = qubits[0]
      qs = qubits[1:]
      if 1 == len(qubits):
          return [H(q)]
      else:
          n = 1 + len(qs)
          cR = []
          for idx, i in enumerate(range(n - 1, 0, -1)):
              q_idx = qs[idx]
              angle = math.pi / 2 ** (n - i)
              cR.append(CPHASE(coeff * angle, q, q_idx))
          return _core_qft(qs, coeff) + list(reversed(cR)) + [H(q)]
docs: Generates the core program to perform the quantum Fourier transform
      
      :param qubits: A list of qubit indexes.
      :param coeff: A modifier for the angle used in rotations (-1 for inverse QFT, 1 for QFT)
      :return: A Quil program to compute the core (inverse) QFT of the qubits.