How to convert between frame and coordinate bases

Difficulty level:   ★ ★ ★

This article describes how to transform components of vectors or other tensors between a coordinate basis and an arbitrary frame / tetrad. This process is more general than the transformation between two coordinate bases as found in any introductory general relativity course. Some frames are “non-holonomic” meaning they do not arise from any set of coordinate basis vectors, also there may be situations in which a coordinate representation is inconvenient or not known. I also outline how to implement the transformations in a computer algebra system (CAS).

Effectively we only work in a single tangent space on the manifold, so it turns out to be just a linear algebra problem. My description is based on Carroll (§J) and de Felice & Clarke (§4.2) who assume the frame is orthonormal, however I simply assume it is a basis: that it spans the tangent space and is linearly independent. So suppose we have coordinates x^\mu, and a frame (\mathbf e_a) with components e_a^{\hphantom a\mu}:=(e_a)^\mu in the coordinate system, that is:

    \[\mathbf e_a = e_a^{\hphantom a\mu}\boldsymbol\partial_\mu\]

in terms of coordinate basis vectors. I use Latin indices to specify vectors in the tetrad frame, and add a hat for orthonormal frames. I use Greek indices for coordinate components, for example (e_0)^\mu for the vector \mathbf e_0. (In place of our e_a^{\hphantom a\mu}, de Felice & Clarke write \lambda_{\hat a}^{\hphantom ai}, and Carroll swaps the index order to e^\mu_{\hphantom\mu a}.) In a CAS we can implement the frame as a 4\times 4 array / matrix called “\texttt{frame}” say, reading the indices of e_a^{\hphantom a\mu} from left to right but ignoring their up-or-down placement. This ordering conveniently gives an array of “vectors”:

    \[\texttt{frame} := \big((e_0^{\hphantom 00},\ldots,e_0^{\hphantom 03}),(\cdots),(\cdots),(\cdots)\big)\]

However there is a tradeoff that vectors are placed in rows instead of the more standard column vector representation, because matrix indices refer to the row first and column second. We also define quantities (e^b_{\hphantom b\mu}) implemented as a matrix “\texttt{dualframe}“, which give the coordinate basis vectors in terms of the new frame:

    \[\partial_\mu = e^b_{\hphantom b\mu}\mathbf e_b\]

It follows from linear independence that e_a^{\hphantom a\mu}e^b_{\hphantom b\mu}=\delta_a^b, hence as matrices: \texttt{dualframe}=(\texttt{frame}^\top)^{-1}. The transpose is required because of the index summation order, since the convention for matrix multiplication is (AB)_{ij}:=\sum A_{ik}B_{kj}. This point could easily be missed when references call it “inverse” with more general index summation in mind. Note summing over the Latin indices also returns the identity: e_a^{\hphantom a\mu}e^a_{\hphantom a\nu}=\delta^\mu_\nu.

Now suppose a vector \mathbf q is specified by its coordinate basis components q^\mu, which we implement as a 4-element array \texttt{Q}. Since \mathbf q=q^\mu\boldsymbol\partial_\mu, substituting the previous expression for \partial_\mu and using linear independence gives the components in the new frame (note the Latin index) as: q^b = e^b_{\hphantom b\mu}q^\mu. Programmatically this is the matrix multiplication \texttt{dualframe*Q}, at least for my CAS does not distinguish between a row and column vector but automatically matches the dimensions. Now suppose we have m different vectors, stored in an m\times 4 matrix \texttt{QQ} say (typically m=4). These are processed in a batch operation by converting to column vectors, applying the transformation, then transposing back, so the components are: (\texttt{dualframe*QQ}^\top)^\top = \texttt{QQ*dualframe}^\top, in the new frame.

Now consider the dual bases. In the coordinate dual basis, the vector dual to \mathbf q has components q_\mu = g_{\mu\nu}q^\nu. These components can be implemented as an array \texttt{dualQ} = \texttt{G*Q} where \texttt{G} is the matrix (g_{\mu\nu}) and the row / column vector distinction is ignored as before. Again we can lower multiple vectors in one step via (\texttt{G*QQ}^\top)^\top = \texttt{QQ*G}.

The dual to the new frame satisfies \mathbf e^b(\mathbf e_a) = \delta^b_a by definition, hence

    \[\mathbf e^b = e^b_{\hphantom b\mu}dx^\mu\]

which may be validated by substitution, and these components are just \texttt{dualframe} again. Similarly

    \[dx^\mu = e_a^{\hphantom a\mu}\mathbf e^a\]

which are the components \texttt{frame} again. Carroll’s description for an orthonormal frame is true for any frame:

The vielbeins [e^b_{\hphantom b\mu}] thus serve double duty as the components of the coordinate basis vectors in terms of the orthonormal basis vectors, and as components of the orthonormal basis one-forms in terms of the coordinate basis one-forms; while the inverse vielbeins serve as the components of the orthonormal basis vectors in terms of the coordinate basis, and as components of the coordinate basis one-forms in terms of the orthonormal basis.

Likewise Schutz’ (§3.3) description of Lorentz transformations holds more generally:

…components of one-forms transform in exactly the same manner as basis vectors and in the opposite manner to components of vectors.
[…Whereas basis one-forms transform] the same as for components of a vector, and opposite that for components of a one-form.

We may also define (de Felice & Clarke, eqn. 4.2.5):

    \[e_{a\mu} := \mathbf e_a \cdot \partial_\mu\]

which I interpret as a definition. This evaluates to g_{\mu\nu}e_a^{\hphantom a\nu (or \texttt{frame*G}), hence g^{\mu\nu}e_{a\nu} = e_a^{\hphantom a\mu}. Define also

    \[e^{b\nu} := \mathbf e^b \cdot dx^\nu\]

which evaluates to g^{\mu\nu}e^b_{\hphantom b\mu} (or \texttt{dualframe*Ginv}, where \texttt{Ginv} is the matrix (g^{\mu\nu})), hence g_{\mu\nu}e^{b\nu} = e^b_{\hphantom b\mu}. Thus Greek indices are raised and lowered in the familiar way — using the metric components in the coordinate basis). On the other hand the metric components in the new frame are

    \[g_{ab} := \mathbf e_a\cdot\mathbf e_b = g_{\mu\nu}e_a^{\hphantom a\mu}e_b^{\hphantom b\nu}\]

which can be implemented as \texttt{Gframe} := \texttt{frame*G*frame}^\top. In the particular case of an orthonormal frame g_{\hat a\hat b}=\eta_{\hat a\hat b}, so in this case Latin indices are raised and lowered with the Minkowski metric. The metric in the dual frame is

    \[g^{ab} := \mathbf e^a\cdot\mathbf e^b = g^{\mu\nu}e^a_{\hphantom a\mu}e^b_{\hphantom b\nu}\]

so define \texttt{Gdualframe} := \texttt{dualframe*Ginv*dualframe}^\top. These are matrix inverses: g_{ab}g^{bc}=\delta_a^c. We can show Latin indices are raised or lowered using this frame metric, so for example e_b^{\hphantom b\mu} = g_{ab}e^{a\mu}.

With all these definitions of components as metric inner products between quantities, we may wonder if the original frame components can also be expressed this way. Indeed they can: e_a^{\hphantom a\mu} = \mathbf e_a(dx^\mu) and e^a_{\hphantom b\mu} = \mathbf e^a(\partial_\mu), where the vectors and dual vectors are acted on one another. The metric is implicit in the summation, because as a (1,1)-tensor it is just the identity. But the (1,1)-tensor e_b^{\hphantom b\nu}\mathbf e^b\otimes\partial_\nu made from the “frame” components is also just the identity (see Carroll), so it and the metric tensor are equal. Input \mathbf e_a and dx^\mu into this tensor and it indeed returns e_a^{\hphantom a\mu}. We can do similarly with the dual frame.

For higher rank tensors, their components are expressed in the new frame as e.g. (de Felice & Clarke, Hartle §20.3, §21.2)

    \[T^{ab}_{\hphantom{ab}cd} = T^{\mu\nu}_{\hphantom{\mu\nu}\sigma\tau} e^a_{\hphantom a\mu} e^b_{\hphantom b\nu} e_c^{\hphantom c\sigma} e_d^{\hphantom d\tau}\]

My CAS multiplies higher rank “matrices” \texttt{A*B} by contracting the last index of \texttt{A} with the first index of \texttt{B}. Hence we can only change two indices of T by this method, short of reordering the indices halfway through. There is another inbuilt method “TensorContract” which I will relate sometime later. Of course you could just program in the sum manually, but I am seeking an elegant solution for aesthetic satisfaction, also because inbuilt operations are probably more optimised. Finally you can continue to mix Greek and Latin (coordinate and frame) indices, see Carroll and I will add an example later.