Discrete Hodge

The Combinatorial Laplacian and the Discrete Hodge Decomposition for simplicial complexes, simplicial sets, Delta complexes and Cubical complexes.

The Algebraic Topological Model

For such objects, this implementation uses the method algebraic_topological_model available at SAGEMATH. The specification of the method for the case of a finite simplicial complex (see SS, DC and CC for the implementation in other simplicial structures) is the following:

Algebraic topological model for this simplicial complex with coefficients in base_ring.

The term “algebraic topological model” is defined by Pilarczyk and Réal [PR15].

INPUT:

  • base_ring – coefficient ring (default: QQ); must be a field

Denote by \(C\) the chain complex associated to this simplicial complex. The algebraic topological model is a chain complex \(M\) with zero differential, with the same homology as \(C\), along with chain maps \(\pi: C \to M\) and \(\iota: M \to C\) satisfying \(\iota \circ \pi = 1_M\) and \(\pi \circ \iota\) chain homotopic to \(1_C\). The chain homotopy \(\phi\) must satisfy

  • \(\phi \circ \phi = 0\),

  • \(\pi \circ \phi = 0\),

  • \(\phi \circ \iota = 0\).

Such a chain homotopy is called a chain contraction.

OUTPUT: a pair consisting of

  • chain contraction \(\phi\) associated to \(C\), \(M\), \(\pi\), and \(\iota\)

  • the chain complex \(M\)

Note that from the chain contraction \(\phi\), one can recover the chain maps \(\pi\) and \(\iota\) via phi.pi() and phi.iota(). Then one can recover \(C\) and \(M\) from, for example, phi.pi().domain() and phi.pi().codomain(), respectively.

An alternative definition for cochain complexes is given in [CG08]:

Given two cochain complexes \(C\) and \(M\), a contraction \((\pi, \iota, \phi)\) from \(C\) to \(M\) consists of chain maps:

\[\begin{split}\begin{array}{cc} \pi:& C \rightarrow M ,\\ \iota:& M \rightarrow C , \end{array}\end{split}\]

and a chain homotopy

\[\phi: C^{*} \rightarrow C^{*-1},\]

such that

\[\pi \circ \iota = \mathrm{1}_M\]

and

\[\iota \circ \pi - \mathrm{1}_C = d_C \circ \phi + \phi \circ d_C.\]

Such a chain homotopy provides a strong relation between the chain complexes \(C\) and \(M\); for example, their homology groups are isomorphic.

The Combinatorial Laplacian and the Discrete Hodge Decomposition

This definitions come from [Dod76a, Gol02].

Let \(K\) be a finite oriented simplicial complex, \(d \geq 0\) be an integer, and \(\partial_d: C_d(K) \rightarrow C_{d-1}(K)\), the boundary operator. Then,

Definition: The \(d\)-th combinatorial Laplacian is the linear operator \(\Delta_d : C_d \longrightarrow C_d\) given by

\[\Delta_d = \partial_{d+1} \circ \partial_{d+1}^* + \partial_d^* \circ \partial_d.\]

For convenience, we use the notations

\[\Delta_d^{\mathrm{up}} = \partial_{d+1} \circ \partial_{d+1}^*\]

and

\[\Delta_d^{\mathrm{down}} = \partial_d^* \circ \partial_d,\]

so that

\[\Delta_d = \Delta_d^{\mathrm{up}} + \Delta_d^{\mathrm{down}}.\]

Now, let \(B_{d}\) be the adjacenty matrix of dimension d defined by the simplicial structure of K.

The \(d\)-th Laplacian matrix of \(K\), denoted \(L_d\), relative to some orderings of the standard bases for \(C_d\) and \(C_{d-1}\) of \(K\), is the matrix representation of \(\Delta_d\).

Observe that

\[L_d = B_{d+1} B_{d+1}^T + B_d^T B_d.\]

As above, for convenience, we use the notations

\[L_d^{\mathrm{up}} = B_{d+1} B_{d+1}^T\]

and

\[L_d^{\mathrm{down}} = B_d^T B_d,\]

so that

\[L_d = L_d^{\mathrm{up}} + L_d^{\mathrm{down}}.\]

Relation between the AT-model and the combinatorial laplacian

Let

\[ \begin{array}{rcl} H_d & := & \ker{(L_d^{up})} \cap \ker{(L_d^{down})} \\ E_d & := & \ker{(L_d^{up})} \cap \text{Im}({L_d^{down}}) \\ C_d & := & \text{Im}({L_d^{up}}) \cap \ker{(L_d^{down})} \end{array} \]

It is easy to see that \(H_d = \ker{L_d}\). The fundamental theo of discrete Hodge theory states:

For any finite simplicial complex \(K\), we have the orthogonal decomposition:

\[C^k(K;\mathbb{K}) = H_d \oplus E_d \oplus C_d\]

and

\[ \begin{array}{rcl} H_d & \perp & E_d \\ E_d & \perp & C_d \\ C_d & \perp & H_d \end{array} \]

Furthermore, \(\ker{(L_k)} \cong H^k(K; \mathbb{K})\) via the natural projection.

Taking into account the AT-model:

Theorem:

\[ \begin{array}{rcl} H_d & \cong & \text{Im}(\iota \circ \pi) \\ E_d & \cong & \text{Im}{(d_C \circ \phi)} \\ C_d & \cong & \text{Im}{(\phi \circ d_C)} \end{array} \]

and

\[ \begin{array}{rcl} \text{Im}(\iota \circ \pi) & \perp & \text{Im}{(d_C \circ \phi)} \\ \text{Im}{(d_C \circ \phi)} & \perp & \text{Im}{(\phi \circ d_C)} \\ \text{Im}{(\phi \circ d_C)} & \perp & \text{Im}(\iota \circ \pi) \end{array} \]

and

\[C^k(K) = \text{Im}(\iota \circ \pi) \oplus \text{Im}{(d_C \circ \phi)} \oplus \text{Im}{(\phi \circ d_C)}\]

See also

  • Finite simplicial complexes: SC.

  • Simplicial sets: SS.

  • Finite Delta-complexes: DC.

  • Finite cubical complexes: CC.

Note

References:

class Hodge(*args: Any, **kwargs: Any)[source]

Bases: SageObject, UniqueRepresentation, CachedRepresentation

This class implements the Combinatorial Laplacian and the Discrete Hodge Decomposition of the cochain complex of a simplicial structure. For such decomposition, this class makes use of the AT_model implementation available at SAGEMATH.

base_ring()[source]

Return the base ring of “self”.

boundary_operator(dim)

The differentials which make up the chain complex.

INPUT:

  • dim – element of the grading group (optional, default “None”);

OUTPUT:

The differential starting in dimension dim as a sparse matrix.

EXAMPLES:

sage: K = simplicial_complexes.Sphere(2)
sage: H = Hodge(K)
sage: H.boundary_operator(1)
[-1 -1 -1  0  0  0]
[ 1  0  0 -1 -1  0]
[ 0  1  0  1  0 -1]
[ 0  0  1  0  1  1]
sage: H.boundary_operator(1) == K.chain_complex().differential(1)
True
coboundary_operator(dim)

The differentials which make up the cochain complex.

INPUT:

  • dim – element of the grading group (optional, default “None”);

OUTPUT:

The differential starting in dimension dim as a sparse matrix.

EXAMPLES:

sage: K = simplicial_complexes.Sphere(2)
sage: H = Hodge(K)
sage: H
The Discrete Hodge structure of Minimal triangulation of the 2-sphere over the base ring Rational Field
sage: H.coboundary_operator(1)
[ 1 -1  0  1  0  0]
[ 1  0 -1  0  1  0]
[ 0  1 -1  0  0  1]
[ 0  0  0  1 -1  1]
sage: H.coboundary_operator(1) == K.chain_complex().dual().differential(1)
True
coexact_basis(d)

The basis of the coexact (non-closed) cochain subspace of \(C^d(K)\).

EXAMPLES:

sage: K = simplicial_complexes.Sphere(2)
sage: H = Hodge(K)
sage: H.coexact_basis(1)
[(1, 0, -1, 0, 1, 0), (0, 1, -1, 0, 0, 1), (0, 0, 0, 1, -1, 1)]
coexact_matrix(d)

The coexact (non-closed) cochain subspace of \(C^d(K)\) as a sparse matrix with rows the basis of the vector subspace.

EXAMPLES:

sage: K = simplicial_complexes.Sphere(2)
sage: H = Hodge(K)
sage: H.coexact_basis(1)
[(1, 0, -1, 0, 1, 0), (0, 1, -1, 0, 0, 1), (0, 0, 0, 1, -1, 1)]
sage: H.coexact_matrix(1)
[ 1  0 -1  0  1  0]
[ 0  1 -1  0  0  1]
[ 0  0  0  1 -1  1]
exact_basis(d)

The basis of the exact cochain subspace of \(C^d(K)\).

EXAMPLES:

sage: K = simplicial_sets.Torus()
sage: H = Hodge(K)
sage: H.harmonic_basis(1)
[
(1, 0, 1),
(0, 1, 1)
]
sage: H.exact_basis(1)
[]
sage: H.coexact_basis(1)
[(1, 1, -1)]
exact_matrix(d)

The exact cochain subspace of \(C^d(K)\) as a sparse matrix with rows the basis of the vector subspace.

EXAMPLES:

sage: K = delta_complexes.KleinBottle()
sage: H = Hodge(K)
sage: [H2,E2,C2] = H.hodge_decomposition(2)
sage: H2
[0 0]
sage: E2
[ 1  1]
[ 1 -1]
sage: C2
[]
sage: K.dimension()
2
sage: [H1,E1,C1] = H.hodge_decomposition(1)
sage: H1
[0 0 1]
sage: E1
[]
sage: C1
[1 0 0]
[0 1 0]
sage: d1 = H.coboundary_operator(1)
sage: (d1*C1.T).T == E2
True

EXAMPLES:

K = delta_complexes.KleinBottle()
H = Hodge(K)
[H2,E2,C2] = H.hodge_decomposition(2)
print("K.dimension()")
[H1,E1,C1] = H.hodge_decomposition(1)
d1 = H.coboundary_operator(1)
print((d1*C1.T).T == E2)
harmonic_basis(d)

The basis of the harmonic cochain subspace of \(C^d(K)\).

EXAMPLES:

sage: K = simplicial_sets.Torus()
sage: H = Hodge(K)
sage: H.harmonic_basis(1)
[
(1, 0, 1),
(0, 1, 1)
]
sage: H.exact_basis(1)
[]
sage: H.coexact_basis(1)
[(1, 1, -1)]
harmonic_matrix(d)

The harmonic cochain subspace of \(C^d(K)\) as a sparse matrix with rows the basis of the vector subspace.

EXAMPLES:

sage: K = simplicial_sets.Torus()
sage: H = Hodge(K)
sage: H.harmonic_matrix(1)
[1 0 1]
[0 1 1]
sage: H.exact_matrix(1)
[0 0 0]
sage: H.coexact_matrix(1)
[ 1  1 -1]
hodge_cochain_decomposition(cochain, degree)[source]

Returns the hodge decomposition of the cochain c as a sum of three components

\[cochain = h + e + c\]

where h is the harmonic component, e is the exact component and c is the coexact component.

INPUT:

  • cochain – a cochain of \(C^d(K)\) represented as a vector over the base ring.

  • degree – the degree of the cochain.

OUTPUT: a tuple (h,e,c) of elements of \(C^d(K)\)

EXAMPLES:

sage: K = cubical_complexes.Sphere(2)
sage: H = Hodge(K)
sage: v = random_vector(QQ, len(K.n_cells(2)))
sage: v
(-1/15, 1, 1/449, 1/3, -2/5, 0)
sage: (h,e,c) = H.hodge_cochain_decomposition(v,2)
sage: v == h+c+e
True
sage: h
(0, 0, 0, 0, 0, 4036/2245)
sage: e
(-1/15, 1, 1/449, 1/3, -2/5, -4036/2245)
sage: c
(0, 0, 0, 0, 0, 0)
hodge_decomposition(dim)

Returns the hodge decomposition of \(C^dim(K)\).

INPUT:

  • dim – the degree of the cochain module.

OUTPUT: a tuple of matrices (H,E,C) corresponding with the harmonic, exact and coexact matrices.

EXAMPLES:

The hodge decomposition of the simplicial cochain complex of the 2-Sphere at degree 2:

sage: K = cubical_complexes.Sphere(2) sage: H = Hodge(K) sage: (H,E,C) = H.hodge_decomposition(2) sage: H [0 0 0 0 0 1] sage: E [ 1 0 0 0 0 1] [ 0 1 0 0 0 -1] [ 0 0 1 0 0 1] [ 0 0 0 1 0 -1] [ 0 0 0 0 1 1] sage: C [] sage: len(K.n_cells(2)) 6

(TO UPDATE) Example that ilustrates the orthogonality of the decomposition:

sage: S2 = simplicial_sets.Sphere(2) sage: T = simplicial_sets.Torus() sage: K = S2.product(S2).product(T) sage: K S^2 x S^2 x Torus sage: W = APLK(K) sage: W Algebra of Whitney Forms on S^2 x S^2 x Torus sage: hodge = W.hodge()

S2 = simplicial_sets.Sphere(2) T = simplicial_sets.Torus() K = S2.product(S2).product(T) ch = K.chain_complex(base_ring=QQ).dual() (phi,M) = K.algebraic_topological_model() d1 = ch.differential(1) d2 = ch.differential(2) C = phi.dual().in_degree(3)*d2 E = d1*phi.dual().in_degree(2) H = phi.dual().iota().in_degree(2)*phi.dual().pi().in_degree(2) H*E == 0 H*C == 0 C*E == 0 E*C == 0

laplacian(dim)

Returns the discrete laplacian of dimension dim.

INPUT:

  • dim – the dimension of the cochain module.

OUTPUT: a tuple of sparse matrices (L, Ldown, Lup) corresponding with the laplacian, the down laplacian and the up laplacian matrices.

EXAMPLES:

sage: K = delta_complexes.KleinBottle()
sage: K
Delta complex with 1 vertex and 7 simplices
sage: H = Hodge(K)
sage: H
The Discrete Hodge structure of Delta complex with 1 vertex and 7 simplices over the base ring Rational Field
sage: (L, Ldown, Lup) = H.laplacian(1)
sage: L
[ 2  0  0]
[ 0  2 -2]
[ 0 -2  2]
sage: Ldown
[0 0 0]
[0 0 0]
[0 0 0]
sage: Lup
[ 2  0  0]
[ 0  2 -2]
[ 0 -2  2]
sage: L.right_kernel().dimension() == len(H.harmonic_basis(1))
True
preimage(cochain, degree)[source]

Returns the coexact cochain of degree-1 whose differential correspond with the exact component of the given cochain.

INPUT:

  • cochain – a cochain vector

  • degree – the degree of the cochain.

OUTPUT: a cochain vector of degree degree-1 whose differential corresponds with the exact component of the given cochain.

EXAMPLES:

sage: S2 = simplicial_sets.Sphere(2)
sage: K = S2.product(S2)
sage: H = Hodge(K)
sage: H
The Discrete Hodge structure of S^2 x S^2 over the base ring Rational Field
sage: v = random_vector(QQ, len(K.n_cells(3)))
sage: (h,e,c) = H.hodge_cochain_decomposition(v,3)
sage: h
(0, 0, 0, 0, 0, 0)
sage: e
(1/12, 0, 1/12, -1/12, 0, -1/12)
sage: c
(-1/12, -2, 1/4, 1/12, -1/6, 1/12)
sage: y = H.preimage(v,3)
sage: dif = K.chain_complex(base_ring=QQ).dual().differential(2)
sage: dif*y == e
True