Hodge Star in Euclidean Three-Space¶
A metric and an orientation identify $k$-forms with $(3-k)$-forms. In oriented Euclidean coordinates,
$$\star dx=dy\wedge dz,\qquad \star(dx\wedge dy)=dz.$$
The Hodge star is where the metric enters differential-form calculus.
Euclidean metric and basis forms¶
We use the identity metric on $(x,y,z)$ and the standard orientation. The metric is typed as a matrix of symbolic mathematical values so the same definition pattern also works for nonconstant metrics.
declare symbol x, y, z : MathValue
def N : Integer := 3
def params : Vector MathValue := [| x, y, z |]
def g : Matrix MathValue :=
[| [| 1, 0, 0 |], [| 0, 1, 0 |], [| 0, 0, 1 |] |]
def dx : DiffForm MathValue := [| 1, 0, 0 |]
def dy : DiffForm MathValue := [| 0, 1, 0 |]
def dz : DiffForm MathValue := [| 0, 0, 1 |]
Definition of the Hodge star¶
For a $k$-form $A$, the Levi-Civita tensor supplies the complementary indices, inverse metrics raise the contracted indices, and $\sqrt{|\det g|}$ supplies the volume density.
def hodge (A : DiffForm MathValue) : DiffForm MathValue :=
let k := dfOrder A
in withSymbols [i, j]
sqrt (abs (M.det g_#_#)) *
foldl
(.)
((ε' N k)_(i_1)..._(i_N) . A..._(j_1)..._(j_k))
(map (\n -> g~(i_n)~(j_n)) [1..k])
A one-form becomes a two-form supported in the complementary oriented plane.
hodge dx
Conversely, the oriented area form in the $xy$-plane becomes the one-form normal to that plane.
hodge (wedge dx dy)
The two outputs are the component versions of $\star dx=dy\wedge dz$ and $\star(dx\wedge dy)=dz$. In three-dimensional Euclidean signature, applying $\star$ twice returns a one-form or a two-form with positive sign; changing the metric signature changes that sign, as the Minkowski-space notebook demonstrates.