## Feature #729

### Betti numbers, betti diagram

**Description**

Design a good data structure for storing Betti numbers (also for multigraded case).

**Related issues**

### History

#### #1 Updated by John Abbott almost 3 years ago

Mario points out that for a non-graded case we will also need a datastructure.**UPDATE** (20150608) Mario thinks it is better to skip consideration of the non-graded case because the numbers depend on the actual resolution chosen.

The usual case is with a grading over ZZ, when the Betti diagram is represented as a matrix.

#### #2 Updated by John Abbott almost 3 years ago

**Status**changed from*New*to*In Progress***% Done**changed from*0*to*10*

Mario suggested that the internal representation should be `vector< map<degree, long> >`

.

The resolution is a list of modules (with homomorphisms between them) traditionally indexed from 0 on the right, and with higher integers as ones goes to the left (in the traditional way of writing them).

Since the list of modules is "dense" (*i.e.* there are no "holes") is seems most sensible to use a `vector`

with one position for each module. In the entry for each module we must find the shifts and their multiplicities: each degree(-shift) appears at most once, and has a positive integer multiplicity. Using a `std::map`

will ensure that each degree appears only once. Degrees must be ordered to use them as keys in a `map`

, but in fact they are already (lex) ordered.

Note that this design also allows an empty resolution (*e.g.* the resolution of the zero ideal).

Note: normally the shifts are written prefixed with a minus sign. In CoCoALib we have gradings over some cartesian power of `ZZ`

, so we can negate degrees. What do we want to store in the Betti structure? A shift which is to be **subtracted** from the plain degree, or a shift which is to be **added** to a plain degree?

#### #3 Updated by Anna Maria Bigatti about 2 years ago

**Target version**changed from*CoCoALib-0.99540 Feb 2016*to*CoCoALib-0.99560*

#### #4 Updated by Anna Maria Bigatti about 2 years ago

**Target version**changed from*CoCoALib-0.99560*to*CoCoALib-0.99550 spring 2017*

#### #5 Updated by John Abbott over 1 year ago

**Target version**changed from*CoCoALib-0.99550 spring 2017*to*CoCoALib-0.99560*

#### #6 Updated by John Abbott 6 months ago

**Target version**changed from*CoCoALib-0.99560*to*CoCoALib-0.99570*