From ec47af187a2e22fa8e0d40204d3967518bf35377 Mon Sep 17 00:00:00 2001 From: Joseph Weston <joseph@weston.cloud> Date: Mon, 11 Feb 2019 17:15:29 +0100 Subject: [PATCH] add 'parameters' property to abstract system API Also require that 'leads' of FiniteSystems have a 'parameters' property. --- kwant/system.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/kwant/system.py b/kwant/system.py index a670d773..d7253597 100644 --- a/kwant/system.py +++ b/kwant/system.py @@ -31,6 +31,9 @@ class System(metaclass=abc.ABCMeta): range. In addition, the final triple should have the form ``(len(graph.num_nodes), 0, tot_norbs)`` where ``tot_norbs`` is the total number of orbitals in the system. + parameters : frozenset of strings + The names of the parameters on which the system depends. This attribute + is provisional and may be changed in a future version of Kwant Notes ----- @@ -79,7 +82,11 @@ class FiniteSystem(System, metaclass=abc.ABCMeta): leads : sequence of leads Each lead has to provide a method ``selfenergy`` that has the same signature as `InfiniteSystem.selfenergy` (without the - ``self`` parameter). It may also provide ``modes`` that has the + ``self`` parameter), and must have property ``parameters``: + a collection of strings that name the system parameters ( + though this requirement is provisional and may be removed in + a future version of Kwant). + It may also provide ``modes`` that has the same signature as `InfiniteSystem.modes` (without the ``self`` parameter). lead_interfaces : sequence of sequences of integers @@ -89,6 +96,10 @@ class FiniteSystem(System, metaclass=abc.ABCMeta): Each sub-sequence contains the indices of the system sites that belong to the lead, and therefore have the same onsite as the lead sites, and are connected by the same hoppings as the lead sites. + parameters : frozenset of strings + The names of the parameters on which the system depends. This does + not include the parameters for any leads. This attribute + is provisional and may be changed in a future version of Kwant Notes ----- -- GitLab