## Introduction

A tunable 0 − π Josephson junction has inherent potential applications as a cryogenic memory element which is an important component of a superconducting computer which would be much more energy efficient than supercomputers1,2,3 based on current semiconductor technology. Further π junctions are in high demand as the basic building blocks of a quantum computer4. In Ref.5 a Josephson junction in a carbon nanotube setup sandwiched between two superconductors shows a gate-controlled transition from the 0 to the π state. Further in Ref.6 a superconductor/quantum-dot/superconductor junction is considered and various mechanisms are explored to see the π-junction transition. In this work, we show that a high spin magnetic impurity(HSM) sandwiched between two s-wave superconductors can transit from a 0 to π Josephson junction via tuning any one of the system parameters like strength of tunnel contact, the spin S or magnetic moment of HSM or the exchange coupling J. Our motivation for looking at this set up stems from the fact that most of the π junction proposals depend on either ferromagnet or d-wave superconductor7,8 for their functioning. Integrating ferromagnets into current superconductor circuit technology hasn’t been easy. Controlling ferromagnets is an onerous task. Further d-wave superconductors, in effect high T c superconductors also have a poor record of being integrated into current superconductor technology. Thus, in this work we obviate the need for any ferromagnets or d-wave superconductors by implementing a Josephson π junction with a magnetic impurity. This magnetic impurity can be an effective model for a spin flipper or even a high spin molecule in certain limits.

Our paper is organized as follows- in the next section on Theory, we introduce our model, give a theoretical background to our study with Hamiltonian, wavefunctions and boundary conditions to calculate the Josephson current. In the section on Josephson current in presence of a HSM, we use the Furusaki-Tsukuda formalism to calculate the total Josephson current. To calculate the individual contribution-(i) the bound state we take the derivative of bound state energy with respect to phase difference and (ii) for the continuum contributions use the formalism developed in Refs9 and10. Following this we plot the Andreev bound states as a function of phase difference for different values of spin and magnetic moment of the HSM in the section on Andreev bound states. The next section concerns with the Josephson supercurrent plots. We bring out the fact that the 0 − π junction behavior can be tuned via the spin of the HSM. In the section on Josephson Current: Long junction limit, we study the Josephson current in the long junction limit and find that the π junction is robust to increase in length of normal metal region. The section on Free energy deals with the free energy of our system and we especially concentrate on the parameters necessary to exhibit bistable junction behavior, necessary precursor to Josephson qubits. The effects of interface transparency on the 0 − π junction behavior is brought out in the section on effect of tunnel contacts. The exchange interactions between the HSM and the electrons in normal metal can also play a crucial role on the tunability of 0 − π Josephson junction, this is explored in the section on effect of exchange coupling. We reveal that the electron-electron interactions in our system has a nontrivial role in the tunability of the π junction in the section on effect of electron-electron interaction. The section on effect of high spin/magnetic moment states deals with the effect of the HSM spin states on the Josephson supercurrent. These too in conjunction with electron-electron interactions have a nontrivial role in the tunability of our Josephson π junction. Finally, the paper ends with a perspective on future endeavors.

## Theory

### Hamiltonian

The Hamiltonian11,12 used to describe a HSM is given by-

$${H}_{HSM}=-{J}_{0}\overrightarrow{s}\mathrm{.}\overrightarrow{S}$$
(1)

The above model for a magnetic impurity in a Josephson junction matches quite well with solid-state scenarios such as seen in 1D quantum wires or graphene with an embedded magnetic impurity or quantum dot13,14. The electrons in the normal metals interact with HSM via the Hamiltonian with just a exchange term $${J}_{0}\overrightarrow{s}.\overrightarrow{S}$$, where J0 is the strength of the exchange interaction, $$\overrightarrow{s}$$ is the electronic spin and $$\overrightarrow{S}$$ is the spin of the HSM. $${J}_{0}(=\frac{{\hslash }^{2}{k}_{F}J}{{m}^{\ast }})$$, with J being the relative magnitude of the exchange interaction which ranges from 0 − 3 in this work, $${m}^{\ast }$$ is the electronic mass and Fermi wavevector k F is obtained from the Fermi energy E F which is the largest energy scale in our system around 1000Δ, where Δ- the superconducting gap for a widely used s-wave superconductor like lead is 1 meV. Substituting the value of the Fermi wavevector so obtained in the formula for J0 we get J0 = 0.778 eV (if J = 2). In a realistic HSM there is an anisotropy term15 ($$-D{S}_{z}^{2}$$) in the Hamiltonian (Eq. 1). The magnitude of “anisotropy parameter” denoted by D is 56 μeV. This value has been found by different spectroscopic techniques like Electron Paramagnetic Resonance EPR, neutron scattering and superconducting quantum interference device SQUID magnetometry16. Thus exchange interaction J0 is almost 14000 times larger than anisotropy parameter D. Therefore, we can neglect the term D in Hamiltonian of HSM. Our system consists of two normal metals with a HSM sandwiched between two conventional s-wave singlet superconductors. The superconductors are isotropic, and we consider an effective 1D model as shown in Fig. 1, it depicts a HSM at x = 0 and two superconductors at x < −a/2 and x > a/2. There are normal metal regions in −a/2 < x < 0 and 0 < x < a/2. The model Hamiltonian in Bogoliubov-de Gennes formalism of our system is a 4 × 4 matrix which is given below:

$$(\begin{array}{cc}H\hat{I} & i\Delta {\hat{\sigma }}_{y}\\ -i{{\rm{\Delta }}}^{\ast }{\hat{\sigma }}_{y} & -H\hat{I}\end{array}){\rm{\Psi }}(x)=E{\rm{\Psi }}(x),$$
(2)

$$H={p}^{2}/2{m}^{\ast }+V[\delta (x+a/\mathrm{2)}+\delta (x-a/\mathrm{2)]}-{J}_{0}\delta (x)\overrightarrow{s}\mathrm{.}\overrightarrow{S}-{E}_{F}$$, here $${p}^{2}\mathrm{/2}{m}^{\ast }$$ is the kinetic energy of an electron with effective mass $${m}^{\ast }$$, V is the strength of the δ potential at the interfaces between normal metal and superconductor, J0 is the strength of exchange interaction between the electron with spin $$\overrightarrow{s}$$ and a HSM with spin $$\overrightarrow{S}$$. Further, Ψ is a four-component spinor, $$\hat{\sigma }$$ is Pauli spin matrix and $$\hat{I}$$ is 2 × 2 unit matrix, E F being the Fermi energy. The superconducting gap parameters Δ for left and right superconductor, are assumed to have the same magnitude but different phases φ L and φ R and are given by $${\rm{\Delta }}={{\rm{\Delta }}}_{0}[{e}^{i{\phi }_{L}}\theta (-x-a/2)+{e}^{i{\phi }_{R}}\theta (x-a/2)]$$, θ(x) is the Heaviside step function, Δ0 is temperature dependent gap parameter and it follows $${{\rm{\Delta }}}_{0}\to {{\rm{\Delta }}}_{0}\,\tanh \,(1.74\sqrt{({T}_{c}/T-\mathrm{1)}})$$, where T c is the superconducting critical temperature17.

The wavefunctions for different regions and boundary conditions at different interfaces of our system are given in supplementary material section I. By imposing the boundary conditions on the wavefunctions one can get the different scattering amplitudes.

## Josephson Current in Presence of a HSM

### Total Josephson current

Using the generalized version of the Furusaki-Tsukuda formalism18 we can calculate the total dc Josephson current-

$${I}_{T}({\rm{\phi }})=\frac{e{{\rm{\Delta }}}_{0}}{2{\rm{\beta }}\hslash }\frac{1}{2\pi }{\int }_{0}^{2\pi }\sum _{{\omega }_{n}}\frac{{q}_{+}({\omega }_{n})+{q}_{-}({\omega }_{n})}{{{\rm{\Omega }}}_{n}}\times [\frac{{a}_{1}({\omega }_{n})-{a}_{2}({\omega }_{n})}{{q}_{+}({\omega }_{n})}+\frac{{a}_{3}({\omega }_{n})-{a}_{4}({\omega }_{n})}{{q}_{-}({\omega }_{n})}]d({k}_{F}a),$$
(3)

herein ω n  = (2n + 1)π/β are fermionic Matsubara frequencies with n = 0, ±1, ±2, ... and $${{\rm{\Omega }}}_{n}=\sqrt{{\omega }_{n}^{2}+{{\rm{\Delta }}}_{0}^{2}}$$. k F a is the phase accumulated in normal metal region. β = 1/kT is the inverse temperature. q + (ω n ), q − (ω n ), and a i (ω n ) are obtained from q+, q and a i by analytically continuing E to n . Here a i (i = 1, 2, 3, 4) with $${a}_{1}={r}_{eh}^{\uparrow \downarrow }$$ is the Andreev reflection coefficient without flip for electron up incident in left superconductor, similarly $${a}_{2}={r}_{eh}^{\downarrow \uparrow }$$ is the Andreev reflection coefficient without flip for electron down incident in left superconductor, $${a}_{3}={r}_{he}^{\uparrow \downarrow }$$ and $${a}_{4}={r}_{he}^{\downarrow \uparrow }$$ are the Andreev reflection coefficients without flip for hole up and hole down incident in left superconductor respectively. There are other ways of writing the Josephson supercurrent formula in Furusaki-Tsukuda approach19,20, all such ways give identical total Josephson current. These different ways involve different scattering amplitudes, as due to the fact that Furusaki-Tsukuda procedure obeys both detailed balance as well as probability conservation, allowing for the possibility of different representations of the same formula. We sum over the Matsubara frequencies numerically. The detailed balance conditions18 are verified as follows:

$$\frac{{a}_{1}(-{\rm{\phi }},E)}{{q}_{+}}=\frac{{a}_{4}({\rm{\phi }},E)}{{q}_{-}},\frac{{a}_{2}(-{\rm{\phi }},E)}{{q}_{+}}=\frac{{a}_{3}({\rm{\phi }},E)}{{q}_{-}}$$

### Bound state contribution

Neglecting the contribution from incoming quasiparticle20 and inserting the wave function into the boundary conditions, we get a homogeneous system of 24 linear equations for the scattering amplitudes. If we express the scattering amplitudes in the two normal metal regions by the scattering amplitudes in the left and right superconductor we get a homogeneous system of 8 linear equations17,

$$Mx=0$$
(4)

where x is a 8 × 1 column matrix and is given by $$x=[{r}_{ee}^{\uparrow \uparrow },{r}_{ee}^{\uparrow \downarrow },{r}_{eh}^{\uparrow \uparrow },{r}_{eh}^{\uparrow \downarrow },{t}_{ee}^{\uparrow \uparrow },{t}_{ee}^{\uparrow \downarrow },{t}_{eh}^{\uparrow \uparrow },{t}_{eh}^{\uparrow \downarrow }]$$ and M is a 8 × 8 matrix which is explicitly written in supplementary material section II. For a nontrivial solution of this system of equations, det M = 0, we can get a relation between the Andreev bound state energy and phase difference, i.e., Andreev levels with dispersion E i , i = {1, ..., 4}21. We find that $${E}_{i}({\rm{\phi }})={E}_{\sigma }^{\pm }({\rm{\phi }})=\pm {E}_{\sigma }({\rm{\phi }}),(\sigma =\uparrow ,\downarrow )$$ and

$${E}_{\sigma }^{\pm }({\rm{\phi }})=\pm {{\rm{\Delta }}}_{0}\sqrt{\frac{|A({\rm{\phi }})|+{\rho }_{\sigma }\sqrt{|B({\rm{\phi }})|}}{\mathrm{2|}C|}}$$
(5)

wherein ρ↑(↓) = +1(−1) and A(φ), B(φ), C depend on all junction parameters. Their explicit forms are given in supplementary material section III. For simplicity we have taken all wavevectors equal to the Fermi wavevector (Andreev approximation). For transparent regime (Z = 0) we find-

$$\begin{array}{rcl}{E}_{\sigma }^{\pm }({\rm{\phi }}) & = & \pm \frac{{{\rm{\Delta }}}_{0}}{\sqrt{2}}(\surd \mathrm{((2(8}+{J}^{4}{({F}_{2}^{2}+m^{\prime} +{m^{\prime} }^{2})}^{2}\\ & & +\,{J}^{2}\mathrm{(3}+2{F}_{2}^{2}+6m^{\prime} \mathrm{(1}+m^{\prime} ))\\ & & +\,\mathrm{(8}+{J}^{2}\mathrm{(1}-2{F}_{2}^{2}+2m^{\prime} \mathrm{(1}+m^{\prime} )))\cos ({\rm{\phi }}))\\ & & +\,{\rho }_{\sigma }\surd \mathrm{(2}{J}^{2}\mathrm{(64}{F}_{2}^{4}{J}^{2}+\mathrm{3(}J+2Jm^{\prime} {)}^{2}\\ & & +\,4{F}_{2}^{2}\mathrm{(16}+{J}^{2}\mathrm{(5}+4m^{\prime} \mathrm{(1}+m^{\prime} )))\\ & & +\,4{J}^{2}(-4{F}_{2}^{2}+16{F}_{2}^{4}-{\mathrm{(1}+2m^{\prime} )}^{2})\cos ({\rm{\phi }})\\ & & +\,({(J+2Jm^{\prime} )}^{2}-4{F}_{2}^{2}(16+{(J+2Jm^{\prime} )}^{2}))\\ & & \times \,\cos \,\mathrm{(2}{\rm{\phi }}))))/(16+{J}^{4}{({F}_{2}^{2}+m^{\prime} +{m^{\prime} }^{2})}^{2}+{J}^{2}(4+8{F}_{2}^{2}+8m^{\prime} \mathrm{(1}+m^{\prime} )))))\end{array}$$
(6)

For Z = 0, interestingly the bound states are independent of any phase (k F a) accumulated in normal metal region. For tunneling regime (Z → Large) we get-

$${E}_{\sigma }^{\pm }({\rm{\phi }})=\pm {{\rm{\Delta }}}_{0}[1+\frac{(8+{J}^{2}(1-2{F}_{2}^{2}+2m^{\prime} \mathrm{(1}+m^{\prime} ))+(8+{J}^{2}(-1+2{F}_{2}^{2}-2m^{\prime} \mathrm{(1}+m^{\prime} )))cos({k}_{F}a))\cos ({\rm{\phi }})}{16{Z}^{4}\,\sin \,{(\frac{{k}_{F}a}{2})}^{2}({(4-{J}^{2}({F}_{2}^{2}+m^{\prime} +{m^{\prime} }^{2})+(4+{J}^{2}({F}_{2}^{2}+m^{\prime} +{m^{\prime} }^{2}))\cos ({k}_{F}a)+2J\sin ({k}_{F}a))}^{2}}]$$
(7)

For Z → Large, we can clearly say that bound states are phase (k F a) dependent. From Andreev bound states energies Eq. 5 we can derive the Josephson bound state current22-

$${I}_{B}({\rm{\phi }})=\frac{2e}{\hslash }\frac{1}{2\pi }{\int }_{0}^{2\pi }\sum _{i}f({E}_{i})\frac{d{E}_{i}}{d{\rm{\phi }}}d({k}_{F}a)=-\frac{2e}{\hslash }\frac{1}{2\pi }{\int }_{0}^{2\pi }\sum _{\sigma }\tanh (\frac{{\rm{\beta }}{E}_{\sigma }}{2})\frac{d{E}_{\sigma }}{d{\rm{\phi }}}d({k}_{F}a)$$
(8)

wherein e is the electronic charge and f(E i ) denotes the Fermi-Dirac distribution function. For transparent regime (Z = 0) we obtain the current-phase relation

$$\frac{{I}_{B}({\rm{\phi }})}{{I}_{0}}=\frac{{{\rm{\Delta }}}_{0}\,\sin ({\rm{\phi }})(({C}_{1}+{C}_{2})\frac{1}{{E}_{\downarrow }}\,\tanh (\frac{{\rm{\beta }}{E}_{\downarrow }}{2})-({C}_{1}-{C}_{2})\frac{1}{{E}_{\uparrow }}\,\tanh (\frac{{\rm{\beta }}{E}_{\uparrow }}{2}))}{{C}_{3}}$$
(9)

where

$$\begin{array}{rcl}{C}_{1} & = & ((\sqrt{2}{J}^{4}(4{F}_{2}^{2}-16{F}_{2}^{4}+{\mathrm{(1}+2m^{\prime} )}^{2})\\ & & +\,\sqrt{2}{J}^{2}(4{F}_{2}^{2}(16+{(J+2Jm^{\prime} )}^{2})-{(J+2Jm^{\prime} )}^{2})\cos ({\rm{\phi }}))\\ {C}_{2} & = & \mathrm{(8}+{J}^{2}-2{J}^{2}{F}_{2}^{2}+2{J}^{2}m^{\prime} \mathrm{(1}+m^{\prime} ))\surd ({J}^{2}\mathrm{(64}{F}_{2}^{4}{J}^{2}+\mathrm{3(}J+2Jm^{\prime} {)}^{2}\\ & & +\,4{F}_{2}^{2}\mathrm{(16}+{J}^{2}\mathrm{(5}+4m^{\prime} \mathrm{(1}+m^{\prime} )))\\ & & +\,4{J}^{2}(-4{F}_{2}^{2}+16{F}_{2}^{4}-{\mathrm{(1}+2m^{\prime} )}^{2})\cos ({\rm{\phi }})\\ & & +\,((J+2Jm^{\prime} {)}^{2}-4{F}_{2}^{2}\mathrm{(16}+{(J+2Jm^{\prime} )}^{2}))\cos \,\mathrm{(2}{\rm{\phi }})))\\ {C}_{3} & = & \mathrm{((16}+{J}^{4}{({F}_{2}^{2}+m^{\prime} +{m^{\prime} }^{2})}^{2}\\ & & +\,{J}^{2}\mathrm{(4}+8{F}_{2}^{2}+8m^{\prime} \mathrm{(1}+m^{\prime} )))\surd ({J}^{2}\mathrm{(64}{F}_{2}^{4}{J}^{2}+\mathrm{3(}J+2Jm^{\prime} {)}^{2}\\ & & +\,4{F}_{2}^{2}\mathrm{(16}+{J}^{2}\mathrm{(5}+4m^{\prime} \mathrm{(1}+m^{\prime} )))\\ & & +\,4{J}^{2}(-4{F}_{2}^{2}+16{F}_{2}^{4}-{\mathrm{(1}+2m^{\prime} )}^{2})\cos ({\rm{\phi }})\\ & & +\,((J+2Jm^{\prime} {)}^{2}-4{F}_{2}^{2}\mathrm{(16}+{(J+2Jm^{\prime} )}^{2}))\cos \,\mathrm{(2}{\rm{\phi }}))))\end{array}$$

I0 = eΔ0/ħ; and E↑(↓) is given in Eq. 6. For tunneling regime (Z → Large) and at T = 0 we find

$$\frac{{I}_{B}({\rm{\phi }})}{{I}_{0}}=\frac{1}{2\pi }{\int }_{0}^{2\pi }[\tfrac{(8+{J}^{2}(1-2{F}_{2}^{2}+2m^{\prime} \mathrm{(1}+m^{\prime} ))+(8+{J}^{2}(-1+2{F}_{2}^{2}-2m^{\prime} \mathrm{(1}+m^{\prime} )))\cos ({k}_{F}a))\sin ({\rm{\phi }})}{4{Z}^{4}\,\sin \,{(\tfrac{{k}_{F}a}{2})}^{2}{(4-{J}^{2}({F}_{2}^{2}+m^{\prime} +{m^{\prime} }^{2})+(4+{J}^{2}({F}_{2}^{2}+m^{\prime} +{m^{\prime} }^{2}))\cos ({k}_{F}a)+2J\sin ({k}_{F}a))}^{2}}]d({k}_{F}a)$$
(10)

### Continuum contribution

The continuum contribution to the Josephson current is the collection of currents carried by both electron-like and hole-like quasiparticles outside the gap. Using the formalisms developed earlier in Refs9,23 the continuum contribution from electron-like excitations is given below9.

$$\begin{array}{rcl}{I}_{C}^{e}({\rm{\phi }}) & = & \frac{2e}{h}\frac{1}{2\pi }{\int }_{0}^{2\pi }({\int }_{-\infty }^{-{\Delta }_{0}}+{\int }_{\infty }^{{\Delta }_{0}})\frac{1}{|{u}^{2}-{v}^{2}|}\\ & & \times \,[{T}_{L\to R}^{e\uparrow \uparrow }(E,{\rm{\phi }})+{T}_{L\to R}^{e\uparrow \downarrow }(E,{\rm{\phi }})-{T}_{L\leftarrow R}^{e\uparrow \uparrow }(E,{\rm{\phi }})\\ & & -{T}_{L\leftarrow R}^{e\uparrow \downarrow }(E,{\rm{\phi }})]f(E)dEd({k}_{F}a)\end{array}$$
(11)

Similarly the continuum contribution from hole-like excitations can be calculated by replacing ‘e’ in Eq. 11 by ‘h’. In Eq. 11 $${T}_{L\to R}^{e\uparrow \uparrow }=|{t}_{ee}^{\uparrow \uparrow }{|}^{2}-|{t}_{eh}^{\uparrow \uparrow }{|}^{2}$$ is the transmission without flip for the electronic currents moving from left to right of the system as depicted in Fig. 1. $${T}_{L\to R}^{e\uparrow \downarrow }=|{t}_{ee}^{\uparrow \downarrow }{|}^{2}-|{t}_{eh}^{\uparrow \downarrow }{|}^{2}$$ is the transmission with flip for the electronic currents moving from left to right of the system and similarly $${T}_{L\leftarrow R}^{e\uparrow \uparrow }$$ and $${T}_{L\leftarrow R}^{e\uparrow \downarrow }$$ are the transmission without flip and with flip for the electronic currents moving from right to left of the system respectively. Here we have

$${T}_{L\leftarrow R}^{e\uparrow \uparrow }(E,{\rm{\phi }})={T}_{L\to R}^{e\uparrow \uparrow }(E,-{\rm{\phi }}),{T}_{L\leftarrow R}^{e\uparrow \downarrow }(E,{\rm{\phi }})={T}_{L\to R}^{e\uparrow \downarrow }(E,-{\rm{\phi }})$$

The hole continuum contribution is found to be equal to the electronic continuum contribution. Therefore, the total continuum current due to electron-like and hole-like excitations is given as follows:

$${I}_{C}({\rm{\phi }})=\frac{{I}_{C}^{e}({\rm{\phi }})+{I}_{C}^{h}({\rm{\phi }})}{2}={I}_{C}^{e}({\rm{\phi }})$$
(12)

In our work we have verified the total current conservation-I T (φ) = I B (φ) + I C (φ)

## Andreev Bound States

The Andreev bound states (ABS) as obtained in Eq. 5 are analyzed in this section. We focus on the role of spin S and magnetic moment m′ of the HSM on ABS. In Fig. 2(a), we plot ABS for S = 1/2 and m′ = 1/2, as here the spin flip probability $${F}_{2}=\sqrt{(S-m^{\prime} )(S+m^{\prime} +\mathrm{1)}}=0$$ which corresponds to no flip, we get only two bound states, but in Fig. 2(b) with S = 1/2 and m′ = −1/2, F2 ≠ 0 thus due to spin flip processes we get four bound states. To address the situation of large spin S in HSM in Fig. 3 we plot ABS for S = 9/2 and all allowed m′ values. For particular S, as m′ changes, separation between electron (positive) bound states and hole (negative) bound states increases. Similarly for particular m′ as we change S, this separation increases. For large S, ABS lie at the gap edge. This is seen for large m′ as well. This behavior is also seen as one changes J, Z as well. We only plot ABS for m′ = ±1/2, ±3/2, ±9/2, but we do not plot for m′ = ±5/2, ±7/2 because the separation between electron bound states and hole bound states increases from m′ = 3/2 to m′ = 9/2 and these m′ values lie between m′ = 3/2 and m′ = 9/2. Large S, m′, Z, J lead to ABS shifting to gap edge.

## Josephson Current: π Junction

The considered model shows π junction behavior. To see this, we plot the bound state, continuum and total Josephson currents for S = 1/2 (Fig. 4) and S = 9/2 (Fig. 5). We choose the transparent regime (Z = 0) case. A separate section will be denoted to effect of tunnel contacts. One can clearly conclude that the continuum contribution of the total current is very small, therefore the bound current and total current are almost same. In Fig. 4(a) as there is no flip we have 0 junction. For spin flip case, the Josephson current changes sign in 0 < φ < π regime. In Fig. 5 we concentrate on high spin (S = 9/2) of HSM. Here we also see that for m′ = 5/2, 3/2, 1/2, −1/2, −3/2, −5/2, −7/2 we get π junction. But for m′ = 9/2, 7/2, −9/2 we get 0 junction. So here also there will be a switching from 0 to π and again from π to 0 with change of m′ from 9/2 to −9/2. Thus, one can conclude that all π shifts are due to spin flip scattering (F2 ≠ 0), however the reverse is not necessarily true. This π-junction state has been studied earlier in Ref.24 with spin-active normal metal superconductor (NS) interfaces, but they did not consider any high spin magnetic impurity. Their system shows a 0 − π transition as a function of the kinematic phase, misorientation angle and temperature.

## Josephson Current: Long Junction Limit

There are eight different types of quasiparticle injection into our system: an electron-like quasiparticle (ELQ) with spin up or down or a hole-like quasiparticle (HLQ) with spin up or down injected from either the left or from the right superconducting electrode. Following the procedure established in supplementary material section I.A, we write the wavefunction for the injection of spin up electron in left side superconductor as-

$$\begin{array}{rcl}{\psi }_{SL}(x) & = & (\begin{array}{c}u\\ 0\\ 0\\ v\end{array}){e}^{i{q}_{+}x}{{\rm{\varphi }}}_{m^{\prime} }^{S}\,+\,{r}_{ee}^{\uparrow \uparrow }(\begin{array}{c}u\\ 0\\ 0\\ v\end{array}){e}^{-i{q}_{+}x}{{\rm{\varphi }}}_{m^{\prime} }^{S}\,+\,{r}_{ee}^{\uparrow \downarrow }(\begin{array}{c}0\\ u\\ -v\\ 0\end{array}){e}^{-i{q}_{+}x}{{\rm{\varphi }}}_{m^{\prime} +1}^{S}\\ & & +\,{r}_{eh}^{\uparrow \uparrow }(\begin{array}{c}0\\ -v\\ u\\ 0\end{array}){e}^{i{q}_{-}x}{{\rm{\varphi }}}_{m^{\prime} +1}^{S}\,+\,{r}_{eh}^{\uparrow \downarrow }(\begin{array}{c}v\\ 0\\ 0\\ u\end{array}){e}^{i{q}_{-}x}{{\rm{\varphi }}}_{m{\rm{^{\prime} }}}^{S},\,for\,x < -\frac{a}{2}\,\end{array}$$

Similarly the corresponding wave function for the right side superconductor is-

$$\begin{array}{ccc}{\psi }_{SR}(x) & = & {t}_{ee}^{\uparrow \uparrow }(\begin{array}{c}u{e}^{i\phi }\\ 0\\ 0\\ v\end{array}){e}^{i{q}_{+}x}{\varphi }_{m^{\prime} }^{S}\,+\,{t}_{ee}^{\uparrow \downarrow }(\begin{array}{c}0\\ u{e}^{i\phi }\\ -v\\ 0\end{array}){e}^{i{q}_{+}x}{\varphi }_{m^{\prime} +1}^{S}\\ & & +\,{t}_{eh}^{\uparrow \uparrow }(\begin{array}{c}0\\ -v{e}^{i\phi }\\ u\\ 0\end{array}){e}^{-i{q}_{-}x}{\varphi }_{m^{\prime} +1}^{S}\,+\,{t}_{eh}^{\uparrow \downarrow }(\begin{array}{c}v{e}^{i\phi }\\ 0\\ 0\\ u\end{array}){e}^{-i{q}_{-}x}{\varphi }_{m^{\prime} }^{S},\,{\rm{f}}{\rm{o}}{\rm{r}}\,x > \frac{a}{2}\end{array}$$

The wavefunction in the normal metal region (N1) is given by for the long junction limit following Ref.25,

$$\begin{array}{rcl}{{\rm{\psi }}}_{{N}_{1}}(x) & = & e{e}^{i{k}_{e}(x+a\mathrm{/2)}}(\begin{array}{c}v\\ 0\\ 0\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} }^{S}\,+\,f{e}^{-i{k}_{e}x}(\begin{array}{c}u\\ 0\\ 0\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} }^{S}\\ & & +\,e^{\prime} {e}^{i{k}_{e}(x+a\mathrm{/2)}}(\begin{array}{c}0\\ -v\\ 0\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} +1}^{S}\,+\,f^{\prime} {e}^{-i{k}_{e}x}(\begin{array}{c}0\\ u\\ 0\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} +1}^{S}\\ & & +\,g{e}^{-i{k}_{h}(x+a\mathrm{/2)}}(\begin{array}{c}0\\ 0\\ -v\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} +1}^{S}\,+\,h{e}^{i{k}_{h}x}(\begin{array}{c}0\\ 0\\ u\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} +1}^{S}\\ & & +g^{\prime} {e}^{-i{k}_{h}(x+a\mathrm{/2)}}(\begin{array}{c}0\\ 0\\ 0\\ v\end{array}){{\rm{\varphi }}}_{m^{\prime} }^{S}\,+\,h^{\prime} {e}^{i{k}_{h}x}(\begin{array}{c}0\\ 0\\ 0\\ u\end{array}){{\rm{\varphi }}}_{m^{\prime} }^{S},\,{\rm{for}}\,-\frac{a}{2} < x < 0\,\end{array}$$

Similarly the wavefunction in the normal metal region (N2) is given by-

$$\begin{array}{rcl}{{\rm{\psi }}}_{{N}_{2}}(x) & = & {a}_{0}{e}^{i{k}_{e}x}(\begin{array}{c}v\\ 0\\ 0\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} }^{S}\,+\,b{e}^{-i{k}_{e}(x-a\mathrm{/2)}}(\begin{array}{c}u\\ 0\\ 0\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} }^{S}\\ & & +\,a^{\prime} {e}^{i{k}_{e}x}(\begin{array}{c}0\\ -v\\ 0\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} +1}^{S}\,+\,b^{\prime} {e}^{-i{k}_{e}(x-a\mathrm{/2)}}(\begin{array}{c}0\\ u\\ 0\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} +1}^{S}\\ & & +\,c{e}^{-i{k}_{h}x}(\begin{array}{c}0\\ 0\\ -v\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} +1}^{S}\,+\,d{e}^{i{k}_{h}(x-a\mathrm{/2)}}(\begin{array}{c}0\\ 0\\ u\\ 0\end{array}){{\rm{\varphi }}}_{m^{\prime} +1}^{S}\\ & & +\,c^{\prime} {e}^{-i{k}_{h}x}(\begin{array}{c}0\\ 0\\ 0\\ v\end{array}){{\rm{\varphi }}}_{m^{\prime} }^{S}\,+\,d^{\prime} {e}^{i{k}_{h}(x-a\mathrm{/2)}}(\begin{array}{c}0\\ 0\\ 0\\ u\end{array}){{\rm{\varphi }}}_{m^{\prime} }^{S},\,{\rm{for}}\,0 < x < \frac{a}{2}\end{array}$$

For |E| E F , we can write $${k}_{e,h}\approx {k}_{F}\pm \frac{E}{2{{\rm{\Delta }}}_{0}{\xi }_{0}}$$, where ξ0 = E F /(k F Δ0) is the BCS coherence length10. By using the boundary conditions mentioned in supplementary material section I.B one can get the different scattering amplitudes. The wavefunction for the other seven types of quasiparticle injection process are constructed in the same way. Using the generalized version of Furusaki-Tsukuda Josephson current formula mentioned in the section on Josephson current in presence of a HSM, we can calculate the total dc Josephson current for long junction limit. In Fig. 6 we plot the Josephson current for a long junction. In Fig. 6(a) we plot Josephson supercurrent as a function of junction length a for φ = π/2 and different values of spin (S) of HSM from S = 1/2 to S = 11/2. We see that Josephson supercurrent dies monotonically with increase of length (a) of the junction. For large a the Josephson supercurrent goes to zero. In Fig. 6(b) we have plotted Josephson supercurrent as a function of phase difference (φ) for different junction length a and high spin of HSM (S = 9/2). We see that Josephson supercurrent decreases with increase of junction length a. In Fig. 6(a) and (b) the magnetic moment of HSM m′ = −1/2 and the junction transparency Z = 0. However, change in length has no effect on the sign of Josephson current. Thus signifying that the π junction is robust to change in normal metal length.

## Free Energy

We can also determine the nature of the junction, i.e. 0 or π by the minimum of the free energy, which is given by

$$F({\rm{\phi }})=-\frac{1}{{\rm{\beta }}}\frac{1}{2\pi }{\int }_{0}^{2\pi }\,\mathrm{ln}[\prod _{i}(1+{e}^{-{\rm{\beta }}{E}_{i}({\rm{\phi }})})]d({k}_{F}a)=-\frac{2}{{\rm{\beta }}}\frac{1}{2\pi }{\int }_{0}^{2\pi }\sum _{\sigma }\mathrm{ln}[2\,\cosh (\frac{{\rm{\beta }}{E}_{\sigma }({\rm{\phi }})}{2})]d({k}_{F}a)$$
(13)

In Fig. 7 we have plotted F0 as a function of phase difference for spin S = 9/2 and different values of m′, we have considered a transparent junction (Z = 0). In the same figure we see that the free energy for m′ = 9/2 is almost half than that of the other cases (m′ ≠ 9/2). A plausible reason for why these occurs could be that for m′ = 9/2 there is no spin flip process (F2 = 0) while for the other cases F2 ranges from 3 to 5. In Fig. 8 we plot the Free energy for S = 5/2 and m′ = 1/2 for different values of interface transparency Z. At particular value of Z = 0.383 the Free energy shows a bistable behavior, i.e., the Free energy minima occurs at both 0 and π meaning that the ground state of the system does not occur at either 0 or π exclusively but is shared by both. These bistable junctions have a major role to play in quantum computation applications26,27,28,29.

## Effect of Tunnel Contacts

In Fig. 9 we plot the Josephson supercurrent as a function of phase difference for different values of interface barrier strength. From Fig. 9(a) where m′ = 5/2 we see that there is no π shift from transparent to tunnel regime and the ground state of the system always stays at φ = 0. The reason that ground state stays at φ = 0 in Fig. 9(a) is because of the absence of spin flip processes as S = m′ = 5/2 and F2 = 0. In Fig. 9(b) the ground state of the system shifts from φ = π to φ = 0 as a function of Z. Infact for a transparent junction (Z = 0) the ground state is at φ = π and as we increase Z we see the ground state shift from π to 0 state. Of course in this case as S = 5/2 and m′ = 1/2 therefore the probability for the HSM to flip (F2 ≠ 0) is nonzero. Thus spin flip processes aid in the transition from 0 to π junction. Notably, this transition can be tuned by the transparency of the junction (Z) as is evident from Fig. 9(b). Of course not all cases where in the HSM flips its spin leads to a transition from 0 to π state as is evident in Fig. 9(c). In Fig. 9(c) the ground state stays at φ = 0, but here as S = 5/2, m′ = 3/2 and F2 ≠ 0, so spin flip processes occur in contrast to Fig. 9(a). In Fig. 9 the strength of exchange interaction J is taken as 1. It has to be pointed out that J has a nontrivial role in the 0 to π state transition as will be evident in the next section. Thus our conclusions regarding Fig. 9(c) has to be qualified by the fact that we haven’t focused on the issue of exchange interaction so far.

## Effect of Exchange Coupling

In Hamiltonian H, in Eq. (2) the term J0δ(x)$$\overrightarrow{s}$$.$$\overrightarrow{S}$$ represents the exchange coupling of strength J0 between the electron with spin $$\overrightarrow{s}$$ and a HSM with spin $$\overrightarrow{S}$$. In Fig. 10 the Josephson supercurrent is plotted as a function of phase difference for different values of strength of exchange interaction in the transparent regime. We choose S = 5/2 and allowed values of m′. One sees for the no spin flip case there is no transition from 0 to π junction while for cases with spin flip one can see a 0 to π state transition. Thus all spin flip process i.e., F2 ≠ 0 and with J > 1/2 may show π junction behavior.

## Effect of Electron-Electron Interaction (Phenomenological)

We have considered a phenomenological30,31 approach to electron-electron interactions. The effect of such interactions are included through an energy dependent transmission probability which is given as-

$$T(E)=\frac{{T}_{0}{|\frac{E}{{D}_{0}}|}^{\alpha }}{1-{T}_{0}(1-{|\frac{E}{{D}_{0}}|}^{\alpha })}$$
(14)

with T0 being the transparency of the metal superconductor interface in the absence of electron-electron interactions. α (0 < α < 1) represents the electron-electron interaction strength (α = 0 corresponds to no interactions while α = 1 corresponds to a maximally interacting system), D0 is a high energy cutoff obtained by the energy bandwidth of the electronic states. Now for non-interacting case the parameter Z is a constant and is related to the transmission probability T0 as

$${Z}^{2}=\frac{1-{T}_{0}}{{T}_{0}}$$
(15)

Now in presence of electron-electron interaction, T0 is replaced by T(E) in the above equation. Thus, the interface transparency Z which is considered identical at both interfaces will be energy dependent and will change from Z to Z ee :

$${Z}_{ee}^{2}={|\frac{E}{{D}_{0}}|}^{-\alpha }\frac{1-{T}_{0}}{{T}_{0}}={|\frac{E}{{D}_{0}}|}^{-\alpha }{Z}^{2}$$
(16)

For Z = 0 (T0 = 1), Z ee  = 0 which implies that for a transparent interface electron-electron interaction have no effect on electronic transport. In Fig. 11 we plot the Josephson supercurrent as a function of phase difference for different values of electron-electron interaction parameter α. We see that for m′ = 5/2, 1/2, −3/2 there is no 0-π transition with increase of electron-electron interaction strength. But for m′ = 3/2, −1/2, −5/2 there is a change from π to 0 junction with increase of electron-electron interaction strength (α).

## Effect of High Spin/Magnetic Moment States

Since we have a high spin magnetic impurity(HSM) it is imperative for us to study high spin states of our HSM. In Fig. 12(a) we see that Josephson supercurrent at φ = π/2 is positive for S = 1/2, but as we increase spin (S) of HSM it changes to negative from S = 3/2 to S = 9/2. We choose phase difference φ = π/2 to see the sign change of the Josephson supercurrent. In the inset of Fig. 12(a) we plot the Josephson supercurrent for still higher spin states of HSM (S = 11/2 − 19/2). In Fig. 12(a) for all different values of S the magnetic moment of HSM m′ = −1/2 and the junction transparency Z = 0. The reason for the change in sign in the Josephson supercurrent can be guessed from the fact that the spin flip probability (F2) of the HSM for negative Josephson supercurrent is greater than 1. This previous statement is however subject to qualification-negative supercurrent for low spin states of HSM require smaller values of spin flip probability F2 than do high spin states of HSM. In Fig. 12(b) we look at the effect of spin magnetic moment states on Josephson supercurrent. We consider the spin S of HSM to be 9/2. The Josephson supercurrent changes sign with m′. One can clearly see when the spin flip probability of HSM, i.e., F2 > 3 the Josephson supercurrent is negative but for flip probability F2 < 3 the Josephson supercurrent is positive for a transparent junction Z = 0. We see in Fig. 12(c) the possibility of a π junction also at Z = 1 (intermediate transparency). In Fig. 12(c) we plot the Josephson supercurrent including still higher spin states of HSM (S = 1/2−19/2). In supplementary material section IV we juxtapose the spin state S, magnetic moment m′ and spin flip probability F2 of HSM in a tabular format. Finally in Fig. 12(d) we plot the Josephson supercurrent at Z = 1 (non transparent junction) as a function of spin magnetic moment m′ for S = 9/2. We see non transparent junction inhibit a 0 − π junction transition for S = 9/2. However, one has to qualify the aforesaid statement by looking at Fig. 12(c). In Fig. 12(c) we see that a finite Z (equal 1) can act as a barrier to the 0−π junction transition. To overcome this barrier one needs to go to still higher spin states like S = 15/2 − 19/2. Thus in Fig. 12(d) instead of plotting for S = 9/2 if we had plotted for S = 15/2 − 19/2 we would have seen a 0 − π junction transition for some value of m′. So to conclude this section for transparent interfaces spin flip processes lead to a 0 to π junction transition. However, when junction transparency reduces one has to go to much higher spin states to see a 0 − π junction transition. The moral of the story is a finite Z inhibits 0 − π transition but a large S can overcome the Z barrier. The π − shift seen due to change in S can be experimentally implemented. One can control the impurity spin S optically as shown in Refs32,33.

## Experimental Realization and Conclusions

In this paper we have provided an exhaustive study of the nature of the 0 to π Josephson junction transition in presence of a high spin magnetic impurity (HSM). We have studied various aspects of the problem like the strength of the exchange interaction (J) between HSM and charge carriers (Section on effect of exchange coupling), the effect of electron-electron interactions (α) albeit phenomenologically (Section on effect of electron-electron interaction), effect of junction transparencies (Z) (Section on effect of tunnel contacts) and of course the high spin states S, spin magnetic moment m′ of the HSM itself (Section on effect of high spin/magnetic moment states). We identify spin flip probability of the HSM as the key to understand the 0 to π junction transition. We also focused on applications of our junction in quantum computation proposals (Section on Free energy). The set-up as shown in Fig. 1 can be easily realized in the lab. Superconductor-Normal metal-Superconductor Josephson junctions have been experimentally realized since long34. High spin magnetic impurities have been realized since 20 years35. The amalgamation of a Superconductor-Normal metal-Superconductor (SNS) junction with a high spin magnetic impurity shouldn’t be difficult, especially with a s-wave superconductor like Aluminum or Lead it should be perfectly possible. π Josephson junction with a quantum dot sandwiched between two superconductors has been demonstrated experimentally in Ref.5. They observe a gate-controlled transition from the 0 to the π state. Further, in Ref.15 they look at the Josephson effect in a quantum spin Hall system coupled with a localized magnetic impurity. Our work will help experimentalists in designing tunable π junctions without taking recourse to Ferromagnets or high T c superconductors or any applied magnetic fields but with only a magnetic impurity.