code: def get_cnot_control_positions(k):
      
      rotation_cnots = [1, 1]
      for i in range(2, k + 1):
          # algorithm described is to replace the last control
          # with a control to the new qubit
          # and then repeat the sequence twice
          rotation_cnots[-1] = i
          rotation_cnots = rotation_cnots + rotation_cnots
      return rotation_cnots
docs: Returns a list of positions for the controls of the CNOTs used when
      decomposing uniformly controlled rotations, as outlined in
      arXiv:quant-ph/0407010.
  
      Referencing Fig. 2 in the aforementioned paper, this method
      uses the convention that, going up from the target qubit,
      the control qubits are labelled :math:`1, 2, \ldots, k`,
      where :math:`k` is the number of control qubits.
      The returned list provides the qubit that controls
      each successive CNOT, in order from left to right.
  
      :param int k: the number of control qubits
      :return: the list of positions of the controls
      :rtype: list