MPOTransferMatrix

  • full name: tenpy.networks.mpo.MPOTransferMatrix

  • parent module: tenpy.networks.mpo

  • type: class

Inheritance Diagram

Inheritance diagram of tenpy.networks.mpo.MPOTransferMatrix

Methods

MPOTransferMatrix.__init__(H, psi[, ...])

MPOTransferMatrix.adjoint()

Return the hermitian conjugate of self

MPOTransferMatrix.dominant_eigenvector(**kwargs)

Find dominant eigenvector of self using scipy.sparse.

MPOTransferMatrix.energy(dom_vec)

Given the dominant eigenvector, calculate the energy per MPS site.

MPOTransferMatrix.find_init_LP_RP(H, psi[, ...])

Find the initial LP and RP.

MPOTransferMatrix.matvec(vec[, project])

One matvec-operation.

MPOTransferMatrix.to_matrix()

Contract self to a matrix.

Class Attributes and Properties

MPOTransferMatrix.acts_on

class tenpy.networks.mpo.MPOTransferMatrix(H, psi, transpose=False, guess=None, _subtraction_gauge='rho')[source]

Bases: NpcLinearOperator

Transfermatrix of a Hamiltonian-like MPO sandwiched between canonicalized MPS.

Given an MPS in canonical form, this class helps to find the correct initial MPO environment on the left or right by diagonalizing the transfer matrix. This is only needed for infinite range Hamiltonians; for finite range you can just use MPOEnvironment.init_first_LP_last_RP() with start_env_sites=H.max_range. This class assumes that H is the sum of local terms such that the transfer matrix has a Jordan Block form when the MPO leg is divided into MPO.IdL, MPO.IdR and the rest.

Parameters:
  • H (MPO) – The MPO sandwiched between psi. Should have ‘IdL’ and ‘IdR’.

  • psi (MPS) – The MPS to project on. Should be given in usual ‘ket’ form; we call conj() on the matrices directly.

  • transpose (bool) – Whether self.matvec acts on RP (False) or LP (True).

  • guess (Array) – Initial guess for the converged environment.

transpose

Whether self.matvec acts on RP (True) or LP (False).

Type:

bool

dtype

Common dtype of H and psi.

IdL, IdR

Indices of the MPO leg between unit cells, where only identities are to the left/right.

Type:

int

_M, _M_conj, _W

Tensors to be contracted into vec in matvec().

Type:

list of Array

guess

Initial guess as npc Array.

Type:

Array

flat_linop

Wrapper to allow calling scipy sparse functions.

Type:

FlatLinearOperator

flat_guess

Initial guess suitable for flat_linop in non-tenpy form.

matvec(vec, project=True)[source]

One matvec-operation.

Parameters:

project (bool) – If True, project away the trace of the “IdL” part (transpose=False) or “IdR” part (transpose=True), respectively, to transform the Jordan-Block structure into something that is translation invariant.

dominant_eigenvector(**kwargs)[source]

Find dominant eigenvector of self using scipy.sparse.

Parameters:

**kwargs – Keyword arguments for eigenvectors().

Returns:

  • val (float) – Eigenvalue for the transfer matrix; should be (very) close to 1.

  • vec – Eigenvector to be used as initial LP/RP for an MPOEnvironment.

adjoint()[source]

Return the hermitian conjugate of self

If self is hermitian, subclasses can choose to implement this to define the adjoint operator of self.

energy(dom_vec)[source]

Given the dominant eigenvector, calculate the energy per MPS site.

Assumes that dominant_vec is the result of dominant_eigenvector().

Returns:

energy – Energy per site of the MPS.

Return type:

float

to_matrix()[source]

Contract self to a matrix.

If self represents an operator with very small shape, e.g. because the MPS bond dimension is very small, an algorithm might choose to contract self to a single tensor.

Returns:

matrix – Contraction of the represented operator.

Return type:

Array

classmethod find_init_LP_RP(H, psi, first=0, last=None, guess_init_env_data=None, calc_E=False, tol_ev0=1e-08, _subtraction_gauge='rho', **kwargs)[source]

Find the initial LP and RP.

Parameters:
  • H – MPO and MPS, see class docstring.

  • psi – MPO and MPS, see class docstring.

  • first (int) – Indices to the left/right of which to extract the environments.

  • last (int) – Indices to the left/right of which to extract the environments.

  • calc_E (bool) – Wether to calculate and return the energy.

  • tol_ev0 (float) – Tolerance to trigger a warning about non-unit eigenvalue.

  • guess (None | dict) – Possible init_env_data with the guess/result of DMRG updates. If some legs are incompatible, trigger a warning and ignore.

  • _subtraction_gauge (string) – How the additive part of the generalized eigenvector is subtracted out. Possible values are ‘rho’ and ‘trace’; see documentation for MPOTransferMatrix for more details.

  • **kwargs – Further keyword arguments for eigenvectors().

Returns:

  • init_env_data (dict) – Dictionary with init_LP and init_RP that can be given to MPOEnvironment.

  • E (float) – Energy per site. Only returned if calc_E is True.

  • eps (float) – The contraction of <LP |SS|RP> for the environment