[GAP Forum] first example towards GAP, need some explanation

Jack Schmidt jack at ms.uky.edu
Sun Aug 19 22:54:25 BST 2012


[ One has a permutation group and wants to export its irreducible representations to fortran. ]

I wrote a naive method to do this in GAP:

http://www.ms.uky.edu/~jack/2012-08-19-GAPToFortranIrreps.g.txt

The documentation is in the file.  Save this file in the directory from which you call GAP (probably with a short name, like fortran.g), then read it into gap with:

gap> Read("fortran.g");

Then you can have it create one file per matrix in an easily readable format for fortran using:

gap> ExampleUsage( SymmetricGroup(4) );

This function especially is meant to be easy for you to change. The file format is three lines: first line is the dimension of the matrix, second line is the entries of the matrix in column major order, and third line is the name of the group element (meant to be ignored by fortran).

You will need Frank Luebeck's unreleased futil package, available from http://www.math.rwth-aachen.de/~Frank.Luebeck/gap/FUtil/

And unless he updates it, you'll need to change two lines in futil/gap/Decimal.gi to change the name "Exp" to "ExpFutil" since these days there is already a function called Exp.

The function to rewrite over the real field can be unreasonably slow because it uses no theory; if you need this to work on larger groups, you'll need to use theory.  The function to rewrite a representation as unitary (keeping real reps real) does not fit into the GAP philosophy, so I recommend only using it to export to fortran.




More information about the Forum mailing list