]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
eja: require the rank argument for an EJA, because we can't compute it.
authorMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 04:11:08 +0000 (00:11 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Mon, 29 Jul 2019 04:11:08 +0000 (00:11 -0400)
mjo/eja/eja_algebra.py

index ec58b57e8d78b004bcdc0ffaa83fc773c3cfffa8..cd39704407deda564f857677a3439bb382f2bcb7 100644 (file)
@@ -32,10 +32,10 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
     def __classcall_private__(cls,
                               field,
                               mult_table,
+                              rank,
                               names='e',
                               assume_associative=False,
                               category=None,
-                              rank=None,
                               natural_basis=None):
         n = len(mult_table)
         mult_table = [b.base_extend(field) for b in mult_table]
@@ -56,20 +56,20 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
         return fda.__classcall__(cls,
                                  field,
                                  mult_table,
+                                 rank=rank,
                                  assume_associative=assume_associative,
                                  names=names,
                                  category=cat,
-                                 rank=rank,
                                  natural_basis=natural_basis)
 
 
     def __init__(self,
                  field,
                  mult_table,
+                 rank,
                  names='e',
                  assume_associative=False,
                  category=None,
-                 rank=None,
                  natural_basis=None):
         """
         SETUP::
@@ -386,11 +386,61 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
     def rank(self):
         """
         Return the rank of this EJA.
+
+        ALGORITHM:
+
+        The author knows of no algorithm to compute the rank of an EJA
+        where only the multiplication table is known. In lieu of one, we
+        require the rank to be specified when the algebra is created,
+        and simply pass along that number here.
+
+        SETUP::
+
+            sage: from mjo.eja.eja_algebra import (JordanSpinEJA,
+            ....:                                  RealSymmetricEJA,
+            ....:                                  ComplexHermitianEJA,
+            ....:                                  QuaternionHermitianEJA,
+            ....:                                  random_eja)
+
+        EXAMPLES:
+
+        The rank of the Jordan spin algebra is always two::
+
+            sage: JordanSpinEJA(2).rank()
+            2
+            sage: JordanSpinEJA(3).rank()
+            2
+            sage: JordanSpinEJA(4).rank()
+            2
+
+        The rank of the `n`-by-`n` Hermitian real, complex, or
+        quaternion matrices is `n`::
+
+            sage: RealSymmetricEJA(2).rank()
+            2
+            sage: ComplexHermitianEJA(2).rank()
+            2
+            sage: QuaternionHermitianEJA(2).rank()
+            2
+            sage: RealSymmetricEJA(5).rank()
+            5
+            sage: ComplexHermitianEJA(5).rank()
+            5
+            sage: QuaternionHermitianEJA(5).rank()
+            5
+
+        TESTS:
+
+        Ensure that every EJA that we know how to construct has a
+        positive integer rank::
+
+            sage: set_random_seed()
+            sage: r = random_eja().rank()
+            sage: r in ZZ and r > 0
+            True
+
         """
-        if self._rank is None:
-            raise ValueError("no rank specified at genesis")
-        else:
-            return self._rank
+        return self._rank
 
 
     def vector_space(self):
@@ -1414,7 +1464,17 @@ class FiniteDimensionalEuclideanJordanAlgebra(FiniteDimensionalAlgebra):
             # are power-associative.
             #
             # TODO: choose generator names intelligently.
-            return FiniteDimensionalEuclideanJordanAlgebra(F, mats, assume_associative=True, names='f')
+            #
+            # The rank is the highest possible degree of a minimal polynomial,
+            # and is bounded above by the dimension. We know in this case that
+            # there's an element whose minimal polynomial has the same degree
+            # as the space's dimension, so that must be its rank too.
+            return FiniteDimensionalEuclideanJordanAlgebra(
+                     F,
+                     mats,
+                     V.dimension(),
+                     assume_associative=True,
+                     names='f')
 
 
         def subalgebra_idempotent(self):