Skip to content

Commit

Permalink
fix ident-add mpo hamil; fix cpx cg
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Aug 28, 2022
1 parent 034c2c7 commit db31dab
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions pyblock2/driver/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,9 +778,7 @@ def expectation(self, bra, mpo, ket, iprint=0):
return ex

def fix_restarting_mps(self, mps):
bw = self.bw
cg = bw.bs.CG(200)
cg.initialize()
cg = self.ghamil.opf.cg
if (
mps.canonical_form[mps.center] == "L"
and mps.center != mps.n_sites - mps.dot
Expand Down
2 changes: 2 additions & 0 deletions src/dmrg/mpo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,7 @@ template <typename S, typename FL> struct AncillaMPO : MPO<S, FL> {
const auto n_sites = MPO<S, FL>::n_sites;
const shared_ptr<OpExpr<S>> i_op =
make_shared<OpElement<S, FL>>(OpNames::I, SiteIndex(), S());
MPO<S, FL>::hamil = mpo->hamil;
MPO<S, FL>::const_e = mpo->const_e;
MPO<S, FL>::op = mpo->op;
MPO<S, FL>::tf = mpo->tf;
Expand Down Expand Up @@ -1453,6 +1454,7 @@ template <typename S, typename FL> struct IdentityAddedMPO : MPO<S, FL> {
using MPO<S, FL>::n_sites;
IdentityAddedMPO(const shared_ptr<MPO<S, FL>> &mpo, const string &tag = "")
: MPO<S, FL>(mpo->n_sites, tag == "" ? mpo->tag : tag) {
MPO<S, FL>::hamil = mpo->hamil;
MPO<S, FL>::const_e = mpo->const_e;
MPO<S, FL>::op = mpo->op;
MPO<S, FL>::tf = mpo->tf;
Expand Down
1 change: 1 addition & 0 deletions src/dmrg/mpo_simplification.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ template <typename S, typename FL> struct SimplifiedMPO : MPO<S, FL> {
if (!collect_terms)
use_intermediate = false;
static shared_ptr<OpExpr<S>> zero = make_shared<OpExpr<S>>();
MPO<S, FL>::hamil = mpo->hamil;
MPO<S, FL>::const_e = mpo->const_e;
MPO<S, FL>::tensors = mpo->tensors;
MPO<S, FL>::basis = mpo->basis;
Expand Down
2 changes: 2 additions & 0 deletions src/dmrg/parallel_mpo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ template <typename S, typename FL> struct ClassicParallelMPO : MPO<S, FL> {
rule->comm->para_type =
rule->comm->para_type ^ ParallelTypes::NewScheme;
shared_ptr<OpExpr<S>> zero = make_shared<OpExpr<S>>();
MPO<S, FL>::hamil = mpo->hamil;
MPO<S, FL>::const_e = mpo->const_e;
MPO<S, FL>::tensors = mpo->tensors;
MPO<S, FL>::basis = mpo->basis;
Expand Down Expand Up @@ -154,6 +155,7 @@ template <typename S, typename FL> struct ParallelMPO : MPO<S, FL> {
// cannot parallelize archived mpo
// one should archive parallelized mpo instead
assert(mpo->archive_filename == "");
MPO<S, FL>::hamil = mpo->hamil;
MPO<S, FL>::const_e = mpo->const_e;
MPO<S, FL>::tensors = mpo->tensors;
if (MPO<S, FL>::tag != mpo->tag)
Expand Down

0 comments on commit db31dab

Please sign in to comment.