Improve documentation of DiscreteSymmetry
I have the impression that the documentation of kwant.physics.DiscreteSymmetry
could be improved.
Is using the method validate
supposed to be the only documented way to use DiscreteSymmetry
instances? I suppose not, because it's used differently in kwant.physics.leads
. Then, the four attributes should be documented.
What about __getitem__
. It seems to me that this has been added so that one can write:
projectors, time_reversal, particle_hole, chiral = discrete_symmetry
. Is this really useful enough to jusitfy that usage? If yes, I think that a cleaner way would be to derive DiscreteSymmetry
from namedtuple
.
A somewhat related question: I note that the code in leads.py
gets the four matrices and then performs many transformations on them. Wouldn't it be possible to abstract some (or most) of this into generally useful methods of DiscreteSymmetry
?