From d16afb8e2be4c1add9f7b60958770e44215d5252 Mon Sep 17 00:00:00 2001 From: Christoph Groth <christoph.groth@cea.fr> Date: Tue, 11 Apr 2017 18:36:09 +0200 Subject: [PATCH] clarify to_fd() --- kwant/builder.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kwant/builder.py b/kwant/builder.py index 777cbe1f..751e801e 100644 --- a/kwant/builder.py +++ b/kwant/builder.py @@ -282,6 +282,11 @@ class Symmetry(metaclass=abc.ABCMeta): is used together with sites whose site family is not compatible with it. A typical example of this is when the vector defining a translational symmetry is not a lattice vector. + + The type of the domain objects as handled by the methods of this class is + not specified. The only requirement is that it must support the unary + minus operation. The reference implementation of `to_fd()` is hence + `self.act(-self.which(a), a, b)`. """ @abc.abstractproperty @@ -306,12 +311,11 @@ class Symmetry(metaclass=abc.ABCMeta): def to_fd(self, a, b=None): """Map a site or hopping to the fundamental domain. - If ``b`` is None, return a site equivalent to ``a`` within the fundamental - domain. Otherwise, return a hopping equivalent to ``(a, b)`` but where - the first element belongs to the fundamental domain. - - This default implementation works but may be not efficient. + If ``b`` is None, return a site equivalent to ``a`` within the + fundamental domain. Otherwise, return a hopping equivalent to ``(a, + b)`` but where the first element belongs to the fundamental domain. + Equivalent to `self.act(-self.which(a), a, b)`. """ return self.act(-self.which(a), a, b) -- GitLab