full name: tenpy.linalg.np_conserved.grid_concat
grid_concat(grid, axes, copy=True)¶
Given an np.array of npc.Arrays, performs a multi-dimensional concatentation along ‘axes’.
numpy.block(), but only for uniform blocking.
Stacks the qind of the array, without sorting/blocking.
Assume we have rank 2 Arrays
A, B, C, Dof shapes
(1, 2), (1, 4), (3, 2), (3, 4)sharing the legs of equal sizes. Then the following grid will result in a
(1+3, 2+4)shaped array:
>>> g = grid_concat([[A, B], [C, D]], axes=[0, 1]) >>> g.shape (4, 6)
A, B, C, Dwere rank 4 arrays, with the first and last leg as before, and sharing common legs
2of dimensions 1, 2, then you would get a rank-4 array:
>>> g = grid_concat([[A, B], [C, D]], axes=[0, 3]) >>> g.shape (4, 1, 2, 6)
can be used to block by charges.