From: Michael Orlitzky Date: Tue, 20 Aug 2019 23:30:45 +0000 (-0400) Subject: eja: don't adjoin sqrt(2) to the field if it's already there. X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=97d4dcfae8b0c5ab1577da2ba3629e0a4169c789;p=sage.d.git eja: don't adjoin sqrt(2) to the field if it's already there. --- diff --git a/mjo/eja/eja_algebra.py b/mjo/eja/eja_algebra.py index 99490b0..f7983c8 100644 --- a/mjo/eja/eja_algebra.py +++ b/mjo/eja/eja_algebra.py @@ -1324,7 +1324,9 @@ class RealSymmetricEJA(FiniteDimensionalEuclideanJordanAlgebra): # algebra needs to be over the field extension. R = PolynomialRing(field, 'z') z = R.gen() - field = NumberField(z**2 - 2, 'sqrt2', embedding=RLF(2).sqrt()) + p = z**2 - 2 + if p.is_irreducible(): + field = NumberField(p, 'sqrt2', embedding=RLF(2).sqrt()) S = _real_symmetric_basis(n, field) Qs = _multiplication_table_from_matrix_basis(S) @@ -1420,7 +1422,10 @@ class ComplexHermitianEJA(FiniteDimensionalEuclideanJordanAlgebra): # algebra needs to be over the field extension. R = PolynomialRing(field, 'z') z = R.gen() - field = NumberField(z**2 - 2, 'sqrt2', embedding=RLF(2).sqrt()) + p = z**2 - 2 + if p.is_irreducible(): + field = NumberField(p, 'sqrt2', embedding=RLF(2).sqrt()) + S = _complex_hermitian_basis(n, field) Qs = _multiplication_table_from_matrix_basis(S)