From 97d4dcfae8b0c5ab1577da2ba3629e0a4169c789 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 20 Aug 2019 19:30:45 -0400 Subject: [PATCH] eja: don't adjoin sqrt(2) to the field if it's already there. --- mjo/eja/eja_algebra.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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) -- 2.44.2