Skip to content

Commit

Permalink
cc: fix t1-eq
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Feb 21, 2024
1 parent 8058786 commit fbc29da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyblock2/cc/gccsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def px(x):
Z = P("") # zero

def CommT(t, d): # commutator with t (at order d)
return lambda h, i: (1.0 / i) * (h ^ t).expand((d - i) * 4).simplify()
return lambda h, i: (1.0 / i) * (h ^ t).expand((d + 1 - i) * 4).simplify()

def HBar(h, t, d): # exp(-t) h exp(t) (order d)
return sum(itertools.accumulate([h, *range(1, d + 1)], CommT(t, d)), Z)
Expand Down
2 changes: 1 addition & 1 deletion pyblock2/cc/uccsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def px(*xs):
Z = P("") # zero

def CommT(t, d): # commutator with t (at order d)
return lambda h, i: (1.0 / i) * (h ^ t).expand((d - i) * 4).simplify()
return lambda h, i: (1.0 / i) * (h ^ t).expand((d + 1 - i) * 4).simplify()

def HBar(h, t, d): # exp(-t) h exp(t) (order d)
return sum(itertools.accumulate([h, *range(1, d + 1)], CommT(t, d)), Z)
Expand Down

0 comments on commit fbc29da

Please sign in to comment.