-- First, the smooth cubic.
restart
P2 = QQ[x,y,z]
I = ideal(y^2*z - x^3 + x*z^2)
S = P2/I
C = Proj(S)
wdim C
singularLocus(C)
genus C
-- Now, the second cubic.
restart
P2 = QQ[x,y,z]
I = ideal(y^2*z - x^3 - x^2*z)
S = P2/I
C = Proj(S)
dim C
singularLocus(C)
genus C -- notice that this gives the arihmetic genus
-- Intersection of fermat cubic with a quadric
restart
P3 = QQ[w,x,y,z]
I = ideal(w^3+x^3+y^3+z^3)
J = ideal(2*w^2-x^2+3*y^2-7*z^2+8*x*y-5*x*z+12*y*z-11*w*x+19*w*y-17*w*z)
dim Proj(P3/I)
dim Proj(P3/J)
K = I+J
C = Proj(P3/K)
singularLocus C
dim C
degree C
genus C
-- Fermat quintic
P4 = QQ[v,w,x,y,z]
I = ideal(v^5+w^5+x^5+y^5+z^5)
X = variety(I)
omega0 = OO_X
omega1 = cotangentSheaf(X)
omega2 = exteriorPower(2,omega1)
omega3 = exteriorPower(3,omega1)
cohomology(0,omega0)
cohomology(1,omega0)
cohomology(2,omega0)
cohomology(3,omega0)
cohomology(0,omega1)
cohomology(1,omega1)
cohomology(2,omega1)
cohomology(3,omega1)
cohomology(0,omega2)
cohomology(1,omega2)
cohomology(2,omega2)
cohomology(3,omega2)
cohomology(0,omega3) -- these last few are pretty slow, at least on my laptop. Life is easier if you use Serre duality.
cohomology(1,omega3)
cohomology(2,omega3)
cohomology(3,omega3)
-- Rational normal curve
restart
R = QQ[s,t]
S = QQ[w,x,y,z]
phi = map(R,S,{s^3,s^2*t,s*t^2,t^3})
I = ker phi
T = S/I
C = Proj(S/I)
N = Hom(I/I^2,T) -- that's what the normal bundle is
nor = sheaf N
cohomology(0,nor) -- we get H^0 is 12 dimensional.
-- so what could it be? O(a)+O(b) with a+b = 10 and both non-negative.
-- or O(k) + O(11) where k is negative. how to find out which? we can
-- compute the dimension of the space of sections of some twists.
-- it's a little tricky to get our hands on O(1); the problem is that C has
-- inherited its grading from P^3, and so OO_C(1) is going to return OO_{P^1}(3).
-- anyway, here's a stupid trick to circumvent it.
cohomology(0,nor**OO_C(-2))
-- this is the twist O(a-6)+O(b-6) wrt the usual O(1). If it were anything other than
-- O(5) + O(5), this would have sections. But it doesn't, according to the line abov.
-- So we conclude that the normal bundle is O(5)+O(5).
-- General points in P2
restart
F = ZZ/32009 -- this is a case where working over Q is not going to
-- work well: we'll end up with enormous denominators
R = F[x,y,z]
random(F)
m=3
pt1=ideal(x-random(F)*z,y-random(F)*z); -- generate some random points; i think it's pretty
pt2=ideal(x-random(F)*z,y-random(F)*z); -- self-evident what this command does.
pt3=ideal(x-random(F)*z,y-random(F)*z);
pt4=ideal(x-random(F)*z,y-random(F)*z); -- (of course M2 can do for loops and arrays and so on,
pt5=ideal(x-random(F)*z,y-random(F)*z); -- but let's keep it easy.)
pt6=ideal(x-random(F)*z,y-random(F)*z);
pt7=ideal(x-random(F)*z,y-random(F)*z);
idealsheaf = intersect(pt1^m,pt2^m,pt3^m,pt4^m,pt5^m,pt6^m,pt7^m)
-- the sheaf of functions vanishing like we nta.
-- There are a couple ways to proceed. Following our approach of
-- doing everything via coherent sheaves, we do the following.
-- The "coherent sheaf" approach.
restart
P2 = Proj(R)
van = sheaf (module idealsheaf)
cohomology(0,van(5))
cohomology(0,van(6))
cohomology(0,van(7))
cohomology(0,van(8))
cohomology(0,van(9))
-- We find there are such functions of degree 8 (and the naive dimension count works OK in this case).
-- The more direct approach.
B = basis(8,idealsheaf) -- this grabs the degree 8 part of the module in question, and generates a basis
numgens source B -- how many things are there in the basis?
-- Grassmannian
restart
R = QQ[x_1..x_8]
S = QQ[y_1..y_6]
A = matrix({{x_1,x_2,x_3,x_4},{x_5,x_6,x_7,x_8}})
I = minors(2,A)
gens I
phi = map(R,S,gens I)
ker phi
-- tada! it spits out the unique plucker relation for G(2,4).