Introduction

Characterization and control over the super current flow is critical for Josephson junctions (JJs)1,2,3, which have become a building block in quantum and classical technology4,5,6,7,8,9,10,11 while remained a rich area of exploration into fundamental particles12,13,14 and unconventional superconductivity15,16,17. Compared to spectroscopic probes that measures the amplitude of the superconducting (SC) wave function18, the super current flow encodes the SC phase. Mapping the spatial distribution of super current has revealed the pairing symmetry of unconventional superconductors19,20, and recently identified screening current as the source of SC diode effect in SC/ferromagnet structures21. In addition, the local super current flow affects device parameters such as the impedance of SC circuits and anharmonicity of SC qubits due to the change in kinetic inductance22. Despite the scientific and technological relevance, direct visualization of the Josephson current flow and its response to external tuning knobs such as bias current and magnetic field remains experimentally beyond reach18,23,24,25,26,27. This is mostly due to the sensitive nature of the JJ, which responds to small perturbations and the nanoscale spatial resolution needed to resolve the evolution of the super current flow. To date, JJ characterization has primarily relied on indirect measurements such as the critical current that separates the dissipation-less (zero electrical resistance) and resistive states. However, this only provides insight into the resistive state while the ground state below the critical current stays hidden.

Here we quantitatively visualize the current flow in a JJ device with nanoscale resolution. The spatial distribution of Josephson current flow can be modulated by varying the SC phase difference between two sides of the junction. In any JJ, the SC phase difference is governed by three factors: (i) external magnetic field; (ii) external bias current; (iii) self-field or SC phase gradient induced by the finite Josephson current density. Our measurements reveal the evolution of Josephson current flow with all three factors, including features associated with the change of the number of current loops at the junction known as the Josephson vortex (JV). In particular, factors (i) and (ii) can affect (iii), altering the super current flow even without detectable transport features. We find two previously unidentified effects of the Josephson current-induced phase from factor (iii). First, hidden ground states with different numbers of JVs are found within the zero-resistance state, which can be electrically switched below the critical current. Second, a new mechanism for the Josephson diode effect is established based on the second harmonic phase terms induced by the Josephson current when time-reversal and inversion symmetry are broken.

The measurement setup is shown in Fig. 1a. We employ a diamond tip containing a single nitrogen vacancy (NV) center to map the local magnetic field generated by the current flow28. The results are obtained from two devices with junction width W = 0.15 and 0.2 μm, length L = 1.5 μm and thickness t = 35 nm. The SC electrodes are measured to be in the thin-film limit L ≪ λp, where λp is the Pearl length (Supplementary Fig. 1). This suggests the factor (iii) contribution in our device comes from the Josephson current-induced phase associated with the kinetic inductance of the SC film, instead of the self-field effect. The junctions are diffusive (electron mean free path lmfp < W) and over-damped (no hysteresis during bias current sweeps). Throughout the paper, we refer to the transverse (longitudinal) direction as x(y), and the direction perpendicular to the plane as z. The origin x = y = 0 is set to the center of JJ.

Fig. 1: Measurement setup and expected Josephson current flow.
figure 1

a Schematics showing SC-normal-SC junction measured by scanning NV center embedded in a diamond tip. The SC wave function can be described by an amplitude and phase Ψ = ∣Ψeiθ. Under external magnetic field Bz, the screening current near the JJ (red lines) induces a phase difference ϕe(x). The bias current causes a phase difference between the SC electrodes ϕbias. b Measured differential resistance dV/dI versus perpendicular magnetic field Bz and bias current Idc, at T = 7 K. Dashed lines are the expected critical current (see Supplementary Note 2), where red is ϕbias = π/2, blue is ϕbias = −π/2. The Ic nodes are denoted as  ±Bn. c, d Calculated Josephson current normalized by critical current density for 0- and 1-JV states, at external Bz = 1.10 mT in (c), and Bz = 1.91 mT in (d). The current flow is sine-like at zero bias current (bold lines), shifts along x direction at a finite bias current, and becomes cosine-like at the critical current. e Simulations showing the Josephson current flow (top) and local SC phase (bottom) of the 0- and 1-JV states. The screening current near the junction Jx (red arrows) is reduced by the Josephson current Jy (cyan arrows) in the 0-JV state, and enhanced in the 1-JV state. This causes the Josephson current-induced phase. Ibias = 0, Bz ≈ 1.2 mT in this simulation. f, Simulated ϕe(x) for 0- and 1-JV states, at the same Bz as (e). ϕe(x) is the difference of θ taken along the two dashed lines in each sub-panel of (e). g NV control and current bias sequence based on the ac magnetometry protocol. The X(Y) microwave (MW) pulses rotate the qubit around the X(Y) axis by \(\frac{\pi }{2}\) or π. NV qubit is put on the equator of the Bloch sphere and rotated by the magnetic field generated by current flow. Pulses of different bias current are synced with the MW pulses such that the final signal is the difference between the two current flow patterns.

Results

current-induced phase

The Josephson current density can be modeled by the sinusoidal current-phase relation22

$${J}_{y}(x)={J}_{c}\sin [\phi (x)],$$
(1)

where Jc is the Josephson critical current density (assumed constant for now), and ϕ(x) is the phase difference across the JJ at position x. ϕ(x) = ϕe(x) + ϕbias, where ϕe(x) arises from the external magnetic field Bz (factor i), and ϕbias is the additional phase difference due to the injected bias current (factor ii). The strength of Josephson current-induced phase (factor iii) is regulated by Jc. For small Jc, the Josephson penetration length \({\lambda }_{J}\, \approx \, \sqrt{{\Phi }_{0}Lt/4\pi {\mu }_{0}{\, J}_{c}{\lambda }_{L}^{2}} \, \gg \, L\)29, the Josephson current-induced phase can be neglected ("weak junction” limit). Φ0 is the flux quantum, λL is the London penetration length.

In the weak-junction limit, external Bz controls the number of JV. The transport critical current Ic oscillates and reaches zero at nodes Bz = ±Bn (n is integer). It is known as the “Fraunhofer map”30,31. In each lobe where Bn−1 < ∣Bz∣ < Bn, there are n JVs at the junction; in the central lobe there is 0-JV (Fig. 1b); the only way to change the number of JV is by sweeping Bz through the nodes Bn (Supplementary Fig. 2). In weak junctions the first term ϕe(x) is induced by the screening current Jx in the SC electrodes, and scaled by ϕe0 ≡ ϕex=L/2 ≈ 1.7BzL2/Φ031 (Supplementary Eqn. 9). The second term ϕbias changes from  −π/2 + nπ to π/2 + nπ when Ibias sweeps from  −∣Ic∣ to  +∣Ic∣ (Fig. 1c, d), which can be viewed as moving the JV along the xx direction.

In “strong junctions” (λJ ≪ L), ϕ(x) is altered by the Josephson current-induced phase and lacks analytical solutions. Qualitatively, the screening current Jx deviates from the weak-junction limit by an amount proportional to the Josephson current Jy (Fig. 1e), due to the continuity of current. This leads to additional phase gradient \(\partial \theta /\partial x\propto {{{\mathcal{L}}}}_{k}{J}_{x}\), which changes ϕe(x) = θ(x)∣y = W/2 − θ(x)∣y = −W/2. Here \({{{\mathcal{L}}}}_{k}\) is the kinetic inductance, which is inversely proportional to the superfluid stiffness. θ is the SC phase. Specifically, the larger Jx in the 1-JV state leads to enhanced ϕe0, compared to the 0-JV state at the same external magnetic field (Fig. 1f). Ibias can further change the Josephson current and its induced phase. Thus in strong junctions, the total ϕ(x) and current flow need to be solved self-consistently. We find that our device is close to the weak-junction limit at T = 7 K, but is in an intermediate range at T = 4 K.

Visualizing Josephson current flow

To optimize magnetic field sensitivity, we utilize the “ac magnetometry" protocol, synchronizing NV control pulses with the signal (Fig. 1g). In this protocol, different bias currents I1 and I2 is applied to the junction during two halves of each cycle. The magnetic field generated by Ik rotates the prepared NV spin superposition state along the equator of the Bloch sphere by an angle φk = 2πγebnvτ/2, where γe is the gyromagnetic ratio of electron spin, bnv is the magnetic field projected along NV axis, and τ is cycle duration. After the sequence, the accumulated angle is φ1 − φ2 so each measurement records the difference between two selected scenarios. bnv is converted to vector components of the magnetic field bx,y,z using a Fourier method (see Methods). The current vector (jxjy) is then reconstructed with the Fourier method using in-plane components of the magnetic field. We find similar results with regularization and machine learning methods (see Supplementary Note 5).

We start at T = 7 K where the transport result suggests a weak junction (Fig. 1b). To visualize the evolution of Josephson current, we use two types of sequences. In the first sequence, we highlight the effect of ϕbias by taking the difference between finite and zero Ibias (schematics in Fig. 2a). The expected current profiles jy(x) are shown in Fig. 2a, by subtracting the relevant lines in Fig. 1c. The sign of Ibias determines the direction of the profile shift and the amplitude determines the amount of the shift. Fig. 2b, c show measurements using Ibias ≈ ±∣Ic∣ in the sequence while no JV is in the junction. As expected, current features are seen at the opposite side of the junction for  ±Ibias. jy(x) at the junction also shows the lateral movement when sweeping Ibias (Supplementary Fig. 3). ϕbias can be acquired by fitting jy(x) to the calculated profiles from Fig. 2a (Supplementary Eqn. 10). The result agrees with the sinusoidal current-phase relation (Fig. 2d).

Fig. 2: Visualizing Josephson current response to bias current and magnetic field.
figure 2

a Top sketch shows the measurement sequence that takes the difference between zero and finite current bias. Expected current flow show changing line shapes at various bias current Ibias, with the opposite bias current leading to inverted current flow pattern around the center of the junction. b, c Color map shows z-component of the current-generated magnetic field bz. The arrows show the reconstructed current flow vector. Results are measured using the sequence shown in (a). External magnetic field is Bz = 0.95 mT. The SC electrodes are marked by solid lines and normal metal part is marked by dashed lines. d Phase difference caused by bias current ϕbias extracted from the current flow profile at the junction. The result agrees with the sinusoidal current-phase relation. Inset shows the measured jy(x) at Ibias = Ic, and the fitting results using Supplementary Eqn. 10. The data in the gray area is excluded in the fitting. e Top sketch shows the measurement sequence that takes the difference between symmetric positive and negative Ibias. The expected signals change sign when measuring the 0- and 1-JV states at their respective ∣Ic∣. All signals show cosine-like shape, with amplitude growing with Ibias. f, g bz and current flow vector maps measured using the sequence shown in e). The Josephson current changes sign between 0- and 1-JV states. External magnetic field is Bz = 1.10 mT in (f), and Bz = 1.91 mT in (g). h Effective phase difference across the junction ϕeff = ϕex=W/2 deviates from the external field contribution ϕext (indicated by the shaded area), as a result of induced phase from the Josephson current. Scale bar is 0.5 μm for (b, c, f, g). The measurements are taken at T = 7 K. Error bars in d and h represent standard deviation from fitting.

Next we show the effect of magnetic flux on the Josephson current by taking the difference between  ±Ibias (schematics in Fig. 2e). Here the expected signals are cosine-like and only grow in amplitude with Ibias (Fig. 2e). For the same Ibias direction, the signal flips sign for 0- and 1-JV states (switching from red to blue branch in Fig. 1b). Measurements using this sequence are shown in Fig. 2f, g, where we use Ibias ≈ ∣Ic∣ in both cases. Results measured at Ibias ≈ 0.5∣Ic∣ show the same shape with half the amplitude (Supplementary Fig. 5a, b). We repeat the measurement at various magnetic fields, and the current profile reversal can be seen when external Bz crosses the node B0 ≈ 1.5 mT, i.e., when JV number changes by 1 (Supplementary Fig. 4). Notably, the current flow at x = 0 is parallel (anti-parallel) to Ibias when the junction contains even (odd) number of JVs. In the 2-JV state, the current flow at x = 0 and bias current are both positive (Supplementary Fig. 6), like the 0-JV state (Fig. 2f).

Our measurements provide quantitative details of the current flow compared to previous methods24,32,33,34. First, we confirm the SC is in the thin-film limit (L ≪ λp). The absolute value of λp ≈ 13 μm at T = 7 K is directly measured from the stray field (Supplementary Fig. 1). In comparison, indirect measurements of λp range from 1 to 5 μm (see Methods), and thus are unable to determine whether the SC is in the thin-film regime. Second, the JV extends into the SC electrode on both sides by ~350 nm (Supplementary Fig. 5c), consistent with the effective area expected from the nodes Bn. However, the measured jy(x) profile does not match the expectation under external Bz. For example, at Bz = 1.1 mT the jy(x) in Fig. 2f is expected to be negative at x = ±L/2, but stays positive in the experiment, suggesting a smaller than expected ϕe0 (Supplementary Fig. 4f).

We introduce an effective phase difference ϕeff as a fitting parameter for the measured jy(x), replacing the theoretically predicted ϕe0 (Supplementary Eqn. 11). Fig. 2h shows ϕeff is lower (higher) than the phase induced by the external field ϕext when Bz < B0 (Bz > B0). The discrepancy is a direct consequence of the Josephson current-induced phase, as expected in strong junctions. While we find λJ is comparable to L when calculated using experimentally measured parameters, no strong junction feature is observed in the “Fraunhofer map" (Fig. 1b). The Josephson current-induced phase only causes small changes to Ic, and the effect cancels out when tracking Ic over large range of Bz32. However, such an effect is still pertinent to designing SC devices such as JJ arrays because the inductance of each junction is affected by the supercurrent flow35.

Electrically switching JV below ∣I c

The “Fraunhofer map” changes when measured at T = 4 K. The nodes of ∣Ic∣ at Bn are lifted although sharp kinks remain (Fig. 3a). This could be caused by a combination of reasons, including an asymmetric critical current density, Jc(x) ≠ Jc(−x) and the strong junction effect due to the increased ∣Ic33,36,37. However, the precise mechanism remains difficult to dissect owing to the zero-resistance below Ic. Here the origin of non-zero local minima of ∣Ic∣ is revealed by mapping the current flow. A differential magnetic field \({\widetilde{b}}_{{{\rm{nv}}}}\) is measured using a sequence that senses the small ac bias (ĩac) response while fixing the dc bias (Idc), shown by the schematic drawing above Fig. 3b. The \({\widetilde{b}}_{{{\rm{nv}}}}\) is measured around the kinks of ∣Ic∣ while the NV is fixed over the center of the junction (Fig. 3b main panel). Abrupt changes of \({\widetilde{b}}_{{{\rm{nv}}}}\) at large ∣Idc∣ match the transport Ic (circles in Fig. 3b). This suggests that the junction is minimally perturbed by the NV magnetometer.

Fig. 3: Electric control of JV ground state below critical current.
figure 3

a Differential resistance dV/dI measured in the same device as Fig. 1c but at T = 4 K, showing order-of-magnitude increase and oscillation of Ic that does not reach zero. The dashed box shows the measurement range in (b). b Top sketch shows measurement sequence. Main panel shows the differential magnetic field projected along NV axis \({\widetilde{b}}_{{{\rm{nv}}}}\), generated by the current flow response to the small ac current ĩac ≈ 0.8 μA. \({\widetilde{b}}_{{{\rm{nv}}}}\) is shown versus dc bias current Idc and perpendicular magnetic field Bz. The NV is fixed at (xy) ≈ (−500, 0) nm, where x = y = 0 is the center of JJ. Circles are critical current extracted from transport result in (a). c Difference of Gibbs free energy between the 0- and 1-JV states below Ic, Δε = ε0V − ε1V, from TDGL simulations. Blue (red) circles show simulated critical current of state with 0- (1-) JV. The color in the non-overlap region is saturated to indicate only 0- and 1-JV state is present. d, e Spatial maps of differential \({\widetilde{b}}_{z}\) and current flow vector measured with sequence shown in (b), showing both (d) 0-JV, and (e) 1-JV states at the same external field Bz = 1.4 mT. The features in e are positioned asymmetrically because the JV is at right-of-center of the junction due to finite Idc. f Full vortex profile is observed when using a sequence that takes the difference between 0- and 1-JV states.

An additional sharp boundary of \({\widetilde{b}}_{{{\rm{nv}}}}\) below Ic separates the 0- and 1-JV states. This is confirmed by the spatial maps in Fig. 3d, e. In Fig. 3d (0-JV state), the current is almost uniform despite being measured at higher external Bz than Fig. 2f, suggesting ϕe0 is strongly suppressed by the Josephson current-induced phase. Intriguingly, the 0- and 1-JV states can be reached at the same Bz but different Ibias (Fig. 3d, e). Measuring the difference between two such Ibias, the current profile that corresponds to the JV number changing by 1 is observed (Fig. 3f). This demonstrates precise JV number control using pure electric means while staying below Ic, which could be useful for low-dissipation memory and logic devices based on SC hybrid structures.

The phase boundary below Ic supports Josephson current-induced phase as the primary reason for the node-lifting in our device. The induced phase enables the co-stability of the 0- and 1-JV states originating from the existence of two local minima of the energy as a function of the order parameter Ψ(r) at the same external magnetic field, as shown by the time-dependent Ginzburg-Landau (TDGL) simulation (Fig. 3c, for details see Supplementary Note 8). The overlapping states with different number of JVs were predicted to arise from the self-field effect previously38,39,40,41,42. However, we do not expect self-field to be the main effect here. The measured self-field of the current is insignificant in our device (less than 5% of the external field), and the SC is still in the thin-film limit at T = 4 K (L ≪ λp, see Methods). Furthermore, the boundary of the 0- and 1-JV phase diagram only extends from the 1-JV region (Fig. 3b) in the experiment. This is independent of sweeping directions of Bz or Idc (Supplementary Fig. 9a), and similar behavior is observed between the 1- and 2-JV states (Supplementary Fig. 9b). The lack of hysteresis is quite unexpected. One possibility is that the JJ relaxes to the ground state with lower energy due to the elevated temperature and small perturbations of the measurement, although the detailed mechanism is an open question for future work. The simulated Gibbs free energy difference Δε = ε0Vε1V shows the 1-JV state has lower energy than the 0-JV state in most, but not all of the overlap region (Fig. 3c). In fact, including the self-field effect energetically favors the 0-JV over the 1-JV state, further deviating from the experimental results (Supplementary Fig. 20).

Inversion asymmetry and Josephson diode effect

The transport Ic is non-reciprocal when Ibias is applied in opposite directions at T = 4 K, i.e. \(| {I}_{c}^{+}| \ne | {I}_{c}^{-}|\) (Fig. 4a). This is referred to as the “Josephson diode effect”43. The asymmetry parameter, \(\eta=\frac{| {I}_{c}^{+}| -| {I}_{c}^{-}| }{| {I}_{c}^{+}|+| {I}_{c}^{-}| }\), exceeds 10% in our device. We identify a new mechanism for the diode effect comprising three ingredients, (i) time-reversal symmetry breaking (by Bz), (ii) inversion symmetry breaking, and (iii) Josephson current-induced phase. The first two conditions are required by symmetry17,44, while the third provides a mechanism whereby the Josephson current is not a simple sinusoidal function of ϕbias. As a result, the critical current density is reached on opposite sides of the junction at  ±Ibias, which leads to asymmetric \({I}_{c}^{\pm }\) (Fig. 4b). Interestingly, it can be shown theoretically that first two ingredients alone are not sufficient to generate the diode effect Supplementary Note 7. Combining the symmetry breaking with the Josephson current-induced phase introduces higher harmonic terms with a phase offset in the current-phase relation Supplementary Note 7. Our results confirm all three components are necessary. For example, the current profile measured at T = 7 K is asymmetric, jy(x) ≠ jy(−x), suggesting broken inversion symmetry (Supplementary Fig. 16). However, the weaker current-induced phase due to smaller Jc is insufficient to generate a non-reciprocal global critical current response (Supplementary Note 6).

Fig. 4: A new mechanism for the Josephson diode effect.
figure 4

a Left axis, forward and backward critical current extracted from results measured in Fig. 3a. Right axis, asymmetry parameter η showing JDE when time-reversal symmetry is broken by Bz. b Schematics showing inversion symmetry breaking (non-uniform Jc) at the junction can lead to different forward and backward critical current. c, d Differential magnetic field \({\widetilde{b}}_{z}\) and current flow vector measured at symmetric  ±Ibias show inversion asymmetric patterns. Measurements are taken at Bz = 0.5 mT, using the same sequence as described in Fig. 3b. e, f Simulated results corresponding to (c) and (e), when inversion symmetry at the junction is broken, modeled as non-uniform junction width W1 > W2. The measurements in (a, c, d) are taken at T = 4 K.

The current flow measurement directly reveals the broken inversion symmetry even when the global \({I}_{c}^{\pm }\) is almost symmetric. The \({\widetilde{b}}_{{{\rm{nv}}}}\) map at  ±Ibias is measured at Bz = 0.5 mT. Although η is only about 2%, the current flow pattern is clearly asymmetric for  ±Ibias; a loop appears near the left edge for  −Ibias (Fig. 4c) but not for  + Ibias (Fig. 4d). We model the non-uniform Jc(x) with an uneven junction width W (W1 > W2) in the TDGL simulation, confirming the role of broken inversion symmetry (Fig. 4e, f); if the junction is inversion symmetric, the ac current flow for  ±Ibias should be mirrored along the x direction (Supplementary Fig. 21f–h). In fact, the broken inversion symmetry is also responsible for the skewed phase boundary for  ±Ibias in Fig. 3b, c. In reality, the non-uniform Jc(x) could be due to variations in junction width, SC/normal barrier transparency, or normal metal resistivity.

Discussion

The JV discussed in our work should be distinguished from the Abrikosov vortex in type-II superconductors45. While both move in the same direction with Ibias and exhibit normal cores, observed in spectroscopic studies18,46, only the JV configuration can be controlled by a small change of Ibias below Ic. Even when the current-induced phase is weak, the JV can be precisely moved side-to-side by the small change of Ibias from  − ∣Ic∣ to ∣Ic∣ at Bz = Bn ± ε, (ε ≪ 1). In particular, ∣Ic∣ should vanish at Bz = Bn, if the junction is symmetric about its midpoint. This control over the JV position enables us to observe the large alternating magnetic field signal at the JJ with minimal changes in Ibias (Fig. 2g). Finally, the minimal energy cost associated with JV movement (IcΔϕ) as Ic → 0 supports JV control as an energy-efficient way of communication between qubits47.

The new mechanism of the Josephson diode effect offers a blueprint to realize a scalable SC rectifier with any thin-film SC. Conventional Josephson diodes that are driven by the self-field effect require a large operating current because the geometric inductance is usually small, especially at the nanoscale48,49. However, the kinetic inductance can dominate in SC with small superfluid stiffness (e.g., low superfluid density), making it possible to reduce the device size. This also enables electric tuning of the Josephson diode by injecting a small current Jx to control the Josephson current-induced phase.

Finally, spatial mapping of the current flow J(xy) presents an alternative observable to electrical transport in SC hybrid structures. By accurately measuring J(xy) with high sensitivity and spatial resolution, we pinpoint the origin of the Josephson diode effect in our device, which is otherwise hidden. Our approach opens up further avenues to unseal the mechanisms for the non-reciprocity in a broad range of SC systems, and symmetry breaking in gate-tunable superconductors based on van der Waals and moiré materials. The measured current flow could be directly compared with simulations based on TDGL or quantum transport to diagnose SC circuits, such as the local transparency of the JJ barrier.

Methods

Variable temperature scanning setup

Measurements were performed in a home-built variable temperature system with optical access. There are multiple nano-pillars containing NV centers on each diamond probe, and a goniometer with both pitch and yawn control is used to set the stand-off distance between the NV and the sample28, which ranges between 130 to 180 nm throughout the study. The NV center is excited with 532 nm green laser (Coherent Sapphire), and read out with standard optical detected magnetic resonance (ODMR) technique using a 600 nm long-pass optical filter. The time-averaged power of the green laser pulses is less than 50 μW. The microwave (MW) drive is provided via on-chip transmission line next to the sample. MW is sourced from SGS-100A (Rohde & Schwarz) and modulated with the built-in IQ mixer. MW pulses are then amplified by +40 db using 30S1G6C (AR Inc), and routed through another switch (RF lambda) to reduce noise from the amplifier. MW and bias current control sequences are generated by arbitrary wave generator AWG5014C (Tektronic).

Device fabrication and electrical characterization

The SC and normal parts of the JJ are made of niobium nitride (NbN) and gold (Au) thin films, respectively. The JJs are fabricated on undoped Silicon substrate with 285 nm SiO2 on top. Standard electron beam lithography method is used to define the device geometry using double-layer e-beam resist. The normal part of the junction is first formed with thermal evaporation (2 nm Ti/ 35 nm Au). A short Argon milling process is used right before sputtering SC electrodes (2 nm Ti/6 nm Nb/30 nm NbN). The MW strip line is formed with 2 nm Ti/ 60 nm Au. Four terminal resistance result was first measured with dc bias from Keithley 2400 and dc voltage with Keithley 2100, and then taken numerical derivative to acquire differential resistance shown in the main text.

Probe fabrication and typical characteristics

The diamond fabrication process follows ref. 50. Specifically, ultra pure diamond with natural 13C abundance and [100] facet (electronic grade from Element Six) is diced into thin slabs ~50 μm thick. One side of the slab is etched by Argon/Chloride plasma to relieve surface strain, then implanted with 15N ions at a dose of 5 × 1010/cm2 and acceleration energy of 6 keV (Innovion). Then the diamond is annealed in ultrahigh vacuum (<3 × 10−8 Torr) at 800 C for 24 hours to form NV centers. The diamond nano-pillars are defined with standard e-beam lithography and etched with O2 plasma. On average we get 1 NV center per diamond pillar with this process. The NV depth from the surface is about 15-20 nm. Typical ODMR red photon count is 100 k/s, contrast in pulsed measurement is 20 to 30%, and the coherence time is \({T}_{2}^{*}\approx 1\,\mu\) s and T2 ≈ 30 μs at 4 K and the small magnetic field used in this study.

Detail about NV magnetometry

NV is a spin-1 system with low energy states \(s=\left\vert 0\right\rangle,\left\vert \pm 1\right\rangle\). The \(\left\vert 0\right\rangle\) is split in energy from \(\left\vert \pm 1\right\rangle\) by the zero field splitting (2.87 GHz) and \(\left\vert \pm 1\right\rangle\) are further split by the Zeeman energy EZ = gμBBnv, here g = 2 is the Landé g-factor for electron, μB is the Bohr magneton, and Bnv is the magnetic field along NV axis. In practice, we apply a external field of less than 50 G along the NV axis, and drive the \(\left\vert 0\right\rangle\) and \(\left\vert -1\right\rangle\) states as a qubit using MW. As mentioned in the main text, “ac” magnetometry is used to filter out low frequency noise and maximize sensitivity by utilizing the longer T2 coherence time. Specifically, the NV qubit is first prepared in the \(\left\vert 0\right\rangle\) state using a green laser pulse, and then driven into the superposition state \(\frac{1}{\sqrt{2}}(\left\vert 0\right\rangle+i\left\vert -1\right\rangle )\) by a \({X}_{\frac{\pi }{2}}\) MW pulse. We use two types of dynamic decoupling sequences, the spin echo (Hahn echo) with one π-pulse, and the Carr-Purcell-Meiboom-Gill (CPMG) with n-Yπ pulses in the experiment51,52. Between neighboring π-pulses, the qubit rotates by an angle φ = 2πγebnvτn, where γe = 28 GHz/T is the gyromagnetic ratio of the electron spin, bnv is the magnetic field generated by the current projected along NV axis, and τn is the evolution time between neighboring MW pulses. The π-pulses reverse the qubit rotation direction, and the total angle is the difference of the accumulation in each half of the sequence. The frequency of NV control sequence and bias current modulation is f = 100 to 500 kHz, corresponding to <1 nA bias current due to the AC Josephson effect I = hf/2eRN22 (h is Planck’s constant, e is electron charge, RN ≈ 1Ω is the normal state resistance of the JJ). This is 3 to 4 orders of magnitude smaller than the bias current applied to the JJ.

To extract the phase accumulation angle, the NV spin is projected to the \(\left\vert 0\right\rangle\) and \(\left\vert -1\right\rangle\) states using four \(\frac{\pi }{2}\)-pulses \({\frac{\pi }{2}}_{\pm X/Y}\) and record the ODMR signal. The angle is then calculated from

$$\varphi=\arctan \frac{{C}_{{\frac{\pi }{2}}_{X}}-{C}_{{\frac{\pi }{2}}_{-X}}}{{C}_{{\frac{\pi }{2}}_{Y}}-{C}_{{\frac{\pi }{2}}_{-Y}}}$$
(2)

where \({C}_{{\frac{\pi }{2}}_{\pm X/Y}}\) are the photon counts from \({\frac{\pi }{2}}_{\pm X/Y}\) projections. The measurement sequences are averaged up to 100k times (about 10 seconds) at each point to extract the Bnv.

Reconstructing current flow from magnetic field

In this section, we discuss the three methods used to reconstruct current flow jx,y from bnv. For all methods, we first convert the magnetic field projected along NV axis bnv, to Cartesian vector magnetic field bx,y,z using the source-free constraint for the stray field53,54,55,

$$\nabla \times b=0$$
(3)

Thus in the Fourier space the vector components are,

$${b}_{z}({{\bf{k}}})= \frac{{b}_{{{\rm{nv}}}}({{\bf{k}}})}{{{{\bf{u}}}}_{{{\rm{nv}}}} \cdot {{\bf{u}}}}\\ {b}_{x}({{\bf{k}}})= -i\frac{{k}_{x}}{k}{b}_{z}({{\bf{k}}})\\ {b}_{y}({{\bf{k}}})= -i\frac{{k}_{y}}{k}{b}_{z}({{\bf{k}}})$$
(4)

here k = (kxky) is the 2D wavevector, \(k=\sqrt{{k}_{x}^{2}+{k}_{y}^{2}}\), unv is the unit vector of the NV axis, u = (−ikx/k, −iky/k, 1). The singularity point at k = 0 is discarded during the reconstruction. Because the SC electrode is much longer than our measurement window in the y direction, the jy outside the window on the top and bottom sides also contribute to the measured bnv. In practice, we extend the measured bnv with the top and bottom lines in the y direction, and linearly extrapolates bnv to zero in the x direction. The padding size in each direction is 10 times of the measurement window, at which point increasing the size does not change the reconstruction result. More detail of the reconstruction process is discussed in Supplementary Note 5.