Example 1.
First create a 5-dimensional manifold and define a metric tensor on the tangent space of .
The standard basis is an orthonormal basis for and therefore the Hodge star is easily computed.
Example 2.
To show the dependence of the Hodge star upon the metric, we consider a general metric on a 2-dimensional manifold.
Example 3.
The Laplacian of a function with respect to a metric can be calculated using the exterior derivative operation and the Hodge star operator.
To illustrate this result, we use the Euclidean metric in polar coordinates .
To simplify the definition of the Laplacian, we define the Hodge operator with fixed.
To display the Laplacian of in compact form we invoke the PDEtools[declare] command.
Here is the formula for the Laplacian in terms of HodgeStar and ExteriorDerivative. Recall that @ is the composition of functions.
Example 4.
The HodgeStar program also works in the more general context of a vector bundle .
Example 5.
The HodgeStar operation can also be performed using an indefinite metric. The keyword argument detmetric = -1 must be used when the metric has negative determinant.