Ask Your Question

hoyland's profile - activity

2018-04-10 17:30:55 -0500 received badge  Popular Question (source)
2011-02-21 17:59:23 -0500 received badge  Nice Question (source)
2011-02-13 16:03:22 -0500 received badge  Scholar (source)
2011-02-13 16:03:22 -0500 marked best answer Dictating the roots to RootSystem

Currently, there isn't an easy way to specify the choice of simple roots.

If you really want to work with a different set of roots, here's the best way to do it. For the sake of this example, we'll pretend we're working in type A.

1) Create a class MyAmbientSpace which subclasses sage.combinat.root_system.ambient_space.AmbientSpace. The main method you'll need to implement is simple_root(i) which returns the simple root associated with i in the index set. You'll also need implement methods like smallest_base_ring and dimension. See sage.combinat.root_system.type_A for an example.

from sage.combinat.root_system.ambient_space import AmbientSpace
class MyAmbientSpace(AmbientSpace):
    def simple_root(self, i):
        ...
    ...

2) Create a class MyCartanType which is a subclass of the current Cartan type, and set its AmbientSpace attribute to your MyAmbientSpace class:

from sage.combinat.root_system.type_A import CartanType as CartanTypeA
class MyCartanType(CartanTypeA):
    AmbientSpace = MyAmbientSpace

3) Instantiate a root system based on your "new" CartanType:

my_a = MyCartanType(3)
R = RootSystem(my_a)

That root system should now use the simple roots you specified.

2011-02-13 11:32:19 -0500 asked a question Dictating the roots to RootSystem

Is there a way to dictate the choice of roots/simple roots to the RootSystem command?

2010-11-21 19:23:07 -0500 received badge  Student (source)
2010-11-14 07:25:48 -0500 asked a question Can't make subposets

I'm running into a problem trying to construct a subposet.

sage: L #poset of permutations
Finite poset containing 14 elements
sage: L.random_subposet(.5)
Finite poset containing 10 elements
sage: SPG=ShortestPathGraph(L) #constructs a graph that is the Hasse diagram 
                               #of L with some edges deleted
sage: SPG
Digraph on 14 vertices
sage: S=Poset(SPG)
sage: S.random_subposet(.5)

results in an error message ending

AttributeError: 'Permutation_class' object has no attribute 'parent'

I get the same error when I try to construct a specific subposet (what I actually want to do), but I can't create duplicate the error in a small example. random_subposet() works just fine for a small poset created from a digraph whose vertices are permutations. Any ideas what could be going on? (I suspect whatever it is may have to be in ShortestPathGraph, given that I can't duplicate the error with a small digraph, but that doesn't really make sense, so I'd appreciate that sort of answer as well.)