Learn R Programming

stokes (version 1.2-0)

hodge: Hodge star operator

Description

Given a k-form, return its Hodge dual

Usage

hodge(K, n=dovs(K), g, lose=TRUE)

Value

Given a k-form, in an n-dimensional space, return a (n-k)-form.

Arguments

K

Object of class kform

n

Dimensionality of space, defaulting the the largest element of the index

g

Diagonal of the metric tensor, with missing default being the standard metric of the identity matrix. Currently, only entries of 1+/-1 are accepted

lose

Boolean, with default TRUE meaning to coerce to a scalar if appropriate

Author

Robin K. S. Hankin

See Also

wedge

Examples

Run this code


(o <- kform_general(5,2,1:10))
hodge(o)
o == hodge(hodge(o))

Faraday <- kform_general(4,2,runif(6)) # Faraday electromagnetic tensor
mink <- c(-1,1,1,1)  # Minkowski metric
hodge(Faraday,g=mink)

Faraday  == Faraday |>
      hodge(g=mink) |>
      hodge(g=mink) |>
      hodge(g=mink) |>
      hodge(g=mink)

hodge(dx,3) == dy^dz


## Some edge-cases:
hodge(scalar(1),2)
hodge(zeroform(5),9)
hodge(volume(5))
hodge(volume(5),lose=TRUE)
hodge(scalar(7),n=9)



Run the code above in your browser using DataLab