Exterior algebra represented with multidimensional array?

52 Views Asked by At

I wanted to represent the scalar components of the coordinates of a differential form using a multidimensional array but got stuck, it seems that one needs to have both positive and negative elements in the array, but I didn't have a feeling of what was right, I got a bit confused about how $Alt$ interplayed with the notation, since I am not good at converting already "applied" forms back to the corresponding form but with basis expansion. I was trying to implement the hodge star. I think I got the formula right, but the inputs wrong, so I only got nonsense.

I would like for example 1-,2-,3- and 4-forms in 4D Minkowski space as a multidimensional array. For example $dt\wedge dx\wedge dy$ (with friends). (Preferably the same representation as a tensor would have, so the indexing of a metric as a 4x4 array would be similar to the indexing of a 2-form as a 4x4 array, 3-form 4x4x4 array, ... (unless I am very wrong about it))

Should I be filling out all permutations multiplied by the parity and the factorial factor in the array? Something like

$ dx\wedge dy[1,2] = parity(1,2) \cdot 1/2!\\ dx\wedge dy[2,1] = parity(2,1) \cdot 1/2! $

One of the problems were likely that I did not fill in all permutations in the array. I got some basic unit tests working with this code:

def create_form_tensor_indices(k, d, increasing_index):
    form = np.zeros(k * (d,))
    for permutation in itertools.permutations(increasing_index):
        form[permutation] = permutation_symbol(*permutation) / np.math.factorial(len(permutation))
    return form

So that might be good enough for now.