Skip to content

Commit

Permalink
Update lie_conformal_algebra_with_structure_coefs.py
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton authored Sep 3, 2023
1 parent ccf8400 commit 78b34d2
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None):

myvals = tuple((k, tuple(v.items())) for k, v in vals.items() if v)

if key in sc.keys() and sorted(sc[key]) != sorted(myvals):
if key in sc and sorted(sc[key]) != sorted(myvals):
raise ValueError("two distinct values given for one "
"and the same bracket, skew-symmetry"
"is not satisfied?")
Expand All @@ -182,18 +182,18 @@ def _standardize_s_coeff(s_coeff, index_set, ce, parity=None):
if k+j in v.keys():
for i in v[k+j]:
if (i[0] not in ce) or (
i[0] in ce and i[1] + j == 0):
kth_product[(i[0],i[1]+j)] = \
kth_product.get((i[0], i[1]+j), 0)
kth_product[(i[0],i[1]+j)] += parsgn *\
v[k+j][i]*(-1)**(k+j+1)*binomial(i[1]+j,j)
kth_product = {k:v for k,v in kth_product.items() if v}
i[0] in ce and i[1] + j == 0):
kth_product[(i[0], i[1] + j)] = \
kth_product.get((i[0], i[1] + j), 0)
kth_product[(i[0], i[1] + j)] += parsgn *\
v[k+j][i]*(-1)**(k+j+1)*binomial(i[1]+j,j)
kth_product = {k: v for k, v in kth_product.items() if v}
if kth_product:
vals[k] = kth_product

myvals = tuple((k, tuple(v.items())) for k, v in vals.items() if v)

if key in sc.keys() and sorted(sc[key]) != sorted(myvals):
if key in sc and sorted(sc[key]) != sorted(myvals):
raise ValueError("two distinct values given for one "
"and the same bracket. "
"Skew-symmetry is not satisfied?")
Expand Down

0 comments on commit 78b34d2

Please sign in to comment.