class kwant.lattice.TranslationalSymmetry(*periods)[source]#

Bases: Symmetry

A translational symmetry defined in real space.

An alias exists for this common name: kwant.TranslationalSymmetry.

Group elements of this symmetry are integer tuples of appropriate length.

  • p0 (sequences of real numbers) – The symmetry periods in real space.

  • p1 (sequences of real numbers) – The symmetry periods in real space.

  • p2 (sequences of real numbers) – The symmetry periods in real space.

  • ... (sequences of real numbers) – The symmetry periods in real space.


This symmetry automatically chooses the fundamental domain for each new SiteFamily it encounters. If this site family does not correspond to a Bravais lattice, or if it does not have a commensurate period, an error is produced. A certain flexibility in choice of the fundamental domain can be achieved by calling manually the add_site_family method and providing it the other_vectors parameter.

The fundamental domain for hoppings are all hoppings (a, b) with site a in fundamental domain of sites.


act(element, a, b=None)[source]#

Act with a symmetry group element on a site or hopping.

add_site_family(fam, other_vectors=None)[source]#

Select a fundamental domain for site family and cache associated data.

  • fam (SiteFamily) – the site family which has to be processed. Be sure to delete the previously processed site families from site_family_data if you want to modify the cache.

  • other_vectors (2d array-like of integers) – Bravais lattice vectors used to complement the periods in forming a basis. The fundamental domain consists of all the lattice sites for which the zero coefficients corresponding to the symmetry periods in the basis formed by the symmetry periods and other_vectors. If an insufficient number of other_vectors is provided to form a basis, the missing ones are selected automatically.

  • KeyError – If fam is already stored in site_family_data.

  • ValueError – If lattice fam is incompatible with given periods.


Test whether self has the subgroup other

or, in other words, whether other is a subgroup of self. The reason why this is the abstract method (and not is_subgroup) is that in general it’s not possible for a subgroup to know its supergroups.


Tell whether site lies within the fundamental domain.


Return a reversed copy of the symmetry.

The resulting symmetry has all the period vectors opposite to the original and an identical fundamental domain.


Return the subgroup generated by a sequence of group elements.


*generators (sequence of int) – Each generator must have length self.num_directions.

to_fd(a, b=None)[source]#

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.

Equivalent to self.act(-self.which(a), a, b).


Calculate the domain of the site.

Return the group element whose action on a certain site from the fundamental domain will result in the given site.