1 Introduction

The work of Andreev demonstrating the possibility of Andreev reflection was published nearly sixty years ago [1]. Remarkably, the interest to this phenomenon is not decreasing but rather increasing with time. More and more applications of it are being suggested. While in normal reflection a particle (quasiparticle) changes direction of its momentum, in the Andreev reflection it changes the direction of its group velocity. For reflection from an interface between a normal metal and a superconductor this means that a particle in a normal metal is reflected as a hole, or vice versa.

Andreev considered reflection from a planar interface. But it takes place also for quasiparticle reflection from a quantum vortex and not only in superconductors. Rotons in superfluid \(^4\)He have a spectrum similar to that of BCS quasiparticles. Andreev reflection from a velocity field around the vortex contributes to a force on the vortex from moving rotons in superfluid \(^4\)He and BCS quasiparticles in superconductors and in superfluid \(^3\)He. In fact, the first example of the Andreev reflection appeared in the paper by Lifshitz and Pitaevskii [2] on a force on a vortex from rotons even before Andreev’s paper [1], although it is difficult to see this in their less-than-half page communication giving only final expressions for the force. Later calculations of this force with more details and some corrections were published [3,4,5,6]. Andreev reflection by vortices plays an important role in investigations of quantum turbulence in \(^3\)He, which is a Fermi superfluid described by the BCS theory [7]. Recently Skrbek and Sergeev [8] suggested to use Andreev reflection of rotons by vortices in investigations of quantum turbulence in superfluid \(^4\)He.

The concept of Andreev reflection naturally brought Andreev to the next fundamental concept of condensed matter (and maybe not only condensed matter) physics: Andreev bound states [9]. In a normal metal between two superconductors quantum states with energies less than the gap in superconductors are not able to penetrate into the superconductor. Quasiparticles at these states jump forth and back with multiple Andreev reflections from interfaces. After any Andreev reflection a particle becomes a hole, or vice versa.

Andreev reflection and Andreev states are key concepts for the problem addressed in the present paper: long ballistic SNS junction (normal metal sandwiched between two superconductors). It was noticed long ago [10,11,12] that if the normal metal layer is ballistic the Josephson effect exists even for layer thickness much exceeding the coherence length. These works used the self-consistent field method [13]. In this method an effective pairing potential is introduced, which transforms the second-quantization Hamiltonian with the electron interaction into an effective Hamiltonian quadratic in creation and annihilation electron operators. The effective Hamiltonian can be diagonalized by the Bogolyubov–Valatin transformation.

Fig. 1
figure 1

Phase variation across the SNS junction. a The condensate current produced by the phase gradient \(\nabla \varphi \) in the superconducting layers. The phase \(\theta _s =L\nabla \varphi \) is the superfluid phase. In all layers the electric current is equal to \({env}_s\). b The vacuum current produced by the phase \(\theta _0=\theta _+-\theta _-\), which is called the vacuum phase. The current is confined to the normal layer, there is no current in superconducting layers. c The superposition of the condensate and the vacuum current. d The phase variation across a weak link

The effective Hamiltonian is not gauge invariant, and the theory using this Hamiltonian violates the charge conservation law. The charge conservation law is restored if one solves the Bogolyubov–de Gennes equations together with the self-consistency equation for the pairing potential. In the past [10,11,12] this step was skipped. Instead of solving the self-consistency equation, it was postulated that there is a gap \(\Delta \) of constant modulus \(\Delta _0=|\Delta |\) in the superconducting layers and zero gap inside the normal layer.Footnote 1 Further we use this idealized model assuming the following spatial variation of the gap in space (Fig. 1):

$$\begin{aligned} \Delta =\left\{ \begin{array}{ll} \Delta _0\text{e}^{i\theta _++ i\nabla \varphi x} &{} x>L/2 \\ 0 &{} -L/2<x<L/2\\ \Delta _0\text{e}^{i\theta _-+ i\nabla \varphi x} &{} x<-L/2 \end{array} \right. . \end{aligned}$$
(1)

The effective masses and Fermi energies are equal in the superconductors and in the normal metal.

Previous theoretical investigations of the ballistic SNS junction have left some questions open:

  1. 1.

    Since the effective Hamiltonian is not gauge invariant, some solutions of the model violate the charge conservation law. They are mathematically correct, but are unphysical and must be filtered out. In many previous papers starting from the original ones [10,11,12] it was not done properly.

  2. 2.

    There was no clarity about the respective roles of bound and continuum states in the current in the normal layer. Ishii [11] argued that both were important. This view was shared by a number of later publications (see Thuneberg [14] and references therein). But a clear quantitative analysis of the issue was still needed.

  3. 3.

    The effect of parity of Andreev levels (odd vs. even number of states) was not investigated or even mentioned. The effect is possible in the 1D case.

Reference [15] addressed these issues recently. The analysis dealt directly with ab initio analytical expressions for relevant currents via sums and integrals over all bound and continuum states without introducing Green’s function formalism for their calculation as was mostly done in the past starting from Refs. [10, 11]. Sums and integrals were calculated by expanding them in the inverse thickness 1/L of the normal layer.

In paper [15], a remedy for the violation of the conservation law in previous investigations was proposed. The strict conservation law was replaced by a softer condition that, at least, the total currents deep in all layers are the same. The condition can be satisfied only by taking into account three contributions to the total current \(J=J_s+J_v+J_q\): (i) The current \(J_s\) is induced by the phase gradient in the superconducting layers. It was called the Cooper-pair condensate, or simply the condensate current. (ii) The current \(J_v\), which can flow in the normal layer even if the Cooper-pair condensate is at rest and all states are empty. It was called the vacuum current. (iii) The current \(J_q\) induced by nonzero occupation of Andreev levels, i.e., by creation of quasiparticles. It was called the excitation current. Since the condensate motion produces the same current \(J_s\) in all layers; while, the vacuum and the excitation currents exist only in the normal layer, the charge conservation law requires that the sum of the vacuum and the excitation currents \(J_v+J_q\) vanishes.

The solution of the Bogolyubov–de Gennes equations for the phase variation shown in Fig. 1a gives the state with the only condensate current \(J_s={env}_s\) in all layers. Here n is the electron density and \(v_s ={\hbar \over 2m}\nabla \varphi \) is the superfluid velocity. This current does not differ from the current in a uniform superconductor since at Andreev scattering at interfaces between layers the Bogolyubov–de Gennes equations are Galilean invariant despite the translational invariance is broken [12, 15]. The phase difference across the normal layer is \(\theta _s=\nabla \varphi L\). It was called the superfluid phase [15]. There is a state with the vacuum current \(J_v\) flowing only in the normal layer [Fig. 1b], which is determined by the vacuum phase \(\theta _0=\theta _+-\theta _-\) [see Eq. (1)]. The charge conservation law is violated if there is no excitation current compensating the vacuum current. Figure 1c shows the phase variation at the coexistence of the condensate and the vacuum current. The total phase difference across the normal layer is the Josephson phase \(\theta =\theta _s+\theta _0\). The phase profiles in the normal layer are shown in Fig. 1 by dashed lines. This phase is not determined because it is a phase of the order parameter \(\Delta \), which vanishes in the normal layer. Only the total phase difference across the normal layer appears in the Bogolyubov–de Gennes equations. The dashed lines simply show what the phase gradient would be if the normal metal were replaced by a superconductor.

In the past it was common to ignore the effect of the phase gradient in superconducting leads on the Josephson current. By default, it was supposed that this is not an issue because gradients in the leads are very small. This is true for a weak link, inside which the phase varies much faster than in the leads as shown in Fig. 1d. At zero temperature the long SNS junction is not a weak link [15], and the phase gradient in the leads does affect the current in the normal layer. Thus, one should determine currents in the normal and superconducting layers self-consistently. The long ballistic SNS junction is a weak link only at high temperatures when the current is exponentially small.

Fig. 2
figure 2

Saw-tooth current-phase relation at zero temperature. Here \(J_0={\pi \hbar \over 2mL}en\) (\(={\text{ev}_{\rm f}\over L}\) in the 1D case)

Introduction of two phases \(\theta _0\) and \(\theta _s\) and the difference between the condensate and the vacuum current essentially revised the physical picture of charge transport through the ballistic SNS junction at zero temperature. The principal difference between two phases is that at tuning the phase \(\theta _0\) Andreev levels move with respect to the gap, while at tuning the phase \(\theta _s\) Andreev levels move together with the gap and their respective positions do not vary. At zero temperature all investigations predicted a saw-tooth current-phase relation (Fig. 2). But in the works [10,11,12] ignoring phase gradients in the leads, the current at sloped segments was a vacuum current calculated using the formalism of finite temperature Green’s functions. As argued above, the vacuum current cannot flow alone because this violates the charge conservation law. By contrast, according to Ref. [15], at sloped segments only the condensate current \(J_s\) flows in all layers without violation of the charge conservation law. Its value directly follows from the Galilean transformation of the ground state in the condensate at rest to the state with moving condensate. As demonstrated in Sect. 3.1, the Bogolyubov–de Gennes equations are Galilean invariant if there is no normal scattering and the Andreev reflection is the only scattering process. The latter condition is satisfied if the ratio \(\Delta _0/\varepsilon _{\rm f}\) (\(\varepsilon _{\rm f}\) is the Fermi energy) is small. Thus, the derivation of the zero-temperature saw-tooth current-phase relation goes beyond the simple model of the step-function gap profile (Fig. 2) and is valid even if the gap profile is determined from the self-consistency equation. For derivation it is not necessary to first use the sophisticated theory for finite temperature Green functions in order to go to the limit \(T\rightarrow 0\) in the end.

The vacuum current at zero temperature appears only at the vertical segments of the \(T=0\) current-phase relation at \(\theta =\pi (2s+1)\) (s is an integer) when the energy of the lowest Andreev state reaches zero and its occupation becomes possible. This allows to satisfy the condition \(J_v+J_q=0\).

The difference between the phases \(\theta _0\) and \(\theta _s\) was already considered in the past by Riedel et al. [16] although using a different terminology.Footnote 2 They also realized an important difference between the point contact and the planar long ballistic SNS junction: the former is a weak link and the latter is not. This was illustrated by their Fig. 1, which is equivalent to our Fig. 1a, d. The problem of charge conservation when the junction is not a weak link was discussed by Sols and Ferrer [17] for a superconductor interrupted by a barrier with high transmission probability.

Riedel et al. [16] went beyond the model with the postulated step-function dependence of the gap on the coordinate (Fig. 1) and numerically solved the Bogolyubov–de Gennes equations together with the integral self-consistency equation for the gap. Remarkably, they revealed that even though their numerics gave smoothly varying gap dependence in the transient interface between the normal layer and the superconducting leads, the phase gradient remained constant along the whole junction as in Fig. 1a. This is a numerical confirmation of the Galilean invariance proved in Sec. 3.1 of the present paper analytically. Recently Davydova et al. [18] also discussed the Galilean transformation (Doppler shift) for a short SNS junction shunted by a nanowire bridge. This setup was suggested for observation of the Josephson diode effect and essentially differs from that in the present paper. In their case the state with the only condensate current in all layers is absent.

Thuneberg published the Comment [14] rejecting the approach in Ref. [15] and asserting that the vacuum current in continuum states was incorrectly ignored there (see the Reply [19] to the Comment). According to [15], in multidimensional (2D and 3D) cases the vacuum current in continuum states was suppressed after integrating over wave vectors transverse to the current through the junction. However, in the 1D case transverse degrees of freedom are absent, and the contribution of continuum states to the vacuum current does not vanish, but it was crudely estimated as insignificant in the limit \(L\rightarrow \infty \). In the aftermath of the discussion with Thuneberg this estimation for the 1D case was re-accessed. It was revealed that the estimation missed an important term of the same order \(\propto 1/L\) as the current in bound states. A more careful calculation of the vacuum current in continuum states is presented in this paper. Thus, Thuneberg [14] was vindicated in the 1D case. But the respective roles of bound and continuum states are different in the 1D and the multidimensional cases [15].

Discussing the controversy about respective contributions of bound and continuum states into the current, we have in mind only the vacuum current. As for the condensate current, it is clear that contributions of bound and continuum states into the current are proportional to their contributions to the density. The contribution of bound states to the density is less than the contribution of continuum states by the small factor \(\Delta _0/\varepsilon _{\rm f}\).

The re-evaluation of the contribution of continuum states to the vacuum current refuted the prediction [15] that in the 1D case the ballistic long SNS junction becomes a \(\varphi _0\) junction at high temperatures. The \(\varphi _0\) junction is an anomalous Josephson junction, in which the ground state is not at zero phase.Footnote 3 The prediction of a \(\varphi _0\) junction was based on the existence of the large \(\propto 1/L\) temperature-independent term in the excitation current with the sign opposite to the sign of the phase, which was not compensated by the vacuum current in bound states. However, according to the present analysis, the large negative excitation current is fully compensated by the positive continuum vacuum current, which was not taken into account in Ref. [15].

In Ref. [15] the effect of incommensurability of the gap magnitude in the superconducting layers with respect to the Andreev level energy spacing was investigated in the 1D case. With tuning of the incommensurability parameter, the number of bound Andreev states varies being odd or even for every spin (the parity effect). This produces jumps on the current-phase relation. However, the present analysis reveals that the parity effect exists also in the continuum states, which were ignored in Ref. [15]. Although there is no discrete states at energies exceeding the gap, there are peaks of the transmission probability for electrons crossing the normal layer (transmission resonances). The energy spacing between peaks is the same as the energy spacing between Andreev levels. While tuning phase, a new Andreev level appears (or an old one disappears) inside the gap, correspondingly some peak disappears (or a new one appears) in the continuum. As a result, the two parity effects compensate each other, and the total effect vanishes. Transmission peaks were known in the past [12, 21, 22]. Although the parity effect is canceled in the total vacuum current, the effect yields important contributions \(\propto 1/L\) to the currents in the bound and continuum states calculated separately.

The analysis in the paper is focused on the 1D case, where the only motion is along the axis x normal to layers. For the extension of the calculation on multidimensional systems currents must be integrated over transverse components of wave vectors.

2 The Bogolyubov–de Gennes theory

In the self-consistent field method [13] the second-quantized effective Hamiltonian density quadratic in the wave function is

$$\begin{aligned} \mathcal{H}_{\rm eff}= & {} {\hbar ^2 \over 2m} [\nabla \hat{\psi }^\dagger _\gamma (x) \nabla \hat{\psi }_\gamma (x)- k_{\rm f}^2 \hat{\psi }^\dagger _\gamma (x) \hat{\psi }_\gamma (x)] \nonumber \\{} & {} +\Delta \hat\psi ^\dagger _\uparrow (x) \hat\psi ^\dagger _\downarrow (x)+\Delta ^* \hat\psi _\downarrow (x) \hat\psi _\uparrow (x), \end{aligned}$$
(2)

where \(\hat{\psi }_\gamma ^\dagger (x)\) and \(\hat{\psi }_\gamma (x)\) are operators of creation and annihilation of an electron, and the subscript \(\gamma \) has two values corresponding to the spin up (\(\uparrow \)) and down (\(\downarrow \)). We address a 1D problem with the Fermi wave number \(k_{\rm f}\), assuming that our system is uniform in the plane normal to the axis x. In multidimensional systems with the Fermi wave number \(k_F\) \(k_{\rm f} =\sqrt{k_F^2 -k_\perp ^2}\), where \(k_\perp \) is the transverse component of the multidimensional wave vector \(\varvec{k}\).

The effective Hamiltonian can be diagonalized by the Bogolyubov–Valatin transformation from the free electron operators \(\hat{\psi }_\gamma ^\dagger (x)\) and \(\hat{\psi }_\gamma (x)\) to the quasiparticle operators \({\hat{a}}_{i\gamma }^\dagger \) and \({\hat{a}}_{i\gamma }\):

$$\begin{aligned} \hat{\psi }_\uparrow (x)= & {} \sum _{i} \left[ u_i(x) {\hat{a}}_{i\uparrow } -v^*_i(x) {\hat{a}}^\dagger _{i\downarrow } \right] , \nonumber \\ \hat{\psi }_\downarrow (x)= & {} \sum _{i} \left[ u_i(x) {\hat{a}}_{i\downarrow }+v^*_i(x) {\hat{a}}^\dagger _{i\uparrow } \right] . \end{aligned}$$
(3)

The summation over the subscript i means the summation over all bound and continuum states. The functions u(xt) and v(xt) are two components of a spinor wave function,

$$\begin{aligned} \psi (x,t) = \left[ \begin{array}{c} u(x,t)\\ v(x,t) \end{array} \right] , \end{aligned}$$
(4)

describing a state of a quasiparticle, which is a superposition of a state with one particle (upper component u) and a state with one antiparticle, or hole (lower component v). They are stationary solutions of the Bogolyubov–de Gennes equations:

$$\begin{aligned} i\hbar {\partial u\over \partial t} ={\delta \mathcal{H}_{BG}\over \delta u^*}= & {} -{\hbar ^2 \over 2m} \left( \nabla ^2 + k_{\rm f}^2\right) u + \Delta v, \nonumber \\ i\hbar {\partial v\over \partial t} ={\delta \mathcal{H}_{BG}\over \delta v^*}= & {} {\hbar ^2 \over 2m} \left( \nabla ^2 + k_{\rm f}^2\right) v + \Delta ^* u. \end{aligned}$$
(5)

The Bogolyubov–de Gennes equations are the Hamilton equations with the Hamiltonian (per unit volume)

$$\begin{aligned} \mathcal{H}_{BG}={\hbar ^2 \over 2m} (|\nabla u|^2 - k_{\rm f}^2 |u|^2)-{\hbar ^2 \over 2m} ( |\nabla v|^2 - k_{\rm f}^2 |v|^2) +\Delta u^* v+\Delta ^*v^* u. \end{aligned}$$
(6)

The number of particles (charge) is not a quantum number of the state. The average density \(n_i\) and current \(j_i\) in the ith state are

$$\begin{aligned} n_i= |u_i|^2-|v_i|^2, \end{aligned}$$
(7)

and

$$\begin{aligned} j_i= -{ie\hbar \over 2m} (u_i^*\nabla u_i-u_i\nabla u_i^*) -{ie\hbar \over 2m} (v_i^*\nabla v_i-v_i\nabla v_i^*). \end{aligned}$$
(8)

After the diagonalization the effective Hamiltonian becomes

$$\begin{aligned} \mathcal{H}_{\rm eff}=\sum _i\varepsilon _i(\hat a^\dagger _{i\uparrow } \hat a_{i\uparrow }+\hat a^\dagger _{i\downarrow } \hat a_{i\downarrow }-2|v|^2), \end{aligned}$$
(9)

where \(\varepsilon _i\) is the energy of the ith quasiparticle state.

The total density n and the total charge current J are expectation values for the operators

$$\begin{aligned} {\hat{n}}(x)= & {} \hat{\psi }^\dagger _\uparrow (x)\hat{\psi }_\uparrow (x)+\hat{\psi }^\dagger _\downarrow (x)\hat{\psi }_\downarrow (x) \nonumber \\= & {} \sum _{i}\left[ |u_i(x)|^2 ({\hat{a}}^\dagger _{i\uparrow } {\hat{a}}_{i\uparrow }+ {\hat{a}}^\dagger _{i\downarrow } {\hat{a}} _{i\downarrow })+|v_i(x)|^2({\hat{a}}_{i\uparrow } {\hat{a}}^\dagger _{i\uparrow }+ {\hat{a}}_{i\downarrow } {\hat{a}}^\dagger _{i\downarrow } )\right] \nonumber \\= & {} \sum _{i}\left\{ [|u_i(x)|^2 -|v_i(x)|^2 ]({\hat{a}}^\dagger _{i\uparrow } {\hat{a}}_{i\uparrow }+{\hat{a}}^\dagger _{i\downarrow } {\hat{a}}_{i\downarrow }) +2 |v_i(x)|^2\right\} , \end{aligned}$$
(10)
$$\begin{aligned} {\hat{J}}= & {} -{ie\hbar \over 2m}\sum _{i} \left[ (u_i^*\nabla u_i-u_i\nabla u_i^*+v_i^*\nabla v_i-v_i\nabla v_i^*)({\hat{a}}^\dagger _{i\uparrow } {\hat{a}}_{i\uparrow } + {\hat{a}}^\dagger _{i\downarrow } {\hat{a}}_{i\downarrow }) \right. \nonumber \\{} & {} \left. -2 (v_i^*\nabla v_i-v_i\nabla v_i^*)\right] . \end{aligned}$$
(11)

There are two contributions to the energy, the density, and the current [Eqs. (9)–(11)]. One is connected with the quasiparticle vacuum, in which all energy levels are not occupied (last terms in equations without operators). This contribution is responsible for the condensate and the vacuum current. The other terms in the equations are connected with quasiparticles occupying energy levels. They are responsible for the excitation current.

In a uniform superconductor at rest, the constant \(\Delta _0\) solutions of the Bogolyubov–de Gennes equations are plane waves

$$\begin{aligned} \left( \begin{array}{c} u_0 \\ v_0 \end{array} \right) \text{e}^{i k \cdot x-i\varepsilon _0 t/\hbar }, \end{aligned}$$
(12)

where

$$\begin{aligned} u_0=\sqrt{{1\over 2} \left( 1+ {\xi \over \varepsilon _0 }\right) },~~v_0= \sqrt{{1\over 2} \left( 1- {\xi \over \varepsilon _0 }\right) }. \end{aligned}$$
(13)

The quasiparticle energy is given by the well-known BCS expression:

$$\begin{aligned} \varepsilon _0 = \sqrt{\xi ^2 + \Delta _0^2}. \end{aligned}$$
(14)

Here \(\xi = ({\hbar ^2 / 2m})(k^2 - k_{\rm f}^2)\approx \hbar v_{\rm f} (k-k_{\rm f})\) is the quasiparticle energy in the normal Fermi liquid, and \(v_{\rm f}=\hbar k_{\rm f}/m\) is the Fermi velocity. The states with positive and the negative signs of \(\xi \) correspond to particle-like and the hole-like branches of the spectrum, respectively.

The Bogolyubov–de Gennes equations have also solutions with negative energies \(\varepsilon _0= - \sqrt{\xi ^2 + \Delta _0^2}\). In a stable state, energies of all excitations must be positive, and solutions with negative energies should not be considered [23].

3 Ab initio expressions for currents

3.1 Galilean invariance and condensate current

An important assumption in the present analysis (as well as in the previous investigations) was that only the Andreev reflection is possible on interfaces between superconducting and normal layers. The assumption is valid in the limit of large Fermi wave numbers \(k_{\rm f} \gg \Delta _0 /\hbar v_{\rm f}\). As mentioned in Introduction, this means that there is no significant change of the quasiparticle momentum after reflection, and wave functions \(\left( \begin{array}{c} u \\ v \end{array} \right) \) are superpositions of plane waves with wave numbers only close to either \(+ k_{\rm f}\), or \(- k_{\rm f}\). These plane waves describe quasiparticles, which will be called rightmovers (+) and leftmovers (−). After transformation of the wave function,

$$\begin{aligned} \left( \begin{array}{c} u \\ v \end{array} \right) =\left( \begin{array}{c} {\tilde{u}} \\ \tilde{v} \end{array} \right) \text{e}^{\pm ik_{\rm f} x}, \end{aligned}$$
(15)

the second order terms in gradients, \(\nabla ^2 \tilde{u}\) and \(\nabla ^2 \tilde{v}\), can be neglected for small \(\Delta _0/\varepsilon _{\rm f}\), and the Bogolyubov–de Gennes equations are reduced to the equations of the first order in gradients:

$$\begin{aligned} \varepsilon {\tilde{u}}= & {} {\mp } i\hbar v_{\rm f} \nabla \tilde{u} + \Delta \tilde{v}, \nonumber \\ \varepsilon {\tilde{v}}= & {} \pm i\hbar v_{\rm f} \nabla {\tilde{v}} + \Delta ^*\tilde{u}. \end{aligned}$$
(16)

The boundary conditions on the interfaces between layers require the continuity of the wave function components, but not their gradients.

Let us demonstrate Galilean invariance of the Bogolyubov–de Gennes equations when the wave functions are superpositions of only rightmovers, or only of leftmovers. Suppose that we found the Bogolyubov–de Gennes function \(\left( \begin{array}{c} {\tilde{u}}_0 \\ \tilde{v}_0 \end{array} \right) \) with the energy \(\varepsilon _0\) for an arbitrary profile of the superconducting gap \(\Delta (x)\). Now we check what is the solution of the Bogolyubov–de Gennes equations for the superconducting gap \(\Delta (x)\text{e}^{i\nabla \varphi x}\), where \(\nabla \varphi \) is a constant phase gradient. The wave function

$$\begin{aligned} \left( \begin{array}{c} {\tilde{u}} \\ \tilde{v} \end{array} \right) =\left( \begin{array}{c} {\tilde{u}}_0 \text{e}^{i\nabla \varphi x/2} \\ \tilde{v}_0 \text{e}^{-i\nabla \varphi x/2} \end{array} \right) \end{aligned}$$
(17)

satisfies Eq. (16) where the gap \(\Delta (x)\) is replaced by \(\Delta (x)\text{e}^{i\nabla \varphi x}\) and the energy is

$$\begin{aligned} \varepsilon =\varepsilon _0 \pm {\hbar v_{\rm f}\over 2}\nabla \varphi =\varepsilon _0 \pm {\hbar v_{\rm f}\over 2L}\theta _s=\varepsilon _0 \pm v_s \hbar k_{\rm f}. \end{aligned}$$
(18)

Thus, the Galilean transformation produces the same Doppler shift in the energy as in a uniform superconductor. According to Eqs. (7) and (8) for the density \(n_i\) and the current \(j_i\) in the ith Bogolyubov–de Gennes state, the Galilean transformation transforms the current \(j_i\) to the current \(j_i+en_i v_s\). Summation over all bound and continuum states yields that the Galilean transformation added the condensate current \(J_s=\text{env}_s\) in the whole space. The difference between the total charge densities n in the normal and the superconducting layers vanishes in the limit \(L\rightarrow \infty \) [15]. Thus, the condensate current is the same in all layers and does not violate the charge conservation law.

Our derivation does not depend on the profile of the gap in the space, as far as the gap is small compared to the Fermi energy and there is no normal scattering transforming rightmovers into leftmovers and vice versa. The Doppler shift of the energy is of opposite sign for rightmovers and leftmovers, and after the Galilean transformation of a superposition of rightmovers and leftmovers the state is not an eigenstate of the energy. The derivation remains valid if \(\Delta \) vanishes in some part of the space. Independence of the condensate current on the gap profile is confirmed by numerical solution of the Bogolyubov–de Gennes equations together with the integral self-consistency equation for the gap by Riedel et al. [16], as already mentioned in Sect. 1. They obtained that although the absolute value of the gap smoothly varies between the normal layer and the superconducting leads, the phase gradient is constant in all layers as in Fig. 1a. Summarizing, the value of the condensate current directly follows from the Galilean invariance and does not need sophisticated calculations.

3.2 Vacuum current in bound states

The spectrum and the wave functions for the present model of the SNS junction are well-known from previous works, and it is sufficient here to present the resume of these investigations. Solving the Bogolyubov–de Gennes equations with the gap profile given by Eq. (1) for zero gradient \(\nabla \varphi \) (Cooper-pair condensate at rest) and with the boundary conditions formulated above one finds the equation for energies \(\varepsilon _{0\pm } (s)\) of bound Andreev states:

$$\begin{aligned} \varepsilon _{0\pm } (s)={\hbar v_{\rm f}\over 2L}\left[ 2\pi s+2\arcsin {\sqrt{\Delta _0^2-\varepsilon _{0\pm } (s)^2}\over \Delta _0} \pm \theta _0\right] . \end{aligned}$$
(19)

Here s is an integer. The upper and the lower signs correspond to rightmovers (\(+\)) and leftmovers (−), respectively. If the condensate moves (\(\nabla \varphi \ne 0\)) the energy \(\varepsilon _\pm (s)\) of the state is given by Eq. (18):

$$\begin{aligned} \varepsilon _\pm (s)={\hbar v_{\rm f}\over 2L}\left[ 2\pi s+2\arcsin {\sqrt{\Delta _0^2-\varepsilon _{0\pm } (s)^2}\over \Delta _0} \pm \theta \right] . \end{aligned}$$
(20)

The phase in the equation for \(\varepsilon _{0\pm } (s)\) is \(\theta _0\); while, the energy \(\varepsilon _\pm (s)\) depends on the total Josephson phase \(\theta =\theta _0 +\nabla \varphi L=\theta _0 +\theta _s\).

At small energy \(\varepsilon _{0\pm } (s) \ll \Delta _0\) (small s)

$$\begin{aligned} \varepsilon _{0\pm } (s)={\hbar v_{\rm f}\over 2L}\left[ 2\pi \left( s+{1\over 2}\right) \pm \theta _0\right] . \end{aligned}$$
(21)

For Andreev levels close to the gap one can expand the arcsin function in Eq. (19) transforming it to

$$\begin{aligned} \Delta _0- \varepsilon _{0\pm } -{\zeta _0\over L} \sqrt{2\Delta _0(\Delta _0- \varepsilon _{0\pm } )}=\Delta _0-\pi s{\zeta _0 \over L}\Delta _0=\pi ( t+\alpha ){\zeta _0 \over L}\Delta _0. \end{aligned}$$
(22)

Here \(\alpha \) (\(0<\alpha <1 \)) is the parameter of incommensurability, which is the fractional part of the ratio of the gap \(\Delta _0\) to the Andreev level energy spacing,

$$\begin{aligned} {\Delta _0 L\over \pi \hbar v_{\rm f}}={L\over \pi \zeta _0}=s_m +\alpha , \end{aligned}$$
(23)

\(s_m\) is the maximal integer less than the ratio, \(t=s_m-s\) is another integer, and

$$\begin{aligned} \zeta _0={\hbar v_{\rm f}\over \Delta _0} \end{aligned}$$
(24)

is the coherence length. Solution of Eq. (22) yields

$$\begin{aligned} \varepsilon _{0\pm }= & {} \Delta _0-{\pi \zeta _0\over L}\Delta _0\left[ \sqrt{t +\alpha {\mp } {\theta _0\over 2\pi }+{\zeta _0\over 2\pi L }}-\sqrt{{\zeta _0\over 2\pi L}}\right] ^2, \nonumber \\ \sqrt{\Delta _0^2- \varepsilon _{0\pm } ^2}= & {} \Delta _0\sqrt{2\pi \zeta _0 \over L}\left[ \sqrt{t +\alpha {\mp } {\theta _0\over 2\pi }+{\zeta _0\over 2\pi L }} -\sqrt{\zeta _0\over 2\pi L}\right] . \end{aligned}$$
(25)

There is an essential difference between effects of phases \(\theta _0\) and \(\theta _s\) on the Andreev spectrum [15]. Variation of \(\theta _0\) makes the Andreev levels to move with respect to the gap. As a result, some new levels can emerge and some old ones can disappear. In contrast, variation of \(\theta _s\) leads to the shift of the spectrum as a whole without changing positions of Andreev levels with respect to the gap. The principle of the BCS theory that only solutions with positive energies should be taking into account refers to the energy \(\varepsilon _0\); while, the Doppler-shifted energy \(\varepsilon \) can be both positive or negative. If \(\varepsilon \) is negative the level is occupied at zero temperature.

The current in the Andreev state is determined by the canonical relation connecting it with the derivative of the energy with respect to the phase:

$$\begin{aligned} j_\pm (s)={2e\over \hbar }{\partial \varepsilon _{0\pm } (s)\over \partial \theta _0}=\pm {e\over \pi \hbar }{\partial \varepsilon _{0\pm } (s)\over \partial s}=\pm {{ev}_{\rm f}\over L+\zeta } =\pm {{ev}_{\rm f}\over L}\frac{\sqrt{1- {\varepsilon _{0\pm } (s)^2\over \Delta _0^2}}}{\sqrt{1- {\varepsilon _{0\pm } (s)^2\over \Delta _0^2}}+{\zeta _0\over L}}. \end{aligned}$$
(26)

Here

$$\begin{aligned} \zeta = \zeta _0{\Delta _0\over \sqrt{\Delta _0^2-\varepsilon _0^2}} \end{aligned}$$
(27)

is the depth of penetration of the bound states into the superconducting layers, which diverges when \(\varepsilon _0\) approaches to the gap \(\Delta _0\). The factor 2 takes into account that \(\theta _0\) is the phase of a Cooper pair but not of a single electron.

The current \(j_\pm (s)\) is a current produced by a quasiparticle created at the sth state. However, we look for the vacuum current when there is no quasiparticles. In Andreev states \(\vert u|^2=\vert v|^2={1\over 2}\), and according to Eq. (11) the vacuum current in any state is two times less, and it has a sign opposite to the sign of the current \(j_\pm (s)\). Taking this into account and including two spin states, the ab initio expression for the vacuum current in bound states is

$$\begin{aligned} J_{vA}= & {} -\sum _s \{j _+(s)\text{ H }[\varepsilon _{0+} (s)] \text{ H }[\Delta _0 -\varepsilon _{0+} (s)] +j_-(s)\text{ H }[\varepsilon _{0-} (s)] \text{ H }[\Delta _0 -\varepsilon _{0-} (s)]\} \nonumber \\= & {} -{{ev}_{\rm f}\over L}\sum _s \left\{ \frac{ \sqrt{1- {\varepsilon _{0+} (s)^2\over \Delta _0^2}} }{\sqrt{1- {\varepsilon _{0+} (s)^2\over \Delta _0^2}} +{\zeta _0\over L}}\text{ H }[\varepsilon _{0+} (s)] \text{ H }[\Delta _0 -\varepsilon _{0+} (s)] \right. \nonumber \\{} & {} \left. - \frac{ \sqrt{1- {\varepsilon _{0-} (s)^2\over \Delta _0^2}} }{\sqrt{1- {\varepsilon _{0-} (s)^2\over \Delta _0^2}} +{\zeta _0\over L}}\text{ H }[\varepsilon _{0-} (s)] \text{ H }[\Delta _0 -\varepsilon _{0-}(s)]\right\} .~~~ \end{aligned}$$
(28)

Here \(\text{ H }(q)\) is the Heaviside step function, which ensures that summation over s extends only on states with energies \(0<\varepsilon _{0\pm } <\Delta _0\) inside the gap.

3.3 Continuum vacuum current

According to Refs. [12, 15, 24], for a rightmover quasiparticle (\(\xi >0\)) incident from left the transmission and the reflection probabilities are

$$\begin{aligned} \mathcal{T}(\theta _0)= \frac{2(\varepsilon _0 ^2-\Delta _0^2)}{2\varepsilon _0^2 -\Delta _0^2-\Delta _0^2\cos \left( {2\varepsilon _0 m L\over \hbar ^2 k_{\rm f}}-\theta _0\right) },~~R(\theta _0)=1-\mathcal{T}(\theta _0). \end{aligned}$$
(29)

These expressions are valid also for a quasihole (\(\xi <0\)) incident from right. For a quasiparticle incident from right and a hole incident from left the transmission and the reflection probabilities are \(\mathcal{T}(-\theta _0)\) and \(R(-\theta _0)\).

Equation (29) was obtained in the coordinate frame moving with the condensate. Transformation to the laboratory frame leads to replacing of the argument \({2\varepsilon _0 m L\over \hbar ^2 k_{\rm f}}-\theta _0\) of the cosine function by \({2\varepsilon m L\over \hbar ^2 k_{\rm f}}-\theta \). According to Eq. (18) they are equal. Thus, the Galilean transformation discussed in Sect. 3.1 does not change the scattering parameters.

One can transform expressions for \(\mathcal{T}\) and R revealing their dependence on the incommensurability parameter \(\alpha \) introduced in Eq. (23):

$$\begin{aligned} \mathcal{T}(\theta _0)= \frac{2(\varepsilon _0 ^2-\Delta _0^2)}{2\varepsilon _0 ^2 -\Delta _0^2-\Delta _0^2\cos \left[ {2(\varepsilon _0 -\Delta _0)m L\over \hbar ^2 k_{\rm f}}+2\pi \alpha -\theta _0\right] }. \end{aligned}$$
(30)

The reflection probability can be transformed similarly. The both probabilities rapidly oscillate as functions of the energy.

Collecting together all contributions from rightmovers and leftmovers, quasiparticles and quasiholes, the ab initio expression for the continuum vacuum current is [15]

$$\begin{aligned} J_{vC} ={e\over \pi \hbar }\int _{\Delta _0}^\infty [\mathcal{T}(- \theta _0)-\mathcal{T}( \theta _0) ] d\xi . \end{aligned}$$
(31)

3.4 Excitation current

As well as in previous literature, the present analysis addresses the case when temperatures are much lower than critical (\(T \ll \Delta _0\)). Then one can ignore excitations in continuum states and replace sums for a large but finite number of Andreev states by infinite sums. The ab initio expression for the excitation current assumes the Fermi distribution in Andreev levels:

$$\begin{aligned} J_q= \sum _{s=0}^\infty \frac{2j_+(s)}{\text{e}^{\varepsilon _+(s)/T}+1}+\sum _{s=0}^\infty \frac{2j_-(s)}{\text{e}^{\varepsilon _-(s)/T}+1}. \end{aligned}$$
(32)

The currents \(j_\pm (s)\) in the sth state are given by Eq. (26) derived for the condensate at rest despite this expression is for the case of a moving condensate. This is because in Andreev states \(|u |^2=|v |^2\), and according to Eq. (7) quasiparticle creation in an Andreev state does not change the electron density. Thus, the Galilean transformation does not change the electron current of the quasiparticle. At \(T \ll \Delta _0\) the expression Eq. (21) for the small energy \(\varepsilon _{0\pm }\) can be used, and taking into account the relation Eq. (18) between \(\varepsilon _\pm (s)\) and \(\varepsilon _{0\pm }(s)\), the excitation current is

$$\begin{aligned} J_q={2ev_{\rm f}\over L} \sum \limits _0^\infty \left[ \frac{1}{\text{e}^{\beta \left( s+{\pi +\theta \over 2\pi }\right) }+1}-\frac{1}{\text{e}^{\beta \left( s+{\pi -\theta \over 2\pi }\right) }+1}\right] , \end{aligned}$$
(33)

where

$$\begin{aligned} \beta ={\pi \hbar v_{\rm f}\over LT}. \end{aligned}$$
(34)

While the vacuum current depends from the vacuum phase \(\theta _0\), the excitation current depends on the total Josephson phase \(\theta =\theta _0+\theta _s\).

4 Calculation of vacuum and excitation currents

Through the whole paper we assume in calculations that \(0<\alpha <1/2\) and \(\theta _0<\pi \). If \(1/2<\alpha <1\) currents of rightmovers and leftmovers will be different, but their sum will be the same as for \(0<1-\alpha <1/2\). As for the dependence on \(\theta _0\), its extension on the infinite interval of \(\theta _0\) is straightforward bearing in mind that the current is an odd periodic function of \(\theta _0\).

4.1 Vacuum current in bound Andreev states

Calculating the vacuum current in bound Andreev states one can expand the current in 1/L. In Ref. [15] the first terms \(J_1\propto 1/ L\) and \(J_{3/2}\propto 1/ L^{3/2}\) were calculated:

$$\begin{aligned} J_{vA}= J_1+J_{3/2}. \end{aligned}$$
(35)

where

$$\begin{aligned} J_1 ={{ev}_{\rm f}\over L}\text{ H }(- \gamma _+ ), \end{aligned}$$
(36)

and

$$\begin{aligned} J_{3/2}= & {} {e\Delta _0\zeta _0^{3/2}\over \sqrt{2\pi } \hbar L^{3/2}}\left[ \sum _{t=0}^{\infty } \left( \frac{1}{\sqrt{t+{\gamma _+\over 2\pi } } } - \frac{1}{\sqrt{t+{\gamma _-\over 2\pi } } }\right) -\sqrt{2\pi \over \gamma _+ } \text{ H }\left( -\gamma _+\right) \right] \nonumber \\= & {} {e\Delta _0\zeta _0^{3/2}\over \sqrt{2\pi } \hbar L^{3/2}}\left[ \zeta \left( {1\over 2},{\gamma _+\over 2\pi }\right) - \zeta \left( {1\over 2},{\gamma _-\over 2\pi }\right) -\sqrt{2\pi \over \gamma _+ }\text{ H }\left( -\gamma _+\right) \right] . \end{aligned}$$
(37)

Here

$$\begin{aligned} \gamma _\pm = 2\pi \alpha {\mp } \theta _0, \end{aligned}$$
(38)

and

$$\begin{aligned} \zeta \left( z,q\right) =\sum _{t=0} ^\infty {1\over (q+t)^z} \end{aligned}$$
(39)

is Riemann’s zeta function [25]. The series for Riemann’s zeta function at \(z=1/2\) diverges, but the series for a difference of zeta functions with different arguments q converges at large t. It was taken into account that the main contribution to the sum in Eq. (37) is given by Andreev levels close the gap, where one can use the expression Eq. (25) for \(\varepsilon _{0\pm } (s)\).

At small positive \(\gamma _+ =2\pi \alpha -\theta _0 \ll 1\) (but still \(\gamma _+ \gg \zeta _0/L\)) the current \(J_{3/2}\) is determined only by the term \(t=0\) divergent in the limit \(\gamma _+ \rightarrow 0\):

$$\begin{aligned} J_{3/2}={e\Delta _0\zeta _0^{3/2}\over \hbar L^{3/2}\sqrt{\gamma _+}}. \end{aligned}$$
(40)

Later we shall see that the current \(J_{3/2}\) in the bound states is compensated by the \(\propto 1/L^{3/2} \) current in continuum states.

4.2 Continuum vacuum current

The continuum vacuum current is a difference of contributions from right- and leftmovers:

$$\begin{aligned} J_{vC} =J_+-J_-,~~ J_\pm = - {e\over \pi \hbar }\int _{\Delta _0}^\infty \mathcal{T}(\pm \theta _0) \text{d}\xi . \end{aligned}$$
(41)

Calculating \( J_\pm \) we introduce a new variable \(z=(\varepsilon _0-\Delta _0)/\Delta _0\):

$$\begin{aligned} J_\pm = -{e\Delta _0\over \pi \hbar }\int _0^{x_m}\frac{2\sqrt{2z+z^2}(1+z)\,\text {d}z}{4z+2z^2+1-\cos (2Lz/\zeta _0+ \gamma _\pm )}. \end{aligned}$$
(42)

The integrals for \(J_\pm \) diverge, but their difference does not. So, we introduced a large \(x_m\) as an upper limit of integrals assuming that in the end \(x_m\rightarrow \infty \).

Fig. 3
figure 3

Analytical continuation in the complex plane \(z=x+iy\) of the path for the integration in Eq. (42). Black circles on the dashed line are poles

For calculation of the integrals we perform an analytical continuation from the real axis (contour D in Fig. 3) to the complex plane \(z=x+iy\) (contour \({\bar{D}}\) in Fig. 3). Calculating contributions of various segments of the contour we need to take into account only their real parts. The final integral Eq. (42) is real, and the total sum of imaginary parts must vanish.

At the continuation the contour crosses poles in points \(z_{p\pm }=x_{p\pm }+iy_{p\pm }\). The values of \(z_{p\pm }\) are roots of the equation

$$\begin{aligned} 1+4z_{p\pm }+2z_{p\pm }^2-\cos \left( 2Lz_{p\pm }/\zeta _0+\gamma _\pm \right) =0, \end{aligned}$$
(43)

where p is an integer number of a pole. At \(L\rightarrow \infty \) the coordinates of poles are

$$\begin{aligned} x_{p\pm } ={\zeta _0\over 2L}(2\pi p -\gamma _\pm ),~~y_{p\pm }={\zeta _0\over L}\ln \left( \sqrt{2x_{p\pm }+x_{p\pm }^2}+1+x _{p\pm } \right) . \end{aligned}$$
(44)

Residues of poles are

$$\begin{aligned} \mathcal{R}_{p\pm }= & {} -{e\Delta _0\over \pi \hbar }\frac{2 \sqrt{z_{p\pm }(2+z_{p\pm })}(1+z_{p\pm })}{4+4z_{p\pm }+{2L\over \zeta _0}\sin \left( 2Lz_{p\pm }/\zeta _0+\gamma _\pm \right) } \nonumber \\= & {} -{e\Delta _0\over \pi \hbar }\frac{2 \sqrt{z_{p\pm }(2+z_{p\pm })}(1+z_{p\pm })}{4+4z_{p\pm }+{2iL\over \zeta _0}\sqrt{(1+4z_{p\pm }+2z_{p\pm }^2)^2-1}} \nonumber \\= & {} -{e\Delta _0\over 2\pi \hbar }\frac{\zeta _0\sqrt{z_{p\pm }(2+z_{p\pm })}}{iL\sqrt{z_{p\pm }(2+z_{p\pm })}+\zeta _0}\approx {i{ev}_{\rm f}\over 2\pi L}. \end{aligned}$$
(45)

The contribution of poles to the current,

$$\begin{aligned} J_{R\pm }=-2\pi \text{ Im }\sum _p\mathcal{R}_{p\pm }=-{{ev}_{\rm f}\over L}p_\pm , \end{aligned}$$
(46)

is determined by the numbers \(p_\pm \) of poles for rightmovers and leftmovers. Corrections to the total current \(J_{R+}-J_{R-}\) given by this expression are not more than of the order of \(\propto 1/L^3\). This is shown in Appendix A.

All poles must have \(x_{p\pm }\) coordinates satisfying inequalities \(0<x_{p\pm }<x_m\). This imposes the condition on pole numbers p:

$$\begin{aligned} {\gamma _\pm \over 2\pi }<p< {L\over \pi \zeta _0}\left( x_m+{\zeta _0\gamma _\pm \over 2 L}\right) . \end{aligned}$$
(47)

One can divide the right-hand side of this inequality onto an integer and a fractional part:

$$\begin{aligned} {L\over \pi \zeta _0}\left( x_m+{\zeta _0\gamma _\pm \over 2L}\right) =p_{m\pm }+\alpha _{m\pm }, \end{aligned}$$
(48)

where the integer \(p_{m\pm }\) is chosen so that \(0< \alpha _{m\pm }<1\). If both \(\gamma _\pm =2\pi \alpha {\mp } \theta _0 \) are positive the numbers of poles are \(p_\pm =p_{m\pm }\). But when \(\gamma _+\) becomes negative, an additional pole with \(p=0\) appears for rightmovers, and \(p_+=p_{m+}+1\).

The contribution of the contour segment on the imaginary axis is

$$\begin{aligned} J_{i\pm }= & {} - {e\Delta _0\over \pi \hbar }\text{ Re }\int _0^{y_m} \frac{2\sqrt{2iy-y^2}(1+iy) i\text {d}y}{4iy-2y^2+1-\cos (2iLy/\zeta _0+ \gamma _\pm )} \nonumber \\\approx & {} -{e\Delta _0\zeta _0^{3/2}\over \pi \hbar L^{3/2}} \text{ Re }\int _0^\infty \frac{\sqrt{iy'}}{1-\cosh y'\cos \gamma _\pm +i\sin y'\sin \gamma _\pm } i\text {d}y' \nonumber \\= & {} - {e\Delta _0\zeta _0^{3/2}\over \sqrt{2}\pi \hbar L^{3/2}} \int _0^\infty \frac{\sinh y'\sin \gamma _\pm -1+\cosh y'\cos \gamma _\pm }{(\cosh y'-\cos \gamma _\pm )^2} \sqrt{y'}\text {d}y'. \end{aligned}$$
(49)

Here a new integration variable \(y'= 2L y/\zeta _0\) was introduced, and the limits \(y_m\rightarrow \infty \) and \(L \rightarrow \infty \) were considered. Corrections to this value of \(J_{i\pm }\) are on the order of \(1/L^{5/2}\).

The current \(J_{i+}\) diverges in the limit \(\gamma _+\rightarrow 0\). In this limit

$$\begin{aligned} J_{i+}\approx - {\sqrt{2}e\Delta _0\zeta _0^{3/2}\over \pi \hbar L^{3/2}} \int _0^\infty \frac{y'^2-\gamma _+^2+2\gamma _+y'}{(y'^2+\gamma _+^2)^2} \sqrt{y'}\text {d}y' =- {e\Delta _0\zeta _0^{3/2}\over \hbar L^{3/2}\sqrt{\gamma _+}}\text{ H }(\gamma _+). \end{aligned}$$
(50)

There is also a contribution from the contour segment along the vertical path parallel to the imaginary axis with \(x=x_m\):

$$\begin{aligned} J_{m\pm }= & {} -{e\Delta _0\over \pi \hbar }\text{ Re }\int _0^{y_m} \frac{4x_m^2\,i\text {d}y}{4x_m^2-\text{e}^{2Ly/\zeta _0-i(2Lx_m/\zeta _0 +\gamma _\pm )} } \nonumber \\= & {} -{e\Delta _0\over \pi \hbar }\text{ Re }\int _0^{y_m} \frac{4x_m^2\,i\text {d}y}{4x_m^2-\text{e}^{2Ly/\zeta _0-2\pi i\alpha _{m\pm }} }. \end{aligned}$$
(51)

The maximum of the integrand is at the crossing point of the contour path and the curve, on which poles lie (dashed line in Fig. 3). Its coordinates are

$$\begin{aligned} x_0=x_m,~~y_0\approx {\zeta _0\over L}\ln (2x_m). \end{aligned}$$
(52)

After introducing the new integration variables \(y'=y-y_0\), the integral becomes

$$\begin{aligned} J_{m\pm }= & {} {e\Delta _0\over \pi \hbar }\text{ Re }\int _{-y_0}^{y_m-y_0} \frac{i\text {d}y'}{1-\text{e}^{{2Ly'\over \zeta _0}-2\pi i\alpha _{m\pm }} } \nonumber \\\approx & {} {e\Delta _0\over \pi \hbar }\text{ Re }\int _{-\infty }^\infty \frac{i\text {d}y'}{1-\text{e}^{{2Ly'\over \zeta _0}-2\pi i\alpha _{m\pm }} } \nonumber \\= & {} -{{ev}_{\rm f}\over 2\pi L} \arctan \frac{\sin (2\pi \alpha _{m\pm })}{\text{e}^{2Ly'\over \zeta _0}-\cos (2\pi \alpha _{m\pm })}\Bigg |_{y'=-\infty }^{{\tilde{y}}} \nonumber \\{} & {} -{{ev}_{\rm f}\over 2\pi L} \arctan \frac{\sin (2\pi \alpha _{m\pm })}{\text{e}^{2Ly'\over \zeta _0}-\cos (2\pi \alpha _{m\pm })}\Bigg |_{y'={\tilde{y}}}^\infty =-{{ev}_{\rm f}\over L}\left( \alpha _{m\pm }-{1\over 2}\right) , \end{aligned}$$
(53)

where \({\tilde{y}}=(\zeta _0 /2L)\ln \cos (2\pi \alpha _{m\pm }) \) is the value of y in the zero of the denominator in the arctan argument. We divided the integration interval on two parts with \(y<{\tilde{y}}\) and \(y>{\tilde{y}}\) in order to stay at the integration at the same branch of the multivalued \(\arctan \) function.

Collecting all contributions together one obtains

$$\begin{aligned} J_\pm= & {} J_{R\pm }+J_{m\pm }+J_{i\pm }=-{{ev}_{\rm f}\over L}\left( p_\pm +\alpha _{m\pm }-{1\over 2}\right) +J_{i\pm } \nonumber \\= & {} -{{ev}_{\rm f}\over L}[p_{m\pm }+\alpha _{m\pm }+\text{ H }(-\gamma _\pm )]+J_{i\pm } \nonumber \\= & {} -{e\Delta _0\over \pi \hbar }x_m-{{ev}_{\rm f}\over L}\left( {\gamma _\pm \over 2\pi }-{1\over 2}\right) -{{ev}_{\rm f}\over L}\text{ H }(-\gamma _\pm )+J_{i\pm }. \end{aligned}$$
(54)

The total continuum vacuum current is

$$\begin{aligned} J_{vC} =J_+-J_- ={{ev}_{\rm f}\over L}\left[ {\theta _0\over \pi }- \text{ H }(\theta _0-2\pi \alpha )\right] +J_{i+}-J_{i-}. \end{aligned}$$
(55)

Because of importance and nontriviality of the continuum vacuum current, the main term \(\propto 1/L\) in this current is calculated in the Appendix B by another method.

The chain of poles close to the real axis corresponds to the chain of peaks of the transmission probability (transmission resonances). There is the parity effect for transmission resonances similar to that for bound Andreev states. At tuning of the phase \(\theta _0\) the resonances can move in and out of the continuum changing the number of resonances from odd to even and vice versa. Any crossing of the energy \(\Delta _0\) by a resonance produces a current jump.

Resonances can also cross the energy corresponding to the cutoff \(x_m\) at small variation of this arbitrarily chosen parameter. This would also change the parity of the number of resonances and produce a current jump. But any such crossing leads to a jump of the incommensurability parameter \(\alpha _m\) from 0 to 1 or from 1 to 0. This produce a jump in the value of the integral \(J_{m\pm }\) over the contour segment parallel to the imaginary axis [Eq. (54)] completely compensating the jump from crossing the high energy cutoff by a resonance. Eventually, only crossings of the energy \(\Delta _0\) by a resonance produce current jumps.

The abrupt jumps of the continuum vacuum current of the order 1/L at \(\theta _0=2\pi \alpha \) are equal in magnitude but opposite in sign to similar jumps of the vacuum current in bound states. The same is true for the corrections \(\propto 1/L^{3/2}\). This follows from analytical expressions Eqs. (40) and (50) for currents in bound and continuum states in the limit of small \(\gamma _+\). For not small \(\gamma _+\), the analytical expression for the term \(J_{i+}-J_{i-} \propto 1/L^{3/2}\) in Eq. (55) was not found and it was calculated numerically with Mathematica. Its value is equal in magnitude and opposite in sign to the \(\propto 1/L^{3/2}\) term in the current in bound states with high accuracy. The relative difference between two absolute values is about \(10^{-8}\).

4.3 Total vacuum current

Fig. 4
figure 4

Vacuum current in Andreev and continuum states at \(\alpha =0.2\) in the 1D case. Solid lines show currents calculated taking into account only the main terms \(\propto 1/L\). Currents calculated taking into account also corrections \(\propto 1/L^{3/2}\) at \(L/\zeta _0=25\) are shown by dashed lines. Here \(J_0={ev}_{\rm f}/L\). a The vacuum current \(J_{vA}\) in Andreev states. b The vacuum current \(J_{vC}\) in continuum states. c The total vacuum current \(J_v=J_{vA}+J_{vC}\)

The vacuum current \(J_{vA}\) in Andreev states and the continuum vacuum current \(J_{vC}\) in the 1D case are shown in Fig. 4a, b, respectively. Figure 4c shows the total vacuum current \(J_v=J_{vA}+J_{vC}\). Currents calculated neglecting or taking into account corrections \(\propto 1/L^{3/2}\) are shown by solid or dashed lines, respectively. The abrupt jumps of currents produced by the parity effect in the limit \(L\rightarrow \infty \) are broadened by corrections on the order of \(1/L^{3/2}\), which transform them into steep slopes with kinks exactly in the point \(\theta _0=2\pi \alpha \) [15]. These jumps and corrections \(\propto 1/L^{3/2}\) in the bound states and the continuum compensate each other in the total current, and solid and dashed lines merge. Finally, the plot \(J_v\) vs. \(\theta _0\) is the same saw-tooth relation as obtained at \(T=0\) (Fig. 2) when the condensate current is the only current in the junction.

$$\begin{aligned} J_v={{ev}_{\rm f}\over L}{\theta _0\over \pi }= {en\hbar \over 2m }{\theta _0\over L}, \end{aligned}$$
(56)

where \(n=2k_{\rm f}/\pi \) is the 1D electron density.

This picture agrees with calculations at finite L by Bagwell [24] [see his Fig. 5a]Footnote 4. Bagwell revealed kinks of currents in the bound states and in the continuum and their mutual compensation in the total current. But he did not connect them with the parity effect and the incommensurability parameter \(\alpha \), which were not considered by him.

Respective contributions of the bound states and the continuum to the total vacuum current depend on dimensionality [15]. The transition from 1D to multidimensional systems requires averaging of currents over the incommensurability parameter \(\alpha \). After averaging the current \(J_{vC}\) in continuum states and corrections \(\propto 1/L^{3/2}\) both in the bound states and the continuum vanish, and the current \(J_{vA}\) in bound states becomes equal to the total current \(J_v\) described by the saw-tooth relation shown in Fig. 4c.

For multidimensional systems currents calculated for a single 1D channel must be integrated over the space of wave vectors transverse to the current direction keeping in mind that

$$\begin{aligned} v_{\rm f}={\hbar k_{\rm f}\over m}={\hbar \sqrt{k_F^2-k_\perp ^2}\over m}, \end{aligned}$$
(57)

where \(k_F\) is the Fermi radius of a multidimensional system and \(k_\perp \) is a transverse wave vector. The integration operation is \(\int _{-k_F}^{k_F} {\text{d}k_\perp \over 2\pi }... \) in the 2D case and \(\int _0^{k_F} {k_\perp \,\text{d}k_\perp \over 2\pi }...\) in the 3D case. After integration one obtains that the expression Eq. (56) for the current derived for the 1D case is valid also for multidimensional systems if the 1D electron density n is replaced by the 2D or 3D electron densities.

4.4 Excitation current

For temperatures much higher than the Andreev level energy spacing (small \(\beta \)), one can replace the sum in Eq. (33) by an integral. Its value yields the excitation current

$$\begin{aligned} J_q =-{{ev}_{\rm f}\over L} {\theta \over \pi }. \end{aligned}$$
(58)
Fig. 5
figure 5

Contour integration in the complex plane \(z=x+iy\) for the calculation of the excitation current given by Eq. (33). Small black circles show integer values of \(x=s\), which numerate terms of the original sums in Eq. (59). Large black circles show Matsubara poles

In order to find corrections to this approximate expression we transform the sum in Eq. (33) to

$$\begin{aligned} J_q= {2ev_{\rm f}\over L} \left[ \sum _{s=0}^\infty \frac{1}{\text{e}^{\beta \left( s+{\pi +\theta \over 2\pi }\right) }+1}-\sum _{s=-\infty }^{-1}\frac{1}{\text{e}^{-\beta \left( s+{\pi +\theta \over 2\pi }\right) }+1}\right] . \end{aligned}$$
(59)

Next one can use the Matsubara approach transforming the sum to integrals over two contours \(C_+\) and \(C_-\) in the complex plane \(s=z=x+iy\) shown in Fig. 5:

$$\begin{aligned} J_q={{ev}_{\rm f}\over i L} \int _{C_+} \frac{\cot (\pi z)}{\text{e}^{\beta \left( z+{\pi +\theta \over 2\pi }\right) }+1}\,\text {d}z +{\text{ev}_{\rm f}\over iL} \int _{C_-} \frac{\cot (\pi z)}{\text{e}^{-\beta \left( z+{\pi +\theta \over 2\pi }\right) }+1}\,\text {d}z. \end{aligned}$$
(60)

Then we perform analytical continuation transforming the contours \(C_+\) and \(C_-\) to the contours \({\bar{C}}_+\) and \({\bar{C}}_-\) (Fig. 5). At this transformation the Matsubara poles on the vertical line \(x=-{1\over 2}\),

$$\begin{aligned} z_t=-{1\over 2} -{\theta \over 2\pi }+{2\pi i\over \beta }\left( t+{1\over 2}\right) , \end{aligned}$$
(61)

are crossed, and the current is

$$\begin{aligned} J_q={{ev}_{\rm f}\over iL}\left[ \int \limits _{{\bar{C}}_+} \frac{\cot (\pi z)}{\text{e}^{\beta \left( z+{\pi +\theta \over 2\pi }\right) }+1}\,\text {d}z +\int \limits _{{\bar{C}}_-}\frac{\cot (\pi z)}{\text{e}^{-\beta \left( z+{\pi +\theta \over 2\pi }\right) }+1}\,\text {d}z\right] +\sum _{t=-\infty }^\infty M_t, \end{aligned}$$
(62)

where \(M_t\) is the contribution of the tth pole.

Main contributions from contour integrals come from 4 horizontal segments of paths \({\bar{C}}_+\) and \({\bar{C}}_-\). They are integrals over real x at large constant imaginary parts \(iy=\pm iy_m\). The contribution of the upper segment of contour \({\bar{C}}_+\) is

$$\begin{aligned}{} & {} {{ev}_{\rm f}\over iL}\int _\infty ^{-{1\over 2}}\frac{\cot [\pi ( i y_m +x)]}{\text{e}^{\beta \left( i y_m +x+{\pi +\theta \over 2\pi }\right) }+1}\,\text{d}x \approx -{{ev}_{\rm f}\over L}\int _\infty ^{-{1\over 2}}\frac{\text{d}x}{\text{e}^{\beta \left( i y_m +x+{\pi +\theta \over 2\pi }\right) }+1} \nonumber \\{} & {} \quad = {{ev}_{\rm f}\over L\beta } \ln \left[ 1+\text{e}^{-\beta \left( i y_m +x+{\pi +\theta \over 2\pi }\right) }\right] \Bigg |_{x=\infty }^{-{1\over 2}} ={{ev}_{\rm f}\over L\beta } \ln \left[ 1+\text{e}^{-\beta \left( iy_m+ {\theta \over 2\pi }\right) }\right] . \end{aligned}$$
(63)

Making similar estimations of other three horizontal segments one obtains the total contribution of all four horizontal segments,

$$\begin{aligned} {{ev}_{\rm f}\over L\beta }\ln \left|\frac{1+\text{e}^{\beta \left( iy_m- {\theta \over 2\pi }\right) }}{1+\text{e}^{\beta \left( iy_m+{\theta \over 2\pi }\right) }}\right|^2 ={{ev}_{\rm f}\over L\beta }\ln \frac{1+2\cos (\beta y_m)\text{e}^{- {\beta \theta \over 2\pi }}+\text{e}^{- {\beta \theta \over \pi }}}{1+2\cos (\beta y_m)\text{e}^{{\beta \theta \over 2\pi }}+\text{e}^{{\beta \theta \over \pi }}}, \end{aligned}$$
(64)

which in the limit \(\beta \rightarrow 0\) yields the excitation current \(J_q\) given by Eq. (58). The total contribution of vertical segments of the contours \({\bar{C}}_+\) and \({\bar{C}}_-\) vanishes.

The contribution of the tth Matsubara pole is

$$\begin{aligned} M_t={2 \pi {ev}_{\rm f}\over \beta L}\frac{\tan {\theta \over 2} -i \tanh \left[ {2\pi ^2 \over \beta }\left( t+{1\over 2}\right) \right] }{1+i \tan {\theta \over 2} \tanh \left[ {2\pi ^2\over \beta }\left( t+{1\over 2}\right) \right] }. \end{aligned}$$
(65)

In the high temperature limit \(\beta \rightarrow 0\) only the poles with \(t=0\) and \(t=-1\) are important. Finally, the excitation current is

$$\begin{aligned} J_q=-{{ev}_{\text {f}}\over \pi L} \theta +M_0+M_{-1}=-{{ev}_{\text {f}}\over \pi L} \theta +{8e T\over \hbar } \text{e}^{-2\pi TL/\hbar v_{\rm f}}\sin \theta . \end{aligned}$$
(66)

The sinusoidal term in this equation was known before [12].

Integration over transverse wave vectors in multidimensional systems yields

$$\begin{aligned} J_q= -en{\hbar \over 2m }{\theta \over L}+A_q en \sqrt{T\over m k_F L}\text{e}^{-2\pi TL/\hbar v_F}\sin \theta , \end{aligned}$$
(67)

where

$$\begin{aligned} A_q=\left\{ \begin{array}{cc} 8 &{} \text{2D } \text{ case } \\ {} &{} \\ 6\pi &{} \text{3D } \text{ case } \end{array} \right. . \end{aligned}$$
(68)

5 Current-phase relation

The current-phase relation is determined by the condition that the sum of the vacuum and the excitation current vanishes. At zero temperature the both current vanish, and the current-phase relation is the saw-tooth curve shown in Fig. 2. In the 1D case at high temperatures the condition imposed by the charge conservation law is

$$\begin{aligned} J_v+J_q= & {} en{\hbar \over 2m }{\theta _0\over L}-en{\hbar \over 2m }{\theta \over L}+{8e T\over \hbar } \text{e}^{-2\pi TL/\hbar v_{\rm f}}\sin \theta \nonumber \\= & {} -en{\hbar \over 2m }{\theta _s \over L}+{8e T\over \hbar } \text{e}^{-2\pi TL/\hbar v_{\rm f}}\sin \theta =0. \end{aligned}$$
(69)

The current-phase relation is

$$\begin{aligned} J=J_s=en{\hbar \over 2m }{\theta _s \over L}={8e T\over \hbar } \text{e}^{-2\pi TL/\hbar v_{\rm f}}\sin \theta \end{aligned}$$
(70)

for the 1D system, and

$$\begin{aligned} J=A_q en \sqrt{T\over m k_F L}\text{e}^{-2\pi TL/\hbar v_F}\sin \theta \end{aligned}$$
(71)

for multidimensional systems. The constant \(A_q\) is given by Eq. (68).

Because the total current J is exponentially decreases with growing L and T, the SNS junction becomes a weak link, and the widely accepted in the past approach neglecting phase gradients in superconducting leads gives the correct result. The phase \(\theta _s\) connected with phase gradients is small, and the difference between the Josephson phase \(\theta =\theta _0+\theta _s \) and the vacuum phase \(\theta _0\) is not important. Ignoring \(\theta _s\) in Eq. (69), the current \(J_v+J_q\) yields a correct value of the total current J despite formal violation of the charge conservation law.

The exponentially small current at high temperature is a result of mutual cancelation of the large terms \(\propto 1/L\) in the vacuum current \(J_v\) and the temperature-independent part of the excitation current \(J_q\). It is not evident that this cancelation is exact. Any power law correction \(\propto 1/L^w\) independent from temperature becomes more important than the exponentially decaying current at temperatures exceeding the temperature

$$\begin{aligned} T^*={\hbar v_F\over 2\pi L }\ln {L \over C}, \end{aligned}$$
(72)

where the value of C weakly (logarithmically) depends on T and L. Due to a large logarithmic factor in Eq. (72), the temperature \(T^*\) is much larger than the Andreev level energy spacing but, nevertheless, is much smaller than the gap \(\Delta _0\), and all assumptions made in the calculations are valid.

6 Discussion and conclusions

The present paper investigates the long ballistic SNS junction using the approach initiated in Ref. [15]. The approach focused on the problem with the charge conservation law in the self-consistent field method dealing with the effective pairing potential that breaks the gauge invariance. This requires to filter solutions obtained by this method keeping only those, which do not violate the charge conservation law. The filtration is provided by the condition that the total currents inside all three layers must be equal. The total current consists of three parts: \(J=J_s+J_v +J_q\). The condensate current \(J_s={env}_s\) is produced by the phase gradient in the superconducting layers and is the same in all three layers; and therefore, it does not violate the charge conservation law. The vacuum current \(J_v\) and the excitation current \(J_q\) flow only in the normal layer, and the charge conservation law requires that \(J_v+J_q=0\). The current-phase relation of the junction is derived from this condition.

At zero temperature the new approach [15] yielded the same saw-tooth current-phase relation as previous investigations (Fig. 2). But its physical picture was different. In the previous investigations the current \(J_s\) was ignored, and sloped segments were related only with the vacuum current \(J_v\) (although the adjective “vacuum” was not used). This was in conflict with the charge conservation law, which requires that the current \(J_v\) does not flow alone. According to the new approach, slope segments of the curve correspond to the motion of the electron fluid as a whole, and the condensate current \(J_s\) is the only current in the junction, the value of which is simply derived from the Galilean invariance for Andreev scattering. The calculation of \(J_v\) using the sophisticated formalism of finite temperature Green’s functions [10, 11] is not relevant for the current-phase relation at \(T=0\). At \(T=0\) the electron transport in the SNS junctions does not differ from that in a uniform superconductor.

At nonzero temperatures, one should determine the current-phase relation from the condition \(J_v+J_q=0\), and calculations of two currents \(J_v\) and \(J_q\) are necessary. At the calculation of the vacuum current \(J_v\) in Ref. [15] the vacuum current in continuum states was neglected. It was correct for multidimensional (2D and 3D) systems, but not for the 1D case. The present paper reports a calculation of the vacuum current in continuum states correcting this error and retracting the prediction of Ref. [15] that the SNS junction can be a \(\varphi _0\) junction.

The new calculation of the vacuum current in continuum states showed that the parity effect revealed for the 1D case in Ref. [15] for the vacuum current in bound states exists also in continuum states. The parity effect produces current jumps and kinks on the current-phase plots. These jumps in bound states and in the continuum are equal in magnitude and opposite in sign, and in the total vacuum current two parity effects compensate each other. In the past current jumps and kinks were revealed in calculations of the current-phase relation in the 1D case by Bagwell [24], but their connection with the parity effect was not realized.

One might ask why an essential difference in the physical pictures does not lead to a difference in the outcome of the analysis. This “insensitivity” to the physical picture existed already in the past. The physical pictures of Ishii [11] and Bardeen and Johnson [12] are not the same. Bardeen and Johnson [12] assumed that the excitation current \(J_q\) and the condensate current \(J_s\) derived from the Galilean invariance flow in the normal layer (ignoring that the same current \(J_s\) flows also in the superconducting layers). Ishii [11] assumed that the excitation and the vacuum currents \(J_q\) and \(J_v\) flow in the normal layer at \(T=0\). However, the vacuum current \(J_v= {{ev}_{\rm f}\over L}{\theta _0\over \pi }\) and the condensate current \(J_s= {{ev}_{\rm f}\over L}{\theta _s\over \pi }\) have the same expressions as function of their phases; while, the excitation current at high temperatures \(J_q= -{{ev}_{\rm f}\over L}{\theta \over \pi }\) (neglecting the exponentially small term from Matsubara poles) has the similar expression via its phase but with an opposite sign. Since Ishii [11] and Bardeen and Johnson [12] ignored differences between phases \(\theta _0\) and \(\theta \) it did not matter whether \(J_s\) or \(J_v\) flows in the normal layer.

Coincidence of the expressions for different currents as functions of their phases takes place in the approximation taking into account only the main terms \(\propto 1/L\) and \(\propto 1/L^{3/2}\) in the 1/L expansion. The agreement with the results of previous works using [11] or not using [12] the formalism of Green’s functions points out that their results were obtained in the same approximation. The ab initio expressions for different currents are not identical, and the cancelation of temperature-independent terms in \(J_v+J_q\) at high temperatures might not retain in a more accurate approximation taking into account terms decreasing with L faster than \( 1/L^{3/2}\). The estimation of these terms is a subject for a future investigation.

Recently Thuneberg [27] presented a numerical calculation of the currents in the bound states and the continuum. He also revealed kinks on the current-phase dependences, which compensate each other in the total current. This agrees with numerical calculation of these currents by Bagwell [24] and with our analytical calculation connecting the kinks with the parity effect (odd vs. even number of Andreev levels).