np_conserved
full name: tenpy.linalg.np_conserved
parent module:
tenpy.linalg
type: module
Classes
|
A multidimensional array (=tensor) for using charge conservation. |
Functions
|
Stack arrays along a given axis, similar as np.concatenate. |
|
Derive a LegCharge for a grid used for |
|
Calculate a missing LegCharge by looking for nonzero entries of a flat array. |
|
Returns the total charge (w.r.t legs) of the sector with largest entry in flat_array. |
|
Returns a square, diagonal matrix of entries s. |
|
Calculate eigenvalues and eigenvectors for a non-hermitian matrix. |
|
Calculate eigenvalues and eigenvectors for a hermitian matrix. |
|
Calculate eigenvalues for a hermitian matrix. |
|
Calculate eigenvalues for a hermitian matrix. |
|
Use scipy.linalg.expm to calculate the matrix exponential of a square matrix. |
|
Return an identity matrix contractible with the leg axis of the |
|
Given an np.array of npc.Arrays, performs a multi-dimensional concatenation along 'axes'. |
|
Given an np.array of npc.Arrays, return the corresponding higher-dimensional Array. |
|
Contract all legs in a and b, return scalar. |
|
Norm of flattened data. |
|
Short-hand for |
|
Find orthogonal columns for a given matrix. |
|
Forms the outer tensor product, equivalent to |
|
Compute the (Moore-Penrose) pseudo-inverse of a matrix. |
|
Polar decomposition of an Array a. |
|
Q-R decomposition of a matrix. |
|
Sparse eigenvalue decomposition |
|
Singular value decomposition of an Array a. |
|
Similar as |
|
Similar as |
|
Trace of a, summing over leg1 and leg2. |
|
Create a npc array full of zeros (with no _data). |
Module description
A module to handle charge conservation in tensor networks.
A detailed introduction to this module (including notations) can be found in Charge conservation with np_conserved.
This module np_conserved implements a class Array
designed to make use of charge conservation in tensor networks.
The idea is that the Array class is used in a fashion very similar to
the numpy.ndarray
, e.g you can call the functions tensordot()
or svd()
(of this module) on them.
The structure of the algorithms (as DMRG) is thus the same as with basic numpy ndarrays.
Internally, an Array
saves charge meta data to keep track of blocks which are nonzero.
All possible operations (e.g. tensordot, svd, …) on such arrays preserve the total charge
structure. In addition, these operations make use of the charges to figure out which of the blocks
it has to use/combine - this is the basis for the speed-up.
- tenpy.linalg.np_conserved.QCUTOFF = np.float64(2.220446049250313e-15)
A cutoff to ignore machine precision rounding errors when determining charges
- tenpy.linalg.np_conserved.QTYPE = <class 'numpy.int64'>
the type used for charges
Overview
Classes
|
A multidimensional array (=tensor) for using charge conservation. |
|
Meta-data about the charge of a tensor. |
|
Save the charge data associated to a leg of a tensor. |
|
A LegPipe combines multiple legs of a tensor to one. |
Array creation
|
convert a flat numpy ndarray to an Array with trivial charge conservation. |
|
convert a flat (numpy) ndarray to an Array. |
|
Create an Array from a numpy func. |
|
Create an Array from a (numpy) function. |
|
Create a npc array full of zeros (with no _data). |
|
Return an identity matrix contractible with the leg axis of the |
|
Returns a square, diagonal matrix of entries s. |
Concatenation
|
Stack arrays along a given axis, similar as np.concatenate. |
|
Given an np.array of npc.Arrays, performs a multi-dimensional concatenation along 'axes'. |
|
Given an np.array of npc.Arrays, return the corresponding higher-dimensional Array. |
Detecting charges of flat arrays
|
Returns the total charge (w.r.t legs) of the sector with largest entry in flat_array. |
|
Calculate a missing LegCharge by looking for nonzero entries of a flat array. |
|
Derive a LegCharge for a grid used for |
Contraction of some legs
|
Similar as |
|
Forms the outer tensor product, equivalent to |
|
Contract all legs in a and b, return scalar. |
|
Trace of a, summing over leg1 and leg2. |
Linear algebra
|
Singular value decomposition of an Array a. |
|
Compute the (Moore-Penrose) pseudo-inverse of a matrix. |
|
Norm of flattened data. |
|
Q-R decomposition of a matrix. |
|
Use scipy.linalg.expm to calculate the matrix exponential of a square matrix. |
Eigen systems
|
Calculate eigenvalues and eigenvectors for a hermitian matrix. |
|
Calculate eigenvalues and eigenvectors for a non-hermitian matrix. |
|
Calculate eigenvalues for a hermitian matrix. |
|
Calculate eigenvalues for a hermitian matrix. |
|
Sparse eigenvalue decomposition |