]> gitweb.michael.orlitzky.com - sage.d.git/commitdiff
mjo/clan: fix propagation of scalar fields
authorMichael Orlitzky <michael@orlitzky.com>
Wed, 4 Mar 2026 14:09:10 +0000 (09:09 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Wed, 4 Mar 2026 14:09:10 +0000 (09:09 -0500)
Non-default fields were getting lost in __init__. Now there are tests.

mjo/clan/jordan_spin_clan.py
mjo/clan/t_algebra_clan.py
mjo/clan/trivial_clan.py
mjo/clan/vinberg_clan.py

index 54fc6238f92b7fb4ad16f7a30e71ff304e6d1780..ee0991c5b0b027910ce4673d7d6dbe88d1b43595 100644 (file)
@@ -90,6 +90,12 @@ class JordanSpinClan(NormalDecomposition):
         ....:      if i not in [j,k] )
         True
 
+    At least on a superficial level, it is possible to use non-default
+    fields::
+
+        sage: JordanSpinClan(3, scalar_field=AA)
+        Jordan spin clan of dimension 3 over Algebraic Real Field
+
     """
     from sage.rings.rational_field import QQ
     def __init__(self, n, scalar_field=QQ, **kwargs):
@@ -146,7 +152,7 @@ class JordanSpinClan(NormalDecomposition):
             p = cp(x,y) / two
             return sum( p[idx] for idx in indices if idx[0] == idx[1] )
 
-        super().__init__(RN, cp, ip, **kwargs)
+        super().__init__(RN, cp, ip, scalar_field=scalar_field, **kwargs)
 
 
     def __repr__(self) -> str:
index 24c9d25a4900eb1d489ae598b55c0e1889781389..e688c12ba2e61762caecfc211447f057ac19cd56 100644 (file)
@@ -233,6 +233,14 @@ class RealSymmetricClan(TAlgebraClan):
         [2 3 0]
         [0 0 0]
 
+    TESTS:
+
+    At least on a superficial level, it is possible to use non-default
+    fields::
+
+        sage: RealSymmetricClan(2, scalar_field=AA)
+        Clan S^2 over Algebraic Real Field
+
     """
     from sage.rings.rational_field import QQ
     def __init__(self, n, scalar_field=QQ, **kwargs):
@@ -255,7 +263,11 @@ class RealSymmetricClan(TAlgebraClan):
                                 support_order=b.keys(),
                                 ambient=Mn)
 
-        super().__init__(Sn, TAlgebraClan._cp, TAlgebraClan._ip, **kwargs)
+        super().__init__(Sn,
+                         TAlgebraClan._cp,
+                         TAlgebraClan._ip,
+                         scalar_field=scalar_field,
+                         **kwargs)
 
 
     def __repr__(self) -> str:
@@ -343,6 +355,14 @@ class ComplexHermitianClan(TAlgebraClan):
         │ 0       │ 0        │ 0 │
         └─────────┴──────────┴───┘
 
+    TESTS:
+
+    At least on a superficial level, it is possible to use non-default
+    fields::
+
+        sage: ComplexHermitianClan(2, scalar_field=AA)
+        Clan H^2 over Algebraic Real Field
+
     """
     from sage.rings.rational_field import QQ
     def __init__(self, n, scalar_field=QQ, **kwargs):
@@ -367,7 +387,11 @@ class ComplexHermitianClan(TAlgebraClan):
                                 support_order=b.keys(),
                                 ambient=Mn)
 
-        super().__init__(Hn, TAlgebraClan._cp, TAlgebraClan._ip, **kwargs)
+        super().__init__(Hn,
+                         TAlgebraClan._cp,
+                         TAlgebraClan._ip,
+                         scalar_field=scalar_field,
+                         **kwargs)
 
 
     def __repr__(self) -> str:
index 41b5e32b2d8f7af36ecadf82b57b1955a2d898ca..4c849f85907f339e581375ac8f160e82d1764cc3 100644 (file)
@@ -56,6 +56,14 @@ class TrivialClan(NormalDecomposition):
         ....:      if i not in [j,k] )
         True
 
+    TESTS:
+
+    At least on a superficial level, it is possible to use non-default
+    fields::
+
+        sage: TrivialClan(scalar_field=AA)
+        Trivial clan over Algebraic Real Field
+
     """
     from sage.rings.rational_field import QQ
     def __init__(self, scalar_field=QQ, **kwargs):
@@ -68,7 +76,7 @@ class TrivialClan(NormalDecomposition):
         def ip(x,y):
             return scalar_field.zero()
 
-        super().__init__(R0, cp, ip, **kwargs)
+        super().__init__(R0, cp, ip, scalar_field=scalar_field, **kwargs)
 
 
     def __repr__(self) -> str:
index 0650535f879f101799b65eddf2b3984319eaa973..86ab8a83d5dee5415498f205f514f23692405e91 100644 (file)
@@ -124,6 +124,14 @@ class VinbergClan(NormalDecomposition):
         sage: actual == expected
         True
 
+    TESTS:
+
+    At least on a superficial level, it is possible to use non-default
+    fields::
+
+        sage: VinbergClan(scalar_field=AA)
+        Vinberg clan over Algebraic Real Field
+
     """
     def _unlift(self, pair):
         A,B = pair
@@ -211,7 +219,7 @@ class VinbergClan(NormalDecomposition):
                         for idx in p.monomial_coefficients()
                         if idx[0] == idx[1] )
 
-        super().__init__(R5, cp, ip, **kwargs)
+        super().__init__(R5, cp, ip, scalar_field=scalar_field, **kwargs)
 
     def __repr__(self) -> str:
         r"""