]> gitweb.michael.orlitzky.com - sage.d.git/blobdiff - mjo/eja/eja_algebra.py
eja: add a test for the symmetry of the _real_symmetric_basis().
[sage.d.git] / mjo / eja / eja_algebra.py
index 9b028809c6ca46efd13d974fd99b176d1761754e..204a537df12d2ab4d3d27764c20c830ec324a68a 100644 (file)
@@ -797,9 +797,22 @@ def random_eja():
 
 
 
-def _real_symmetric_basis(n, field=QQ):
+def _real_symmetric_basis(n, field):
     """
     Return a basis for the space of real symmetric n-by-n matrices.
+
+    SETUP::
+
+        sage: from mjo.eja.eja_algebra import _real_symmetric_basis
+
+    TESTS::
+
+        sage: set_random_seed()
+        sage: n = ZZ.random_element(1,5)
+        sage: B = _real_symmetric_basis(n, QQbar)
+        sage: all( M.is_symmetric() for M in  B)
+        True
+
     """
     # The basis of symmetric matrices, as matrices, in their R^(n-by-n)
     # coordinates.
@@ -816,7 +829,7 @@ def _real_symmetric_basis(n, field=QQ):
     return tuple(S)
 
 
-def _complex_hermitian_basis(n, field=QQ):
+def _complex_hermitian_basis(n, field):
     """
     Returns a basis for the space of complex Hermitian n-by-n matrices.
 
@@ -857,7 +870,7 @@ def _complex_hermitian_basis(n, field=QQ):
     return tuple(S)
 
 
-def _quaternion_hermitian_basis(n, field=QQ):
+def _quaternion_hermitian_basis(n, field):
     """
     Returns a basis for the space of quaternion Hermitian n-by-n matrices.
 
@@ -1237,7 +1250,7 @@ class RealSymmetricEJA(FiniteDimensionalEuclideanJordanAlgebra):
 
     """
     def __init__(self, n, field=QQ, **kwargs):
-        S = _real_symmetric_basis(n, field=field)
+        S = _real_symmetric_basis(n, field)
         Qs = _multiplication_table_from_matrix_basis(S)
 
         fdeja = super(RealSymmetricEJA, self)
@@ -1306,7 +1319,7 @@ class ComplexHermitianEJA(FiniteDimensionalEuclideanJordanAlgebra):
 
     """
     def __init__(self, n, field=QQ, **kwargs):
-        S = _complex_hermitian_basis(n)
+        S = _complex_hermitian_basis(n, field)
         Qs = _multiplication_table_from_matrix_basis(S)
 
         fdeja = super(ComplexHermitianEJA, self)
@@ -1383,7 +1396,7 @@ class QuaternionHermitianEJA(FiniteDimensionalEuclideanJordanAlgebra):
 
     """
     def __init__(self, n, field=QQ, **kwargs):
-        S = _quaternion_hermitian_basis(n)
+        S = _quaternion_hermitian_basis(n, field)
         Qs = _multiplication_table_from_matrix_basis(S)
 
         fdeja = super(QuaternionHermitianEJA, self)