a, Topological phase diagram as a function of the Zeeman energy \({E}_{{\rm{Z}}}\) and the 2DEG chemical potential µ for two values of the phase bias \(\phi \) = 0, π, calculated from the tight-binding Hamiltonian for JJ1 with infinite length (see Methods) and symmetric superconducting leads. The curves indicate the critical value of \({E}_{{\rm{Z}}}\) above which the system is tuned into the topological phase. b, Topological phase diagram as a function of \({E}_{{\rm{Z}}}\) and \(\phi \) for different values of µ, as indicated by the horizontal ticks in a. The diagrams were calculated for a junction with width W 1 = 80 nm, superconducting lead width W S1 = 160 nm, induced gap ∆ L,R = 150 µeV and Rashba spin–orbit coupling constant α = 100 meV Å. The length of the junction L 1 was assumed to be infinite in order to obtain a well-defined topological invariant, as described in the Methods. c–g, Calculated energy spectra as a function of \(\phi \) for different values of the Zeeman energy. The spectra were obtained for the same parameters used in a and b, except for L 1 = 1.6 µm. For this left–right symmetric junction, the topological transition can occur at \({E}_{{\rm{Z}}}\) = 0 for \(\phi \) = π and specific values of chemical potential. We calculate the spectra and Majorana wavefunctions at this fine-tuned chemical potential µ = 79.25 meV (corresponding to the purple curve in b). For the chosen parameters, the system undergoes a topological transition at \({E}_{{\rm{Z}}}\) = 0 for \(\phi \) = π and at \({E}_{{\rm{Z}}}\) = 0.12 meV for \(\phi \) = 0. The lowest-energy subgap states are shown in red and indicate two Majorana zero modes at the edges of the junction in the topological regime. As a function of \({E}_{{\rm{Z}}}\) these states first reach zero energy at \(\phi \) = π and progressively extend in phase. At high values of \({E}_{{\rm{Z}}}\), the Majorana modes oscillate around zero energy owing to their hybridization, caused by the finite size of our system. This is particularly evident at \(\phi \) = π, where the induced gap is minimized and the coherence length is maximized. h, i, Probability density \({\left|\Psi \right|}^{2}\) of the Majorana wavefunction calculated as a function of the spatial directions x and y in JJ1 for \({E}_{{\rm{Z}}}\) = 0.13 meV and \(\phi \) = 0, π. The x coordinate extends in the width direction including the superconducting leads (\(2{W}_{{\rm{S}}1}+{W}_{1}\)) = 0.4 µm, with x = 0 indicating the centre of the junction, while y is the coordinate along the length of the junction. The Majorana wavefunctions are localized in the y direction at the edges of the junction when the lowest energy states in the spectrum are close to zero energy. In the x direction, the Majorana modes are delocalized below the superconducting leads, owing to our geometry having \({W}_{{\rm{S}}1}\ll {\xi }_{{\rm{S}}}\).