Перл сродни России - грязь, куча непонятных артефактов и никогда не знаешь, что получится, пока не попробуешь.

lineq.pl


lineq.pl is a Perl wrapper around GAP for solving linear equations on nonassociative algebras. The typical problems are: to compute derivations, or, more generally, low-degree cocycles on an algebra with values in a module, or commutative 2-cocycles, or generalized derivations, or Hom-Lie structures on a Lie algebra, etc.

The script takes as input an algebra and a module over it, specified in GAP syntax, and an equation to solve, and outputs solution in a human-readable form, in terms of (multi)linear maps acting on a basis of the algebra.

Here is the output from lineq.pl --help command:
Usage:   lineq.pl --eq=<file> --alg=<file> [--debug=gap|trans] [--log=<file>]
         lineq.pl --help|--version
Example: lineq.pl --eq=der --alg=W1.gap --log=gap.log --debug=trans

--eq=<file>     <file> contains equation(s) to be solved;
--alg=<file>    <file> contains GAP code with definition of an algebra and a
                module over it;
--debug         print debug messages:
                gap   - related to interaction with GAP
                trans - performing perl transformations of algebraic
                expressions;
                this option can be repeated;
--log=<file>    log GAP session to <file>;
--help          print this help;
--version       print version.
The input file with equation(s) to be solved (option --eq) should contain one entry per line, which are left-hand sides of the equation (left-hand side) = 0 . Comments and blank lines are ignored. The left-hand side should obey the following rules: The unknown maps have arguments in the algebra, and values in the module.
Examples: In the example above, the file W1.gap contains the GAP definition of the Witt Lie algebra over GF(5) and its adjoint module:
A := SimpleLieAlgebra ("W", [1], GF(5));
M := AdjointModule (A); 
The file der contains definition of derivations:
D(x*y) + y*D(x) - x*D(y)
The output of the script will be:
finished compose linear system, solving it ...
dimension: 5

#1:
e[1] -> Z(5)*m[4]
e[2] -> Z(5)^0*m[5]
e[3] -> 0
e[4] -> 0
e[5] -> 0

#2:
e[1] -> Z(5)^3*m[3]
e[2] -> Z(5)^0*m[4]
e[3] -> Z(5)^0*m[5]
e[4] -> 0
e[5] -> 0

#3:
e[1] -> Z(5)*m[2]
e[2] -> Z(5)*m[3]
e[3] -> 0
e[4] -> Z(5)^0*m[5]
e[5] -> 0

#4:
e[1] -> 0
e[2] -> Z(5)^0*m[1]
e[3] -> Z(5)^0*m[2]
e[4] -> Z(5)^0*m[3]
e[5] -> Z(5)^0*m[4]

#5:
e[1] -> Z(5)^3*m[1]
e[2] -> 0
e[3] -> Z(5)*m[3]
e[4] -> Z(5)^2*m[4]
e[5] -> Z(5)^0*m[5]
what says that the derivation algebra is 5-dimensional, with the basis consisting of the 5 specified maps.

If the module is not the adjoint module, the action should be specified, according to GAP syntax, by ^. For example, to compute (-2)-derivations of sl(2) with coefficients in the 2-dimensional irreducible module:
L := SimpleLieAlgebra ("A", 1, Rationals);
M := HighestWeightModule (L, [1]);
and
D(x*y) - 2*y^D(x) + 2*x^D(y)
One may wish to modify the location of GAP at the beginning of the script. The whole thing is very messy and certainly full of bugs, but I would like to hear on any problems while using it. YMMV.


Created: Sun Jun 9 2019
Last modified: Thu Apr 01 07:45:38 Central Europe Daylight Time 2021