• full name: tenpy.models.lattice.get_order_grouped

  • parent module: tenpy.models.lattice

  • type: function

tenpy.models.lattice.get_order_grouped(shape, groups)[source]

Variant of get_order(), grouping some sites of the unit cell.

This function is usefull for lattices with a unit cell of more than 2 sites (e.g. Kagome). For 2D lattices with a unit cell, the ordering goes first within a group , then along y, then the next group (for the same x-value), again along y, and finally along x when all groups are done.

As an example, consider the Kagome lattice.

(Source code, png, hires.png, pdf)



In this doc-string, the word ‘direction’ referst to a physical direction of the lattice or the index u of the unit cell as an “artificial direction”.

  • shape (tuple of int) – The shape of the lattice, i.e., the length in each direction.

  • groups (tuple of tuple of int) – A partition and reordering of range(shape[-1]) into smaller groups. The ordering goes first within a group, then along the last spatial dimensions, then changing between different groups and finally in Cstyle order along the remaining spatial dimensions.


order – An order of the sites for Lattice.order in the specified ordering.

Return type

ndarray (, len(shape))

See also


method in Lattice to obtain the order from parameters.


visualizes the resulting order in a Lattice.