#18645: Add some methods to CartanMatrix
-------------------------------------+-------------------------------------
Reporter: jonathan.judge | Owner: jonathan.judge
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.8
Component: combinatorics | Resolution:
Keywords: days65 | Merged in:
Authors: | Reviewers: Ben Salisbury
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jonathan.judge/add_some_methods_to_cartanmatrix|
bb250015dd24f433d84e92b28019b935359fb0a1
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Old description:
> This ticket is to add the following methods to the CartanMatrix class in
> support of ticket #18000: {{{ is_indefinite() }}}, {{{
> is_indecomposable() }}}, {{{ is_hyperbolic() }}}, {{{
> principal_submatrices() }}}.
New description:
This ticket is to add the following methods to the !CartanMatrix class in
support of ticket #18000: {{{is_indefinite()}}},
{{{is_indecomposable()}}}, {{{is_hyperbolic()}}},
{{{principal_submatrices()}}}.
--
Comment (by tscrim):
Some minor things:
- I think this logic
{{{
if compact:
if not subg.is_finite():
return False
else:
if not subg.is_finite() and not subg.is_affine():
return False
}}}
could be rewritten as
{{{
if not ( subg.is_finite() or (compact and subg.is_affine()) ):
return False
}}}
(IMO using `or` reflects the definition better, but feel free to
distribute the `not`).
- I'd change `all([a.det() > 0 for a in self.principal_submatrices()])`
into `all(a.det() > 0 for a in self.principal_submatrices())` as you don't
need to create the intermediary list.
- I'd replace `return comp_num == 0 or comp_num == 1` with `return
comp_num <= 1`.
- The `INPUT:` block contents should not be indented.
- Using Sage's `Set` is somewhat of a heavyhanded approach. So I'd make
this change:
{{{#!diff
- from sage.sets.set import Set
- iset = Set(range(self.ncols()));
- ret = []
- for l in iset.subsets():
+ iset = range(self.ncols())
+ from sage.misc.misc import powerset
+ ret = []
+ for l in powerset(iset):
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/18645#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.