I want to be able to compute with explicit exterior algebras of vector spaces. For example, given a real vector space $V$ of $3 \times 3$ matrices, I want to consider expressions of the form $v\wedge w\in \Lambda^2 V$ and would like Mathematica to understand that $v\wedge w=-w\wedge v$, and $v\wedge w+v\wedge t=v\wedge (w+t)$ etc. In particular, I want to be able to define linear operators on $\Lambda^2 V$ on a basis of decomposable elements and extend it by linearity to all elements. As an example, I would like to define an inner product $$B(x\wedge y,z\wedge w)=\langle x,y\rangle \langle z,w\rangle-\langle x,w\rangle\langle y,z\rangle$$ and have Mathematica understand that $$B(e_1\wedge e_2+e_3\wedge e_4,e_1\wedge e_2-e_3\wedge e_4)=0,$$ where $e_1,e_2,e_3,e_4\in V$ are orthonormal.

So far, my attempts were tricking Mathematica into thinking that $v\wedge w$ is the ordered pair {v,w}, but the problem is that this only makes computations work for decomposable vectors, since it thinks that $e_1\wedge e_2+e_3\wedge e_4=(e_1+e_3)\wedge (e_2+ e_4)$, i.e., {e1,e2}+{e3,e4}={e1+e3,e2+e4}, but I want to rule this out.

The command \wedge in Mathematica does not have a meaning (only makes for a nice display), and I tried using TensorWedge[,] but I can't get it to answer back results of expressions explicitly. I also gave a couple Packages a try, like "Grassmann" and "Ricci", but I feel there should be an easier way of doing this... Any thoughts?

  • $\begingroup$ I don't have v9, so I'm not sure, but it looks like Normal and declaring your symbols to be vectors using $Assumptions may be what you need. Check out the example for TensorWedge here. What do you think? $\endgroup$ Commented Nov 26, 2013 at 12:22
  • $\begingroup$ I suspect that listability of Plus will play havoc with any attempt to represent the operation as an ordered List. Also, might try some ideas from the nb available here, in the section "Some noncommutative algebraic manipulation". $\endgroup$ Commented Nov 26, 2013 at 15:27

1 Answer 1


Suppose we work with objects in some symbolic dimension dim:

In[1]:= $Assumptions = (e[1] | e[2] | e[3] | e[4]) \[Element] Vectors[dim]  
           && (a | b) \[Element] Matrices[{dim, dim}, Antisymmetric[{1, 2}]];

Now we can do something like

In[2]:= TensorRank[e[1]\[TensorWedge]e[2]]
Out[2]= 2

and basic manipulations like

In[3]:= a\[TensorWedge](a + 2 b) // TensorExpand
Out[3]= a\[TensorWedge]a + 2 a\[TensorWedge]b

In[4]:= e[1]\[TensorWedge]e[2] + e[2]\[TensorWedge]e[1] // TensorReduce
Out[4]= 0

In[5]:= a\[TensorWedge]b + a\[TensorWedge]b // TensorReduce
Out[5]= 2 a\[TensorWedge]b

We can define your scalar product as follows:

In[6]:= vectorQ[v_] := SameQ[TensorRank[v], 1];

In[7]:= B[TensorWedge[v1_?vectorQ, v2_?vectorQ], 
          TensorWedge[v3_?vectorQ, v4_?vectorQ]] := v1.v2 v3.v4 - v1.v4 v2.v3

We also need linearity relations:

In[8]:= B[x_Plus, y_] := B[#, y] & /@ x;
        B[x_, y_Plus] := B[x, #] & /@ y;
        B[c_?NumberQ x_, y_] := c B[x, y];
        B[x_, c_?NumberQ y_] := c B[x, y];


In[12]:= B[e[1]\[TensorWedge]e[2] + e[3]\[TensorWedge]e[4], 
           e[1]\[TensorWedge]e[2] - e[3]\[TensorWedge]e[4]] // TensorExpand
Out[12]= 0

Orthonormality of the basis was not required for that. You can impose it as

In[13]:= e /: e[i_].e[j_] := KroneckerDelta[i, j]

In[14]:= Outer[Dot, {e[1], e[2]}, {e[1], e[2]}]
Out[14]= {{1, 0}, {0, 1}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.