Ask Your Question
1

Sage, small group library

asked 2014-07-02 19:45:34 +0100

ahannahan gravatar image

Is there anyway to call the GAP small group library in the Sage?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
4

answered 2014-07-03 10:08:44 +0100

vdelecroix gravatar image

updated 2014-07-03 10:08:58 +0100

Hi,

There are two packages:

  • gap_packages
  • database_gap

this is the second one which contains the database of small groups. After

sage -i database_gap

the following works

sage: G8 = gap.SmallGroup(8,1)
sage: G8
Group( [ f1, f2, f3 ] )
sage: gap.Size(G8)
8

Vincent

edit flag offensive delete link more

Comments

Hmm, this should *really* be better documented! One of the "sample questions" at the Sage SX proposal is even about this. Can you think of where a good place for that would be?

kcrisman gravatar imagekcrisman ( 2014-07-03 15:09:17 +0100 )edit

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_28.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("c2FnZSAtaSBkYXRhYmFzZV9nYXA="),globals())+"\\n"); execfile(os.path.abspath("___code___.py")) File "", line 1, in <module> File "/private/var/folders/zp/z4nx0jkn1_s3lk7z0ythnx880000gn/T/tmpXoDlQm/___code___.py", line 2 sage -i database_gap ^ SyntaxError: invalid syntax Above is the output I get when I type in 'sage -i database_gap'. Is there any way to fix this?

ahannahan gravatar imageahannahan ( 2014-07-08 19:12:26 +0100 )edit

Ah! You have to do it from outside Sage, or perhaps from inside using the `install_package` command.

kcrisman gravatar imagekcrisman ( 2014-07-08 19:21:13 +0100 )edit

How do you do that? What is the syntax for the command?

ahannahan gravatar imageahannahan ( 2014-07-08 20:03:58 +0100 )edit

http://www.sagemath.org/doc/reference/misc/sage/misc/package.html#sage.misc.package.install_package

kcrisman gravatar imagekcrisman ( 2014-07-09 02:35:25 +0100 )edit
0

answered 2014-07-02 20:46:08 +0100

kcrisman gravatar image

I believed it is included in the Gap packages optional Sage package.

$ sage -i gap_packages

But then

sage: gap.eval('SmallGroups(8,1)')

gives me an error similar to one from 2009 (!). (Also, it downloads the "wrong" version, not the most up-to-date gap packages package.)

I don't know why that would be, this should be part of it. If no one responds with a better answer soon I'll open a Trac ticket.

edit flag offensive delete link more

Comments

they are "new style" packages, that is, they are two thing - a tar ball and an entry in SAGE_ROOT/build/, and you need to place the right tarball into SAGE_ROOT/upstream/ for this to work. It's a problem not specific to GAP-related optional packages.

Dima gravatar imageDima ( 2014-07-04 15:09:39 +0100 )edit

So, how does one install the "new style" packages? This should really be doable in a one-liner that is does not involve manually downloading things...

kcrisman gravatar imagekcrisman ( 2014-07-04 16:52:58 +0100 )edit

you can check the file SAGE_ROOT/build/pkgs/gap_packages/package-version.txt to see the version you'd get installed. You can't just grab an .spkg file from the web and install it. If you want a newer spkg you'd need to update the contents of SAGE_ROOT/build/pkgs/gap_packages/, using git.

Dima gravatar imageDima ( 2014-07-04 23:01:57 +0100 )edit

That is really annoying. One should just be able to do something analogous to the old `./sage -f spkg-name` to get an upgrade.

kcrisman gravatar imagekcrisman ( 2014-07-05 23:30:26 +0100 )edit

Well, the new style packages are safer to use, as you won't be able to install an incompatible spkg. What is really annoying is that not all packages are already converted to the new style.

Dima gravatar imageDima ( 2014-07-06 10:28:32 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2014-07-02 19:45:34 +0100

Seen: 2,065 times

Last updated: Jul 03 '14