ExactDiag¶
full name: tenpy.algorithms.exact_diag.ExactDiag
parent module:
tenpy.algorithms.exact_diag
type: class
Inheritance Diagram
Methods

Initialize self. 
Calculate self.full_H from self.mpo. 

Calculate self.full_H from self.mpo. 


Return 

Wrapper taking directly an MPO instead of a Model. 

Full diagonalization to obtain all eigenvalues and eigenvectors. 

Convert a full state (with a single leg) to an MPS. 

Pick the ground state energy and ground state from 

Allow to use self as LinearOperator for lanczos. 
Contract an MPS along the virtual bonds and combine its legs. 


Call 

class
tenpy.algorithms.exact_diag.
ExactDiag
(model, charge_sector=None, sparse=False, max_size=2000000.0)[source]¶ Bases:
object
(Full) exact diagonalization of the Hamiltonian.
 Parameters
model (
MPOmodel
CouplingModel
) – The model which is to be diagonalized.charge_sector (
None
 charges) – If notNone
, project onto the given charge sector.sparse (bool) – If
True
, don’t sort/bunch the LegPipe used to combine the physical legs. This results in array blocks with just one entry, requires much more charge data, and is not what np_conserved was designed for, so it’s not recommended.max_size (int) – The build_H_* functions will do nothing (but emit a warning) if the total size of the Hamiltonian would be larger than this.

model
¶ The model which is to be diagonalized.
 Type
MPOmodel
CouplingModel

chinfo
¶ The nature of the charge (which is the same for all sites).
 Type

charge_sector
¶ If not
None
, we project onto the given charge sector. Type
None
 charges

max_size
¶ The
build_H_*
functions will do nothing (but emit a warning) if the total size of the Hamiltonian would be larger than this. Type

full_H
¶ The full Hamiltonian to be diagonalized with legs
'(p0.p1....)', '(p0*,p1*...)'
(in that order).None
if thebuild_H_*
functions haven’t been called yet, or if max_size would have been exceeded. Type
Array
None

E
¶ 1D array of eigenvalues.
 Type
ndarray 
None

V
¶ Eigenvectors. First leg ‘ps’ are physical legs, the second leg
'ps*'
corresponds to the eigenvalues. Type
Array
None

_labels_p
¶ The labels use for the physical legs; just
['p0', 'p1', ...., 'p{L1}']
.

_mask
¶ Bool mask, which of the indices of the pipe are in the desired charge_sector.
 Type
1D bool ndarray 
None

classmethod
from_H_mpo
(H_MPO, *args, **kwargs)[source]¶ Wrapper taking directly an MPO instead of a Model.
 Parameters
H_MPO (
MPO
) – The MPO representing the Hamiltonian.*args – Further keyword arguments as for the
__init__
of the class.**kwargs – Further keyword arguments as for the
__init__
of the class.

full_diagonalization
(*args, **kwargs)[source]¶ Full diagonalization to obtain all eigenvalues and eigenvectors.
Arguments are given to
eigh
.

groundstate
(charge_sector=None)[source]¶ Pick the ground state energy and ground state from
self.V
. Parameters
charge_sector (None  1D ndarray) – By default (
None
), consider all charge sectors. Alternatively, give the qtotal which the returned state should have. Returns
E0 (float) – Ground state energy (possibly in the given sector).
psi0 (
Array
) – Ground state (possibly in the given sector).