ASKSAGE: Sage Q&A Forum - Latest question feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 19 Jun 2020 00:28:22 -0500Find elements of left coset ZZ_6/{0,3}https://ask.sagemath.org/question/52082/find-elements-of-left-coset-zz_603/ If I have a group G = (ZZ_6,+), i.e. the integers modulo 6 under addition, and a subgroup of G, H = ({0,3}, +), how can I find G/H with sage?turingFri, 19 Jun 2020 00:28:22 -0500https://ask.sagemath.org/question/52082/Group given by congruence relationhttps://ask.sagemath.org/question/50543/group-given-by-congruence-relation/Hi,
Beginner in Sage (I love it!) , I want to ask you this maybe naive question:
I have a group $G$ defined by $\lbrace M \in SL_2(Z) \ | \ M = I + kB \ mod(N) \rbrace $, where $I$ is the identity, $N$ a given positive integer, $B$ is a given fixed matrix verifying $B^2 = 0$ and $k$ (not fixed) any integer in { 0,1,2,....,N-1 }. I want to explore conjugacy classes/subgroups of this group $G$ for some specific $B$ and $N$. Is this subgroup finitely generated for some $N$? subgroups of finite index? etc... Do I have a way to do that with SageMath?
Remark that
It is subgroup of a finitely generated group butv that do not imply that it is finitely generated
$B^2 = 0$ gives that $I + kB = \Lambda^k \ with \ \Lambda = I + B$.
An obvious subgroup is $ H = \lbrace \Lambda^k, \ k \in \mathbb Z \rbrace$
Any advise or web pointer would be appreciated
Thanks for your helpoldaniSun, 05 Apr 2020 05:47:54 -0500https://ask.sagemath.org/question/50543/The question in the name of Normal Subgroup and Isomorphismhttps://ask.sagemath.org/question/49304/the-question-in-the-name-of-normal-subgroup-and-isomorphism/Let **$A$** and **$B$** be two groups.
Show that set **$N$ = { $(a,1): a \in A $ }** is the normal subgroup of **$A$ x $B$** and
that the **$A$ x $B$ $/ N$** quotient group is isomorph to **$B$**.
if you help me, i'll be exulted. hayyambeyWed, 01 Jan 2020 09:04:29 -0600https://ask.sagemath.org/question/49304/Is there any way to find decomposition group and ramification groupshttps://ask.sagemath.org/question/35472/is-there-any-way-to-find-decomposition-group-and-ramification-groups/Let $L/K$ be a Galois extension of number fields with Galois group $G$. Let $O_K$ and $O_L$ be the ring of algebraic integers of $K$ and $L$ respectively. Let $P\subseteq O_K$ be a prime. Let $Q\subseteq O_L$ be a prime lying over $P$.
The decomposition group is defined as $$D(Q|P)=\lbrace \sigma\in G\text{ }|\text{ }\sigma(Q)=Q\rbrace$$
The $n$-th ramification group is defined as $$E_n(Q|P)=\lbrace \sigma\in G:\sigma(a)\equiv a\text{ mod } Q^{n+1}\text{ for all } a\in O_L\rbrace$$
I want to compute the decomposition group and ramification groups of the cyclotomic field $\mathbb{Q}(\zeta)$ over $\mathbb{Q}$ where $\zeta$ is a root of unity.
How to do this ? Any idea ?nebuckandazzerMon, 07 Nov 2016 09:50:42 -0600https://ask.sagemath.org/question/35472/How to iterate over groups in increasing sizehttps://ask.sagemath.org/question/33358/how-to-iterate-over-groups-in-increasing-size/I would like some way to iterate over all finite groups in increasing size till I manually stop the program (preferably as permutation groups). Is there an easy command to do this? AsvinTue, 10 May 2016 15:14:01 -0500https://ask.sagemath.org/question/33358/How do I identify the set of words of given length in matrix generatorshttps://ask.sagemath.org/question/32955/how-do-i-identify-the-set-of-words-of-given-length-in-matrix-generators/I should mention that I am a beginner with Sage so please bear with me. Also this question regards a small sub-step of what this question is about:
http://ask.sagemath.org/question/32935/how-to-efficiently-test-whether-a-matrix-can-be-written-as-a-certain-type-of-word/
But I expect the current issue would be much more common.
Take a small set of matrices, let's say 3 of them: m1, m2, m3. Let G be the group generated by these matrices. I want to be able to work with words of a given length in these generators. Let Gn be the words of length n in G. Then for example
G1 = (m1,m2,m3,m1^(-1),m2^(-1),m3^(-1)).
Is there a pre-built module for working with words of length n for n arbitrary? If not, I'm sure someone can find improvements on the approach I am taking. For instance to get G2, I have been doing this:
G2 = []
for g in G1:
for h in G1:
if g*h not in G2:
G2.append(g*h)
if h*g not in G2:
G2.append(h*g)
This gives me everything in G2, and avoids repitition, but does not extend well to Gn.
To get G3 I have been doing this:
G3 = []
for g in G2:
for h in G1:
if g*h not in G2:
if g*h not in G1:
G2.append(g*h)
if h*g not in G2:
if h*g not in G1:
G2.append(h*g)
If I want to go to G4 in this way, I need to add a line that makes sure my new addition isn't in G3, and I need to keep adding new lines at each increase in word length. I would like to define a function which outputs all words of length n, but as you can imagine from my approach above that is not working out well.
j0equ1nnFri, 01 Apr 2016 18:30:25 -0500https://ask.sagemath.org/question/32955/Multiplicative group of integers mod n?https://ask.sagemath.org/question/29914/multiplicative-group-of-integers-mod-n/ I'm guessing this is pretty basic, but I'm also new to Sage and can't find anything about it.
I know [how to work with the ring of integers mod n](http://doc.sagemath.org/html/en/reference/rings_standard/sage/rings/finite_rings/integer_mod_ring.html). Is there something analogous for the [multiplicative group of integers mod n](https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n)?
Something like:
G = Mult_Integers(5)
list(G)
[1, 2, 3, 4]
Googling has been surprisingly fruitless.
Thanks!
EDIT: @Nathann: right, but I'm not talking about {0, 1, 2, . . ., n-1}, but {1, 2, 3, . . ., n-1}, which [is a group with multiplication](https://en.wikipedia.org/wiki/Multiplicative_group_of_integers_modulo_n).zqcmSun, 11 Oct 2015 10:42:26 -0500https://ask.sagemath.org/question/29914/Demonstrating Cubic Formula to a Studenthttps://ask.sagemath.org/question/26795/demonstrating-cubic-formula-to-a-student/I'm trying to demonstrate the Lagrange approach to solving a cubic to a student.
w = CyclotomicField(3).gen()
x0 = var('x0')
x1 = var('x1')
x2 = var('x2')
s0 = x0 + x1 + x2
s1 = x0 + x1*w + x2*w^2
s2 = x0 + x1*w^2 + x2*w
After expanding `s1^3 + s2^3`, the output is cluttered with cube roots of unity (these _should_ cancel out).
I would like to treat `w` abstractly, where the only relevant constraints are `w^2 + w + 1 == 0` and `w^3 == 1`.
When simplifying, I would like it to collect all coefficients of powers of `w` and automatically apply the above rules (e.g: `w^2 + w == -1`).
Or -- is there some other way to do this?
Specifically, at least for the sake of readability, I would like to the roots to be represented only by `w`.coconutsMon, 11 May 2015 06:36:30 -0500https://ask.sagemath.org/question/26795/Using GAP package in Sagehttps://ask.sagemath.org/question/26163/using-gap-package-in-sage/I would like to use [this GAP package](http://www.gap-system.org/Manuals/pkg/wedderga/doc/chap1.html#X7DB566D5785B7DBC) to do some computations of representations, in particular [these commands](http://www.gap-system.org/Manuals/pkg/wedderga/doc/chap4.html). However, I want to use Sage and not GAP directly for various reasons (such as not having to switch back and forth between systems for where the computations come from).
An ideal "answer" to this question would give me
- Instructions for how to install this package in Sage (assuming Sage's GAP is new enough, which I think it is)
- How to get a group ring nicely with or without this package, from a given (Sage) group
- How to use `PrimitiveCentralIdempotentsByCharacterTable` from within Sage with this
- Ideally, how to apply a given representation to one of these idempotents
That's a tall order, probably, but I don't use the group theory stuff in Sage too often, so it would save me a lot of time if someone who "just knows" the syntax was able to help out. Thanks!kcrismanWed, 11 Mar 2015 17:50:53 -0500https://ask.sagemath.org/question/26163/Trouble importing groups from GAPhttps://ask.sagemath.org/question/24674/trouble-importing-groups-from-gap/I would like to use groups from the GAP library in Sage; something like:
sage: L = gap.AllGroups(16)
sage: G = PermutationGroup(gap_group = L[1])
and use `G` in my sage code. But I must be doing something wrong, becuase I get:
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-32-14053049143a> in <module>()
----> 1 G = PermutationGroup(gap_group = L[Integer(1)])
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup.pyc in PermutationGroup(gens, gap_group, domain, canonicalize, category)
335 raise TypeError("gens must be a tuple, list, or GapElement")
336 return PermutationGroup_generic(gens=gens, gap_group=gap_group, domain=domain,
--> 337 canonicalize=canonicalize, category=category)
338
339
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup.pyc in __init__(self, gens, gap_group, canonicalize, domain, category)
404
405 if domain is None:
--> 406 gens = [standardize_generator(x) for x in gens]
407 domain = set()
408 for x in gens:
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup_element.so in sage.groups.perm_gps.permgroup_element.standardize_generator (build/cythonized/sage/groups/perm_gps/permgroup_element.c:3761)()
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/groups/perm_gps/permgroup_element.so in sage.groups.perm_gps.permgroup_element.string_to_tuples (build/cythonized/sage/groups/perm_gps/permgroup_element.c:3362)()
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/misc/sage_eval.pyc in sage_eval(source, locals, cmds, preparse)
197 return locals['_sage_eval_returnval_']
198 else:
--> 199 return eval(source, sage.all.__dict__, locals)
200
201
/home/amri/sage-6.4.beta4/local/lib/python2.7/site-packages/sage/all.pyc in <module>()
NameError: name 'f1' is not defined
What is the correct way to do this?AmriWed, 29 Oct 2014 03:22:29 -0500https://ask.sagemath.org/question/24674/Problem with AbelianGroup.cayley_graph ()https://ask.sagemath.org/question/10490/problem-with-abeliangroupcayley_graph/Am I misunderstanding something here? `AbelianGroup.cayley_graph(`) fails with the default generators and but is ok if `generators=AbelianGroup.gens()`. It also fails with `.gens_small()`.
We have:
`sage: ag2=(AbelianGroup([3,3]))
sage: ag2.cayley_graph(generators=ag2.gens()))
Digraph on 9 vertices`
While:
`sage: ag2.cayley_graph() `
`---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-42-b5555c6dc56f> in <module>()
----> 1 ag2.cayley_graph()`
`/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/categories/semigroups.pyc in cayley_graph(self, side, simple, elements, generators, connecting_set)
283 generators = connecting_set
284 if generators is None:
--> 285 generators = self.semigroup_generators()
286 if isinstance(generators, (list, tuple)):
287 generators = dict((self(g), self(g)) for g in generators)`
`/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6585)()`
`/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/structure/misc.so in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1606)()`
`AttributeError: 'AbelianGroup_class_with_category' object has no attribute 'semigroup_generators'`
But ag2 is a semi_group:
`sage: ag2.categories()
[Category of groups,
Category of monoids,
Category of semigroups,
Category of magmas,
Category of sets,
Category of sets with partial maps,
Category of objects]`
QuestorsSat, 31 Aug 2013 10:09:18 -0500https://ask.sagemath.org/question/10490/Create graphhttps://ask.sagemath.org/question/9440/create-graph/I want define new graph in sage. Let G be finite group. The graph's vertices are subgroup and two vertices are adjacent if and only if sum of two subgroup is G.
I have trouble with define this graph in sage. Any suggestion?
I have idea in gap but I don't have idea what can I change in sage?
Summands := function(G)
local n, i, sgl, l, A, B, D;
obtain a list of all subgroups
sgl := List(LatticeSubgroups(G)!.conjugacyClassesSubgroups, Representative);
n is the number of divisors of |G|
n := Size(DivisorsInt(Size(G)));
D := [];
if IsOddInt(n) then l := QuoInt(n + 1, 2);
else l := QuoInt(n, 2);
fi;
for i in [1..l] do
for A in Filtered(sgl, function(g) return Size(g) = DivisorsInt(Size(G))[i]; end) do
for B in Filtered(sgl, function(g) return Size(g) = DivisorsInt(Size(G))[n+1-i]; end) do
Add(D, [A, B]);
od;
od;
od;
return D;
end;
BabgenWed, 17 Oct 2012 05:17:15 -0500https://ask.sagemath.org/question/9440/