grid_concat¶
full name: tenpy.linalg.np_conserved.grid_concat
parent module:
tenpy.linalg.np_conserved
type: function

tenpy.linalg.np_conserved.
grid_concat
(grid, axes, copy=True)[source]¶ Given an np.array of npc.Arrays, performs a multidimensional concatentation along ‘axes’.
Similar to
numpy.block()
, but only for uniform blocking.Stacks the qind of the array, without sorting/blocking.
 Parameters
Examples
Assume we have rank 2 Arrays
A, B, C, D
of 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)
If
A, B, C, D
were rank 4 arrays, with the first and last leg as before, and sharing common legs1
and2
of dimensions 1, 2, then you would get a rank4 array:>>> g = grid_concat([[A, B], [C, D]], axes=[0, 3]) >>> g.shape (4, 1, 2, 6)
See also
Array.sort_legcharge()
can be used to block by charges.