It's usually a good idea to 

restart

first.

Exercise 1: run commands

1+1

1/2

sqrt(5)

0..4


You do not need punctuation at the end of the lines. Most of the time, output has two lines:

  • o1 - the actual answer
  • o2 - the type of the answer (="what mathematical object is it? where does it live?")

Exercise 2: compare

a= 1+2

b=1+2;


Semicolon ; suppresses the printing of the output.


Exercise 3: print previous output

oo

o1


Important difference between Macaulay2 and other general computational algebra systems: you need to specify the ring where the variables live before using the variables


Exercise 4: first try

x+y

now try

R=QQ[x,y]

x+y


Why? Describe the set of points x such that their first coordinate x1=0. This question only makes sense if you know where x lives. In R^1, the set is a singleton {0}. In R^2, it's the y-axis. 

Notation for common rings/fields:
  • ZZ - integers
  • QQ - rationals
  • RR - reals
  • CC - complex numbers

Most of the time you'll want to use QQ.


Exercise 5: Matrices

A=matrix{{1,2},{3,4}}

B=matrix{{x,y},{x-y,x+y}}

A*B


Macaulay2 thinks of matrices as maps, so you get additional information about the map in the second line of the output.

Our best friends in this course will be ideals, so let's make some.

Exercise 6: After restarting, define a new ring and an ideal

restart

R=QQ[x_1..x_3]

I = ideal (x_1+x_2^2,x_3-x_1)

Last modified: Friday, 11 September 2020, 11:52 AM