Example 1.
First we initialize a Lie algebra.
For this example we take h to be the trivial subspace. In this case the procedure RelativeChains simply returns a list of bases for the 1-forms on g, the 2-forms on g, the 3-forms on g, and so on.
We pass the output of the RelativeChains program to the Cohomology program.
To read off the dimensions of the cohomology of g, use the nops and map command.
Example 2.
We continue with Example 1. To find the cohomology of just in degree 3, pass the Cohomology program to just the chains of degree 2 and 3 and 4.
Example 3.
We continue with Example 1. Show that the 2-form is closed and express as a linear combination of the cohomology classes in and the exterior derivative of a 1-form.
Example 4.
First we initialize a Lie algebra.
Define a 2 dimensional subspace to be the vectors spanned by ..
Compute the relative chains with respect to the subspace .
Example 5.
In this example we compute the cohomology of a 4-dimensional Lie algebra with coefficients in the adjoint representation. First define and initialize the Lie algebra.
Define the representation space
Define the adjoint representation.
Note that the chains are now linear functions of the coordinates on the representation space.
Example 6.
Finally, we compute the Lie algebra cohomology of Alg3 with coefficients in the adjoint representation, relative to the subalgebra spanned bu