next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc > ideals > ideals to and from matrices

ideals to and from matrices

forming an ideal from a matrix

After defining a matrix (see inputting a matrix) , M, the ideal generated by the entries of the matrix is obtained using the command ideal.
i1 : R = ZZ/101[a..e];
i2 : M = matrix{{a^2*b-c^2, a*b^2-d^3, c^5-d},{a^2*b, b*c*d, c^5}}

o2 = | a2b-c2 ab2-d3 c5-d |
     | a2b    bcd    c5   |

             2       3
o2 : Matrix R  <--- R
i3 : ideal M

             2     2   2      2    3          5       5
o3 = ideal (a b - c , a b, a*b  - d , b*c*d, c  - d, c )

o3 : Ideal of R

forming a matrix from an ideal

In much the same way we can construct a 1 by n (where n is the number of generators of I), matrix from the n generators of an ideal I using the command, generators.
i4 : I = ideal(a^2*b-c^2+c*d, a*b^2-b*d^3, c^5,d+e);

o4 : Ideal of R
i5 : generators I

o5 = | a2b-c2+cd -bd3+ab2 c5 d+e |

             1       4
o5 : Matrix R  <--- R
The abbreviation gens can be used for generators.