Magma has functionality for defining and working with coherent sheaves on ordinary projective schemes. On normal ordinary projective varieties there is also a package for divisors and divisor classes which is linked to the invertible sheaf machinery. The functions allow the computation of cohomology groups, divisor maps, and Riemann–Roch spaces, amongst other things.
Coherent sheaves on a scheme X correspond to finitely-generated graded modules over the (graded) coordinate ring R of the ambient of X which are annihilated by the defining ideal of X. If X is ordinary projective then the module corresponding to a sheaf is not quite unique. With some minor restrictions on the sheaf, there is a maximal, separated, finitely-generated module that represents it. Separated here means that the module has no m-torsion, where m is the maximal homogeneous ideal of R. This maximal module is extremely important. Any module representing the sheaf differs from the maximal module in only a finite number of the graded summands but it is usually the smaller graded parts that are incomplete and these are the most important. For example, the 0th graded summand of the maximal module is the finite-dimensional k-vector space that gives the global sections of the sheaf.
As well as having a suite of functions to perform the standard Gröbner-based commutative algebra operations on (graded) modules over polynomial rings, a good method for computing the maximal module from a given module representation is a key ingredient in general computational work with sheaves. Magma has an efficient algorithm for this computation based on a finite projection of the exact support of the sheaf module to a linear subspace, computed via Noether normalisation combined with a double dual computation on the module considered as a module over the coordinate ring of this subspace. This avoids computing complicated dualising modules and requires only very weak assumptions on the support of the sheaf; namely, that it is equidimensional of positive dimension.
There are functions to construct general sheaves by giving a representing module as well as functions for special important sheaves like the basic structure sheaf as well as the tangent sheaf and the canonical sheaf. There is also a function to give the Serre twists of sheaves which are represented by the same modules but with a shift in the grading. Functions are also provided for the construction of sheaves from other sheaves using operations such as direct sums, duals, and tensor products.
Some of the most important types of sheaf are the locally-free sheaves and there is a test for local-freeness which also computes the rank. The basic version of this test is a standard algorithm based on Fitting ideals but a more complex algorithm can be optionally used which is much faster for sheaves on low-dimensional varieties in high codimension spaces. The latter test applied to the tangent sheaf or sheaf of differentials gives a much faster non-singularity (actually, smoothness) test than the default Magma algorithm in these high-codimensional cases.
Particularly important are rank 1 locally-free (invertible) sheaves. Isomorphism classes of these correspond to rational equivalence classes of Cartier divisors and there is a correspondence between these and rational maps, up to a linear change of variables, of the base scheme X into ordinary projective spaces. Embeddings into projective space come from what are known as very ample invertible sheaves/divisor classes and ample sheaves give embeddings into weighted projective spaces with a smaller number of variables. The map coming from a Cartier divisor class or equivalent invertible sheaf is referred to as the divisor map.
There are functions to compute the divisor maps of invertible sheaves as scheme graph maps or ordinary scheme maps. For example, along with the canonical and anticanonical maps which are the divisor maps associated with the canonical sheaf and its dual, the important adjunction mapping can easily be computed. In the case of surfaces, this is just the divisor map of the first Serre twist of the canonical sheaf.
There is a function to compute the invertible sheaf corresponding to an effective Cartier divisor D, given as a subscheme of X, and to also compute a basis of the Riemann–Roch space of D along with the divisor map. The Riemann–Roch space is the finite-dimensional space of rational functions on X whose divisor of poles is ≤ D. Although this space is closely related to the divisor map, the two are computed in a slightly different manner here.
There are times when it is desirable to anti-project a variety from a lower-dimensional projective space to a higher-dimensional one. This may occur when the higher-dimensional embedding has a relatively simple natural form and the lower-dimensional one is a projection down that has fewer variables but unwieldy equations and bad expressions for automorphisms. A case in which this arose naturally is in 8-descent on elliptic curves where a model in projective 3-space for a homogeneous space E is constructed which is a projection from 7-space of a projective normal embedding. To recover the full embedding with sheaves is simply a matter of computing the divisor map of the structure sheaf and taking its image! Computing the maximal module for the structure sheaf is equivalent to constructing the coordinate ring of E in its 7-space embedding as a module and taking the image under the divisor map essentially recovers this coordinate ring as an algebra.
There is some functionality for working with specific global sections of a sheaf or its twists, represented by homogeneous elements of the original or maximal module. In particular, there is a function to compute the subscheme of zeroes of a global section of a locally-free sheaf. Applied to an invertible sheaf this gives a corresponding effective Cartier divisor. Two sheaves may be tested for isomorphism and an explicit isomorphism is returned if they are found to be isomorphic. One use of this is to test whether two Cartier divisors are rationally equivalent. This will be the case precisely when their corresponding invertible sheaves are isomorphic.
Most of the important discrete invariants of projective algebraic varieties are expressible as the k-dimension of a sheaf cohomology group: the geometric genus and higher plurigenera, the irregularity of a surface, and the Hodge diamond numbers. These cohomology dimensions also occur in deformation theory. For the tangent sheaf, the H0 dimension gives the dimension of the connected component of the automorphism group, the H1 dimension gives the dimension of the tangent space of the local deformation ring, and if the H2 cohomology has dimension zero then there are no obstructions to deformation and the local deformation ring is smooth. There is a function to compute dimension of the cohomology group Hn(X,S) for any sheaf S and n ≥ 0. The algorithm used is the one based on the Bernstein–Gelfand–Gelfand correspondence. As an alternative, the H0 dimension can also be computed more directly with a function that gives the dimension of global sections of a sheaf.
Divisors are finite ℤ-linear combinations of reduced, irreducible subschemes of codimension one of X, ∑1n niDi. The Di are referred to as prime divisors. If the ni are all ≥ 0 then the divisor is said to be effective. On a normal variety, effective divisors are in one-to-one correspondence with certain subschemes (technically, ones whose primary components are all of codimension one) and we sometimes identify the divisor with the corresponding subscheme. Prime divisors correspond to subschemes whose defining ideal is prime. A non-zero rational function f determines a divisor div(f), called a principal divisor, equal to the effective divisor of its zeros minus the effective divisor of its poles.
Abstractly, the multiplicity ni to which any prime divisor Di occurs in the decomposition of div(f) is equal to the valuation of f (considered as an element of the field of all rational functions) with respect to the local ring of the scheme-theoretic generic point of Di, which is a discrete valuation ring.
Two divisors are rationally equivalent if their difference is a principal divisor. A divisor is called Cartier if it is locally a principal divisor in the neighbourhood of any point of X. On a non-singular variety all divisors are Cartier, but divisors may fail to be Cartier in the neighbourhood of singular points. There is a one-to-one correspondence between rational equivalence classes of Cartier divisors and invertible sheaves (see below) and this allows us to use sheaf machinery for the more complex divisor computations.
Divisors are represented as a ℤ-linear combination of effective divisors given by their defining ideals. These effective divisors do not have to be reduced or irreducible. There are functions to refine the representing decomposition into the full decomposition of a ℤ-linear combination of prime divisors or just into a relatively prime decomposition where any two of the effective divisors occurring have no common prime divisor factor. Some operations for divisors are summarised below.
An example of divisor use is to blow down disjoint lines on a Del Pezzo surface. If the divisor corresponding to the sum of the lines and a hyperplane section is computed then the associated divisor map blows down the lines and gives the anticanonical embedding of the resulting higher-degree Del Pezzo surface. With sheaves, this can be performed by taking the divisor map of the first Serre twist of the invertible sheaf corresponding to the sum of the lines.