• full name: tenpy.linalg.charges

  • parent module: tenpy.linalg

  • type: module


Inheritance diagram of tenpy.linalg.charges

ChargeInfo([mod, names])

Meta-data about the charge of a tensor.

LegCharge(chargeinfo, slices, charges[, qconj])

Save the charge data associated to a leg of a tensor.

LegPipe(legs[, qconj, sort, bunch])

A LegPipe combines multiple legs of a tensor to one.

Module description

Basic definitions of a charge.

This module contains implementations for handling the quantum numbers (“charges”) of the Array.

In particular, the classes ChargeInfo, LegCharge and LegPipe are implemented here.


The contents of this module are imported in np_conserved, so you usually don’t need to import this module in your application.

A detailed introduction to np_conserved can be found in Charge conservation with np_conserved.

In this module, some functions have the python decorator @use_cython. Functions with this decorator are replaced by the ones written in Cython, implemented in the file tenpy/linalg/_npc_helper.pyx. For further details, see the definition of use_cython().

tenpy.linalg.charges.QTYPE = <class 'numpy.int64'>

Numpy data type for the charges.