detect_grid_outer_legcharge

tenpy.linalg.np_conserved.detect_grid_outer_legcharge(grid, grid_legs, qtotal=None, qconj=1, bunch=False)[source]

Derive a LegCharge for a grid used for grid_outer().

Note: The resulting LegCharge is not bunched.

Parameters
gridarray_like of {Array | None}

The grid as it will be given to grid_outer().

grid_legslist of {LegCharge | None}

One LegCharge for each dimension of the grid, except for one entry which is None. This missing entry is to be calculated.

qtotalcharge

The desired total charge of the array. Defaults to 0.

Returns
new_grid_legslist of LegCharge

A copy of the given grid_legs with the None replaced by a compatible LegCharge. The new LegCharge is neither bunched nor sorted!

See also

detect_legcharge

similar functionality for a flat numpy array instead of a grid.