The package CharacteristicClasses provides commands to compute the degrees of the Chern and Segre classes of subvarieties and subschemes of projective space. Equivalently, it computes the pushforward to projective space of the Chern and Segre classes.
Let X be an n-dimensional subscheme of projective space Pk. If X is smooth, then by definition the Chern classes of X are the Chern classes c0(TX), ..., cn(TX) of the tangent bundle TX. The Chern classes are cycles in the Chow ring of X, i.e., linear combinations of subvarieties of X modulo rational equivalence. For a subvariety V of X, the degree of the cycle [V] is defined as the degree of the variety V. This extends linearly to linear combinations of subvarieties. Computing the degrees of the Chern classes of X is equivalent to computing the pushforward of the Chern classes to the Chow ring of Pk, which is the ring ZZ[H]/(Hk+1), with H the hyperplane class. Also by definition, the Segre classes of the projective scheme X are the Segre classes s0(X,Pk), ..., sn(X,Pk) of X in Pk. For definition of the concepts used here, see e.g. W. Fulton "Intersection Theory". The functions in this package can have two different kinds of output. The functions chernClass and segreClass give back the pushforward of the total Chern class to the Chow ring of Pk, whereas chernClassList and segreClassList give a list of the degrees of the Chern or Segre classes, respectively. The scheme X can be given as either a homogeneous ideal in a polynomial ring over a field, or as projective variety.
This implementation uses the algorithm given in the articles "Chern Numbers of Smooth Varieties via Homotopy Continuation and Intersection Theory" (Sandra Di Rocco, David Eklund, Chris Peterson, Andrew J. Sommese) and "A method to compute Segre classes" (David Eklund, Christine Jost, Chris Peterson). The main step in the algorithm is the computation of the residuals. This can be done symbolically, using Gröbner bases, and numerically, using the regenerative cascade implemented in Bertini. The regenerative cascade is described in "Regenerative cascade homotopies for solving polynomial systems" by Jonathan Hauenstein, Andrew Sommese, and Charles Wampler. Bertini is developed by Dan Bates, Jonathan Hauenstein, Andrew Sommese, and Charles Wampler.