  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.
