Ask Your Question

Bern's profile - activity

 2019-11-09 14:34:12 -0600 commented question How to create a subgroup with MAGMA inside SAGE of a group created with MAGMA inside SAGE? Thank you very much for your comment! :-) 2019-11-09 14:33:58 -0600 commented answer How to create a subgroup with MAGMA inside SAGE of a group created with MAGMA inside SAGE? Thank you very much for your answer! :-) 2019-11-08 12:17:14 -0600 received badge ● Notable Question (source) 2019-11-08 12:14:46 -0600 asked a question 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) in () ----> 1 GG_MAGMA=magma.new('sub /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 _sage_[3]:=sub 2019-11-08 12:01:16 -0600 commented answer How to connect Magma_free, SAGE and GAP (problem concerning a MAGMA string not readable by GAP)? Thank you very much for your answer! :-) To whom it may concern: In the meantime I got to know that the following is also a possible solution (exemplarily done for G=$S_4$): gap.LoadPackage('"ctbllib"') ct=magma_free("G:=Sym(4);ct:=CharacterTable(G);ct;") myfile=file("tbl_MAGMA.txt", 'w') print >> myfile, ct print >> myfile.close() tbl=gap.GAPTableOfMagmaFile('"tbl_MAGMA.txt"', '"MAGMA_TBL"') gap.Display(tbl) G=gap.SymmetricGroup(4) gap.ConnectGroupAndCharacterTable(G,tbl) 2019-09-29 06:24:12 -0600 received badge ● Popular Question (source) 2019-02-01 10:23:52 -0600 asked a question How to connect Magma_free, SAGE and GAP (problem concerning a MAGMA string not readable by GAP)? Hi, I'd like to ask the following: I'd like to use SAGE in order to compute something with the free magma online calculator and then convert it into a GAP object. Unfortunately, there occurs an error, and I don't know, how to fix this. Any help is very much appreciated. I followed the example on page 91 of http://www.math.rwth-aachen.de/~Thoma... Here is what I did: sage: gap.LoadPackage('"ctbllib"'); sage: ct=magma_free("G:=Alt(5);ct:=CharacterTable(G);ct;") sage: tmpdir = gap.DirectoryTemporary() sage: file=gap.Filename(tmpdir, '"magmatable"') sage: gap.FileString(file,ct) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) in () ----> 1 gap.FileString(file,ct) /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __call__(self, *args, **kwds) 627 628 def __call__(self, *args, **kwds): --> 629 return self._parent.function_call(self._name, list(args), kwds) 630 631 def _instancedoc_(self): /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/gap.pyc in function_call(self, function, args, kwds) 921 922 """ --> 923 args, kwds = self._convert_args_kwds(args, kwds) 924 self._check_valid_function_name(function) 925 /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in _convert_args_kwds(self, args, kwds) 530 for i, arg in enumerate(args): 531 if not isinstance(arg, InterfaceElement) or arg.parent() is not self: --> 532 args[i] = self(arg) 533 for key, value in iteritems(kwds): 534 if not isinstance(value, InterfaceElement) or value.parent() is not self: /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in __call__(self, x, name) 278 279 if isinstance(x, string_types): --> 280 return cls(self, x, name=name) 281 try: 282 return self._coerce_from_special_method(x) /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in __init__(self, parent, value, is_name, name) 1443 except (RuntimeError, ValueError) as x: 1444 self._session_number = -1 -> 1445 raise_(TypeError, TypeError(*x.args), sys.exc_info()[2]) 1446 except BaseException: 1447 self._session_number = -1 /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/expect.pyc in __init__(self, parent, value, is_name, name) 1438 else: 1439 try: -> 1440 self._name = parent._create(value, name=name) 1441 # Convert ValueError and RuntimeError to TypeError for 1442 # coercion to work properly. /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/interface.pyc in _create(self, value, name) 474 def _create(self, value, name=None): 475 name = self._next_var_name() if name is None else name --> 476 self.set(name, value) 477 return name 478 /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/gap.pyc in set(self, var, value) 1387 """ 1388 cmd = ('%s:=%s;;' % (var, value)).replace('\n','') -> 1389 self._eval_line(cmd, allow_use_file=True) 1390 1391 def get(self, var, use_file=False): /opt/sage/local/lib/python2.7/site-packages/sage/interfaces/gap.pyc in _eval_line(self, line, allow_use_file, wait_for_prompt, restart_if_needed) 787 return '' 788 else: --> 789 raise RuntimeError(message) 790 791 except KeyboardInterrupt: TypeError: Gap terminated unexpectedly while reading in a large line: Gap produced error output Syntax error: ; expected in /home/boehmler/.sage/temp/mahlzahn/8255/interface/\ tmp8325 line 1 \$sage2:=Character Table of Group G-------------------------------------------\ ----------Class | 1 2 3 4 5Size | 1 15 20 12 12Order | 1 2\ 3 5 5---------------------------p = 2 1 1 3 5 4p = 3 1\ 2 1 5 4p = 5 1 2 3 1 1---------------------------X.1 + \ 1 1 1 1 1X.2 + 3 -1 0 Z1 Z1#2X.3 + 3 -1 0 Z1#2 Z1X.4 \ + 4 0 1 -1 -1X.5 + 5 1 -1 0 0Explanation of Character Valu\ e Symbols--------------------------------------# denotes algebraic conjugation\ , that is,#k indicates replacing the root of unity w by w^kZ1 = (Cyclotomi\ cField(5: Sparse := true)) ! [ RationalField() | 0, 0, -1, -1 ];; ^ executing Read("/home/boehmler/.sage/temp/mahlzahn/8255/interface/tmp8325"); sage:  2018-01-20 23:31:03 -0600 received badge ● Necromancer (source) 2018-01-20 23:31:03 -0600 received badge ● Self-Learner (source) 2018-01-20 23:31:03 -0600 received badge ● Teacher (source) 2018-01-20 08:47:45 -0600 received badge ● Commentator 2018-01-20 08:47:45 -0600 commented answer Can SAGE calculate with projective (indecomposable) A-modules (A is a finite dimensional Q-algebra)? Thank you very much for your answer. I was thinking of the k-dimension of the algebra. I should have written that in the question. Sorry for my late reply. As a comment, I would like to say that in the meantime I have learned that these things can be done with the aid of the GAP-package QPA. This also works in SAGE via letting GAP be the intermediator. 2018-01-20 08:44:19 -0600 commented answer Dotted and dashed lines in directed graphs Thank you for your answer. Maybe the answer to thie following other question of mine is also helpful: https://ask.sagemath.org/question/356... 2018-01-20 08:42:39 -0600 commented question Compute radical and idempotents of a quotient algebra In the meantime I have learned that these things can be done for admissible quotients of path algebras with the aid of the GAP-package QPA. This also works in SAGE via letting GAP be the intermediator. So, if we make the additional restriction that our algebra is commutative, it works as follows: gap> LoadPackage("qpa");; gap> k:=Rationals; Rationals gap> Q:=Quiver(1,[[1,1,"a"],[1,1,"b"]]); gap> kQ:=PathAlgebra(k,Q); ]> gap> AssignGeneratorVariables(kQ); \#I Assigned the global variables [ v1, a, b ] gap> rels:=[a^2,b^2, a*b-b*a]; [ (1)*a^2, (1)*b^2, (1)*a*b+(-1)*b*a ] gap> A:=kQ/rels; ]/ ]>, (3 generators)>> gap> IsAdmissibleQuotientOfPathAlgebra(A); true gap> RAD:=RadicalOfAlgebra(A); gap> Display(RAD); Algebra( Rationals, [ [(1)*a], [(1)*b], [(1)*a*b] ] ) gap> Dimension(RAD); 3 gap>  If we let$k$be a finite field, then the command IdempotentsForDecomposition(A); works, but I don't have a computational solution for the case$k=\mathbb{Q}$. I have not yet a solution for the non-commutative case. 2018-01-20 08:18:22 -0600 commented answer Drawing Auslander-Reiten quivers with sage possible? Thank you very much for your answer (and sorry for my very late reply). It works perfectly fine! :-) 2017-09-17 18:45:59 -0600 received badge ● Famous Question (source) 2016-11-18 08:53:11 -0600 received badge ● Popular Question (source) 2016-11-18 08:51:08 -0600 commented question Drawing Auslander-Reiten quivers with sage possible? Thank you very much for your comment. I edited the question. 2016-11-18 07:49:43 -0600 asked a question Drawing Auslander-Reiten quivers with sage possible? Hi, I'd like to draw an Auslander-Reiten quiver with sage. I tried to do this by viewing the Auslander-Reiten quiver as a digraph, but, unfortunately, I was not able to find out how to let sage draw both dashed and solid arrows in one digraph. Is this possible? If not, is there another way to let sage draw Auslander-Reiten quivers? Any help would be appreciated. Edit: I used the following code: sage: H=DiGraph() sage: H.add_edges([(2,1),(2,4),(10,4),(1,3),(4,3),(4,11),(11,6),(3,6),(3,5),(5,7),(6,7),(6,12)]) sage: H.add_edges([(7,8),(7,9),(12,9)]) After having typed sage: H.show() a few times I got the following output: Now, I'd like to draw dahed arrows indicating the Auslander-Reiten translates (e.g. a dashed arrow from 3 to 2). 2016-07-02 18:43:58 -0600 received badge ● Popular Question (source) 2016-07-02 18:43:58 -0600 received badge ● Notable Question (source) 2015-12-03 20:39:18 -0600 asked a question Dotted and dashed lines in directed graphs Hi, I would like to know if it is possible to do (one of) the following with Sage. Reading http://doc.sagemath.org/html/en/refer... I saw that it is possible to draw dashed and dotted lines. Now my questions are 1) Is it possible to produce an output graphic where some edges are dotted and some edges are dashed? 2) Is it possible to force the text in the labels of the vertices, e.g. M2, M4, M1 instead of 0,1,2? Thanks for the help! 2015-12-02 09:01:30 -0600 received badge ● Famous Question (source) 2015-11-27 06:49:00 -0600 commented answer How to make pygraphviz and sage compatible? Thank you very much for your answer. 2015-11-25 21:08:31 -0600 commented answer How to draw special trees from a list consisting of tuples with Sage? Thank you very much for your answer. 2015-11-25 21:08:03 -0600 received badge ● Supporter (source) 2015-11-25 21:07:58 -0600 marked best answer How to draw special trees from a list consisting of tuples with Sage? I have the following problem: Imagine, we have tuples (1,1), (1,2), ... , (1,n), (2,1), (2,2), (2,n), (3,1), ... , (k,n) in a list L. To every tuple (i,j) I have associated a list L{ij}=[...]. The entries of L{ij} are special other tuples from L, which we call "compatible with the tuple (i,j)". So, in general, all the lists L{ij} are different from one another. I would like the PC to draw trees in the following manner: In the first level, there is one tuple T. This was manually chosen from the list L. In the second level, there are all the tuples T1, ... , Tr, which are compatible with T. Each of them shall be connected with T by a single line. In the third level, for each tuple Ts of the second line, there are drawn all the tuples that are compatible with Ts and at the same time already appeared one level higher (here: in level 2). Call the tuples of this level T11, ... , T1m, T21, ... T2p, .... Each of the T11, ... , T1m shall be connected with T1 by a single line. Each of the T21, ... , T2p shall be connected with T2 by a single line, and so on. Iterate this, until the process stops (is finished) and you have drawn a tree. The arrows of the tree are just edges and the points are the tuples, that should be numbered by (1,1), ... , (k,n). Note that not every entry of L has to appear in the resulting tree, since the lists L{ij} need not be a partition of L. Here is a small example: Let L=[(1,1), (1,2), (1,3), (2,1), (2,2), (2,3)]. Let L_{11}=[(2,2), (2,3), (2,1)]. Let L_{12}=[(1,3), (2,1)]. Let L_{13}=[(1,2)]. Let L_{21}=[(1,1), (1,2),(2,2)]. Let L_{22}=[(1,1), (2,1)]. Let L_{23}=[(1,1)].  This gives the following tree for (1,1):  (1,1) --------------|-------------- | | | (2,1) (2,2) (2,3) | | | | (2,2) (2,1)  Not only the tree, but also its "longest" branches (i.e. these, that can no more be extended by the procedure above...in the above example, these are (1,1)-(2,1)-(2,2) and (1,1)-(2,2)-(2,1) and (1,1)-(2,3)) should be returned (there are no repetitions allowed in the branches). Now, my question is: What's the best possibility to solve problems of this kind in a fast way with Sage? Thanks for the help! 2015-11-25 21:07:58 -0600 received badge ● Scholar (source) 2015-11-25 20:42:50 -0600 asked a question How to make pygraphviz and sage compatible? Hi, I would like sage to help me when I am working with (un)directed graphs and quivers, and so on. After having played around with various possibilities, I would like to convert some stuff into a string and then let sage print something like a .ps - file that contains an image from dot (or something similar to this). Unfortunately, I came across the following issue(s) and have no idea what to do now. With the sage version I installed, there is python 2.x as a delivered package. But it seems that sage complains about python3, what doesn't make sense to me. Could you help me understand and solve the following: boehmler@boehmler-X55A:~/Schreibtisch/bb/sage-6.9-x86_64-Linux$ ./sage ┌────────────────────────────────────────────────────────────────────┐ │ SageMath Version 6.9, Release Date: 2015-10-10 │ │ Type "notebook()" for the browser-based notebook interface. │ │ Type "help()" for help. │ └────────────────────────────────────────────────────────────────────┘ sage: import networkx as nx sage: import matplotlib.pyplot as plt sage: import matplotlib.image as mpimg sage: from cStringIO import StringIO sage: g = nx.dodecahedral_graph() sage: d = nx.to_pydot(g) AttributeError Traceback (most recent call last) in () ----> 1 d = nx.to_pydot(g) AttributeError: 'module' object has no attribute 'to_pydot' sage: d = nx.to_agraph(g) ImportError Traceback (most recent call last) in () ----> 1 d = nx.to_agraph(g) /home/boehmler/Schreibtisch/bb/sage-6.9-x86_64-Linux/local/lib/python/networkx/drawing/nx_agraph.pyc in to_agraph(N) 132 raise ImportError('requires pygraphviz ', 133 'http://networkx.lanl.gov/pygraphviz ',  --> 134 '(not available for Python3)') 135 directed=N.is_directed() 136 strict=N.number_of_selfloops()==0 and not N.is_multigraph()  ImportError: ('requires pygraphviz ', 'http://networkx.lanl.gov/pygraphviz ', '(not available for Python3)') sage: Exiting Sage (CPU time 0m3.33s, Wall time 56m28.80s). After typing boehmler@boehmler-X55A:~/Schreibtisch/bb/sage-6.9-x86_64-Linux\$ sudo -H pip install pygraphviz I get the message Wall -Wstrict-prototypes -fPIC -I/usr/include/graphviz -I/usr/include/python2.7 -c pygraphviz/graphviz_wrap.c -o build/temp.linux-x86_64-2.7/pygraphviz/graphviz_wrap.o pygraphviz/graphviz_wrap.c:130:21: fatal error: Python.h: Datei oder Verzeichnis nicht gefunden # include ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ----------------------------------------  Command "/usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-6yZh3l/pygraphviz/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-a6o8Fg-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-6yZh3l/pygraphviz in the end. I would be grateful for any hints how to solve / fix this. Thanks for the help! 2015-11-19 21:41:19 -0600 received badge ● Notable Question (source)