The cube graph

has incidence matrix

If is a field, the kernel of is the cycle space. The cycle space has basis

A cut is a partition of the vertex set of into two subsets, . The cocycle of such a cut is the set of edges that have one endpoint in and the other endpoint in . The cocycle space has basis

The Sagemath command below use functions from the file alg-graph-thry1.sage.

sage: Gamma = graphs.CubeGraph(3) sage: eo = [1]*12 sage: incidence_matrix(Gamma, eo) [ 1 -1 0 0 0 0 0 0] [ 1 0 -1 0 0 0 0 0] [ 1 0 0 0 -1 0 0 0] [ 0 1 0 -1 0 0 0 0] [ 0 1 0 0 0 -1 0 0] [ 0 0 1 -1 0 0 0 0] [ 0 0 1 0 0 0 -1 0] [ 0 0 0 1 0 0 0 -1] [ 0 0 0 0 1 -1 0 0] [ 0 0 0 0 1 0 -1 0] [ 0 0 0 0 0 1 0 -1] [ 0 0 0 0 0 0 1 -1] sage: cycle_space(Gamma, eo) Vector space of degree 12 and dimension 5 over Rational Field Basis matrix: [ 1 0 -1 0 -1 0 0 0 0 -1 -1 1] [ 0 1 1 0 0 0 -1 0 0 1 0 0] [ 0 0 0 1 1 0 0 -1 0 0 1 0] [ 0 0 0 0 0 1 1 1 0 0 0 -1] [ 0 0 0 0 0 0 0 0 1 -1 -1 1] sage: cocycle_space(Gamma, eo) Vector space of degree 12 and dimension 7 over Rational Field Basis matrix: [ 1 0 0 0 0 -1 0 0 1 0 0 -1] [ 0 1 0 0 0 -1 0 0 0 -1 0 -1] [ 0 0 1 0 0 0 0 0 -1 -1 0 0] [ 0 0 0 1 0 -1 0 0 0 0 -1 -1] [ 0 0 0 0 1 0 0 0 -1 0 -1 0] [ 0 0 0 0 0 0 1 0 0 1 0 1] [ 0 0 0 0 0 0 0 1 0 0 1 1]