27 #ifndef IETL_JD_SOLVER_H
28 #define IETL_JD_SOLVER_H
34 #include "ietl/jacobi.h"
37 template<
class Matrix,
class SymmGroup>
38 std::pair<double, MPSTensor<Matrix, SymmGroup> >
47 for (
int n = 1; n < ortho_vecs.size(); ++n)
48 for (
int n0 = 0; n0 < n; ++n0)
49 ortho_vecs[n] -=
ietl::dot(ortho_vecs[n0], ortho_vecs[n])/
ietl::dot(ortho_vecs[n0],ortho_vecs[n0])*ortho_vecs[n0];
55 jcd_gmres(sp, vs, params[
"ietl_jcd_gmres"]);
58 jd(sp, vs, ietl::Smallest);
60 double tol = params[
"ietl_jcd_tol"];
61 ietl::basic_iteration<double> iter(params[
"ietl_jcd_maxiter"], tol, tol);
64 for (
int n = 0; n < ortho_vecs.size(); ++n) {
66 maquis::cout <<
"Input <MPS|O[" << n <<
"]> : " <<
ietl::dot(initial, ortho_vecs[n]) << std::endl;
69 std::pair<double, Vector> r0 = jd.calculate_eigenvalue(initial, jcd_gmres, iter);
71 for (
int n = 0; n < ortho_vecs.size(); ++n)
72 maquis::cout <<
"Output <MPS|O[" << n <<
"]> : " <<
ietl::dot(r0.second, ortho_vecs[n]) << std::endl;
74 maquis::cout <<
"JCD used " << iter.iterations() <<
" iterations." << std::endl;
MPSTensor< Matrix, SymmGroup >::scalar_type dot(MPSTensor< Matrix, SymmGroup > const &x, MPSTensor< Matrix, SymmGroup > const &y)
std::pair< double, MPSTensor< Matrix, SymmGroup > > solve_ietl_jcd(SiteProblem< Matrix, SymmGroup > &sp, MPSTensor< Matrix, SymmGroup > const &initial, BaseParameters ¶ms, std::vector< MPSTensor< Matrix, SymmGroup > > ortho_vecs=std::vector< MPSTensor< Matrix, SymmGroup > >())
std::size_t num_elements() const