VMPS++
Loading...
Searching...
No Matches
VumpsTransferMatrixQ.h
Go to the documentation of this file.
1#ifndef VANILLA_VUMPS_TRANSFERMATRIXQ
2#define VANILLA_VUMPS_TRANSFERMATRIXQ
3
5
6template<typename Symmetry, typename Scalar>
8{
10
12 const vector<vector<Biped<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > > &Abra_input,
13 const vector<vector<Biped<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > > &Aket_input,
14 const vector<vector<qarray<Symmetry::Nq> > > &qloc_input,
15 const typename Symmetry::qType& Qtot = Symmetry::qvacuum())
16 :DIR(DIR_input), Abra(Abra_input), Aket(Aket_input), qloc(qloc_input)
17 {
19 }
20
22
24
26 vector<vector<Biped<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > > Abra;
27 vector<vector<Biped<Symmetry,Matrix<Scalar,Dynamic,Dynamic> > > > Aket;
29
30 vector<vector<qarray<Symmetry::Nq> > > qloc;
31};
32
33template<typename Symmetry, typename Scalar1, typename Scalar2>
35{
36 Vout.data.clear();
37 size_t Lcell = H.qloc.size();
38
40
42 {
43 // Calculate T*|Vin>
46 for (int l=Lcell-1; l>=0; --l)
47 {
48 contract_R(R, H.Abra[l], H.Id.W_at(l), H.Aket[l], H.qloc[l], H.Id.opBasis(l), Rnext);
49 R.clear();
50 R = Rnext;
51 Rnext.clear();
52 }
53 TxV = R;
54 }
55 else if (H.DIR == VMPS::DIRECTION::LEFT)
56 {
57 // Calculate <Vin|*T
60 for (size_t l=0; l<Lcell; ++l)
61 {
62 contract_L(L, H.Abra[l], H.Id.W_at(l), H.Aket[l], H.qloc[l], H.Id.opBasis(l), Lnext);
63 L.clear();
64 L = Lnext;
65 Lnext.clear();
66 }
67 TxV = L;
68 }
69 else
70 {
71 assert(1==0 and "Unknown VMPS::DIRECTION::OPTION in TransferMatrixQ!");
72 }
73
74 Vout = MpoTransferVector<Symmetry,Scalar2>(TxV, make_pair(TxV.mid(0),0));
75}
76
77template<typename Symmetry, typename Scalar1, typename Scalar2>
79{
81 HxV(H,Vinout,Vtmp);
82 Vinout = Vtmp;
83}
84
85template<typename Symmetry, typename Scalar>
86inline size_t dim (const TransferMatrixQ<Symmetry,Scalar> &H)
87{
88 return 0;
89}
90
91#endif
size_t dim(const TransferMatrixQ< Symmetry, Scalar > &H)
void HxV(const TransferMatrixQ< Symmetry, Scalar1 > &H, const MpoTransferVector< Symmetry, Scalar2 > &Vin, MpoTransferVector< Symmetry, Scalar2 > &Vout)
const std::vector< std::vector< std::vector< Biped< Symmetry, MatrixType > > > > & W_at(const std::size_t loc) const
Definition: MpoTerms.h:699
const std::vector< std::vector< qType > > & opBasis() const
Definition: MpoTerms.h:710
Definition: Mpo.h:40
Mpo< Symmetry, Scalar > Identity() const
Definition: Mpo.h:130
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={})
Definition: Biped.h:64
Tripod< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > data
void clear()
Definition: Multipede.h:409
qType mid(size_t q) const
Definition: Multipede.h:154
Mpo< Symmetry, Scalar > Id
vector< vector< qarray< Symmetry::Nq > > > qloc
VMPS::DIRECTION::OPTION DIR
vector< vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > > Abra
TransferMatrixQ(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, const typename Symmetry::qType &Qtot=Symmetry::qvacuum())
vector< vector< Biped< Symmetry, Matrix< Scalar, Dynamic, Dynamic > > > > Aket
Definition: qarray.h:26