Update aplK.py

This commit is contained in:
calquezar 2024-08-21 13:26:51 +02:00
parent ebff16e347
commit ea2139bc66

View File

@ -790,7 +790,7 @@ class AlgebraAplK(UniqueRepresentation, Parent):
max_dim = dim max_dim = dim
apl = SimplicialAlgebraplN(dim) apl = SimplicialAlgebraplN(dim)
if dim > 0: if dim > 0:
values[k] = ((-1) ** ((dim * (dim-1)) // 2)) * \ values[k] = ((1) ** ((dim * (dim-1)) // 2)) * \
apl.integrand(cochain[k]) apl.integrand(cochain[k])
else: else:
values[k] = apl(cochain[k]) values[k] = apl(cochain[k])
@ -828,7 +828,7 @@ class AlgebraAplK(UniqueRepresentation, Parent):
face_indexes = [simplex.index(i) for i in face] face_indexes = [simplex.index(i) for i in face]
#print("dim: ",n," pol: ",pol," face_idx: ",face_indexes) #print("dim: ",n," pol: ",pol," face_idx: ",face_indexes)
propagation += value * \ propagation += value * \
((-1) ** ((n * (n-1)) // 2)) * factorial(n) * \ ((1) ** ((n * (n-1)) // 2)) * factorial(n) * \
pol.propagate(face_indexes, dim) pol.propagate(face_indexes, dim)
return propagation return propagation
@ -1060,6 +1060,7 @@ class AlgebraAplK(UniqueRepresentation, Parent):
if(self.elements[sFace] != aFace): if(self.elements[sFace] != aFace):
raise ValueError("the assignation is not valid") raise ValueError("the assignation is not valid")
print("Check ok", flush=True) print("Check ok", flush=True)
return True
def differential(self): def differential(self):
""" """
@ -1141,7 +1142,7 @@ class AlgebraAplK(UniqueRepresentation, Parent):
for k in self.elements.keys(): for k in self.elements.keys():
dim = len(k)-1 dim = len(k)-1
# the sign is due to stoke's theorem # the sign is due to stoke's theorem
cochain[k] = ((-1) ** ((dim*(dim-1)) // 2)) * \ cochain[k] = ((1) ** ((dim*(dim-1)) // 2)) * \
self.elements[k].integral() self.elements[k].integral()
return cochain return cochain