diff --git a/kwant/physics/gauge.py b/kwant/physics/gauge.py index 79682f6aa09479ab6e7ba4f6ab0b13ac4594c037..b120df8af1301b12f0660ac3036368abfa3e3a38 100644 --- a/kwant/physics/gauge.py +++ b/kwant/physics/gauge.py @@ -787,7 +787,7 @@ def calculate_phases(loops, pos, previous_phase, flux): for loop in loops: tail, head = loop[-1], loop[0] integral = flux([pos(p) for p in loop]) - phase = np.exp(2j * np.pi * integral) + phase = np.exp(1j * np.pi * integral) phases[tail, head] = phase / previous_phase(phases, loop) return phases @@ -1001,6 +1001,9 @@ class magnetic_gauge: If callable, takes a position and returns the magnetic field at that position. Can be a scalar if the system is 1D or 2D, otherwise must be a vector. + Magnetic field is expressed in units :math:`φ₀ / l²`, + where :math:`φ₀` is the magnetic flux quantum and + :math:`l` is the unit of length. *lead_fields : scalar, vector or callable The magnetic fields to apply to each of the leads, in the same format as 'syst_field'. In addition, if a callable diff --git a/kwant/physics/tests/test_gauge.py b/kwant/physics/tests/test_gauge.py index 510259d491594c4683f7331501475a18e96af1ae..9798a82ae81dd2a7aad7b28caf6262825cd60cb7 100644 --- a/kwant/physics/tests/test_gauge.py +++ b/kwant/physics/tests/test_gauge.py @@ -211,7 +211,7 @@ def _test_phase_loops(syst, phases, loops): for loop_kind, loop_flux in loops: for loop in available_loops(syst, loop_kind): loop_phase = np.prod([phases(a, b) for a, b in loop_to_links(loop)]) - expected_loop_phase = np.exp(2j * np.pi * loop_flux) + expected_loop_phase = np.exp(1j * np.pi * loop_flux) assert np.isclose(loop_phase, expected_loop_phase)