4.13.2 Computing the Genus

We compute the projective genus of ideals that define curves over $ \mathbf{Q}$ . It is very important to load the normal.lib library before calling the genus command, or you'll get an error message.

sage: singular.lib('normal.lib')
sage: R = singular.ring(0,'(x,y)','dp')
sage: i2 = singular.ideal('y9 - x2*(x-1)^9 + x')
sage: i2.genus()
40

Note that the genus can be much smaller than the degree:

sage: i = singular.ideal('y9 - x2*(x-1)^9')
sage: i.genus()
0

See About this document... for information on suggesting changes.