f = basis M
f = basis(deg, M)
f = basis(lo, hi, M)
The function basis finds a basis or generating set of a module over a coefficient ring, either for the full module, or for a degree range, or for a specific (multi-)degree. A ring or ideal may also be provided instead of a module. Partial multi-degrees may also be given, see below for the usage and meaning.
If $M$ is a matrix, then the matrix between the corresponding bases of the source and target of $M$ is returned. This feature should be considered experimental.
The following examples show the varied uses of this function.
Basis of the whole ring
If no degree or degree range is given, then a full basis is given. In the example below, the 12 entries generate $R$ over the base ring ${\mathbb Q}$. If the object is not finite, then an error is given.
|
|
|
Basis in a degree or range of degrees
If a single degree or degree range is given, give a basis (or generating set) of that particular degree (or degree range) of $M$.
|
|
|
|
|
Notice that phi is a matrix whose source is a free module, and whose target is the ideal. super is used to get the actual elements of $I$.
Basis in a specific multi-degree
If a multidegree is given, then a range cannot be given. In this example, the dimension over QQ of this multigraded piece of R is 2.
|
|
Partially described multidegrees
A partial multidegree can be given. The given columns generate (form a basis in this case) the degree \{2,*\} part of R, over the subring QQ[d] generated by the variables which have degree \{0,*\}.
|
|
The base ring does not need to be a field. In these cases, the given image vectors might only generate over the base ring, not be a basis. For instance, in the following example, $B$ is generated over $A$ by 4 elements, but $B$ is not a free module.
|
|
|
|
If $M$ is an ideal or module, the resulting map looks somewhat strange, since maps between modules are given from generators, in terms of the generators of the target module. Use super or cover to recover the actual elements.
|
|
|
|
|
|
If Variables is given as an optional argument, only monomial multiples of the generators which involve these variables will be considered. In this case, the resulting elements might not form a generating set over the coefficient ring. They do generate over the subring generated by the other variables.
|
|
If the base ring has a local term order, then the generating set or basis will be over this ring.
|
|
|
|
Functoriality
basis is functorial, meaning that if $M : A \rightarrow B$ is a matrix between two modules, then the result is the induced matrix on the images of the result of basis applied to A and B.
|
|
|
|
|
|
|
Obtain the map of free modules using matrix:
|
If the base ring is not a field, then the result is only a generating set. If the optional argument Variables is provided, then even this might not be correct.
The object basis is a method function with options.