detect_qtotal¶
full name: tenpy.linalg.np_conserved.detect_qtotal
parent module:
tenpy.linalg.np_conservedtype: function
-
tenpy.linalg.np_conserved.detect_qtotal(flat_array, legcharges, cutoff=None)[source]¶ Returns the total charge (w.r.t legs) of first non-zero sector found in flat_array.
- Parameters
- flat_arrayarray
The flat numpy array from which you want to detect the charges.
- legchargeslist of
LegCharge For each leg the LegCharge.
- cutofffloat
Blocks with
np.max(np.abs(block)) > cutoffare considered as zero. Defaults toQCUTOFF.
- Returns
- qtotalcharge
The total charge fo the first non-zero (i.e. > cutoff) charge block.
See also
detect_legchargedetects the charges of one missing LegCharge if qtotal is known.
detect_grid_outer_legchargesimilar functionality if the flat array is given by a ‘grid’.