Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Minor format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmarco committed Apr 10, 2019
1 parent 14ee741 commit 7b65e36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/sage/algebras/commutative_dga.py
Expand Up @@ -501,7 +501,7 @@ def cohomology(self, n):
H_basis_raw = [H.lift(H.basis()[i]) for i in range(H.dimension())]
A = self.domain()
B = A.basis(n)
H_basis = [sum([c*b for (c, b) in zip(coeffs, B)]) for coeffs in
H_basis = [sum(c*b for (c, b) in zip(coeffs, B)) for coeffs in
H_basis_raw]
# Put brackets around classes.
H_basis_brackets = [CohomologyClass(b) for b in H_basis]
Expand Down Expand Up @@ -790,7 +790,7 @@ def cohomology(self, n, total=False):
H_basis_raw = [H.lift(H.basis()[i]) for i in range(H.dimension())]
A = self.domain()
B = A.basis(n, total)
H_basis = [sum([c*b for (c, b) in zip(coeffs, B)]) for coeffs in H_basis_raw]
H_basis = [sum(c*b for (c, b) in zip(coeffs, B)) for coeffs in H_basis_raw]
# Put brackets around classes.
H_basis_brackets = [CohomologyClass(b) for b in H_basis]
return CombinatorialFreeModule(A.base_ring(), H_basis_brackets)
Expand Down Expand Up @@ -2416,7 +2416,7 @@ def minimal_model(self, i=3, max_iterations=3):
raise ValueError("the degree must be a positive integer")
if max_iterations not in ZZ or max_iterations < 1:
raise ValueError("max_iterations must be a positive integer")
if max_degree in self._minimalmodels.keys():
if max_degree in self._minimalmodels:
return self._minimalmodels[max_degree]
from copy import copy

Expand Down Expand Up @@ -2522,7 +2522,7 @@ def extendy(phi, degree):
phi = extendy(phi, degnzero+1)
self._minimalmodels[degnzero] = phi
else:
degnzero = max(self._minimalmodels.keys())
degnzero = max(self._minimalmodels)
phi = self._minimalmodels[degnzero]

for degree in range(degnzero+1, max_degree+1):
Expand Down Expand Up @@ -2567,7 +2567,7 @@ def cohomology_algebra(self, max_degree=3):
Free module generated by {[e4*e5*e7], [e4*e5*e6]} over Rational Field
"""
cohomgens = self.cohomology_generators(max_degree)
if len(cohomgens) == 0:
if not cohomgens:
raise ValueError("Cohomology ring has no generators")
chgens = []
degrees = []
Expand Down
6 changes: 3 additions & 3 deletions src/sage/rings/polynomial/plural.pyx
Expand Up @@ -2223,9 +2223,9 @@ cdef class NCPolynomial_plural(RingElement):
INPUT:
- ``codomain`` - The parent where the images live
- ``codomain`` -- The parent where the images live
- ``im_gens`` - A list or tuple with the images of the generators of this ring.
- ``im_gens`` -- A list or tuple with the images of the generators of this ring.
EXAMPLES::
Expand All @@ -2246,7 +2246,7 @@ cdef class NCPolynomial_plural(RingElement):
return codomain.zero()
from sage.misc.misc_c import prod
d = self.dict()
return sum(prod(im_gens[i]**t[i] for i in range(len(t)))*codomain(d[t]) for t in d)
return sum(prod(im_gens[i]**val for i, val in enumerate(t))*codomain(d[t]) for t in d)


cdef long _hash_c(self):
Expand Down

0 comments on commit 7b65e36

Please sign in to comment.