]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: use izip() instead of zip() in a few places.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 26 Aug 2019 03:31:56 +0000 (23:31 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 26 Aug 2019 03:31:56 +0000 (23:31 -0400)
mjo/eja/eja_algebra.py
mjo/eja/eja_element.py

index 53f61511ed480a242df760d6a1808d91ce2f4607..79ccc7904830dc739e4af0a532c1bace2a801936 100644 (file)
@@ -5,7 +5,7 @@ are used in optimization, and have some additional nice methods beyond
 what can be supported in a general Jordan Algebra.
 """
 
-from itertools import repeat
+from itertools import izip, repeat
 
 from sage.algebras.quatalg.quaternion_algebra import QuaternionAlgebra
 from sage.categories.magmatic_algebras import MagmaticAlgebras
@@ -938,7 +938,7 @@ class MatrixEuclideanJordanAlgebra(FiniteDimensionalEuclideanJordanAlgebra):
             (_,x,_,_) = J._charpoly_matrix_system()
             p = J._charpoly_coeff(i)
             # p might be missing some vars, have to substitute "optionally"
-            pairs = zip(x.base_ring().gens(), self._basis_normalizers)
+            pairs = izip(x.base_ring().gens(), self._basis_normalizers)
             substitutions = { v: v*c for (v,c) in pairs }
             return p.subs(substitutions)
 
index c90893f1f65e92e4032b3b51d4f66d0fc5592900..d9b6eb12fe27363721763fc1e6ccb60c7f98aabd 100644 (file)
@@ -1,3 +1,5 @@
+from itertools import izip
+
 from sage.matrix.constructor import matrix
 from sage.modules.free_module import VectorSpace
 from sage.modules.with_basis.indexed_element import IndexedFreeModuleElement
@@ -830,7 +832,7 @@ class FiniteDimensionalEuclideanJordanAlgebraElement(IndexedFreeModuleElement):
         """
         B = self.parent().natural_basis()
         W = self.parent().natural_basis_space()
-        return W.linear_combination(zip(B,self.to_vector()))
+        return W.linear_combination(izip(B,self.to_vector()))
 
 
     def norm(self):