From megahertz to terahertz qubits encoded in molecular ions: theoretical analysis of dipole-forbidden spectroscopic transitions in N$\mathbf{_2^+}$

Recent advances in quantum technologies have enabled the precise control of single trapped molecules on the quantum level. Exploring the scope of these new technologies, we studied theoretically the implementation of qubits and clock transitions in the spin, rotational, and vibrational degrees of freedom of molecular nitrogen ions including the effects of magnetic fields. The relevant spectroscopic transitions span six orders of magnitude in frequency illustrating the versatility of the molecular spectrum for encoding quantum information. We identified two types of magnetically insensitive qubits with very low ("stretched"-state qubits) or even zero ("magic"magnetic-field qubits) linear Zeeman shifts. The corresponding spectroscopic transitions are predicted to shift by as little as a few mHz for an amplitude of magnetic-field fluctuations on the order of a few mG translating into Zeeman-limited coherence times of tens of minutes encoded in the rotations and vibrations of the molecule. We also found that the Q(0) line of the fundamental vibrational transition is magnetic-dipole allowed by interaction with the first excited electronic state of the molecule. The Q(0) transitions, which benefit from small systematic shifts for clock operation and high sensitivity to a possible variation in the proton-to-electron mass ratio, were so far not considered in single-photon spectra. Finally, we explored possibilities to coherently control the nuclear-spin configuration of N$_2^+$ through the magnetically enhanced mixing of nuclear-spin states.


I. INTRODUCTION
Over the past two decades, a range of different methods have been devised for the generation of cold trapped molecules in the gas phase. These include molecular-beam slowing and trapping [1,2], direct laser cooling [3][4][5], assembly from ultracold atoms [6], and sympathetic cooling [7,8].
In this context, experiments in which single molecular ions are co-trapped with single atomic ions [9][10][11][12][13][14] show excellent prospects for achieving the long-standing goal of gaining full control over the quantum state and dynamics of single isolated molecules. In these experiments, a quantum-logic approach [15] is pursued in which the co-trapped atomic ion is used to detect the state of the molecular ion. Coherent Rabi and Ramsey spectroscopy [10,12], quantum-non demolition state detection [9,11,14] and atom-molecule entanglement [13] have recently been demonstrated.
A full control over the quantum states of cold and trapped molecules will enable improved experiments in the realm of precision spectroscopy. Applications range from precisely validating existing physical theories such as quantum electrodynamics [16][17][18], testing fundamental concepts [19,20] such as a possible time variation of physical constants [21,22] and the putative existence of new forces of nature [23], benchmarking molecular-structure theory [12,24], performing controlled chemical reactions [25,26], to implementing new time standards based on narrow rovibrational molecular transitions in the mid-infrared spectral domain [27][28][29].
While spectroscopy can be performed in a destructive fashion [27,30], the newly developed methods for nondestructive detection and coherent manipulation of molecular ions promise an increase of several orders of magnitude in the experimental duty cycle [11,31]. This increase will result * To whom correspondence should be addressed: stefan.willitsch@unibas.ch in a markedly improved spectroscopic sensitivity and, therefore, precision. Another exciting aspect of this technology is the implementation of molecular qubits which can be used for applications in quantum computation [32], simulation [33], metrology [34], and communication [35].
Here, we studied theoretically the implementation of molecular qubits and their prospective application for spectroscopic precision measurements in the homonuclear 14 N + 2 molecular ion. We chose this molecule due to its prospects for investigating a possible time variation of the electronto-proton mass ratio [36] and for serving as a mid-infrared (MIR) frequency standard [28,29,37]. These applications are enabled by the lack of a permanent dipole moment of the molecule such that rovibrational transitions within the same electronic state are electric-dipole forbidden. These transitions only become allowed in higher order and thus exhibit very narrow natural linewidths [27,38] and low to vanishing susceptibility to external perturbations such as blackbody radiation and stray electric fields [36,37]. These qualities also make N + 2 an excellent system for encoding qubits in its rovibrational state manifold in which radiative lifetimes of excited states are estimated to be on the order of months to years [38].
While electric perturbations are inherently small in N + 2 (see discussion in Ref. [36] and in Appendix A), the molecular states are strongly coupled to external magnetic fields due to the doublet electron-spin character of the molecule [37]. Finite magnetic fields are present in a typical experimental apparatus, especially in ion-trapping experiments in which they are a perquisite for operation. Moreover, an external magnetic field is used to lift the degeneracy of Zeeman states and to define the quantization axis of qubits realized in atomic systems. Therefore, there is a need for a comprehensive theoretical analysis of the influence of external magnetic fields on the rovibrational states of N + 2 . Here, we expanded the theory on the hyperfine structure of N + 2 in Ref. [39] to include the Zeeman effect. We numerically diagonalized the effective molecular Hamiltonian of N + 2 in the electronic ground-state, X 2 Σ + g , including the interaction with magnetic fields. From the energy-level structure thus derived, we analyzed several classes of spectroscopic transitions from the radio (MHz) to mid-infrared (THz) domains. The different types of transitions (Zeeman, hyperfinestructure, fine-structure, rotational and vibrational) are discussed with respect to their applications as qubits and in precision spectroscopy.
Magnetic-field insensitive transitions are important since magnetic-field fluctuations are amongst the dominant effects causing decoherence of qubit superpositions. The use of magnetic-field-insensitive transitions for molecular qubits can dramatically increase their coherence time [40]. We identified "magic" transitions [41] for which the relative Zeeman shift between the energy levels involved cancels to first order at a experimentally practicable magnetic-field strength of a few Gauss. These transitions allow for magnetic-field-limited coherence times of tens of minutes in rotational and vibrational qubits at realistic levels of magnetic field noise without the need for magnetic shielding or active magnetic-noise cancellation. We also identified transitions in which the linear Zeeman shift is only on the order of 10 Hz/G irrespective of the magnetic-field strength. The latter are transitions between "stretched" states of different ro-vibrational manifolds in the electronic ground state for which the contribution of the electron spin to the Zeeman shift largely cancels [36,42]. These "streched" magnetic-insensitive transitions are unique to molecular qubits.
Previous experimental and theoretical works on N + 2 analyzed the S(0) rotational component of the fundamental vibrational transition [27,37], i.e, the transition from the vibrational and rotational ground state to first vibrationally and second rotationally excited state. This transition is single-photon allowed by electric-quadrupole (E2) selection rules. The corresponding Q(0) transition, i.e, the pure vibrational transition with no excitation of the rotation, was predicted to exhibit superior properties for clock and precision-spectroscopy applications due to smaller systematic shifts [36]. Here, we show that the Q(0) transitions, which were previously considered to be forbidden in single-photon excitation in the present system [37], are actually magnetic dipole (M1) allowed through the anisotropy of the interaction of the electron spin with the magnetic field. This is enabled by a mixing of the first excited electronic state, A 2 Π u , with the electronic ground-state, X 2 Σ + g , of the nitrogen ion [43]. In addition, we identified avoided crossings of energy levels originating from two different nuclear-spin configurations with nuclear-spin quantum numbers I = 0 and I = 2. The avoided crossings occur at low, experimentally accessible magnetic-field strengths of a few tens of Gauss. Around these avoided crossings, the molecular eigenstates have a mixed character of the I = 0 and I = 2 spin states. This magnetically enhanced nuclear-spin mixing opens up opportunities for transmuting molecular-spin states on demand by coherent two-photon processes, e.g, stimulated Raman pumping [44], through the highly mixed states around the avoided crossings.
Finally, we found that for some transitions, M1 coupling dominates the spectrum while for others E2 coupling prevails due to selection rules forbidding M1 coupling. We also found that hyperfine mixing terms in the Hamiltonian allow for otherwise forbidden transitions which significantly changes the spectra compared to zeroth-order expectations.

A. Basis states
The molecular nitrogen ion, N + 2 , in the electronic ground state, X 2 Σ + g , is adequately described within the Hund's case (b βJ ) angular momentum coupling scheme [45] given by, Here, N is the rotational angular momentum in a Σ electronic state, J is the angular momentum resulting from the coupling between the electron spin S and the rotation, and F is the total angular momentum including the nuclear spin I. The Hund's case (b βJ ) basis describing this coupling scheme is denoted by, Here, v is the vibrational, N the rotational, S the electronspin, J the fine-structure (spin-rotation), I the nuclear-spin and F the hyper-fine quantum number. We denote the projection of the total angular momentum F on the axis of the external magnetic field by m, and i is a compound index for all quantum numbers. We used an effective Hamiltonian approach [46,47] in which global perturbations from other electronic and vibrational states are absorbed in the molecular constants. Therefore, we omit the electronic index of the basis states.
Since each 14 N atom has a nuclear spin of 1, the total nuclear spin, I, of the 14 N + 2 molecule can take the values of I = 0, 1, 2. This gives rise to different nuclear-spin-symmetry isomers with even (odd) I denoted as ortho (para). In N + 2 , even (odd) values of I allow for only even (odd) rotational quantum numbers N due to the total permutation symmetry of the molecular wavefunction imposed by the generalized Pauli principle. While our results are applicable for both spin isomers of N + 2 , in this manuscript, we mainly focus on the ortho nuclear-spin isomer with I = 0, 2 which is associated with the rotational ground state of particular interest in experiments.

B. Effective Hamiltonian
We considered the following effective Hamiltonian for the electronic ground state, X 2 Σ + g , of N + 2 [39,46,48], Here, the subscript v indicates that the molecular constants are effective values for a given vibrational and Born-Oppenheimer electronic state, G v is the vibrational energy, B v is the rotational constant, D v is the centrifugal-distortion constant and γ v,N is the electron spin-rotation coupling constant which includes a centrifugal correction term γ v,N = γ v + γ Dv N (N + 1) [39]. The relevant spectroscopic constants are listed in Table I. Note that our notation of the constants differs in places from the one found in the literature [39] to render it unambiguous in the present context.
The effective hyperfine-interaction Hamiltonian takes the form [39], Here, H bF represents the Fermi-contact interaction which has off-diagonal matrix elements in the J quantum number, H t is the dipolar hyperfine interaction with off-diagonal matrix elements in N and J, H eqQ is the electric-quadrupole hyperfine interaction with off-diagonal matrix elements in N , J and I and H cI is the magnetic nuclear spin-rotation interaction which mixes states with different J quantum numbers. All matrix elements are given in Appendix B, and the effective coupling constants are given in Table I. A schematic of the resulting energy levels is shown in Fig. 1.
In the X 2 Σ + g ground state of N + 2 , the effective Zeeman Hamiltonian, H z , neglecting relativistic and radiative corrections [49], has four first-order contributions corresponding to the interaction of the magnetic field B with the magnetic moments of the electron spin, rotation and nuclear spin [46,47,50,51], Here, g s , g r and g n are the g-factors for the spin, rotation and nuclear spin and µ B (µ N ) is the Bohr (nuclear) magneton. The last term in H z represents the anisotropic correction to the electron-spin Zeeman interaction and g l is the corresponding effective g-factor. T 1 p denotes a spherical tensor operator of rank 1 in the space-fixed (subscript p) coordinate system, D 1 pq (ω) is a Wigner rotation-matrix element, and the subscript q denotes spherical tensor components in the molecule-fixed coordinate system. The p = 0 component of the space-fixed coordinate system is taken to be aligned with the direction of the magnetic field, T 1 p=0 (B) = B ZẐ . The rotational and anisotropic spin g-factors, g r and g l , show a non-negligible dependence on the vibrational state (see Table I). Diagonal terms in the interaction of the magnetic field with the electronic orbital angular momentum (L) vanish in a Σ state and terms of higher order in the magnetic field (∝ B 2 ) [46,52] are neglected in our analysis.
The interaction of the magnetic field with the electron spin mixes states with different J and F quantum numbers. The matrix-elements are given by, The same type of mixing occurs also for the interaction with the rotational magnetic moment, Interaction with the nuclear spin only mixes states with differ-ent F quantum numbers, The matrix elements of the anisotropic correction to the electron-spin interaction in the Zeeman Hamiltonian are given by, This interaction mixes different F ,J and N quantum numbers. The complete Hamiltonian given in Eq. 4 was diagonalized numerically by solving H (B Z ) |ψ k = E k (B Z ) |ψ k in the Hund's case (b βJ ) basis (Eq. 3) to obtain the energies, E k (B Z ), and mixing-coefficients, c k i (B Z ), as function of the external magnetic value, B Z . A basis set of 2 vibrational (v = 0, 1), 3 rotational (N = 0, 2, 4), 2 nuclear (I = 0, 2) and all resulting fine, hyperfine and Zeeman states was used yielding a total of 360 states.  14 N + 2 in the v = 0 and v = 1 vibrational states of the electronic ground state, X 2 Σ + g , used to calculate the energy levels. The numbers in parentheses are uncertainties given in the literature (references in square brackets). The values of the effective coupling constants of the electric-quadrupole hyperfine interaction, eqQv=0, and the magnetic nuclear spin-rotation hyperfine interaction, cIv=0, in the vibrational ground state, v = 0, are not reported in the literature. It was assumed that they are equal to the values reported for the first excited vibrational state, v = 1.

C. Transition moments
In homonuclear diatomic molecules, transitions within the same Born-Oppenheimer electronic state are electric-dipole (E1) forbidden due to the permutation symmetry of the two nuclei. We therefore derived general expressions for magnetic-dipole (M1) and electric-quadrupole (E2) transitions and calculated their strengths under the influence of an external magnetic field.
In the basis set of Eq. 3, the square of the transition moment S kl between different Zeeman levels can be separated into an angular (A) and a radial (R) part as [58], Here, ψ k(l) is the upper (lower) state of the transition and T u p (μ) is the transition operator in spherical tensor notation. For M1 transitions and E2 transitions, u = 1 and 2, respectively. The quantum number p = −u, ..., u represents the polarization of the radiation in the space-fixed frame with respect to the quantization axis defined by the direction of the static magnetic field. The sum over the different polarizations in Eq. 12 yields a polarization-independent transition moment.

D. Magnetic-dipole transitions within the same vibrational state
For magnetic-dipole transitions, the operators that couple to the radiation have the same form as the Zeeman Hamiltonian for coupling with an external magnetic field given in Eq. 7 with the substitution B Z → B(t) [46]. Therefore, the angular part of the transition moment Eq. 12 for M1 transitions can be obtained from the matrix elements Eqs. 7,8, 9 and 10 where p is now the polarization index of the magnetic-field of the radiation, B(t). Transitions induced by isotropic and anisotropic interaction with the electron spin and interaction with the rotation and nuclear spin are denoted by M1 S , M1 aS , M1 N and M1 I . From the angular part of the transition moment, the following selection rules can be derived, For transitions within the same vibrational state, ∆v = 0, the radial part of the transition moment is given by the expectation value of the magnetic moment, R(v, v) ≡ g, where the values of the g-factors are determined by the underlying interaction (Table I).

E. Electric-quadrupole transitions within the same vibrational state
For E2 transitions, the coupling operator is T 2 p (Q nΛ ) in spherical tensor notation where Q nΛ is the electric quadrupole moment in a specific electronic state [59]. The matrix elements for the E2 transition moments are given by [59], From the angular part of the transition moment, the following selection rules can be derived for E2 transitions, In addition, N = 0 → 0 transitions are not allowed within a Σ electronic state. For transitions within the same vibrational level ∆v = 0, the radial part of the transition moment is given by the permanent electric quadrupole moment, [43] for low vibrational states.

F. Vibrational transitions
The transition strength between different vibrational levels was estimated by expanding the radial part of the transition moment to first order around the equilibrium bond length (R e ) [58], Here, µ p = µ(R)| (R=Re) is the permanent (electric quadrupole or magnetic dipole) moment and dµ/dR| (R=Re) is its derivative as a function of internuclear distance evaluated at the equilibrium bond length. From Eq. 20, it seems that the first term only contributes to transitions within the same vibrational manifold, since v ′ |v = δ vv ′ . However, rovibrational mixing, which is not explicitly apparent in the effective Hamiltonian approach taken here, introduces a non-zero overlap between different vibrational states [48]. Therefore, the first term in Eq. 20 allows for vibrational transitions according to Eq. 12.
The second term in Eq. 20 introduces vibrational transitions through the change in the transition moment with internuclear distance. The vibrational matrix element for the fundamental vibrational transition within the harmonic approximation is given by, Here, R e = 2.13 a 0 [43] is the equilibrium bond length, and ω e ≈ 2207 cm −1 [53] and B e ≈ 1.93 cm −1 [56] are the harmonic vibration frequency and the equilibrium rotational constant (which both need to be inserted in the same units in Eq. 21). For low rotational states, we found that the strongest (M1 S ) transitions caused by the first term in Eq. 20 are 4-5 orders of magnitude weaker than those originating from the second term for E2 and M1 aS coupling. Transitions due to vibrational mixing are therefore neglected in the following. The reader is referred to Appendix C for further details [60] .
The couplings can be estimated from the change in the relevant g-factors with the effective bond length upon vibrational excitation given in Table I yielding ∆g r /∆R ≈ 4 · 10 −5 µ B /a 0 and ∆g l /∆R ≈ 2 · 10 −3 µ B /a 0 . The difference in averaged bond lengths, ∆R, between v = 0 and v = 1 is estimated from the relation of the rotational constant to the equilibrium positions, For E2 transitions, the change in the electric quadrupole moment with the internuclear distance is given by dQ/dR = 2.63 ea 0 [43].

G. Einstein A coefficients
The relative importance of M1 and E2 transitions to the spectra was assessed by comparing their Einstein A coefficients. For M1 transitions [61], one obtains while for E2 transitions [61], the A coefficient is given by, Here, λ kl is the transition wavelength, µ 0 is the vacuum permeability, ε 0 is the vacuum permittivity and h is the Planck constant. All values are in SI units. Since S kl in Eq. 22 and 23 is the square of the polarization-independent transition moment that was defined in Eq. 12, the Einstein A coefficients slightly differ from their regular definitions as they explicitly depend on the Zeeman levels.

III. RESULTS AND DISCUSSION
A. Hyperfine and Zeeman qubits in the rotational ground state, N=0 The hyperfine-Zeeman energy levels of the rovibronic ground-state manifold, X 2 Σ + g (v = 0, N = 0), of N + 2 as function of the strength of an external magnetic field are displayed in Fig. 2a.
For the I = 0 isomer, the situation is similar to the ground state of bosonic alkaline-earth ions (e.g., 88 Sr + ) which are also used as qubits [62]. The total angular momentum J = 1/2 results in two Zeeman levels which are separated by (g s + 2/3g l )µ B ≈ 2.8 MHz/G (green traces in Fig. 2). All terms in the Zeeman Hamiltonian are zero except for the isotropic and anisotropic electron-spin terms. Thus, the situation is formally identical (apart from negligible mixing terms to higher rotational states) to the atomic 2 S 1/2 case. Transitions between the two Zeeman levels can be driven by M1 S coupling (green stick in Fig. 3).
For the I = 2 isomer, the hyperfine interaction splits the rovibronic ground state into two hyperfine manifolds with total angular-momentum quantum numbers F = 3/2 and F = 5/2 (red and blue traces in Fig. 2). The relatively small splitting of 5/2b F,v=0 ≈ 256 MHz (for B=0 G), together with the strong magnetic coupling, M1 S , leads to a deviation of Energies, E, of hyperfine-Zeeman levels in the rovibronic ground-state (v = 0, N = 0) manifold of N + 2 as a function of the external-magnetic-field strength, B. b) Derivatives of the energies in a) with respect to the magnetic field. Circles indicate positions of "magic" magnetic-field values at which the transition energy between two levels is independent of the magnetic field to first order. The corresponding M1S transitions are indicated by the arrows in a). All of these are allowed by the selection rules.
, of the I = 0 (green) and I = 2 (blue and red) nuclear-spin species of N + 2 as a function of transition frequency, f21. The abscissa indicates the transition frequencies at a magnetic field value of 5 G. The color code is the same as in Fig. 2. the Zeeman splittings from the weak coupling regime (linear Zeeman effect) to the intermediate coupling regime already at relatively low magnetic fields of few tens of Gauss. The full decoupling of the spin and orbital angular momenta (Paschen-Back regime) occurs already at magnetic fields of a few hundreds of Gauss.
As a consequence, Zeeman transitions within each hyperfine manifold are not equally spaced (Fig. 3, blue and red bars). The unequal spacing can be used to address Zeeman transitions individually and to allow for optical pumping and state readout as was demonstrated with polar CaH + molecules [10]. The transitions are dominated by M1 S coupling (see Fig.  3 for the transition strengths). M1 transitions arising from the anisotropic-spin, rotational and nuclear-spin terms were found to be 3-5 orders of magnitude weaker due to the difference in magnitude between g s and g r , g n , and g l . Transition between the two hyperfine manifolds, |F = 3/2 → |F ′ = 5/2 , are also allowed by M1 S coupling. These transitions are commonly used as long-lived qubits in atomic ions [41]. Here, we identified transitions in which the dependence of the energy levels on the magnetic field is equal for both the lower and upper states for specific values of the magnetic field (see arrows in Fig. 2a, circles in Fig. 2b and dotted lines in Fig. 4b). This equal dependency results in an insensitivity of the transitions to magnetic field fluctuations to first order. Insensitive transitions at "magic" magnetic fields are used in atomic systems [41,63] to encode qubits with improved coherence times and to circumvent the need for magnetic shielding. Due to the small hyperfine splittings in N + 2 , the "magic" magnetic field occurs at small and easily accessible values. The second-order Zeeman susceptibility of the transitions around the "magic" values is ∼ 16 mHz/mG 2 (for all the hyperfine "magic" transitions in Fig. 4b) from which we estimated a shift of as low as ∆E/h = ∆f ≈ 16 mHz in the transition frequencies for a magnetic-field fluctuation of 1 mG. Thus, these transitions are ideally suited for encoding qubits with magnetic-field-limited coherence times of up to 1/∆f ≈ 60 s [64] as well as for applications in precision spectroscopy and in clocks. Typical strengths for these hyperfine transitions are given in Fig. 4a. B. Hyperfine and Zeeman qubits in the rotationally excited state, N=2 The energy levels of the second rotationally excited state in the vibronic ground state, X 2 Σ + g (v = 0, N = 2), of the  ortho nuclear-spin isomer, are displayed in Fig. 5. The rotational excitation shifts the spectrum by 6B v=0 − 36D v=0 ≈ 345.784 GHz compared to the rotationless case. The spinrotation coupling, H f s , splits the levels into J = 3/2 and J = 5/2 manifolds which are separated by 5/2γ v=0 ≈ 700 MHz (for B=0 G). For the I = 0 species, this coupling generates an energy-level structure which is qualitatively similar to the that of the I = 2 configuration within N = 0 (Fig. 2). However, because of the large spinrotation splitting, the deviation from a linear Zeeman effect occurs at higher magnetic fields compared to the situation in Fig. 2. For instance, the first "magic" magnetic field for the |J = 3/2, m = −1/2 → |J ′ = 5/2, m ′ = −1/2 transition occurs at ∼49 G compared to ∼18 G for the |F = 3/2, m = −1/2 → |F ′ = 5/2, m ′ = −1/2 transition in the N = 0, I = 2 state.
An interesting effect in N + 2 as exemplified here with the N = 2 manifold is the coupling between nuclear-spin states  through the electric-quadrupole hyperfine interaction, H eqQ , which mixes levels with even (or odd) total nuclear spin I. In 14 N + 2 , there is only a single para nuclear-spin state with I = 1 such that only the ortho species with I = 0, 2 exhibit this coupling. This interaction results in avoided crossings of energy levels originating from the different ortho spin states. As an example, Fig. 7a shows such an avoided crossing between the |F = 3/2, m = −3/2 states originating from the I = 0 (red) and I = 2 (blue) species. This avoided crossing occurs at a relatively low magnetic field of ∼54 G. Around the crossing point, the levels exhibit a strong mixing of the I = 0 and I = 2 basis states (see Fig. 7b). This magnetically enhanced nuclear-spin mixing is interesting as it opens up possibilities to manipulate the nuclear-spin configuration of the molecule on demand (see Fig. 12 and the accompanying discussion further below).

C. Rotational qubits
We now consider transitions from the rotational ground state N = 0 to the second excited rotational state N ′ = 2 at frequencies around ∼345 GHz. The sensitivity of these transitions to the proton-to-electron mass ratio [65] renders them interesting for testing a possible time variation of these fundamental constants as they are within the reach of stabilized THz sources [66].
In general, M1 S transition selection rules do not permit a change of rotational quantum numbers by ∆N = 2, but this mechanism must still be considered due to mixing of rotational states. In addition, the anisotropy of the electron-spin g-factor tensor allows for ∆N = 2 transitions through M1 aS coupling. We also consider electric-quadrupole (E2) transitions which also permit such a change in the rotational quantum number. In addition, E2 transitions permit changes in the angular-momentum-projection quantum number ∆m = ±2, ±1, 0. Thus, magnetic-dipole and electric-quadrupole rotational spectra will show different signatures as illustrated in Fig. 8a,b. For the |J = 1/2 → |J ′ = 3/2 transitions, M1 aS coupling was found to be ∼3 orders of magnitude stronger than the E2 coupling while for the |J = 1/2 → |J ′ = 5/2 , it was only found to be about 1 order of magnitude stronger (Fig. 8a,b).
The ∆m = ±2 and ∆J = 2 lines are allowed for E2 coupling opening up opportunities to exploit transitions between "stretched" states, e.g., |J = 1/2, m = ±1/2 → |J ′ = 5/2, m ′ = ±5/2 in the I = 0 nuclear-spin isomer and |F = 5/2, m = ±5/2 → |F ′ = 9/2, m ′ = ±9/2 in the I = 2 nuclear-spin isomer. These transitions show a very small linear dependence on the magnetic field due to cancellation of the major contribution from the isotropic Zeeman Hamiltonian (Eq. 7) in the ground and excited "stretched" states. The remaining susceptibility of these levels to magnetic field is attributed to the rotational dependence of the anisotropic (Eq. 10) and rotational (Eq. 8) Zeeman Hamiltonians. The isotropic term (Eq. 7) still has a small effect due to mixing of the rotational states. Thus, precise measurements of the magnetic dependence of these transitions can be used for an accurate determination of the anisotropic electron-spin and rotational g-factors.
The "stretched" transitions depend linearly on the magnetic field in the range considered here (up to 70 G) as can be seen in Fig. 8c. The frequencies of these transitions will change by ∆E/h = ∆f ≈475 mHz for magnetic field fluctuations of 1 mG. Therefore, they can be exploited for encoding THz qubits with coherence times of up to 1/∆f ≈ 2 s [64] and for precision THz spectroscopy. The rotational spectrum of the I = 2 nuclear-spin species also exhibits "magic" magneticfield insensitive transitions with second-order shifts as low as ∼ 3 mHz/mG 2 (Appendix D). Magnetic field fluctuations on the order of ∼ 1 mG still permit qubits with Zeeman-limited coherence times of up to 1/∆f ≈ 5 min.
In Fig. 9, the hyperfine components of the transition |N = 0, J = 1/2, F = 5/2 → |N ′ = 2, J ′ = 5/2, F ′ in the I = 2 nuclear-spin state due to M1 and E2 coupling are shown. The M1 S rotational transitions are allowed by rotational mixing induced by the dipolar hyperfine interaction, H t . The strongest M1 S lines are on-par with the strongest M1 aS lines and are up to two order of magnitude stronger than the E2 lines. However, in some cases the strengths for both types of transitions are similar and in other cases, only E2 transitions are allowed due to quadrupole selections rules. Thus, one should consider both types of transitions when analyzing the molecular spectrum. To directly compare the strength of both types of couplings with Eq. 12, we calculated the relevant Einstein A coefficients using Eq. 22 and Eq. 23.

D. Rovibrational qubits
Dipole-forbidden rovibrational lines in N + 2 were first observed by Germann et al. [27]. Vibrational transitions are promising for tests of a possible temporal variation of the proton-to-electron mass ratio because of their sensitivity to these constants. Also, they benefit from higher transition frequencies than rotational lines and thus allow for a better relative precision [36]. Transitions within the Q(0) manifold, |v = 0, N = 0 → |v ′ = 1, N ′ = 0 , are usually considered to be forbidden for single photon excitation within a Σ electronic state [36]. E2 selection rules forbid transitions from N = 0 to N ′ = 0. However, the anisotropic electron-spin interaction (Eq. 10) permits N = 0 to N ′ = 0 transitions and it varies considerably with the internuclear distance (Eq. 20). This leads to the appearance of Q(0) lines in the spectrum which, to the best of our knowledge, were so far not considered for the present vibrational spectrum.
In Fig. 11, components of the Q(0) transition, i.e. |v = 0, N = 0, J = 1/2 → |v ′ = 1, N ′ = 0, J ′ = 1/2 , of both the I = 0 and I = 2 species is shown. For both nuclear-spin configurations, the "stretched" transitions, i.e |J = 1/2, m = ±1/2 → |J ′ = 1/2, m ′ = ±1/2 and |F = 5/2, m = ±5/2 → |F ′ = 5/2, m ′ = ±5/2 are allowed by M1 aS coupling and show very small linear Zeeman shifts of ∆g l /3 ≈ 9.3 mHz/mG. This dependency is ∼ 50 times smaller than for transitions between "stretched" states in the S(0) (|N = 0 → |N ′ = 2 ) manifold. Precise measurements of the magnetic dependence of these transitions constitute a direct measurement of the anisotropy of  the electron-spin g-factor tensor. The Q(0) spectrum also exhibits "magic" transitions for the I = 2 species (indicated by black crosses in Fig. 11) at relatively low magnetic fields of a few 10 G. The second-order Zeeman susceptibility of these transitions is ∼ 16 mHz/mG 2 . Note that there are no "magic" transitions for the I = 0 nuclear-spin configuration when driving a transition from the rotational ground state, N = 0. This is due to the linear Zeeman shifts of the rotational ground state at the magnetic field values considered here (see Fig. 2a green lines).
The S(0) spectrum is predicted to exhibit "magic" transitions at low magnetic fields of a few Gauss and with secondorder Zeeman susceptibilities as low as ∼ 1 mHz/mG 2 (see Appendix D). With magnetic field fluctuations on the order of ∼ 1 mG, they can be used for encoding vibrational qubits with coherence times of up to ≈ 15 min. This corresponds to a relative Zeeman shift of ∆E/E ≈ 1 × 10 −17 without any active or passive magnetic field stabilization. The S(0) spectrum also features "streched" transitions that have a low linear Zeeman shift of ∼480 mHz/mG. The S(0) transitions at 4.574 µm with A ≈ 3 × 10 −8 Hz can be driven using commercial quantum-cascade lasers as demonstrated in Ref. [27]. With typical values for the laser power of 100 mW and a 1/e beam radius of 50 µm at the position of the molecule, Rabi frequencies [67] of Ω ∼ (2π)10 kHz are estimated yielding π-pulse times of t π ∼50 µs thus enabling an efficient coherent manipulation of the rovibrational levels of the molecule. For the Q(0) transitions, A ≈ 4 × 10 −10 Hz. With the same laser parameters, Ω ∼ (2π)0.5 kHz and t π ∼1 ms are estimated.
The |v ′ = 1, N ′ = 2 rotational manifold of the first excited vibrational state exhibits avoided crossings between levels of the two ortho-nuclear-spin species as illustrated in Fig. 12. The mixing is again induced by the quadrupole hyperfine interaction, H eqQ . At a magnetic field of ∼25.8 G, the states labeled |ψ ′ 0,2 in Fig. 12 are composed of a 50-50 mixture of the |I ′ = 2, F ′ = 3/2, m ′ = −3/2 and |I ′ = 0, J ′ = 3/2, m ′ = −3/2 basis states. This opens up the possibility of coupling two distinct molecular states of different nuclear-spin character, for instance the |ψ 2 = |I = 2, F = 5/2, m = 1/2 and |ψ 0 = |I = 0, J = 1/2, m = 1/2 in the rovibrational ground state, v = 0, N = 0. These states show negligible nuclear-spin mixing. Fig. 12 illustrates how these two states in the vibrational ground state can be interconverted by excitation and deexcitation to the mixed states |ψ ′ 0,2 in v = 1. Alternatively, interconversion of the nuclear-spin states can be achieved by populating one of the mixed state in v = 1 and appropriately tuning the magnetic field across the crossing region.

IV. SUMMARY AND CONCLUSIONS
In this paper, we presented a theoretical study of dipoleforbidden spectroscopic transitions in N + 2 considering the complete hyperfine, rovibrational and Zeeman level structure. We identified magnetic-field insensitive transitions which are promising for encoding qubits because of their excellent coherence properties and for clock operation because of their 15   weak dependence on magnetic fields. We calculated the strengths of magnetic-dipole and electric-quadrupole allowed spectroscopic transitions showing the importance of both in the radiofrequency, microwave and infrared spectrum of the nitrogen molecular ion. We found that pure vibrational transitions, Q(0), are allowed by M1 coupling induced by the anisotropic spin-magnetic field interaction. These transitions, which benefit from the lowest systematic shifts for clock operation, were not considered in the single-photon spectrum of N + 2 so far. Finally, we showed that the electric-quadrupole hyperfine interaction causes avoided crossings between states of the two ortho nuclear-spin configurations of nitrogen. This magnetically enhanced nuclear-spin mixing opens the possibility to coherently transmute the the nuclear-spin state on demand.
It is instructive to make a quantitative comparison between the magnetic insensitivity of clock transitions embedded in N + 2 to other clock systems, e.g., Al + quantum-logic clocks which currently exhibit among the lowest systematic uncertainties [68]. The Al + clock is based on the 1 S 0 ↔ 3 P 0 electronic transition which is first-order magnetically sensitive due to the nuclear spin, I = 5/2, of 27 Al + . By averaging two stretched Zeeman transitions, the first-order shift is canceled, and the clock only depends on second-order Zeeman shifts [69]. This averaging technique is not an option for qubit ap-plications. The second-order sensitivity of Al + , ∼ 7.2 × 10 −4 mHz/mG 2 , is five orders of magnitude smaller than the sensitivity of N + 2 "magic" transitions analysed here. However, since the Al + clock works at a finite magnetic field of 1.2 G [68], the clock transition acquires an effective first-order sensitivity of ∼ 1.7 mHz/mG. This first-order sensitivity is five times smaller than that of the Q(0) "streched" transitions in N + 2 . However, for the "magic" transitions in N + 2 , which have a vanishing first-order sensitivity, the magnetic-field sensitivity breaks even with the Al + clock transition at a fluctuating magnetic field value of ∼ 0.1 mG which is a typical value for a system with actively stabilized magnetic field. Below this value, the N + 2 "magic" transitions are less sensitive than the Al + clock while above they are more sensitive to magnetic field fluctuations.

APPENDIX Appendix A: Electric-field induced systematic shifts
In the main text, we have considered the usefulness of different types of spectroscopic transitions for clock applications and as qubits in terms of their sensitivity to magnetic fields which causes the dominant systematic shifts in N + 2 . In addition, viable clock candidates should also have low susceptibilities to electric fields. For completeness, we consider here the AC-Stark and electric quadrupole shifts, complementing the discussion in Ref. [36].

Stark shifts
In a homonuclear diatomic molecule, there is no electricdipole coupling between rovibrational states and the firstorder Stark shift vanishes. There is, however, dipole coupling to excited electronic states. The AC-Stark shift of state j is given by, where E 0 is the electric field amplitude at frequency ω and α j (ω) is the polarizability given by, Here, the summation runs over all states of the molecule, k, with non-vanishing dipole matrix element, k|µ|j , and transition angular frequency, ω jk . Data on excited electronic states of N + 2 can be found in the literature, e.g., Ref. [73]. The AC-Stark-shift-induced differential shift of the transition frequency between two levels j and i is then given by h∆f AC = ∆E j − ∆E i . Different types of AC-Stark shifts contribute to the present problem. The AC-Stark shift from the RF drive of an ion trap with frequency ω ≈ (2π)20 MHz can be estimated in the limit ω → 0 in Eq. (A2). For vibrational transitions with f ≈ 65.2 THz, one obtains a relative shift of ∆f AC /(f E 2 0 ) = 7×10 −24 (m/V) 2 . Typically, the electric field amplitude vanishes at the position of the ions in a Paul trap. However, trap imperfections can lead to a non-zero electric-field amplitude. These fields will cause a relative shift of 1.26 × 10 −18 at a field amplitude of 300 V/m for the fundamental vibrational transition. It should be noted that such a field amplitude is excessive for an ion in a typical ion trap built for quantum-logic experiments. For other classes of transitions, e.g., hyperfine or rotational excitations, the corresponding shift is smaller as the energy spacing decreases and the cancellation of the AC-Stark shift between the upper and the lower state is more significant.
The AC-Stark shift induced by ambient blackbody radiation can also be estimated in the limit of ω → 0 because the maximum of the thermal spectral energy density at a temperature of 300 K is situated around 31 THz which is small compared to the frequencies of electronic transitions from the vibrational ground-state. The time-averaged value of the quadratic electric-field amplitude of a 300 K radiator is E 2 0 /2 = E 2 0 ≈ (831.9 V/m) 2 [74] yielding a relative shift of ∆f AC /f = 1.0 · 10 −17 for vibrational transitions. Transitions within a vibrational state will have smaller shifts due to cancellation between the upper and lower levels. The N + 2 molecular clock is therefore suitable for operation in a roomtemperature environment.
AC-Stark shifts from the probe laser can be eliminated by using the Hyper-Ramsey spectroscopic method [75] or through a balanced Raman scheme [76]. In a Rabi-or Ramsey-type clock experiment, the laser power is reduced in order to minimize power broadening. In order to obtain a Rabi frequency of Ω ∼ (2π)1 Hz on the S(0) branch of the fundamental vibrational transition, 1 nW of laser power focused to a beam radius of 50 µm are required. The intensity is thus I = 0.26 W/m 2 corresponding to an electric field of 13.9 V/m. The AC-Stark shift obtained from Eq. (A1) is then ∆f AC /f = 8.9 · 10 −22 . With a laser power more suitable for driving qubits of ∼ 100 mW, the intensity is I = 2.55 · 10 7 W/m 2 and an AC-Stark shift of 5.8 Hz or ∆f AC /f = 8.9 × 10 −14 is obtained.

Electric-quadrupole shift
The matrix element in Eq. 18 that was used to obtain the electric quadrupole transition moment can also be used for estimating the quadrupole shift caused by static-field gradients prevalent in an ion trap. For the present purpose, the permanent moments R(0, 0) ≈ 1.86 ea 2 0 for v = 0 and R(1, 1) ≈ 1.89 ea 2 0 for v = 1 [43] were assumed in Eq. 18. Furthermore, we assumed p = 0 to describe a static field gradient along the trap axis. The first-order energy correction due to the quadrupole shift is then given by [77], A typical field gradient, dE/dz, in an ion trap is ∼ 10 7 V/m 2 . From the matrix elements in Eq.18, we see that the quadrupole shift vanishes for all states in the rotational ground state, N = 0, as is also apparent by the selection rules for E2 transitions. Further, for any state with F = 0 or F = 1/2, the shift also vanishes. For other states in v = 0, 1 and N = 0, 2, 4, the matrix element ranges between 10 −3 −10 −1 R(v, v) corresponding to an absolute quadrupole shift between 0.013 − 1.3 Hz.
All the Zeeman-and hyperfine transitions in N = 0 are therefore immune to electric-quadrupole shifts to first order. Rotational transitions of the form N = 0 → (N ′ = 2, F = 1/2), among which several "magic" transitions were identified (see Appendix D), are also not affected by this shift, as is the Q(0) branch of vibrational transitions. The Q(0) transitions of the I = 0 nuclear-spin configuration are therefore especially suitable for clock operation because they are immune from the quadrupole shift and feature stretched-state transitions which have a low susceptibility to magnetic fields. Q(2) transitions can also be chosen with F = F ′ = 1/2 such that the quadrupole shift cancels. For S(0) transitions, the quadrupole shift vanishes in the lower states N = 0 and the upper state can be chosen as F ′ = 1/2.
The differential shift of the fine-structure transitions with ∆J = 1 within the N = 2 manifold was calculated for the "magic" transitions listed in Appendix D. The differential shift ranges between 0.38 − 1.86 Hz for the "magic" transitions with the exception of |J = 3/2, I = 2, F = 7/2, M F = −1/2 → |J = 5/2, I = 2, F = 9/2, M F = −3/2 for which an accidental cancellation leads to a vanishing shift. Therefore, suitable clock transitions with a low sensitivity to magnetic fields and vanishing quadrupole shifts were identified in every class of transitions examined in this paper.
Appendix C: Vibrational mixing The rovibrational mixing was estimated in the same way as in Refs. [48,78], i.e., as a result of the dependence of the rotational constant, B, on the bond length, R, within the harmonic approximation for the vibration. The rotational constant, B(R) ∝ R −2 , was expanded in a Taylor series to first order around the equilibrium internuclear distance R = R e , Here,ξ = (R − R e )/R e and B e is the equilibrium rotational constant. The zero-order term corresponds to the rigid-rotor rotational Hamiltonian whereas the linear term inξ causes the rovibrational interaction. Inserting Eq. C1 in the rotational Hamiltonian, B(R)N 2 , the rigid-rotor Hamiltonian, B eN 2 , and the rotation-vibration coupling Hamiltonian to first order, are obtained.ξ is further expressed in terms of creation (â † ) and annihilation (â) operators of an harmonic oscillator, which results in the matrix elements, Here, ω e is the harmonic vibration frequency (expressed in the same units as B e ). The combined vibrational and rotational Hamiltonians, H vib = G v and H rot = B eN 2 , respectively, were diagonalized including the rovibrational interaction H ro−vib numerically using the v = 0, 1, 2, 3, 4 vibrational and N = 0, 2, 4, 6, 8, 10 rotational states as a basis set to obtain the mixing coefficients. In this treatment, we found ij c i c j R(v = 0, v = 1) ∼ 5 × 10 −6 µ p in N = 2 according to Eq. 20. For E2 transitions, this corresponds to transition moment of ∼ 10 −5 ea 2 0 . The second term in Eq. 20, however, leads to a much stronger transition moment of ∼ 10 −1 ea 2 0 . Therefore, the effect of ro-vibrational mixing in the calculation of the transition moments for low-lying rotational states can be neglected.
Appendix D: "Magic" magnetic-field-insensitive transitions TABLE II: Partial list of the strongest "magic" magnetic-field insensitive transitions within the hyperfine, fine, rotational and vibrational manifolds below 70 G. The labels |v, N, S, J, I, F, m correspond to those basis states which exhibit the largest overlap with with the true molecular eigenstates. For each transition, the "magic" magnetic-field strength, B, the Einstein A coefficient, the transition frequency, f − f0, and the second-order magnetic-field dependence, a, of the transition are indicated. The dominant coupling mechanism (M1S, M1aS or E2) is also listed for each type of transition. The transition frequencies are given with respect to a reference frequency, f0, defined as follows: f0 = 0 for pure hyperfine and fine-structure transitions, f0 = B0 × 6 − D0 × 6 2 ≈ 345 ′ 784.31 MHz for rotational transitions,