A Simple Example using W. Schelter's Affine Program
by Michaela Vancliff
Back to home page Last revision: April 3, 2019.
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 x and z, 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).
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 for degree-5 elements, enter mono([x,z], 5); . One can even use this command and monomial_dimensions( ); command if the algebra is not graded; however, in this case, it is unclear to what the “5” (or any degree) refers, but one can always type a degree or 2 (or more) higher to compensate.
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 (over the reals??). 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, but note that Affine sometimes treats %I as a generic symbol in a particular code and, in other places, in the same code, will treat it as .
If you want to compute, say, x.z-z.x in this algebra, enter dotsimp(x.z-z.x); .
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([x,z],3); .
To quit Affine &/or Maxima, 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*x+aa2*z).(aa3*x+aa4*z)) needs to be dotsimp(aa1*aa3*x.x+aa1*aa4*x.z+aa2*aa3*z.x+aa2*aa4*z.z) . If anyone finds a way to avoid this, please let me know!!
If you wish to try a different order for your generators, say, x >y>z instead of x<y<z, the only method I know to get Affine to do this is to relabel the generators; i.e., map x→z, z→x and rerun Affine.
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.
Another potential cause of unnoticed error is in the choice of symbols for the generators. As of April 2019, Affine on Fedora Linux 26-28 is treating generators a, b, c, d and some upper-case letters as though they are scalars; I am finding that Affine is dividing by them even though they are not scalars. This is true for generators a, b, c etc and also for generators a1, a2, a3, etc and X1, X2, X3, etc. However, e through z appear to be treated correctly by Affine. This highlights how important it is to check the output from the command factor(all_dotsimp_denoms); .
If the program hangs, make sure the defining relations have been simplifed as much as possible; i.e., delete any relations that are redundant in order to reduce the number of overlaps/ambiguities that Affine needs to check – this helps with RAM use.
Recall that documentation on Affine can be found here and here; those sites also list other commands.
Back to home page Back to comments on Affine and Maxima.