diff --git a/doc/source/pre/whatsnew/1.5.rst b/doc/source/pre/whatsnew/1.5.rst index 9340cec96666ac0b9f02b7fa92ab1471ea63dc78..a509ccc0a16dc525e8330671790459ae5eaa2040 100644 --- a/doc/source/pre/whatsnew/1.5.rst +++ b/doc/source/pre/whatsnew/1.5.rst @@ -3,6 +3,30 @@ What's new in Kwant 1.5 This article explains the user-visible changes in Kwant 1.5.0. +Automatic addition of Peierls phase terms to Builders +----------------------------------------------------- +Kwant 1.4 introduced `kwant.physics.magnetic_gauge` for computing Peierls +phases for arbitrary geometries and for systems with leads. Using this +functionality requires that the system value functions are equipped to +take the required Peierls phase parameters, which is not possible when +you are not in direct control of the value functions (e.g. discretized +systems). In Kwant 1.5 we have added the missing piece of functionality, +`kwant.builder.add_peierls_phase`, which properly adds the Peierls phase +parameters to a Builder's value functions:: + + syst = make_system() + lead = make_lead() + syst.attach_lead(lead) + syst.attach_lead(lead.reversed()) + + fsyst, phase = kwant.builder.add_peierls_phase(syst) + + def B_syst(pos): + return np.exp(-np.sum(pos * pos)) + + kwant.smatrix(fsyst, parameters=dict(t=-1, **phase(B_syst, 0, 0))) + + Improved tutorial building -------------------------- Improving or adding to Kwant's tutorial is now much simpler. Now diff --git a/doc/source/reference/kwant.builder.rst b/doc/source/reference/kwant.builder.rst index af02a1bc27e3bbeb3adc4f82e0594c7604b7ab07..327afca9e9f44c797378b918baa0799ef30af45f 100644 --- a/doc/source/reference/kwant.builder.rst +++ b/doc/source/reference/kwant.builder.rst @@ -26,3 +26,10 @@ Abstract base classes SiteFamily Symmetry Lead + +Functions +--------- +.. autosummary:: + :toctree: generated/ + + add_peierls_phase