get_order

tenpy.models.lattice.get_order(shape, snake_winding, priority=None)[source]

Built the Lattice.order in (Snake-) C-Style for a given lattice shape.

Note

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

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

  • snake_winding (tuple of bool) – For each direction one bool, whether we should wind as a “snake” (True) in that direction (i.e., going forth and back) or simply repeat ascending (False)

  • priority (None | tuple of float) – If None (default), use C-Style ordering. Otherwise, this defines the priority along which direction to wind first; the direction with the highest priority increases fastest. For example, “C-Style” order is enforced by priority=(0, 1, 2, ...), and Fortran F-style order is enforced by priority=(dim, dim-1, ..., 1, 0)

  • group (None | tuple of tuple) – If None (default), ignore it. Otherwise, it specifies that we group the fastest changing dimension

Returns:

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

Return type:

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

See also

Lattice.ordering

method in Lattice to obtain the order from parameters.

Lattice.plot_order

visualizes the resulting order in a Lattice.

get_order_grouped

a variant grouping sites of the unit cell.