From: Michael Orlitzky Date: Mon, 26 Aug 2019 03:31:56 +0000 (-0400) Subject: eja: use izip() instead of zip() in a few places. X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=9528af011cbb4d5e6a38ef972e0d14e7928d5eef;hp=02fe7b401586d6ec76028b576b9c61ff6c65d62d;p=sage.d.git eja: use izip() instead of zip() in a few places. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 53f6151..79ccc79 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -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) diff --git a/mjo/eja/eja_element.py b/mjo/eja/eja_element.py index c90893f..d9b6eb1 100644 --- a/mjo/eja/eja_element.py +++ b/mjo/eja/eja_element.py @@ -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):