from sage.categories.category_types import Category_over_base_ring
from sage.combinat.free_module import CombinatorialFreeModule
-from sage.rings.rational_field import QQ
class Clans(Category_over_base_ring):
r"""
correspond to unital clans).
"""
from mjo.clan.clan_element import ClanElement as Element
+ from sage.rings.rational_field import QQ
def __init__(self,
vector_space,
"""
return self._mt[i][j]
-
-
-class UnitalClan(Clan):
- r"""
- A clan with a unit element.
-
- These correspond to homogeneous convex cones, and vice-versa.
- Not much here except a constructor that ensures we are using
- a ``Unital()`` category.
- """
- def __init__(self,
- vector_space,
- clan_product,
- inner_product,
- scalar_field=QQ,
- category=None,
- prefix=None,
- bracket=False):
-
- category = Clans(scalar_field).or_subcategory(category).Unital()
-
- # Use the vector_space basis keys so we can convert
- # easily between them.
- super().__init__(vector_space,
- clan_product,
- inner_product,
- scalar_field=scalar_field,
- category=category,
- prefix=prefix,
- bracket=bracket)
class ClanElement(IndexedFreeModuleElement):
"""
- An element of a :class:`UnitalClan`.
+ An element of a :class:`Clan`.
"""
def lift(self):
-from mjo.clan.clan import UnitalClan
+from mjo.clan.clan import Clan, Clans
-class NormalDecomposition(UnitalClan):
+class NormalDecomposition(Clan):
r"""
- A unital clan for which a normal decomposition is available.
- This is needed to compute the rank of the cone, and the clan trace
- as defined by Ishi.
+ A clan for which a normal decomposition is available. This is
+ needed to compute the rank of the cone, and the clan trace as
+ defined by Ishi.
+
+ Vinberg says that we can do this for non-unital clans, but then
+ the entire section is devoted to clans with a unit. Rather than
+ try to figure out what parts of that are essential, we assume a
+ unit element too.
"""
from mjo.clan.normal_decomposition_element import (
NormalDecompositionElement as Element
)
- from sage.rings.rational_field import QQ
def __init__(self,
vector_space,
clan_product,
inner_product,
- scalar_field=QQ,
+ scalar_field=None,
category=None,
prefix=None,
bracket=False):
+
+ if scalar_field is None:
+ from sage.rings.rational_field import QQ
+ scalar_field = QQ
+
+ category = Clans(scalar_field).or_subcategory(category).Unital()
+
# The normal decomposition assumes that we already have a
# lower-triangular (Ishi) basis of the form (i,j,k).
self._rank = 1 + max( k[0]
-from sage.rings.rational_field import QQ
-
from mjo.clan.normal_decomposition import NormalDecomposition
[0 0 0]
"""
+ from sage.rings.rational_field import QQ
def __init__(self, n, scalar_field=QQ, **kwargs):
from sage.matrix.matrix_space import MatrixSpace
Mn = MatrixSpace(scalar_field, n)
└─────────┴──────────┴───┘
"""
+ from sage.rings.rational_field import QQ
def __init__(self, n, scalar_field=QQ, **kwargs):
from mjo.hurwitz import ComplexMatrixAlgebra
from sage.rings.qqbar import QQbar
self._S2((1,1,1))*v[(2,2,1)] )
return (M1,M2)
+
+ from sage.rings.rational_field import QQ
def __init__(self, scalar_field=QQ, **kwargs):
from sage.matrix.matrix_space import MatrixSpace
from sage.modules.free_module import VectorSpace