1#ifndef VANILLA_VUMPS_TRANSFERMATRIX_AA
2#define VANILLA_VUMPS_TRANSFERMATRIX_AA
11template<
typename Symmetry,
typename Scalar>
21 const vector<vector<
Biped<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > > &Abra_input,
22 const vector<vector<
Biped<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > > &Aket_input,
24 bool SHIFTED_input =
false,
32 vector<vector<Biped<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > >
Aket;
33 vector<vector<Biped<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > >
Abra;
40 vector<vector<qarray<Symmetry::Nq> > >
qloc;
48template<
typename Symmetry,
typename Scalar>
54template<
typename Symmetry,
typename Scalar_>
79template<
typename Symmetry,
typename Scalar1,
typename Scalar2>
83 size_t Lcell = H.
qloc.size();
93 for (
int l=Lcell-1; l>=0; --l)
106 for (
size_t l=0; l<Lcell; ++l)
203 H.
TopEigvec.template cast<Matrix<Scalar2,Dynamic,Dynamic> >());
207template<
typename Symmetry,
typename Scalar1,
typename Scalar2>
215template<
typename Symmetry,
typename Scalar>
219 for (
size_t q=0; q<V.
data.
dim; ++q)
226template<
typename Symmetry,
typename Scalar>
232template<
typename Symmetry,
typename Scalar>
238template<
typename Symmetry,
typename Scalar>
244template<
typename Symmetry,
typename Scalar>
253template<
typename Symmetry,
typename Scalar>
257 data.addScale(1.,Vrhs.
data);
261template<
typename Symmetry,
typename Scalar>
265 data.addScale(-1.,Vrhs.
data);
269template<
typename Symmetry,
typename Scalar>
270template<
typename OtherScalar>
274 for (
size_t q=0; q<data.dim; ++q)
276 data.block[q] *= alpha;
281template<
typename Symmetry,
typename Scalar>
282template<
typename OtherScalar>
286 for (
size_t q=0; q<data.dim; ++q)
288 data.block[q] /= alpha;
293template<
typename Symmetry,
typename Scalar,
typename OtherScalar>
299template<
typename Symmetry,
typename Scalar,
typename OtherScalar>
305template<
typename Symmetry,
typename Scalar>
313template<
typename Symmetry,
typename Scalar>
321template<
typename Symmetry,
typename Scalar>
327template<
typename Symmetry,
typename Scalar,
typename OtherScalar>
333template<
typename Symmetry,
typename Scalar>
338 for (
size_t q=0; q<Vout.
data.
dim; ++q)
339 for (
size_t i=0; i<Vout.
data.
block[q].rows(); ++i)
340 for (
size_t j=0; j<Vout.
data.
block[q].cols(); ++j)
342 Vout.
data.
block[q](i,j) = threadSafeRandUniform<Scalar>(-1.,1.);
void normalize(PivotVector< Symmetry, Scalar_ > &V)
size_t dim(const TransferMatrix< Symmetry, Scalar > &H)
double squaredNorm(const TransferVector< Symmetry, Scalar > &V)
void HxV(const TransferMatrix< Symmetry, Scalar1 > &H, const TransferVector< Symmetry, Scalar2 > &Vin, TransferVector< Symmetry, Scalar2 > &Vout)
void addScale(const OtherScalar alpha, const TransferVector< Symmetry, Scalar > &Vin, TransferVector< Symmetry, Scalar > &Vout)
void normalize(TransferVector< Symmetry, Scalar > &V)
void setZero(TransferVector< Symmetry, Scalar > &V)
Scalar dot(const TransferVector< Symmetry, Scalar > &V1, const TransferVector< Symmetry, Scalar > &V2)
TransferVector< Symmetry, Scalar > operator*(const OtherScalar &alpha, TransferVector< Symmetry, Scalar > V)
double norm(const TransferVector< Symmetry, Scalar > &V)
TransferVector< Symmetry, Scalar > operator-(const TransferVector< Symmetry, Scalar > &V1, const TransferVector< Symmetry, Scalar > &V2)
TransferVector< Symmetry, Scalar > operator+(const TransferVector< Symmetry, Scalar > &V1, const TransferVector< Symmetry, Scalar > &V2)
TransferVector< Symmetry, Scalar > operator/(TransferVector< Symmetry, Scalar > V, const OtherScalar &alpha)
void contract_R(const Tripod< Symmetry, MatrixType2 > &Rold, const vector< Biped< Symmetry, MatrixType > > &Abra, const vector< vector< vector< Biped< Symmetry, MpoMatrixType > > > > &W, const vector< Biped< Symmetry, MatrixType > > &Aket, const vector< qarray< Symmetry::Nq > > &qloc, const vector< qarray< Symmetry::Nq > > &qOp, Tripod< Symmetry, MatrixType2 > &Rnew, bool RANDOMIZE=false, tuple< CONTRACT_LR_MODE, size_t > MODE_input=make_pair(FULL, 0), const std::unordered_map< pair< qarray< Symmetry::Nq >, size_t >, size_t > &basis_order_map={})
void contract_L(const Tripod< Symmetry, MatrixType2 > &Lold, const vector< Biped< Symmetry, MatrixType > > &Abra, const vector< vector< vector< Biped< Symmetry, MpoMatrixType > > > > &W, const vector< Biped< Symmetry, MatrixType > > &Aket, const vector< qarray< Symmetry::Nq > > &qloc, const vector< qarray< Symmetry::Nq > > &qOp, Tripod< Symmetry, MatrixType2 > &Lnew, bool RANDOMIZE=false, tuple< CONTRACT_LR_MODE, size_t > MODE_input=make_pair(FULL, 0), const std::unordered_map< pair< qarray< Symmetry::Nq >, size_t >, size_t > &basis_order_map={})
Biped< Symmetry, MatrixType_ > adjoint() const
std::vector< MatrixType_ > block
void addScale(const Scalar &factor, const Biped< Symmetry, MatrixType_ > &Mrhs, BLOCK_POSITION BP=SAME_PLACE)
Biped< Symmetry, MatrixType_ > contract(const Biped< Symmetry, MatrixType_ > &A, const contract::MODE MODE=contract::MODE::UNITY) const
static void fill(size_t N, TransferVector< Symmetry, Scalar > &Vout)
vector< vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > > Abra
qarray< Symmetry::Nq > Qtot
vector< vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > > Aket
TransferMatrix(VMPS::DIRECTION::OPTION DIR_input)
VMPS::DIRECTION::OPTION DIR
bool PROJECT_OUT_TOPEIGVEC
vector< vector< qarray< Symmetry::Nq > > > qloc
TransferMatrix(VMPS::DIRECTION::OPTION DIR_input, const vector< vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > > &Abra_input, const vector< vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > > &Aket_input, const vector< vector< qarray< Symmetry::Nq > > > &qloc_input, bool SHIFTED_input=false, qarray< Symmetry::Nq > Qtot_input=Symmetry::qvacuum())
Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > LReigen
Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > TopEigvec
Biped< Symmetry, Matrix< Scalar_, Dynamic, Dynamic > > & operator()(size_t i)
TransferVector(const Biped< Symmetry, Matrix< Scalar_, Dynamic, Dynamic > > &data_input)
TransferVector< Symmetry, Scalar_ > & operator-=(const TransferVector< Symmetry, Scalar_ > &Vrhs)
TransferVector< Symmetry, Scalar_ > & operator*=(const OtherScalar &alpha)
Biped< Symmetry, Matrix< Scalar_, Dynamic, Dynamic > > data
Biped< Symmetry, Matrix< Scalar_, Dynamic, Dynamic > > & operator[](size_t i)
TransferVector< Symmetry, Scalar_ > & operator/=(const OtherScalar &alpha)
TransferVector< Symmetry, Scalar_ > & operator+=(const TransferVector< Symmetry, Scalar_ > &Vrhs)