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.Sun, 05 Apr 2020 12:47:54 +0200Group 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 12:47:54 +0200https://ask.sagemath.org/question/50543/How to create a subgroup with MAGMA inside SAGE of a group created with MAGMA inside SAGE?https://ask.sagemath.org/question/48678/how-to-create-a-subgroup-with-magma-inside-sage-of-a-group-created-with-magma-inside-sage/Dear SAGE team,
I would like to let MAGMA inside SAGE create a subgroup of a group (which was also created with MAGMA inside SAGE), but an error message was returned.
Unfortunately, I don't know ho to resolve this.
I would be thankful for any help.
Here's the code (only an example):
>> sage: GG=gap.SymmetricGroup(4)
>> sage: gensGG = gap.GeneratorsOfGroup(GG)
>> sage: m=gap.LargestMovedPoint(gensGG)
>> sage: GGG=magma.Sym(m)
>> sage: GG_MAGMA=magma.new('sub< GGG | [(1,2)] > ')
The error message is as follows:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-13-da9ee2cf66f9> in <module>()
----> 1 GG_MAGMA=magma.new('sub<GGG|[(1,2)]>')
/var/autofs/nfs/scratch/hannes/sage-8.8/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in new(self, code)
351
352 def new(self, code):
--> 353 return self(code)
354
355 ###################################################################
/var/autofs/nfs/scratch/hannes/sage-8.8/local/lib/python2.7/site-packages/sage/interfaces/magma.pyc in __call__(self, x, gens)
792 pass
793
--> 794 A = Expect.__call__(self, x)
795 if has_cache:
796 x._magma_cache[self] = A
/var/autofs/nfs/scratch/hannes/sage-8.8/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __call__(self, x, name)
286
287 if isinstance(x, string_types):
--> 288 return cls(self, x, name=name)
289 try:
290 return self._coerce_from_special_method(x)
/var/autofs/nfs/scratch/hannes/sage-8.8/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in __init__(self, parent, value, is_name, name)
1441 except (RuntimeError, ValueError) as x:
1442 self._session_number = -1
-> 1443 raise_(TypeError, TypeError(*x.args), sys.exc_info()[2])
1444 except BaseException:
1445 self._session_number = -1
/var/autofs/nfs/scratch/hannes/sage-8.8/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in __init__(self, parent, value, is_name, name)
1436 else:
1437 try:
-> 1438 self._name = parent._create(value, name=name)
1439 # Convert ValueError and RuntimeError to TypeError for
1440 # coercion to work properly.
/var/autofs/nfs/scratch/hannes/sage-8.8/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in _create(self, value, name)
482 def _create(self, value, name=None):
483 name = self._next_var_name() if name is None else name
--> 484 self.set(name, value)
485 return name
486
/var/autofs/nfs/scratch/hannes/sage-8.8/local/lib/python2.7/site-packages/sage/interfaces/magma.pyc in set(self, var, value)
627 13/5
628 """
--> 629 out = self.eval("%s:=%s" % (var, value))
630 if out.lower().find("error") != -1:
631 raise TypeError("Error executing Magma code:\n%s" % out)
/var/autofs/nfs/scratch/hannes/sage-8.8/local/lib/python2.7/site-packages/sage/interfaces/magma.pyc in eval(self, x, strip, **kwds)
561 ans = Expect.eval(self, x, **kwds).replace('\\\n', '')
562 if 'Runtime error' in ans or 'User error' in ans:
--> 563 raise RuntimeError("Error evaluating Magma code.\nIN:%s\nOUT:%s" % (x, ans))
564 return ans
565
TypeError: Error evaluating Magma code.
IN:_sage_[3]:=sub<GGG|[(1,2)]>;
OUT:
>> _sage_[3]:=sub<GGG|[(1,2)]>;
^
User error: Identifier 'GGG' has not been declared or assigned
BernFri, 08 Nov 2019 19:14:46 +0100https://ask.sagemath.org/question/48678/Is there any code to calculate the subgroup generated by the permutationshttps://ask.sagemath.org/question/47371/is-there-any-code-to-calculate-the-subgroup-generated-by-the-permutations/ Consider the Symmetric Group $S_4$
I have three permutations namely $(3,4), (1,2), (1,3)(2,4)$.
How to find the subgroup generated by these permutations ?
Is there any code to calculate in Sagemath the subgroup generated by the permutations given above?
As an example the code should work like this :
If I input $(12)$ the code should give $\{(12),e\}$
Can someone help please?CaptchaSun, 04 Aug 2019 08:16:11 +0200https://ask.sagemath.org/question/47371/coercion into/from subgroup or Tietze of generator changehttps://ask.sagemath.org/question/40483/coercion-intofrom-subgroup-or-tietze-of-generator-change/Hi there,
do you know of a function, which solves the Tietze for subgroups or converts elements from parentgroup to elements of subgroup and the other way round (if possible)?
Neither of the commented codes work (but I hope it is clear what I want):
F.<a,b,c> = FreeGroup()
x=a*b/c
H=F.subgroup([a*b,b,b*c])
y=H.gens()[1]*H.gens()[0]
x in H
y in F
#F(y)
#F.coerce(y)
#H.coerce(x).Tietze()
#H(x)
I am using cocalc, if this is a version thing.
I know something like that exists for quotient groups (s. http://doc.sagemath.org/html/en/reference/groups/sage/groups/finitely_presented.html )
In my use-case I have a free group $F$ and an element $x \in F$ in it.
Now I want for a given list of generators (e.g. in above [ a*b, b, b*c ]) the $x$ as a word of these generators,
hence I would like to see $x$ as an element in $H$ and use x.Tietze().
Another solution to my problem would be to swap the generators, but I can't see a way to do that either?ctstSat, 06 Jan 2018 00:53:14 +0100https://ask.sagemath.org/question/40483/Routines for Pell's equationshttps://ask.sagemath.org/question/40202/routines-for-pells-equations/Hi,
I am interested in finding solutions to Pell's equations in finite fields. Are there Sagemath routines that I could use or should I create my own routines? I am interested in finding out solutions to the general equation x^2 - Dy^2 = 1 (mod p). Solutions to this form an closed Abelian group and the points form a cyclic subgroup.
Any suggestions/pointers would be deeply appreciated.
Thank you,
Rahul RahulKrishnanSun, 17 Dec 2017 17:21:54 +0100https://ask.sagemath.org/question/40202/Defining a subgroup of elliptic curves with specific characteristicshttps://ask.sagemath.org/question/39726/defining-a-subgroup-of-elliptic-curves-with-specific-characteristics/Hey,
is there a way, to define a subgroup of an elliptic curve with two or more characteristics? I would like to take an elliptic curve over a finite field of order p and $p^4$, define the r-torsion subgroup (where $r$ is a prime, too) and reduce those to the set of points, which also lays in the Frobenius-eigenspace.
For example:
p= 13
r=5
R=GF(p)
_.<x> = PolynomialRing(R)
R4.<x> = R.extension(x^4 - 2, 'x')
_.<y> = PolynomialRing(R)
b= x^-1
E = EllipticCurve(R, [1,0]) # y^2 = x^3+x
E4 = EllipticCurve(R4, [b,0])
Well, it is easy to find a point on $Q\in E4$, such that $r*Q = (0:1:0)$, use
Q=ZZ(E4.order()/r *Q
, but checking, if $( x(Q)^p, y(Q)^p )=\pi(Q) = pQ$ is hard. I only need one point of that group at all, but my $p$ is even larger (~340 bits), so brute-forcing would be an option, if I could start it 6-12 month ago :)
Furthermore, if I concider to evaluate the secant or tangent on E and let me return a point on that curve, it will have projective coordinates, with $z(P)\neq1$. Shall I apply $\pi$ to all three coordinates?ShalecWed, 22 Nov 2017 14:16:18 +0100https://ask.sagemath.org/question/39726/Compute all Elements of a subgroup GL_3(R)https://ask.sagemath.org/question/30739/compute-all-elements-of-a-subgroup-gl_3r/ Hi there, i have two matrices A and B, they both out Gl_3(R). I have find all Elements in the Subgroup created by these two. is there a way to do it in sage?
M3 = MatrixSpace(QQ, 3) # Rational numbers
print("Identity matrix:")
show(M3.identity_matrix())
A = M3.matrix([[1, 0, 0], [0, -1, 0], [0, 0, -1]])
B = M3.matrix([[0, 1, 0], [0, 0, 1], [1, 0, 0]])
There should be 36 Elements in this group B is cyclic B^3=I
and A creates 2 possible Element by negating elements. so the Left inverses create 6 Elements and the Right creates also 6, total is 36. thethaSun, 15 Nov 2015 14:24:19 +0100https://ask.sagemath.org/question/30739/List members of each subgroup of integers modulo nhttps://ask.sagemath.org/question/11019/list-members-of-each-subgroup-of-integers-modulo-n/Hi - I am new to Sage so apologies if this is a dumb question.
For a given n, I would like to print out the list of subgroups of the multiplicative group modulo n as a list of the members of the subgroup. Here's one of the things I have tried so far:
R = Zmod(20)
grouplist = R.multiplicative_subgroups()
for subgroup in grouplist:
print subgroup
(11, 17)
(9, 11)
(3,)
(11,)
(19,)
(17,)
(9,)
()
As you can see, this gives me the generators of the sub-groups, but what I'd like is the complete list of members of the subgroup for each subgroup. Something along these lines - where members() is the method I would like, but don't know if it exists!:
R = Zmod(20)
grouplist = R.multiplicative_subgroups()
for subgroup in grouplist:
print subgroup.members()
(1, 3, 7, 9, 11, 13, 17, 19)
(1, 9, 11, 19)
(1, 3, 7, 9)
(1, 11)
(1, 19)
(1, 9, 13, 17)
(1, 9)
(1)
Thanks for any help, Martin
MartinMon, 10 Feb 2014 14:31:48 +0100https://ask.sagemath.org/question/11019/