ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 23 Jun 2021 17:50:29 +0200how can I manipulate a multiplicative group of Zmod(n)https://ask.sagemath.org/question/57703/how-can-i-manipulate-a-multiplicative-group-of-zmodn/Hi,
I want to create the multiplicative group $(\mathbb{Z}/7\mathbb{Z})^*=\\{1,2,3,4,5,6\\}$.
I did these steps:
sage: n = 7
sage: Zn = Zmod(n)
sage: G = Zn.unit_group()
sage: list(G)
[1, f, f^2, f^3, f^4, f^5]
Then I want to create the subgroups generated by $2=f^2$ which is $\\{1,2,4\\}$.
I did the following steps:
sage: f = G.gen()
sage: H = G.subgroup([f^2])
sage: list(H)
[1, f, f^2]
My problem is when I did
sage: Zn(f)
3
But here `f` needs to be 2. How can I solve this? Replace `f` by value?AltarioWed, 23 Jun 2021 17:50:29 +0200https://ask.sagemath.org/question/57703/Orbits on group actions acting on setshttps://ask.sagemath.org/question/9652/orbits-on-group-actions-acting-on-sets/Hello!
I am wondering how to solve the following problem efficiently.
I have a Permuation Group $G$ acting on $A = \{1,\ldots,n\}$ and I wish to compute the orbits of $G$ but not the ones of $G$ acting on $A$ but rather for $G$ acting on some $S \subseteq A \times A$ in the natural way. That is if $g \in G$ and $ x = \{a,b\} \in S$ then $x^g = {a^g,b^g\} \in S$
Other software for permuation groups (magma, gap) allows to do this by specifing an additional option "on sets/on tuples" to compute the specifed orbits.
I am wondering how could I do the same in sage, given a permuation group $G$ and an $S$ as described above.
Thanks!SGQWed, 26 Dec 2012 10:56:11 +0100https://ask.sagemath.org/question/9652/Determining if two subgroups of a symmetric group are conjugatehttps://ask.sagemath.org/question/44357/determining-if-two-subgroups-of-a-symmetric-group-are-conjugate/If I have two particular subgroups of a symmetric group, is there any built-in way in Sage to determine if the groups are conjugate to one another? I tried creating a `ConjugacyClass` for each and then comparing them, but this gives an error:
S = SymmetricGroup(3)
gen1 = Permutation('(1,2,3)')
gen2 = Permutation('(1,3,2)')
gen3 = Permutation('(1,2)')
gen4 = Permutation('(1,3)')
G1 = PermutationGroup([gen1, gen3])
G2 = PermutationGroup([gen2, gen4])
ConjugacyClass(S, G1) == ConjugacyClass(S, G2)
When executing the very last line I get the error
TypeError: For implementing multiplication, provide the method '_mul_' for (1,2) resp. Permutation Group with generators [(1,2), (1,2,3)]
cjohnsonTue, 20 Nov 2018 20:06:56 +0100https://ask.sagemath.org/question/44357/Group actions (e.g. on simplicial complexes, sets of tuples etc.)https://ask.sagemath.org/question/47015/group-actions-eg-on-simplicial-complexes-sets-of-tuples-etc/I'm trying to implement some extended functionality with simplicial complexes and have several questions about group actions in Sage. Any help with any of the following would be greatly appreciated!
**1.** *Group actions on nested lists, sets, tuples etc.*
In Magma, I can apply a permutation to an arbitrarily nested object of sets, sequences etc. without having to know what exactly that object is. For example,
`>> [{[1,2],[4,5]},{[4,5]}] ^ Sym(5)!(1,2,3,4);`
applies the permutation to a list of sets of lists. GAP is slightly less flexible, providing functions such as `OnTuples`, `OnTuplesTuples`, `OnSetsTuples` which deal with specific cases, but you have to know "in advance" what sort of object you are acting on. As far as I can see Sage hasn't got functions like these at all.
The simplicial complexes can take various forms which would each require a different type of action; for example, the vertices could be integers, or tuples (for example in the case of a Chessboard complex the vertices are coordinates on a chessboard), or sets.
I don't mind calling GAP functions, but would rather avoid calling Magma functions so that code I write can be used by those who don't have access to Magma. Am I missing a simple way of acting on such objects in Sage, or do I need to write my own code dealing with each case separately?
**2.** *Registering group actions in Sage*
Once I have defined my action with a function I'd like to register it so I can apply permutations to simplices using `x * g`. I have tried to follow the syntax explained in the docs here: (I cannot post links, search for `register_action` in the doc entitled `Base class for parent objects`.) A minimal example follows:
import sage.categories.action
import operator
def chessboard(n, m):
k = min(n, m)
row_tups = [tuple(x) for x in Subsets([1..n], k)]
col_tups = [tuple(x) for x in Permutations([n+1..n+m], k)]
placements = cartesian_product([row_tups, col_tups])
placements_as_sets = [{(p[0][i],p[1][i]) for i in range(k)} \
for p in placements]
G = SymmetricGroup(n+m)
A = G.stabilizer([1..n], "OnSets")
return SimplicialComplex(placements_as_sets), A
class ChessboardAction(sage.categories.action.Action):
def __init__(self, G, C, is_left=True):
sage.categories.action.Action.__init__(self, G, C, is_left,
operator.mul)
def _act_(self, g, c):
new = set(tuple([g(i) for i in x]) for x in c)
out = next(f for f in C.faces()[c.dimension()] if set(f) == new)
return out
C, G = chessboard(3, 4)
act = ChessboardAction(G, C)
g = G.an_element()
c = C.an_element()
act(g, c)
This fails with error:
NotImplementedError Traceback (most recent call last)
<ipython-input-69-7155e64e7004> in <module>()
----> 1 load("chessboard.sage")
sage/structure/sage_object.pyx in sage.structure.sage_object.load (build/cythonized/sage/structure/sage_object.c:12879)()
/usr/lib/python2.7/dist-packages/sage/repl/load.pyc in load(filename, globals, attach)
245 if attach:
246 add_attached_file(fpath)
--> 247 exec(preparse_file(open(fpath).read()) + "\n", globals)
248 elif ext == '.spyx' or ext == '.pyx':
249 if attach:
<string> in <module>()
sage/categories/action.pyx in sage.categories.action.Action.__call__ (build/cythonized/sage/categories/action.c:3602)()
sage/categories/action.pyx in sage.categories.action.Action._call_ (build/cythonized/sage/categories/action.c:3864)()
NotImplementedError: Action not implemented.
I then tried to implement a simple action on another object but received the same error, so perhaps I am misunderstanding the method:
class TestAction(sage.categories.action.Action):
def __init__(self, G, S, is_left=True):
sage.categories.action.Action.__init__(self, G, S, is_left,
operator.mul)
def _act_(self, g, s):
return Set([g(i) for i in s])
G = SymmetricGroup(4)
S = Subsets([1..4], 3)
act = TestAction(G, S)
g = G.an_element()
s = S.an_element()
act(g, s)
This fails with the same error as above.markbutler94Fri, 28 Jun 2019 18:30:10 +0200https://ask.sagemath.org/question/47015/Constructing group representationshttps://ask.sagemath.org/question/46701/constructing-group-representations/I've got a vector space $V= \mathbb{F}_p^n$ and I want to construct rings such as the symmetric algebra $\mathrm{Sym}^*(V)$, the divided power algebra generated by $V$, and so forth. I can do this, but the thing I'm not sure how to do is to build these objects along with the induced action of $\mathrm{GL}_n(\mathbb{F}_p)$ by algebra homomorphisms.
This brings two more general questions:
1. (Likely simple) If I've got a finite group $G$, how do I build a vector space $V$ with an action of $G$? In particular, it would be nice if I could build $V$ with named generators $v_1, v_2, \ldots$.
2. If I've got a vector space $V$ with an action of a group $G$, and I want to define an algebra $\mathcal{F}(V)$ which is functorial in $V$, then how do I port the action of $G$ over?
Alternatively, it might be computationally a lot more efficient to simply construct the divided power algebra over $\mathbb{F}_p$ on $n$ generators from scratch, but if I do this then how do I tell sage how $\mathrm{GL}_n(\mathbb{F}_p)$ acts on it?
(The divided power algebra on one generator $y$ is a ring with polynomial generators $y_1, y_2, y_3, \ldots$ subject to the relation $y_iy_j=\binom{i+j}{i}y_{i+j}$. So intuitively, one thinks of $y_n=\frac{y_1^n}{n!}$. Over a field of characteristic $p$, this amounts to being an algebra on $y_1, y_p, y_{p^2}, \ldots$ where the $p$-th power of each generator equals zero.)ksankarWed, 29 May 2019 20:09:55 +0200https://ask.sagemath.org/question/46701/group algebrahttps://ask.sagemath.org/question/46218/group-algebra/Can anyone help in writing code to find the list of idempotent and primitive elements of a group algebra?
The examples goes like this. Let $p$ be an odd prime such that $\bar2$ generates $U(Z_{p^2})$ and let $G =(\text{ideal generated by }a) ∗ (\text{ideal generated by }b)$ an abelian group, with $o(a)=p^2$ and $o(b)=p$.
Then $F_2G$ has four inequivalent minimal codes, namely, the ones generated by the idempotents:
$$e_0 = \hat{G}$$
$$e_1=\hat{b}−\widehat{(\text{ideal generated by }a)∗ (\text{ideal generated by }b)}$$
$$e_2=\widehat{a−G}$$
$$e_3=\widehat{(\text{ideal generated by }a_p)∗ (\text{ideal generated by }b)}−\hat{G}$$bandanaTue, 16 Apr 2019 11:04:47 +0200https://ask.sagemath.org/question/46218/Quaternion * integerhttps://ask.sagemath.org/question/44869/quaternion-integer/ how can i multiply my own quaternion group elements with a normal integer?
it says this:
unsupported operand parent(s) for +: 'Integer Ring' and '<class 'quater'>'SpreeterThu, 03 Jan 2019 16:36:01 +0100https://ask.sagemath.org/question/44869/Multiplicative Group of a fieldhttps://ask.sagemath.org/question/42726/multiplicative-group-of-a-field/ I have a finite field with me. I want to work with a multiplicative group of it. I only found that it is possible to do this with Z modulo n in Sage. But my fields are finite extensions of such a field.
If someone has a way to deal with, please help! mathjainSun, 24 Jun 2018 20:44:16 +0200https://ask.sagemath.org/question/42726/Matrix Group over Symbolic Ringhttps://ask.sagemath.org/question/40976/matrix-group-over-symbolic-ring/I have problem on generate matrix group over symbolic ring.
First, I define
eta=I;
eta2=(1+I)*sqrt(2)/2;
Then, define a generator matrix
T=matrix(SR,4,[eta**(i*j)*eta2/2 for i in range(4) for j in range(4)]);
I try to make a matrix group by
G=MatrixGroup(T);
What I get is only very long computation that does not give any result.
Can somebody help me? Thank you very much.
I have checked the order of T, I got 8 since T**8=I where I is identity matrix. dimahphoneMon, 05 Feb 2018 05:31:14 +0100https://ask.sagemath.org/question/40976/SageMath giving NameError on predefined functionshttps://ask.sagemath.org/question/41825/sagemath-giving-nameerror-on-predefined-functions/ I am following **Abstract Algebra an Interactive Approach** by *William Paulsen* but some of the functions in the first chapter itself, like `ShowTerry()`, `ItitTerry()`, `MultTable()` etc are giving `NameError`. Same is the case with most of the functions in the preliminaries chapter like `ShowRationals()`, `PowerMod()` <br/> I'm not really sure how to go about it. I even tried installing sage from Source Code but the problem persists. Do I have to install some separate group theory package or am I missing something here?JarwinThu, 29 Mar 2018 19:43:15 +0200https://ask.sagemath.org/question/41825/How to test with whether a group is cyclic?https://ask.sagemath.org/question/41740/how-to-test-with-whether-a-group-is-cyclic/ Does Sage offer a 'native' way to test whether a group is *cyclic*?
**Remarks.** Needless to say, Sage offers commands like 'is_abelian()' or 'is_finite()', but wherever I look, nothing like 'is_cyclic'. Peter HeinigFri, 23 Mar 2018 19:07:01 +0100https://ask.sagemath.org/question/41740/does as_permutation_group() respect generators?https://ask.sagemath.org/question/40927/does-as_permutation_group-respect-generators/From sage documentation I can construct a group as follows:
sage: m1 = matrix(GF(11), [[1,2],[3,4]])
sage: m2 = matrix(GF(11), [[1,3],[10,0]])
sage: G = MatrixGroup(m1, m2); G
Matrix group over Finite Field of size 11 with 2 generators (
[1 2] [ 1 3]
[3 4], [10 0]
)
Now I use the following code:
sage: G_p=G.as_permutation_group(); G_p
Permutation Group with generators [(1,2,3,4,5,6,7,8,9,10,11)(12,13,15,14,16)(17,18), (1,3,5,7,9,11,2,4,6,8,10)(12,14,13,16,15)(17,18)]
In this case it is true that the generators of G are in correspondence with the generators of G_p. Is this always the case? I mean, if I compute a very complicated group G with lots of generators and its corresponding permutation group G_p, then is it true that G.gens()[i] corresponds to G_p.gens[i]?amontero90Thu, 01 Feb 2018 20:20:47 +0100https://ask.sagemath.org/question/40927/Action of lattice automorphism group on discriminant grouphttps://ask.sagemath.org/question/40645/action-of-lattice-automorphism-group-on-discriminant-group/I have a lattice $L$ with automorphism group $G=Aut(L)$. The action of $G$ on $L$ should induce an action on the discriminant group $D={\tilde L}/L$ such that we have a group homomorphism $\phi: Aut(L) \rightarrow Aut(D)$. The kernel of this map will be a normal subgroup $N$ of $G$. I need to be able to compute the action of the quotient $G/N$ on $D$. In the actual example I am interested in $L$ has rank $20$ and is defined through its Gram Matrix. $L$ is an even lattice. A simpler model of this situation would be to take $L$ to be a root lattice, say the $A_2$ root lattice to be concrete, $Aut(L)$ is the dihedral group $D_6$ arising as the product of the $Z_2$ outer automorphism and the $S_3$ Weyl group of $A_2$. The dual lattice $\tilde L$ is the weight lattice of $A_2$ and the discriminant group ${\tilde L}/L$ is $Z_3$ with one non-trivial automorphism, taking $g \rightarrow g^{-1}$. In this simple case everything is computable by hand, but for the case I am interested in I only have $Aut(L)$ presented in terms of $20 \times 20$ matrix generators and computing by hand seems too difficult. Can anyone provide any hints on how to get sage to do this? I can compute $Aut(L)$ and $Aut(D)$ using sage, my problem is in figuring out how to determine $N$ and the action of the quotient $G/N$ on $D$.jahTue, 16 Jan 2018 21:37:35 +0100https://ask.sagemath.org/question/40645/Random element in a finitely generated grouphttps://ask.sagemath.org/question/39117/random-element-in-a-finitely-generated-group/ I would like to define a matrix group by some generators, e.g.
gens = [matrix(CDF,2, [1,0, -1,1]), matrix(CDF,2, [1,1,0,1])]; G = MatrixGroup(gens)
and then to generate random matrices from G. The command
G.random_element()
throws the error message: AttributeError: 'FinitelyGeneratedMatrixGroup_generic_with_category'
object has no attribute 'random_element' . I think the problem is due to the fact that my group is infinite, since it works fine if I replace the complex numbers by some finite field. Is there a better solution than just randomly multiplying the generators by hands? I am especially interested in time efficiency, since I need to generate many elements.LorWed, 11 Oct 2017 09:47:04 +0200https://ask.sagemath.org/question/39117/Multivariable equation in multiplicative group Z_phttps://ask.sagemath.org/question/39004/multivariable-equation-in-multiplicative-group-z_p/ I am able to, in wolfram alpha, plug in the equation
> 11=x*(y^119)^149mod151
where all numbers are in Z_151
and wolfram is able to give me a set of non-zero solutions (x,y) that I think satisfy (11*y^119, y)
I have tried using symbolic equations and the sage quickstart for number theory to replicate this functionality, but I am getting stuck on some integer conversion TypeErrors in sage.
I have tried to set it up like:
> x,y = var('x,y');
> qe=(mod(x*(y^119)^149,151)==mod(11,151))
Can someone help me set up this equation, and then solve for all possible non-zero solutions?
THanks!dcoleFri, 29 Sep 2017 15:19:36 +0200https://ask.sagemath.org/question/39004/Solving two-variable equations mod phttps://ask.sagemath.org/question/39003/solving-two-variable-equations-mod-p/ I am able to, in wolfram alpha, plug in the equation
> 11=x*(y^119)^149mod151
and wolfram is able to give me a set of non-zero solutions (x,y) that I think satisfy (11*y^119, y)
I have tried using symbolic equations and the sage quickstart for number theory to replicate this functionality, but I am getting stuck on some integer conversion TypeErrors in sage.
I have tried to set it up like:
> x,y = var('x,y');
> qe=(mod(x*(y^119)^149,151)==mod(11,151))
Can someone help me set up this equation, and then solve for all possible non-zero solutions?
THanks!dcoleFri, 29 Sep 2017 15:13:34 +0200https://ask.sagemath.org/question/39003/Check if a finitely generated matrix group is finite (works with QQ and not with CC)https://ask.sagemath.org/question/38403/check-if-a-finitely-generated-matrix-group-is-finite-works-with-qq-and-not-with-cc/Dear all, I am a newbie in sage. I would like to check if a finitely generated matrix group is finite. Before to proceed with the calculation on my actual problem (where matrices have complex entries), I have tried a very simple example. Consider the group generated by the matrices [1,0,0,1] and [0,1,1,0], this group is clearly finite. Can somebody explain me why the following code works:
sage: MS = MatrixSpace(QQ, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
True
but if I change the field QQ -> RR (or CC), an error is generated:
sage: MS = MatrixSpace(RR, 2, 2)
sage: G = MatrixGroup([MS([1,0,0,1]),MS([0,1,1,0])])
sage: G.is_finite()
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-215-0022a668c150> in <module>()
----> 1 G.is_finite()
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.is_finite (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2696)()
179 NotImplementedError
180 """
--> 181 return self.order() != infinity
182
183 def is_multiplicative(self):
/Applications/SageMath-7.6.app/Contents/Resources/sage/src/sage/groups/group.pyx in sage.groups.group.Group.order (/Applications/SageMath-7.6.app/Contents/Resources/sage/src/build/cythonized/sage/groups/group.c:2623)()
164 NotImplementedError
165 """
--> 166 raise NotImplementedError
167
168 def is_finite(self):
NotImplementedError:
Is there any way to force the second piece of code to work with matrices with entries in CC?
Thank you in advance.frenkyoTue, 25 Jul 2017 17:22:22 +0200https://ask.sagemath.org/question/38403/How to iterate through finite groupshttps://ask.sagemath.org/question/36326/how-to-iterate-through-finite-groups/ How can I have a collection of all finite groups with order less than a given number?
I have tried
G = gap.AllSmallGroups(64)
However it does not work for other arguments. It instead spits out this [1] error for example for 63 rather than 64.
I can tell that this may be a problem with the gap library in sage so I am wondering if there is any other way to do this in sage? I just want to be able to iterate through finite groups less than a given order.
[1]
Error in lines 3-4
Traceback (most recent call last):
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 976, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 2, in <module>
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 608, in __call__
return self._parent.function_call(self._name, list(args), kwds)
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 921, in function_call
res = self.eval(marker+cmd)
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 575, in eval
result = Expect.eval(self, input_line, **kwds)
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 1294, in eval
for L in code.split('\n') if L != ''])
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 771, in _eval_line
raise RuntimeError(message)
RuntimeError: Gap produced error output
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `RankPGroup' on 1 arguments
executing __SAGE_LAST__:="__SAGE_LAST__";;Rank(\$sage1);;alizterTue, 17 Jan 2017 14:04:35 +0100https://ask.sagemath.org/question/36326/PermutationGroupMorphism_im_genshttps://ask.sagemath.org/question/35722/permutationgroupmorphism_im_gens/I'm trying this code (taken from "Adventures in Group Theory"). I get an error, why ?
G=SymmetricGroup(4)
gensG=G.gens()
h=G([(1,3,4,2)]) # a 'random' element of G
gensG_h=[h*g*h^(-1) for g in gensG]
phi = PermutationGroupMorphism_im_gens(G,G,gensG,gensG_h)
phi.image(G)
phi.range()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_78.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("cGhpID0gUGVybXV0YXRpb25Hcm91cE1vcnBoaXNtX2ltX2dlbnMoRyxHLGdlbnNHLGdlbnNHX2gp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/private/var/folders/gm/z065gk616xg6g0xgn4c7_bvc0000gn/T/tmplbPZy2/___code___.py", line 2, in <module>
exec compile(u'phi = PermutationGroupMorphism_im_gens(G,G,gensG,gensG_h)
File "", line 1, in <module>
TypeError: __init__() takes at most 4 arguments (5 given)
faguiThu, 24 Nov 2016 17:51:17 +0100https://ask.sagemath.org/question/35722/Direct product of $S_n$ and $\mathbb Z_m$https://ask.sagemath.org/question/35568/direct-product-of-s_n-and-mathbb-z_m/How do I generate cayley table for direct product of symmetric group $S_n$ and additive group of integers modulo $\mathbb Z/m\mathbb Z$ or $\mathbb Z_m$.huhahuMon, 14 Nov 2016 17:22:01 +0100https://ask.sagemath.org/question/35568/Sage 7.4 : sage -i database_gap hangshttps://ask.sagemath.org/question/35550/sage-74-sage-i-database_gap-hangs/Using Sage 7.4 on Ubuntu 16.04, x86_64. The above command tries to load database_gap-4.8.3, but hangs after the messages:
[database_gap-4.8.3] Installed small group database.
[database_gap-4.8.3] Installed prim database.
[database_gap-4.8.3] Installed trans database.
[database_gap-4.8.3] Installed tomlib database.doug719Sat, 12 Nov 2016 20:55:57 +0100https://ask.sagemath.org/question/35550/Listing elements of (Z/nZ)*https://ask.sagemath.org/question/35006/listing-elements-of-znz/ I want to find all the elements of (Z/nZ)*. Is there a command for that ?
For example if the user gives input 8, the the output will be
{1,3,5,7}.nebuckandazzerSat, 01 Oct 2016 18:28:42 +0200https://ask.sagemath.org/question/35006/Generating all elements of $SL_2(\mathbb{F}_q)$https://ask.sagemath.org/question/34960/generating-all-elements-of-sl_2mathbbf_q/ What is the fastest way to create a set with all elements of $SL_2(\mathbb{F}_q)$ for $q$ some prime power of size about $50$? One way to do it is to find a representative for each conjugacy class and then use the ConjugacyClass method, but this seems inefficient. Is there a better way?vukovMon, 26 Sep 2016 23:01:48 +0200https://ask.sagemath.org/question/34960/How to make group act on a set?https://ask.sagemath.org/question/34792/how-to-make-group-act-on-a-set/How to make group act on set? For example, the set is s A={1, 2} and the group is SymmetricGroup(3). I would like to calculate the output put each permutation map of elements of Symmetric Group so that I can calculate normaizer and stablizer.sageuserSat, 10 Sep 2016 13:26:03 +0200https://ask.sagemath.org/question/34792/How to treat a vector space as a group?https://ask.sagemath.org/question/33990/how-to-treat-a-vector-space-as-a-group/
I need to use a module as a group, so that I can define a group algebra over this module.
Essentially, I want to take the group of 2-dimensional complex vector space and define a group algebra over this. I cannot find appropriate direction on the internet and sage gives me the ridiculous "False" as below.
sage: V=FreeModule(CC,2)
sage: V in Groups()
False
Nihar GargavaFri, 01 Jul 2016 19:27:43 +0200https://ask.sagemath.org/question/33990/Get vector from abelian grouphttps://ask.sagemath.org/question/32436/get-vector-from-abelian-group/ I want to represent the Cayley graph of an abelian group (let's say $A=Z_5^2$) is a way that the element $g=a^i b^j$ is in the position $[i,j]$. I need a method `.pos()`such that:
A= groups.presentation.FGAbelian([n,n]);
g=A[2]
---> g = a*b*a^-1
g.pos()
---> [0,1]
How could I do that?
MLainzThu, 04 Feb 2016 02:30:48 +0100https://ask.sagemath.org/question/32436/Get abelian group element powers.https://ask.sagemath.org/question/32435/get-abelian-group-element-powers/ I have the abelian group (let's say, $Z_5^2$). I want to represent its Cayley graph as a grid, in which the element $a^i b^j$ occupies the $[i,j]$ position in the plane. For that, I need would need a method `.pos()`. which did the following.
A = groups.presentation.FGAbelian([n,n]);
e=A[2]
-->e=a*b*a^-1
e.pos()
--> [0,1]
How can I create something like that?MLainzThu, 04 Feb 2016 02:22:33 +0100https://ask.sagemath.org/question/32435/Constructing subgroups by intersectionhttps://ask.sagemath.org/question/25955/constructing-subgroups-by-intersection/ I'd like to construct a subgroup of $Sp\left(4,\mathbb{Z}\right)$ of the form:
$$G_0\left(N\right) = M\left(N\right)
\cap {Sp}\left(4,\mathbb{Z}\right)$$
where $M\left(N\right)$ is a $4\times4$ matrix over the integer ring with elements that are multiples of the integer $N$. I think I know how to construct such an $M\left(N\right)$ for a given $N$, but how does one then construct such a subgroup $G_0\left(N\right)$? Thanks!JimereeFri, 27 Feb 2015 19:03:03 +0100https://ask.sagemath.org/question/25955/Iterator for conjugacy classes of Snhttps://ask.sagemath.org/question/7794/iterator-for-conjugacy-classes-of-sn/Hello,
I would like to iterate through elements of a conjugacy classes of the symmetric group Sn. In other words, I'm looking for an algorithm which given an integer partition p = [p1,...,pk] of n provides an iterator over permutations with cycle decomposition whose length of cycles is exactly given by p.
There is one way which uses GAP, but as I have to iterate through conjugacy classes of S(12) and it is infinitely slow inside Sage. On the other hand, there is a useful efficient way to iterate through all permutations of Sn : there exists a "Gray code" for which two consecutive permutations differ by a swap (ie exchange of images between two elements). Such a method is implemented in cython in sage.combinat.permutation_cython (thanks Tom Boothby!).
- Do there exist algorithms for iteration through conjugacy classes of the symmetric group which is as close as possible as a Gray code ?
- Does there exist a better algorithm if we consider partitions of given length (the number k above) ? In other words, not iterating through conjugacy classes but through permutations with fixed number of cycles in their cycle decomposition.
- Is there something yet implemented in softwares included in Sage ?
Thanks,
VincentvdelecroixTue, 07 Dec 2010 16:48:05 +0100https://ask.sagemath.org/question/7794/Untrusted group warninghttps://ask.sagemath.org/question/25043/untrusted-group-warning/I have 'installed' sage following [these](http://www.sagemath.org/doc/installation/binary.html) instructions, by just extracting the latests binary tarball and then adding a symbolic link like so: `ln -s ~/sage/sage /usr/local/bin/sage`
Now every time I execute a file with `sage path/to/file` I get the following warning:
sys:1: RuntimeWarning: not adding directory '' to sys.path since it's writable by an untrusted group.
Untrusted users could put fi les in this directory which might then be imported by your Python code. As a general precaution from similar exploits, you should not execute Python code from this directory
Especially during debugging sessions the additional output tends to clutter up my screen a lot and pushes away the meaningful output. Is there any way I can fix this?
kekxFri, 28 Nov 2014 20:45:53 +0100https://ask.sagemath.org/question/25043/