Skip to content

Commit

Permalink
Merge pull request #367 from emstoudenmire/localop_bugfix
Browse files Browse the repository at this point in the history
localop bugfix
  • Loading branch information
emstoudenmire committed Oct 12, 2020
2 parents 7af4030 + 51f4a5b commit 5d36dbe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion itensor/mps/localop.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ LocalOp(const ITensor& Op1,
R_(nullptr),
size_(-1)
{
nc_ = args.getInt("NumCenter",2);
nc_ = args.getInt("NumCenter",1);
if(nc_ == 1)
update(Op1,L,R);
else
Expand Down
3 changes: 2 additions & 1 deletion itensor/mps/mps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1260,7 +1260,7 @@ template <typename MPSType>
IndexSet
linkInds(MPSType const& x, int i)
{
if( i == 1 ) return IndexSet(rightLinkIndex(x,i));
if(i == 1) return IndexSet(rightLinkIndex(x,i));
else if( i == length(x) ) return IndexSet(leftLinkIndex(x,i));
return IndexSet(leftLinkIndex(x,i),rightLinkIndex(x,i));
}
Expand All @@ -1276,6 +1276,7 @@ linkInds(MPSType const& x)
for( auto n : range1(N-1) )
{
auto s = linkIndex(x,n);
if(!s) Error("MPS or MPO has missing/null link index");
inds.nextIndex(std::move(s));
}
return inds.build();
Expand Down

0 comments on commit 5d36dbe

Please sign in to comment.