A Simple Example using W. Schelter's Affine Program

by Michaela Vancliff



Back to home page

Last revision: Oct 2, 2013.



Affine uses Bergman's diamond lemma. Below is a simple example. It is typed for the new version of Affine. For the 1990s version of Affine, delete the green commands (1st 4 lines); additionally, you might also need to upper-case the remaining code.

In this example, there is 1 defining relation with generators being b and c, and 1 scalar parameter which is aa1. The * denotes a scalar multiplying a generator, while . denotes a generator non-commutatively multiplying a generator. I was told that the program prefers scalars entered as aa1, aa2, etc, bb1, bb2, etc., but perhaps this is false for the new version of Affine? The command all_dotsimp_denoms:[] deletes all existing expressions that have already shown up as denominators in the algorithm (in case it has been run already). Enter the 1st and 2nd blue lines below; the 2nd blue line is asking for ambiguities (overlaps) to be checked through degree 6 inclusive. The program then will ask some questions, to which the answers are as given (5 answers). The command monomial_dimensions(5) asks for the dimensions of the degree-i subspaces up to and including degree 5 (one less than the number used at the 2nd blue line). It will then ask another question; answer it as given below, and then enter the last line, which asks for all the denominators that have shown up in this run of the program (to be presented in factored form).



load(affine);

dotexptsimp:false;

dotscrules:true;

matrix_element_mult:".";

all_dotsimp_denoms:[];

set_up_dot_simplifications ([b.c-aa1*c.b-b.b],6);

y

n

n

n

[b,c];

monomial_dimensions(5);

y

factor(all_dotsimp_denoms);



Note that the semi-colon after a command prints output; the dollar symbol at the end suppresses output.

If you want a vector-space basis through degree 5, enter mono([b,c], 5); .

If any scalar parameters satisfy some polynomials, say aa1 is the square root of 2, one can inform Affine of this at the start by entering tellrat(aa1^2-2)$ algebraic:true$ , and if aa1 should be anything except the square root of 2, presumably one enters tellrat(aa1^2-2)$ algebraic:false$ . The polynomial used here should be monic and irreducible. Beware that Affine sometimes ignores this command. Check the output of factor(all_dotsimp_denoms); before continuing in order to check that the polynomial that should be nonzero is not used in a denominator! To avoid defining in this way, enter as %I.

If you want to compute, say, b.c-c.b in this algebra, enter dotsimp(b.c-c.b); .

Affine can compute central elements up to a certain degree in an algebra, by using fast_central_elements (variables,degree) ; in the above example, we can compute the central elements of degree 3 by entering fast_central_elements([b,c],3); .

To quit Affine, one enters quit(); .

There appears to be differences in the way commands are entered in the Affine for MSwindows vs for linux. In particular, if the program stalls, try running it again with a ``;'' entered just prior to where the stall typically occurs. This sometimes keeps it going and gives the correct answer but also prints an error message!

The new version has problems with exponents; similarly an expression that needs to be simplified needs to be multiplied out by the user first (at least, if it involves arbitrary coefficients), before entering into Affine for reduction subject to the defining relations; e.g., dotsimp((aa1*b+aa2*c).(aa3*b+aa4*c)) needs to be dotsimp(aa1*aa3*b.b+aa1*aa4*b.c+aa2*aa3*c.b+aa2*aa4*c.c) . If anyone finds a way to avoid this, please let me know!!

If you get an error message saying something like “what is x like?”, this is asking what the multiplication is (yes, x here stands for multiplication). This means you likely have omitted or mistyped the green lines of code above.

In both versions of Affine, one should do a search through the entire output (using an editor of some kind) for the words ``error'', ``Error'' and ``ERROR''; I have noticed that if Affine encounters a problem, it still sometimes prints the erroneous final output as though it is correct and without comment. However, a scan through the prior output reveals there is a problem, and usually the source of the problem too. A typical occurrence of this is if the defining relations are not homogeneous and 1 is in the ideal (but not one of the entered defining relations); however, the newer version does a better job than the 1990's version at dealing with this type of scenario.



Recall that documentation on Affine can be found here and here; those sites also list other commands. There are also some other examples here and here that might be useful to you.



Back to home page Back to comments on Affine and Maxima.