]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: don't adjoin sqrt(2) to the field if it's already there.
authorMichael Orlitzky <michael@orlitzky.com>
Tue, 20 Aug 2019 23:30:45 +0000 (19:30 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Tue, 20 Aug 2019 23:30:45 +0000 (19:30 -0400)
mjo/eja/eja_algebra.py

index 99490b0e0aecee54c1ff14314c2060e1d9e553ab..f7983c857d8fdceffac3dbdfeaa6bf70fd7e811e 100644 (file)
@@ -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)