Intro to Macaulay 2 UGA VIGRE Algebraic Geometry October 15, 2009 First, if you don't have Macaulay 2 installed, you need to ssh or putty to a machine where it is installed. Jose has created accounts for all of you on happy.math.uga.edu Log in. (The first time, use the standard math dept. default password.) Then cd /Applications/Macaulay2-1.2/bin ./M2 ---------------- --Really basic stuff ---------------- To start M2 from the command line in Linux/MacOSX/cygwin: > M2 To start M2 from inside emacs: M-x M2 (the meta key is usually either escape or option) Next let's visit the Macaulay 2 homepage: http://www.math.uiuc.edu/Macaulay2/ Important tabs: Downloads Getting started Documentation -- also has some information about getting started There are a few noteworthy tutorials: Find the tab "Getting started" and the link to "a first Macaulay 2 session" --I stole a lot of examples from this Later: under Documentation -- Mathematical examples -- Plane curves and gonality there is a tutorial that's pretty relevant for us (but they use a lot of language we haven't covered yet) http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.2/share/doc/Macaulay2/Macaulay2Doc/html/___Tutorial_co_sp__Canonical_sp__Embeddings_spof_sp__Plane_sp__Curves_spand_sp__Gonality.html ----------- --Arithmetic: ----------- 2+2 3/5+7/11 1*2*3 2^3 3! ------------ --More basics ------------ semicolons suppress output oo, ooo, o2 assign a value to a variable versus checking equality Macaulay 2 uses pointy brackets for ordered lists, not unordered sets {} Lists behave like vectors To create a list: either type in your list, or use apply To create simple functions ---------------- --Polynomial rings ---------------- ZZ,QQ,RR,CC R=QQ[x,y,z] Can also do finite fields: K=ZZ/101; Or fraction fields: R=QQ[x]; K=frac R; --great for checking algebraic identities -------------------- --Example: Klein quartic -------------------- clearAll R=QQ[x,y,z] I = ideal(x^3*y-y^3*z-z^3*x) hilbertPolynomial(I) hilbertPolynomial(I, Projective=>false) apply(10, i -> hilbertFunction(i,I)) apply(10, i -> 4*i-2) regularity(I) dim I J = singularLocus(I) dim J C= variety I dim C degree C genus C ------------ --Example: Tetrahedron ------------ --This example comes from work by Dave Bayer and David Eisenbud clearAll R=QQ[x,y,z] I = ideal(x^2*y*z-x*y^2*z+x*y*z^2) --Let's see if it's singular J= singularLocus(I) --Primary decomposition in algebra corresponds to finding the irreducible components of a variety in algebra. So to get the points in J: primaryDecomposition(I) ----------------------- --Example: Bicanonical Klein Quartic ----------------------- --This example comes up in my recent preprint with Ian Morrison, http://www.arxiv.org/abs/0910.2047. clearAll R=QQ[a..f] I = ideal {a*b-d^2, d*e-b*f, a*e-d*f, a*c-f^2, c*d-e*f, b*c-e^2, a*d+b*e+c*f} betti res I --For this example, what is the invariant $a$ that David Krumm defined last week? What does that tell us about this curve? ----------------- --Example: TH ----------------- --This example comes from David Eisenbud. clearAll R=QQ[a..h]; I = ideal {-f^2 + e*g, -e*f + d*g, -e^2 + d*f, -e^2 + c*g, -d*e + c*f, -d*e + b*g, -d^2 + c*e, -d^2 + b*f, -d^2 + a*g, -c*d + b*e, -c*d + a*f, -c^2 + b*d, -c^2 + a*e, -b*c + a*d, -b^2 + a*c, a*b - g^2 - h^2, c^3 - f*g^2 - f*h^2, b*c^2 - f^2*g - e*h^2, b^2*c - f^3 - d*h^2, b^3 - e*f^2 - c*h^2}; --For this example, what is the invariant $a$ that David Krumm defined last week? What does that tell us about this curve? ------------------------------- ------------------------------- --EXERCISES: points in P2, points in P3 ------------------------------- ------------------------------- --Here is a way to study random points in P2 Example: Two points in P2: Say P=[1,2,3], Q=[5,1,-4] clearAll R=QQ[a..c]; IP = ideal(c-3*a,b-2*a); IQ = ideal(a-5*b,c+4*b); I=intersect(IP,IQ); 1. What is the Hilbert function? The Hilbert polynomial? The Betti diagram? 2. Generate examples for 3 points and 4 points in P2, and answer the same questions. 3. Now do some examples for a few random points in P3. 4. Think back to Jacob's lecture and Theorem 2.8 from Eisenbud's book. We know what the Betti diagram should look for --a general set of 7 points in P^3 --a set of 7 points in P^3 that all lie on a twisted cubic. Find an example of each kind, and compute their Betti diagrams. 5. Choose an example from Chapter 3 in Eisenbud's book. Find an explicit example of the kind of example he discusses. Compute the Betti diagram. 6. Work through the examples below that we didn't have time to do together. 7. For the examples BKQ = Bicanonical Klein Quartic and TH above, we computed the Betti diagram and hence the invariant $a$ (the left hand side of Green's Conjecture last week). What does that tell us about these curves? ------------- --Example: K33 ------------- --This example popped up when I was doing some work with Jen Paulhus (Kansas State) clearAll R=QQ[a..d] I=ideal(a*d-b*c, a^3-b^3-c^3+d^3) hilbertPolynomial(I, Projective=>false) J=singularLocus(I) hilbertPolynomial(J, Projective=>false) --Primary decomposition in algebra corresponds to finding the irreducible components of a variety in algebra. So to get the points in J: primaryDecomposition(ideal(J)) --looks like there are 5 components --Problem: we are just working over QQ, not CC. Look at the first ideal. It suggests we need a square root of -3 ==> let's work over Q[sqrt(-3)] S=QQ[x]; K=ideal(x^2+3); T=S/K; U=T[a..d]; JU=ideal(-b*c+a*d,a^3-b^3-c^3+d^3,3*a^2*c-3*b^2*d,3*a^2*b-3*c^2*d,-3*b^3+3*c^3,-3*a^3+3*d^3,3*a*b^2-3*c*d^2,3*a*c^2-3*b*d^2) primaryDecomposition(JU) --------------- --Example: RB --------------- --Another one from Dave Bayer and David Eisenbud that Ian and I studied clearAll R=QQ[a..d] I = ideal(a*c-b^2,a*d^2-2*b*c*d+c^3); --Something's funny about the singular locus here. Can you tell what's going on? Hint: hilbertPolynomial(radical(I), Projective=>false) ------------------------------- ------------------------------- --COMING SOON ------------------------------- ------------------------------- --curves with gonality --more curves with singularities --additional smooth curves of higher genus