diff --git a/doc/source/pre/whatsnew/1.4.rst b/doc/source/pre/whatsnew/1.4.rst index c962fb9741f8f6ac8709aa8f8bd62b8ced65f377..a2ea4f32b4a5f99232b61948a5c3dde8c1ba8866 100644 --- a/doc/source/pre/whatsnew/1.4.rst +++ b/doc/source/pre/whatsnew/1.4.rst @@ -35,12 +35,12 @@ ensure that the chosen gauge is consistent across the whole system directions). This release introduces `kwant.physics.magnetic_gauge`, which calculates the Peierls phases for you:: - import numpy as np - import kwant - def hopping(a, b, t, peierls): return -t * peierls(a, b) + def B_syst(pos): + return np.exp(-np.sum(pos * pos)) + syst = make_system(hopping) lead = make_lead(hopping).substituted(peierls='peierls_lead') syst.attach_lead(lead) @@ -48,11 +48,7 @@ which calculates the Peierls phases for you:: gauge = kwant.physics.magnetic_gauge(syst) - def B_syst(pos): - return np.exp(-np.sum(pos * pos)) - # B_syst in scattering region, 0 in lead. - # Ensure that the fields match at the system/lead interface! peierls_syst, peierls_lead = gauge(B_syst, 0) params = dict(t=1, peierls=peierls_syst, peierls_lead=peierls_lead)