[top][index]
search for:

map(Module,Module,Function) -- make a map

Synopsis:

  • Usage: h = map(M,N,f)
  • Function: map -- make a map
  • Input:
  • M, an instance of class Module:
  • N, an instance of class Module:
  • f, an instance of class Function:
  • Output:
  • h, an instance of class Matrix: a map from the module N to the module M whose matrix entry h_(i,j) is obtained from the function f by evaluating f(i,j).
  • Optional arguments :
  • map(..., Degree)
  • map(..., DegreeMap => ...)
  • i1 : R = ZZ[a..c];
    i2 : f = map(R^3,R^{0,-1,-2},(i,j) -> R_i^j)

    o2 = | 1 a a2 |
         | 1 b b2 |
         | 1 c c2 |

                 3       3
    o2 : Matrix R  <--- R

    We specified the degrees of the source basis elements explicitly to ensure the matrix would be homogeneous.

    i3 : isHomogeneous f

    o3 = true

    We could have let Macaulay2 take care of that for us, by replacing the source module by its desired rank.

    i4 : g = map(R^3,3,(i,j) -> R_i^j)

    o4 = | 1 a a2 |
         | 1 b b2 |
         | 1 c c2 |

                 3       3
    o4 : Matrix R  <--- R
    i5 : degrees g

    o5 = {{{0}, {0}, {0}}, {{0}, {1}, {2}}}

    o5 : List
    i6 : isHomogeneous g

    o6 = true

    Another way would be to let matrix take care of that for us.

    i7 : h = matrix table(3,3,(i,j) -> R_i^j)

    o7 = | 1 a a2 |
         | 1 b b2 |
         | 1 c c2 |

                 3       3
    o7 : Matrix R  <--- R
    i8 : degrees h

    o8 = {{{0}, {0}, {0}}, {{0}, {1}, {2}}}

    o8 : List
    i9 : isHomogeneous h

    o9 = true

    Code:

         -- ../../../Macaulay2/m2/matrix1.m2:12-14
         map(Module,Module,Function) := Matrix => options -> (M,N,f) -> (
              map(M,N,table(numgens M, numgens N, f))
              )

    [top][index]
    search for: