3 divided into three parts, namely a central region (C), containing the H atoms, which is connected to the right (R) and left (L) semi-infinite clean leads. The Hamil- tonian matrix describing the whole system is then given by where H$_{C}$ , H$_{L}$ and H$_{R}$ are the Hamiltonian matrices of the central region, the left and the right lead, respec- tively. V$_{LC}$ and V$_{RC}$ represent the coupling between the central region and the leads. In general, the non- orthogonality of the basis set must be taken into account when writing the Green’s function of the central region: with Γ$_{R}$$_{(}$$_{L}$$_{)}$ = i ( Σ$_{R}$$_{(}$$_{L}$$_{)}$ − Σ † R ( L ) ) . Notice that since we are interested in collinear magnetic solutions, all the ma- trices carry the spin index η , which we have not made explicit in previous equations. All the terms in Eq. 2 must be obtained self-consistently either from a periodic boundary condition calculation, e.g., using CRYSTAL03 in the case of the LSDA calculations, or following the methodology in Ref. 9 in the case of the Hubbard model. The Fermi energy is set to zero and, in both cases, global charge neutrality in all regions is imposed by shifting the onsite energies as necessary. The self-energies of the left (Σ$_{L}$) and right (Σ$_{R}$) leads account for the influence of these on the electronic struc- ture of the central part and S$_{C}$ is the overlap matrix in this region. For the calculation of the conductance we use the Landauer formula, G ( E ) = e 2 $_{h}$T ( E ). The trans- mission function T can, in turn, be obtained from the expression: We first examine the energetics of the F ( S = 1) and AF ( S = 0) states as a function of the mutual distance d between H atoms. We first choose a semiconducting AGNR of width N = 9, where N is the number of dimer lines across the ribbon, and restrict ourselves to the case of H atoms placed on different sublattices [see Fig. 1(a)]. The reason for this choice is three-fold. The AB (or BA) configurations are always energetically preferred to the AA or BB configurations for similar distances between H atoms $^{22}$. Second, and most importantly for the purpose of this work, the magnetic state of the AB (or BA) config- uration can be tuned by a magnetic field. Furthermore, as briefly mentioned in the introduction, even if energetic H = H$_{C}$ + H$_{R}$ + H$_{L}$ + V$_{LC}$ + V$_{RC}$ (2) G$_{C}$ ( E ) = [ ES$_{C}$ − H$_{C}$ − Σ$_{L}$( E ) − Σ$_{R}$( E )] − $^{1}$. (3) T ( E ) = ∑ η Tr [ G † $_{C}$( E )Γ$_{R}$( E ) G$_{C}$ ( E )Γ$_{L}$( E ) ]$_{η}$ , (4) III. RESULTS A. Energetics FIG. 3: (a) Total energy referred to E$_{0}$ [lowest energy in case (b)] as a function of the distance between H atoms for the fer- romagnetic (dashed) and the antiferromagnetic (solid) state when placed in the middle of the ribbon. Upper inset: Pic- ture of a nanoribbon with two H atoms. Lower inset: Energy difference between both states and extrapolation to large dis- tances (solid line). The vertical line in the inset denotes the distance above which the energy difference becomes less than 1 meV. (b) Same as in (a), but for both H atoms near the same edge. (c) Same as in (a), but for H atoms placed on op- posite edges. Here the width of the ribbon is larger ( N = 13) and E$_{0}$ is the minimum energy among all the AF solutions.