# chainComplex(Complex) -- translate between data types for chain complexes

## Synopsis

• Function: chainComplex
• Usage:
C = chainComplex D
• Inputs:
• D, ,
• Outputs:
• C, ,

## Description

Both ChainComplex and Complex are Macaulay2 types that implement chain complexes of modules over rings. The plan is to replace ChainComplex with this new type. Before this happens, this function allows interoperability between these types.

The first example is the minimal free resolution of the twisted cubic curve.

 i1 : R = ZZ/32003[a..d]; i2 : I = monomialCurveIdeal(R, {1,2,3}) 2 2 o2 = ideal (c - b*d, b*c - a*d, b - a*c) o2 : Ideal of R i3 : M = R^1/I o3 = cokernel | c2-bd bc-ad b2-ac | 1 o3 : R-module, quotient of R i4 : C = resolution M 1 3 2 o4 = R <-- R <-- R <-- 0 0 1 2 3 o4 : ChainComplex i5 : D = freeResolution M 1 3 2 o5 = R <-- R <-- R 0 1 2 o5 : Complex i6 : C1 = chainComplex D 1 3 2 o6 = R <-- R <-- R 0 1 2 o6 : ChainComplex i7 : assert(C == C1)

The tensor products make the same choice of signs.

 i8 : D2 = D ** D 1 6 13 12 4 o8 = R <-- R <-- R <-- R <-- R 0 1 2 3 4 o8 : Complex i9 : C2 = chainComplex D2 1 6 13 12 4 o9 = R <-- R <-- R <-- R <-- R 0 1 2 3 4 o9 : ChainComplex i10 : assert(C2 == C1 ** C1)

## Caveat

This is a temporary method to allow comparisons among the data types, and will be removed once the older data structure is replaced