# get_order_grouped¶

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

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

In this function, the word ‘direction’ referst to a physical direction of the lattice or the index u of the unit cell as an “artificial direction”. This function is usefull for lattices with a unit cell of more than 2 sites (e.g. Kagome). The argument group is a To explain the order, assume we have a 3-site unit cell in a 2D lattice with shape (Lx, Ly, Lu). Calling this function with groups=((1,), (2, 0)) returns an order of the following form:

# columns: [x, y, u]
[0, 0, 1]  # first for u = 1 along y
[0, 1, 1]
:
[0, Ly-1, 1]
[0, 0, 2]  # then for u = 2 and 0
[0, 0, 0]
[0, 1, 2]
[0, 1, 0]
:
[0, Ly-1, 2]
[0, Ly-1, 0]
# and then repeat the above for increasing x.

Parameters
• 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.

Returns

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

Return type

ndarray (np.prod(shape), len(shape))

Lattice.ordering()
method in Lattice to obtain the order from parameters.
Lattice.plot_order()
visualizes the resulting order in a Lattice.