prefix=None,
bracket=False)
- def rank(self) -> int:
- r"""
- The rank of this clan. Not implemented by default,
- because it is only easy to deduce from a normal decomposition.
- """
- return self._rank
-
def idempotent(self, i):
r"""
Return the i'th idempotent in this clan.
if j == i and k == i
)
+ def one(self):
+ r"""
+ Return the unit element of this clan.
+
+ EXAMPLES::
+
+ sage: C = SnClan(4)
+ sage: I = C.one()
+ sage: I.lift().lift()
+ [1 0 0 0]
+ [0 1 0 0]
+ [0 0 1 0]
+ [0 0 0 1]
+ sage: all( I*b == b and b*I == b for b in C.basis() )
+ True
+
+ """
+ return self.sum_of_monomials(
+ (i,j,k)
+ for (i,j,k) in self.indices()
+ if i == j
+ )
+
+ def rank(self) -> int:
+ r"""
+ The rank of this clan. Only implemented for normal
+ decompositions because we don't know the rank until
+ we know the (number of) idempotents used for the
+ normal decomposition.
+
+ EXAMPLES::
+
+ sage: C = HnClan(2)
+ sage: C.rank()
+ 2
+
+ """
+ return self._rank
class SnClan(NormalDecomposition):
r"""
return f"Clan S^{self.rank()} over {self.base_ring()}"
- def one(self):
- r"""
- Return the unit element of this clan.
-
- EXAMPLES::
-
- sage: C = SnClan(4)
- sage: I = C.one()
- sage: I.lift().lift()
- [1 0 0 0]
- [0 1 0 0]
- [0 0 1 0]
- [0 0 0 1]
- sage: all( I*b == b and b*I == b for b in C.basis() )
- True
-
- """
- return sum( self.basis()[i,i,1] for i in range(self.rank()) )
-
-
def from_matrix(self, x):
r"""
Construct an element of this clan from a symmetric matrix.