# Ticket #4326: trac_4326-root_systems-fix-nt.patch

File trac_4326-root_systems-fix-nt.patch, 9.3 KB (added by nthiery, 10 years ago)

Fix ClassicalWeylSubgroup? and remove unneeded long time, as spotted by Mike

• ## sage/combinat/root_system/weight_lattice_realization.py

```# HG changeset patch
# User Nicolas M. Thiery <nthiery@users.sf.net>
# Date 1258550767 -3600
# Node ID f9ce7c86fc834bc63786785d0c410f1dfe273a2b
# Parent  713d7a6f05ac79bc94458f5b2f5be899c175b4cb
#4326: Root systems: fix ClassicalWeylSubgroup and remove unneeded long time

diff --git a/sage/combinat/root_system/weight_lattice_realization.py b/sage/combinat/root_system/weight_lattice_realization.py```
 a class WeightLatticeRealization(RootLatti The plot returned has a size of one fundamental polygon by default. We can ask plot to give a bigger plot by using the argument size sage: G = RootSystem(['G',2,1]).weight_space().plot(size = [[0..1],[-1..1]]) #long time sage: G = RootSystem(['A',2,1]).weight_space().plot(size = [[-1..1],[-1..1]]) #long time sage: G = RootSystem(['G',2,1]).weight_space().plot(size = [[0..1],[-1..1]]) sage: G = RootSystem(['A',2,1]).weight_space().plot(size = [[-1..1],[-1..1]]) A very important argument is the projection which will draw the plot. There are some usual projections is this method. If you want to draw in the plane a very special Cartan type, Sage will ask you to specify the projection. The projection is a matrix over a ring. In practice, calcul over float is a good way to draw. sage: L = RootSystem(['A',2,1]).weight_space() sage: G = L.plot(projection=matrix(RR, [[0,0.5,-0.5],[0,0.866,0.866]])) #long time sage: G = RootSystem(['C',2,1]).weight_space().plot() #long time sage: G = L.plot(projection=matrix(RR, [[0,0.5,-0.5],[0,0.866,0.866]])) sage: G = RootSystem(['C',2,1]).weight_space().plot() By default, the plot method draw the simple roots, this can be disabled by setting the argument simple_roots=False class WeightLatticeRealization(RootLatti setting the argument fundamental_weights=False sage: G = RootSystem(['A',2]).weight_space().plot(fundamental_weights=False, simple_roots=False) There is in a plot an argument to draw alcoves walks. The good way to do this is There is in a plot an argument to draw alcoves walks. The good way to do this is to use the crystals theory. the plot method contains only the drawing part... sage: L = RootSystem(['A',2,1]).weight_space() sage: G = L.plot(size=[[-1..1],[-1..1]],alcovewalks=[[0,2,0,1,2,1,2,0,2,1]]) # long time sage: G = L.plot(size=[[-1..1],[-1..1]],alcovewalks=[[0,2,0,1,2,1,2,0,2,1]]) """ from sage.plot.plot import Graphics
• ## sage/combinat/root_system/weyl_group.py

`diff --git a/sage/combinat/root_system/weyl_group.py b/sage/combinat/root_system/weyl_group.py`
 a from sage.matrix.constructor import matr from sage.combinat.root_system.root_lattice_realization import RootLatticeRealization from sage.structure.unique_representation import UniqueRepresentation from sage.categories.all import WeylGroups, FiniteWeylGroups, AffineWeylGroups from sage.sets.family import Family def WeylGroup(x): """ def WeylGroup(x): class WeylGroup_gens(ClearCacheOnPickle, UniqueRepresentation, MatrixGroup_gens): def __init__(self, lattice): """ EXAMPLES: sage: G = WeylGroup(['F',4]) sage: G == loads(dumps(G)) True EXAMPLES:: sage: G = WeylGroup(['B',3]) sage: TestSuite(G).run() """ self._lattice = lattice if self.cartan_type().is_affine(): class WeylGroup_gens(ClearCacheOnPickle, else: category = WeylGroups() self._init_category_(category) MatrixGroup_gens.__init__(self, [self.morphism_matrix(s) for s in lattice.simple_reflections()]) self.n = lattice.dimension() # Really needed? # MatrixGroup_gens takes plain matrices as input. So we can't do: #MatrixGroup_gens.__init__(self, list(self.simple_reflections())) MatrixGroup_gens.__init__(self, [self.morphism_matrix(self.lattice().simple_reflection(i)) for i in self.index_set()]) @cached_method def cartan_type(self): class WeylGroup_gens(ClearCacheOnPickle, @cached_method def index_set(self): return self.lattice().index_set() """ Returns the index set of self. EXAMPLES:: sage: G = WeylGroup(['F',4]) sage: G.index_set() [1, 2, 3, 4] sage: G = WeylGroup(['A',3,1]) sage: G.index_set() [0, 1, 2, 3] """ return self.cartan_type().index_set() # Should be implemented in (morphisms of) modules with basis def morphism_matrix(self, f): class ClassicalWeylSubgroup(WeylGroup_ge """ A class for Classical Weyl Subgroup of a Weyl Group EXAMPLES:: sage: G = WeylGroup(["A",3,1]).classical() sage: G Parabolic Subgroup of the Weyl Group of type ['A', 3, 1] (as a matrix group acting on the root space) sage: G.category() Category of finite weyl groups sage: G.cardinality() 24 sage: TestSuite(G).run() TESTS:: sage: from sage.combinat.root_system.weyl_group import ClassicalWeylSubgroup sage: H = ClassicalWeylSubgroup(RootSystem(["A", 3, 1]).root_space()) sage: H is G True Caveat: the interface is likely to change. The current main application is for plots. class ClassicalWeylSubgroup(WeylGroup_ge - Parabolic subrootsystems - Parabolic subgroups with a set of nodes as argument """ def __init__(self, lattice): @cached_method def cartan_type(self): """ EXAMPLES:: sage: from sage.combinat.root_system.weyl_group import ClassicalWeylSubgroup sage: G = ClassicalWeylSubgroup(RootSystem(["A", 3, 1]).root_space()) sage: G == loads(dumps(G)) True sage: WeylGroup(['A',3,1]).classical().cartan_type() ['A', 3] sage: WeylGroup(['A',3,1]).classical().index_set() [1, 2, 3] Note: won't be needed, once the lattice will be a parabolic sub root system """ self._lattice = lattice self.n = lattice.dimension() MatrixGroup_gens.__init__(self, [self.morphism_matrix(lattice.simple_reflections()[s]) for s in range(1,self.n)]) return self.lattice().cartan_type().classical() def simple_reflections(self): """ EXAMPLES:: sage: WeylGroup(['A',2,1]).classical().simple_reflections() Finite family {1: [ 1  0  0] [ 1 -1  1] [ 0  0  1], 2: [ 1  0  0] [ 0  1  0] [ 1  1 -1]} Note: won't be needed, once the lattice will be a parabolic sub root system """ return Family(dict((i, self.from_morphism(self.lattice().simple_reflection(i))) for i in self.index_set())) def __repr__(self): """ class ClassicalWeylSubgroup(WeylGroup_ge sage: RootSystem(['C',4,1]).coweight_lattice().weyl_group().classical() Parabolic Subgroup of the Weyl Group of type ['C', 4, 1]^* (as a matrix group acting on the coweight lattice) """ return "Parabolic Subgroup of the Weyl Group of type %s (as a matrix group acting on the %s)"%(self.cartan_type(), return "Parabolic Subgroup of the Weyl Group of type %s (as a matrix group acting on the %s)"%(self.lattice().cartan_type(), self._lattice._name_string(capitalize=False, base_ring=False, type=False)) class ClassicalWeylSubgroup(WeylGroup_ge Tests some internal invariants EXAMPLES:: sage: WeylGroup(['A', 2, 1]).classical()._test_is_finite() sage: WeylGroup(['B', 3, 1]).classical()._test_is_finite() """ tester = self._tester(**options) assert(self.cartan_type().is_affine()) assert(not self.weyl_group().is_finite()) assert(self.is_finite()) class WeylGroupElement(MatrixGroupElement): """ Class for a Weyl Group elements class WeylGroupElement(MatrixGroupElemen sage: G = WeylGroup(['A',2]) sage: s1 = G.simple_reflection(1) sage: loads(dumps(s1)) [0 1 0] [1 0 0] [0 0 1] sage: TestSuite(s1).run() """ MatrixGroupElement.__init__(self, g, parent) self.__matrix = self._MatrixGroupElement__mat