Ask Your Question

nborie's profile - activity

2019-01-29 19:37:36 -0500 received badge  Notable Question (source)
2019-01-29 19:37:36 -0500 received badge  Popular Question (source)
2015-09-21 04:54:26 -0500 received badge  Autobiographer
2015-09-18 17:09:25 -0500 received badge  Student (source)
2015-09-18 13:23:11 -0500 commented question how to set latex options on graph to make them ultra small ?

I just upload an example here Precisely, I need to decrease the size of nodes. If I only decrease the scale, it produces some overlaps of the nodes.

2015-09-18 12:06:18 -0500 asked a question how to set latex options on graph to make them ultra small ?

I am currently playing with functions indexed by unlabeled graphs. The following method (belonging to my parent class which models linear combinations of graphs) tells my parent how to print basis element indexed by a graph m (m is in fact an integer vector modeling a graph up to isomorphism).

 def _latex_term(self, m):
    G = m.to_graph()
    opt = G.latex_options()
    opt.set_option('tkz_style', 'Simple')
    opt.set_option('vertex_labels', False)
    opt.set_option('scale', 0.25)
    opt.set_option('vertex_size', 0.0)
    return '\mathcal{M}_{' + latex(G) + '}'

I tried to set the option 'vertex_size' to zero but the size of the vertex was not affected. I realize that some combinations of options can rapidly become incoherent. Currently, I do not manage to do smaller than in the copy-pasted proposition of code.

I just want a very small (but readable) unlabeled graph.

2013-11-02 06:48:33 -0500 received badge  Teacher (source)
2013-11-02 05:47:40 -0500 received badge  Editor (source)
2013-11-02 05:19:05 -0500 answered a question Group algebra/matrix space homomorphism


it seems to me that R.module_morphism for R a parent inheriting from CombinatorialFreeModule does not support a definition on_gens (probably some code by Robert Bradshaw do that but I do not remember where it is in Sage...). So the only current way to define your morphism imply to do some math to get a definition on_basis instead on_gens.

For example, this work but is ugly :

sage: S3 = SymmetricGroup(3)
sage: QG = GroupAlgebra(S3, QQ)
sage: QG.gens()
Finite family {(1,2,3): (1,2,3), (1,2): (1,2)}
sage: M_3 = MatrixSpace(QQ, 2)
sage: ma = M_3([[0,-1],[1,-1]])
sage: mb = M_3([[1,-1],[0,-1]])
sage: def img_of_perm(p, gens_mat):
    w = p.reduced_word()
    R = gens_mat[0].parent()
    return[gens_mat[i-1] for i in w])
sage: f = QG.module_morphism(on_basis=lambda x: img_of_perm(x, [ma,mb]), 
codomain=ma.parent(), category=Algebras(QQ))
sage: f(QG.an_element())    
[ 2 -5]
[ 2 -3]

Another bug : if you replace category=Algebras(QQ) by category=AlgebrasWithBasis(QQ), you get the error : TypeError: Full MatrixSpace of 2 by 2 dense matrices over Rational Field is not in Category of algebras with basis over Rational Field

In a perfect world, the category should be at least FiniteDimensionnalAlgebraWithBasis(QQ) (because the parents should lies in it if I don't say something false)

The other way is trying to find stuff from Robert to define maps between parents on generators... I am not sure but I think it won't work either because it assume that elements of the two parents are not based on RingElement (old category stuff) and your group algebra is a CombinatorialFreeModule in data structure.

anyway, generally, define an algebra homomorphism between a group algebra and a matrix space implies there exist an algorithm to decompose each element of the domain in a polynomial over the algebra generators (I am not very sure it is a prerequisite but I think so...). For the symmetric group, we know how to do that with reduced word but a lot of combinatorial free module in Sage have a method algebra_generators() but do not know how to decompose an element along these algebra generators...

GAP do probably that very well but I also never tried (GAP knows how to decompose a group element along group generators...).

I hope that help a little...


Nicolas B.