<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>manipulating modules</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="___Manipulator.html">next</a> | <a href="_making_spmodules_spfrom_spmatrices.html">previous</a> | <a href="___Manipulator.html">forward</a> | <a href="_making_spmodules_spfrom_spmatrices.html">backward</a> | up | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <hr/> <div><h1>manipulating modules</h1> <div>Suppose we have a module that is represented as an image of a matrix, and we want to represent it as a cokernel of a matrix. This task may be accomplished with <a href="_prune.html" title="prune, e.g., compute a minimal presentation">prune</a>.<table class="examples"><tr><td><pre>i1 : R = QQ[x,y];</pre> </td></tr> <tr><td><pre>i2 : I = ideal vars R o2 = ideal (x, y) o2 : Ideal of R</pre> </td></tr> <tr><td><pre>i3 : M = image vars R o3 = image | x y | 1 o3 : R-module, submodule of R</pre> </td></tr> <tr><td><pre>i4 : N = prune M o4 = cokernel {1} | -y | {1} | x | 2 o4 : R-module, quotient of R</pre> </td></tr> </table> The isomorphism between them may be found under the key <tt>pruningMap</tt>.<table class="examples"><tr><td><pre>i5 : f = N.cache.pruningMap o5 = {1} | 1 0 | {1} | 0 1 | o5 : Matrix</pre> </td></tr> <tr><td><pre>i6 : isIsomorphism f o6 = true</pre> </td></tr> <tr><td><pre>i7 : f^-1 o7 = {1} | 1 0 | {1} | 0 1 | o7 : Matrix</pre> </td></tr> </table> The matrix form of <tt>f</tt> looks nondescript, but the map knows its source and target<table class="examples"><tr><td><pre>i8 : source f o8 = cokernel {1} | -y | {1} | x | 2 o8 : R-module, quotient of R</pre> </td></tr> <tr><td><pre>i9 : target f o9 = image | x y | 1 o9 : R-module, submodule of R</pre> </td></tr> </table> It's a 2 by 2 matrix because <tt>M</tt> and <tt>N</tt> are both represented as modules with two generators.<p/> Functions for finding related modules:<ul><li><span><a href="_ambient.html" title="ambient free module of a subquotient, or ambient ring">ambient</a> -- ambient free module of a subquotient, or ambient ring</span></li> <li><span><a href="_cover.html" title="get the covering free module">cover</a> -- get the covering free module</span></li> <li><span><a href="_super.html" title="get the ambient module">super</a> -- get the ambient module</span></li> </ul> <table class="examples"><tr><td><pre>i10 : super M 1 o10 = R o10 : R-module, free</pre> </td></tr> <tr><td><pre>i11 : cover N 2 o11 = R o11 : R-module, free, degrees {1, 1}</pre> </td></tr> </table> Some simple operations on modules:<ul><li><span><a href="___Module_sp^_sp__Z__Z.html" title="direct sum">Module ^ ZZ</a> -- direct sum</span></li> <li><span><a href="___Module_sp_pl_pl_sp__Module.html" title="direct sum of modules">Module ++ Module</a> -- direct sum of modules</span></li> <li><span><a href="___Module_sp_st_st_sp__Module.html" title="tensor product">Module ** Module</a> -- tensor product</span></li> </ul> <table class="examples"><tr><td><pre>i12 : M ++ N o12 = subquotient ({0} | x y 0 0 |, {0} | 0 |) {1} | 0 0 1 0 | {1} | -y | {1} | 0 0 0 1 | {1} | x | 3 o12 : R-module, subquotient of R</pre> </td></tr> <tr><td><pre>i13 : M ** N o13 = cokernel {2} | -y 0 -y 0 | {2} | x 0 0 -y | {2} | 0 -y x 0 | {2} | 0 x 0 x | 4 o13 : R-module, quotient of R</pre> </td></tr> </table> Ideals and modules behave differently when making powers:<table class="examples"><tr><td><pre>i14 : M^3 o14 = image | x y 0 0 0 0 | | 0 0 x y 0 0 | | 0 0 0 0 x y | 3 o14 : R-module, submodule of R</pre> </td></tr> <tr><td><pre>i15 : I^3 3 2 2 3 o15 = ideal (x , x y, x*y , y ) o15 : Ideal of R</pre> </td></tr> </table> </div> </div> </body> </html>