27 #ifndef MP_TENSORS_MPO_CONTRACTOR_SS_H
28 #define MP_TENSORS_MPO_CONTRACTOR_SS_H
30 #include <boost/random.hpp>
35 #include "dmrg/optimize/arpackpp_solver.h"
41 template<
class Matrix,
class SymmGroup>
59 #define BEGIN_TIMING(name) \
60 now = boost::chrono::high_resolution_clock::now();
61 #define END_TIMING(name) \
62 then = boost::chrono::high_resolution_clock::now(); \
63 maquis::cout << "Time elapsed in " << name << ": " << boost::chrono::duration<double>(then-now).count() << std::endl;
69 template<
class Matrix,
class SymmGroup,
class Storage>
89 boost::chrono::high_resolution_clock::time_point sweep_now = boost::chrono::high_resolution_clock::now();
91 std::size_t L = mps.length();
93 std::pair<double,double> eps;
95 norm_boudary.
insert_block(Matrix(1, 1, 1), SymmGroup::IdentityCharge, SymmGroup::IdentityCharge);
97 for (
int _site = 0; _site < 2*L; ++_site)
114 t = mpsp[site].normalize_left(DefaultSolver());
115 mpsp[site+1].multiply_from_left(t);
120 }
else if (lr == -1) {
123 t = mpsp[site].normalize_right(DefaultSolver());
124 mpsp[site-1].multiply_from_right(t);
137 norm_boudary.
insert_block(Matrix(1, 1, 1), mps[L-1].col_dim()[0].first, mps[L-1].col_dim()[0].first);
140 if (_site == 2*L-1) {
152 mpsp[0].normalize_right(DefaultSolver());
161 std::size_t L = mps.length();
163 left_.resize(mpo.length()+1);
164 right_.resize(mpo.length()+1);
166 Storage::drop(left_[0]);
167 left_[0] = mps.left_boundary();
168 Storage::evict(left_[0]);
170 for (
int i = 0; i < L; ++i) {
171 Storage::drop(left_[i+1]);
173 Storage::evict(left_[i+1]);
176 Storage::drop(right_[L]);
177 right_[L] = mps.right_boundary();
178 Storage::evict(right_[L]);
180 for(
int i = L-1; i >= 0; --i) {
181 Storage::drop(right_[i]);
183 Storage::evict(right_[i]);
191 std::vector<Boundary<typename storage::constrained<Matrix>::type, SymmGroup> > left_, right_;
MPSTensor< Matrix, SymmGroup > const & ket_tensor
MPOTensor< Matrix, SymmGroup > const & mpo
static block_matrix< OtherMatrix, SymmGroup > overlap_right_step(MPSTensor< Matrix, SymmGroup > const &bra_tensor, MPSTensor< Matrix, SymmGroup > const &ket_tensor, block_matrix< OtherMatrix, SymmGroup > const &right, block_matrix< OtherMatrix, SymmGroup > *localop=NULL)
call IETL Jacobi-Davidson solver
size_type insert_block(Matrix const &, charge, charge)
static Boundary< OtherMatrix, SymmGroup > overlap_mpo_right_step(MPSTensor< Matrix, SymmGroup > const &bra_tensor, MPSTensor< Matrix, SymmGroup > const &ket_tensor, Boundary< OtherMatrix, SymmGroup > const &right, MPOTensor< Matrix, SymmGroup > const &mpo)
SiteProblem(MPSTensor< Matrix, SymmGroup > const &ket_tensor_, Boundary< typename storage::constrained< Matrix >::type, SymmGroup > const &left_, Boundary< typename storage::constrained< Matrix >::type, SymmGroup > const &right_, MPOTensor< Matrix, SymmGroup > const &mpo_)
Boundary< typename storage::constrained< Matrix >::type, SymmGroup > const & left
scalar_type trace() const
static block_matrix< OtherMatrix, SymmGroup > overlap_left_step(MPSTensor< Matrix, SymmGroup > const &bra_tensor, MPSTensor< Matrix, SymmGroup > const &ket_tensor, block_matrix< OtherMatrix, SymmGroup > const &left, block_matrix< OtherMatrix, SymmGroup > *localop=NULL)
block_matrix< Matrix, SymmGroup >::scalar_type trace(block_matrix< Matrix, SymmGroup > const &m)
mpo_contractor_ss(MPS< Matrix, SymmGroup > const &mps_, MPO< Matrix, SymmGroup > const &mpo_, BaseParameters &parms_)
MPS< Matrix, SymmGroup > get_current_mps() const
std::pair< double, double > sweep(int sweep)
static Boundary< OtherMatrix, SymmGroup > overlap_mpo_left_step(MPSTensor< Matrix, SymmGroup > const &bra_tensor, MPSTensor< Matrix, SymmGroup > const &ket_tensor, Boundary< OtherMatrix, SymmGroup > const &left, MPOTensor< Matrix, SymmGroup > const &mpo)
Boundary< typename storage::constrained< Matrix >::type, SymmGroup > const & right
void mult(SiteProblem< Matrix, SymmGroup > const &H, MPSTensor< Matrix, SymmGroup > const &x, MPSTensor< Matrix, SymmGroup > &y)
alps::numeric::real_type< T >::type real(T f)
MPS< Matrix, SymmGroup > get_original_mps() const