code: def get_rotation_program(pauli_term: PauliTerm) -> Program:
      
      meas_basis_change = Program()
      for index, gate in pauli_term:
          if gate == 'X':
              meas_basis_change.inst(RY(-np.pi / 2, index))
          elif gate == 'Y':
              meas_basis_change.inst(RX(np.pi / 2, index))
          elif gate == 'Z':
              pass
          else:
              raise ValueError()
  
      return meas_basis_change
docs: Generate a rotation program so that the pauli term is diagonal.
  
      :param pauli_term: The Pauli term used to generate diagonalizing one-qubit rotations.
      :return: The rotation program.