Macaulay2 » Documentation
Packages » PruneComplex :: toChainComplex
next | previous | forward | backward | up | index | toc

# toChainComplex -- Converts a list of mutable matrices into a ChainComplex.

- Usage:
    `C = toChainComplex(M, F)`
- Inputs:
  - M, a list, a list of MutableMatrix type
  - F, a module, the initial free module in the resolution. This is used to calculate the degrees in the maps.
- Outputs:
  - C, a complex,

## Description

    i1 : R = ZZ/32003[vars(0..17)];

    i2 : m1 = genericMatrix(R,a,3,3)

    o2 = | a d g |
         | b e h |
         | c f i |

                 3      3
    o2 : Matrix R  <-- R

    i3 : m2 = genericMatrix(R,j,3,3)

    o3 = | j m p |
         | k n q |
         | l o r |

                 3      3
    o3 : Matrix R  <-- R

    i4 : I = ideal(m1*m2-m2*m1)

    o4 = ideal (d*k + g*l - b*m - c*p, b*j - a*k + e*k + h*l - b*n - c*q, c*j +
         ------------------------------------------------------------------------
         f*k - a*l + i*l - b*o - c*r, - d*j + a*m - e*m + d*n + g*o - f*p, - d*k
         ------------------------------------------------------------------------
         + b*m + h*o - f*q, - d*l + c*m + f*n - e*o + i*o - f*r, - g*j - h*m +
         ------------------------------------------------------------------------
         a*p - i*p + d*q + g*r, - g*k - h*n + b*p + e*q - i*q + h*r, - g*l - h*o
         ------------------------------------------------------------------------
         + c*p + f*q)

    o4 : Ideal of R

    i5 : C = freeResolution I;

    i6 : D = C[-10]

          1      8      33      60      61      32      5
    o6 = R  <-- R  <-- R   <-- R   <-- R   <-- R   <-- R

         10     11     12      13      14      15      16

    o6 : Complex

    i7 : MC = toMutableComplex D;

    i8 : MC = first pruneComplex MC;

    i9 : D' = toChainComplex MC

          1      8      33      60      61      32      5
    o9 = R  <-- R  <-- R   <-- R   <-- R   <-- R   <-- R

         0      1      2       3       4       5       6

    o9 : Complex

    i10 : assert(betti D == betti D'[-10])

## Caveat

Since the information about source of target of maps is not available, the grading may be incorrect for general complexes.

## See also

- toMutableComplex -- Converts a chain complex into a list of mutable matrices.

## Ways to use toChainComplex:

- `toChainComplex(List)`
- `toChainComplex(List,Module)`

## For the programmer

The object toChainComplex is a method function.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/PruneComplex/doc.m2:249:0.