mps-0.0.0
MatrixProductStatesinC++
 All Data Structures Namespaces Functions Variables Enumerations Enumerator Groups Pages
mps::QuadraticForm< MPO > Class Template Reference

Internal representation of a MPO as a quadratic form. More...

Public Member Functions

const elt_t apply_one_site_matrix (const elt_t &P) const
 Apply the two_site_matrix() onto a tensor representing one site. More...
 
const elt_t apply_two_site_matrix (const elt_t &P12, int sense=+1) const
 Apply the two_site_matrix() onto a tensor representing two sites. More...
 
int here () const
 The site at which the quadratic form is defined. More...
 
index last_site () const
 Last site in the lattice. More...
 
void propagate (const elt_t &braP, const elt_t &ketP, int sense)
 Implement propagate_right (sense>0) or propagate_left (sense<0). More...
 
void propagate_left (const elt_t &braP, const elt_t &ketP)
 Update the form changing the tensors of the bra and ket states. More...
 
void propagate_right (const elt_t &braP, const elt_t &ketP)
 Update the form changing the tensors of the bra and ket states. More...
 
 QuadraticForm (const mpo_t &mpo, const mps_t &bra, const mps_t &ket, int start=0)
 Initialize with the given MPO and bra and ket states. More...
 
const elt_t single_site_matrix () const
 Matrix representation of the quadratic form with respect to site here(). More...
 
index size () const
 Number of sites in the lattice. More...
 
const elt_t take_single_site_matrix_diag () const
 Efficiently take the diagonal part of the single_site_matrix(). More...
 
const elt_t take_two_site_matrix_diag (int sense=+1) const
 Efficiently take the diagonal part of the two_site_matrix(). More...
 
const elt_t two_site_matrix (int sense=+1) const
 Matrix representation of the quadratic form with respect to sites here() and here()+1. More...
 

Detailed Description

template<class MPO>
class mps::QuadraticForm< MPO >

Internal representation of a MPO as a quadratic form.

This object works with a scalar product $$|O|$$, where $O$ is a MPO, and the bra and ked, $$ and $$, are two MPS. This scalar product, from the point of view of the k-th site, it may be seen as a quadratic form $w^{T} {O} v$, where $w$ and $v$ are the elements of the tensors $$[k] and $$[k] of the MPS on that given site.

Definition at line 39 of file qform.h.

Constructor & Destructor Documentation

template<class MPO >
mps::QuadraticForm< MPO >::QuadraticForm ( const mpo_t &  mpo,
const mps_t &  bra,
const mps_t &  ket,
int  start = 0 
)

Initialize with the given MPO and bra and ket states.

This function assumes that we are inspecting site 'start', which may be at the beginning or the end of the chain.

Definition at line 28 of file qform.cc.

Member Function Documentation

template<class MPO >
const QuadraticForm< MPO >::elt_t mps::QuadraticForm< MPO >::apply_one_site_matrix ( const elt_t &  P) const

Apply the two_site_matrix() onto a tensor representing one site.

Definition at line 251 of file qform.cc.

template<class MPO >
const QuadraticForm< MPO >::elt_t mps::QuadraticForm< MPO >::apply_two_site_matrix ( const elt_t &  P12,
int  sense = +1 
) const

Apply the two_site_matrix() onto a tensor representing two sites.

Definition at line 311 of file qform.cc.

template<class MPO>
int mps::QuadraticForm< MPO >::here ( ) const
inline

The site at which the quadratic form is defined.

Definition at line 62 of file qform.h.

template<class MPO>
index mps::QuadraticForm< MPO >::last_site ( ) const
inline

Last site in the lattice.

Definition at line 66 of file qform.h.

template<class MPO >
void mps::QuadraticForm< MPO >::propagate ( const elt_t &  braP,
const elt_t &  ketP,
int  sense 
)

Implement propagate_right (sense>0) or propagate_left (sense<0).

Definition at line 108 of file qform.cc.

template<class MPO >
void mps::QuadraticForm< MPO >::propagate_left ( const elt_t &  braP,
const elt_t &  ketP 
)

Update the form changing the tensors of the bra and ket states.

The function updates the $$ and $$ states in $|O|$ changing the tensor of those states at the site here(), and moving to the next site, here()-1.

Definition at line 114 of file qform.cc.

template<class MPO >
void mps::QuadraticForm< MPO >::propagate_right ( const elt_t &  braP,
const elt_t &  ketP 
)

Update the form changing the tensors of the bra and ket states.

The function updates the $$ and $$ states in $|O|$ changing the tensor of those states at the site here(), and moving to the next site, here()+1.

Definition at line 141 of file qform.cc.

template<class MPO >
const QuadraticForm< MPO >::elt_t mps::QuadraticForm< MPO >::single_site_matrix ( ) const

Matrix representation of the quadratic form with respect to site here().

Definition at line 201 of file qform.cc.

template<class MPO>
index mps::QuadraticForm< MPO >::size ( ) const
inline

Number of sites in the lattice.

Definition at line 64 of file qform.h.

template<class MPO >
const QuadraticForm< MPO >::elt_t mps::QuadraticForm< MPO >::take_single_site_matrix_diag ( ) const

Efficiently take the diagonal part of the single_site_matrix().

Definition at line 281 of file qform.cc.

template<class MPO >
const QuadraticForm< MPO >::elt_t mps::QuadraticForm< MPO >::take_two_site_matrix_diag ( int  sense = +1) const

Efficiently take the diagonal part of the two_site_matrix().

Definition at line 359 of file qform.cc.

template<class MPO >
const QuadraticForm< MPO >::elt_t mps::QuadraticForm< MPO >::two_site_matrix ( int  sense = +1) const

Matrix representation of the quadratic form with respect to sites here() and here()+1.

Definition at line 219 of file qform.cc.