Skip to content

hodge

hodge_star(cochain)

Hodge star operator *(.) acting on a Cochain.

Paramters

cochain The k-cochain we want to apply the Hodge star on.

Returns:

Type Description
The (n-k)-cochain dual of the former.
Notes
  • This operator can only be applied on Cochain instances defined on a SimplicialManifold. This is checked thanks to the @on_manifold decorator.
  • Should not be mistaken with the topological operator star defined in the topology sub-module.
See also
  • @on_manifold decorator defined in the typecheck module.
Source code in src/dxtr/operators/hodge.py
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
@on_manifold
def hodge_star(cochain:Cochain) -> Optional[Cochain]:
    """Hodge star operator *(.) acting on a `Cochain`.

    Paramters
    ---------
    cochain
        The k-cochain we want to apply the Hodge star on.

    Returns
    -------
        The (n-k)-cochain dual of the former.

    Notes
    -----
      * This operator can only be applied on `Cochain` instances defined on 
        a `SimplicialManifold`. This is checked thanks to the `@on_manifold`
        decorator.
      * Should not be mistaken with the topological operator `star` 
        defined in the `topology` sub-module.

    See also
    --------
      * `@on_manifold` decorator defined in the `typecheck` module.
    """

    k = cochain.dim
    vals = cochain.values
    dual = cochain.isdual
    mfld = cochain.complex
    n = mfld.dim

    mtrx = _compute_hodge_star_of(mfld, k, dual)
    values = mtrx@vals

    return Cochain(mfld, dim=n-k, dual=not dual, values=values)