
# Comparison of notation in QM and GR

Linear algebra is used in both Quantum Mechanics (QM) and General Relativity (GR). The notation however, is very different. This obscures the many mathematical similarities. In learning GR when you already know QM (or vice versa), it is very useful to see these similarities more clearly. That's why I've made an overview here, the construction of which was very useful for me, and I hope you may get something form it as well.

This page is organized such that equation (QM.$n$) should be compared to (GR.$n$). I do not intend to give a self-contained or pedagogical account of the theories separately, I only compare notation. The notation I use for QM is quite standard (although sometimes I'll bend it a bit towards GR), the notation for GR is as in 'Spacetime and geometry' by S. Carroll. Many thanks to Li Liu from the University of Waterloo for giving me the idea of this page!

### Vectors

QM. In quantum mechanics, a pure state $\ket \psi$ is a vector, or 'ket', in a complex Hilbert space $\mc H$. With $\{\ket{i}\}$ a basis of this space, $\ket \psi$ can be expanded as $\ket \psi = \sum_i \psi_i \ket i. \tag{QM.1}$ When using the bra-ket notation, we also need the dual space $\mc H^\dagger$. A dual vector in this space is called a 'bra'. Using the basis of the dual space $\{\bra{i}\}$, the bras can be expanded as $\bra \varphi = \sum_i \varphi_i \bra i.\tag{QM.2}$

GR. In GR, at every point $p$ in space-time, there is a (usually 4-dimensional) vector space, the tangent space $T_p$. An example of a vector in this space is the velocity of a particle at $p$. A basis for this space is the coordinate basis $\{\del_\mu\}$, formed by directional derivatives to the coordinate functions $x^{\mu}$. This basis need not be orthogonal. A vector $V$ can thus be expanded as $V=V^\mu \del_\mu \tag{GR.1}.$ (I only use the Einstein summation convention in the parts about GR.) The dual space $T_p^*$ consists of all linear functions on $T_p$. The objects in this space are called one-forms, or simply dual vectors. This space has a basis $\{\mrm d x^{\mu}\}$, where $\mrm d x^{\mu}$ is the gradient of the coordinate function $x^{\mu}$. The one-forms can thus be expanded as $\om=\om_\mu \mrm d x^\mu \tag{GR.2}.$

Differences. $\HH$ is a complex vector space (i.e. the coefficients $\psi_i$ are complex numbers) of any dimension. $T_p$ is a real vector space (the $V^\mu$ are real) that is usually 4 dimensional. In QM, it is very common to choose an orthonormal basis, whereas the coordinate basis in GR need not be even orthogonal. Additionally, the basis elements $\ket i$ and $\del_\mu$ have a totally different physical meaning.

### Operators / Tensors

QM. An operator $A$ is a linear function from $\HH$ to $\HH$ that maps $\ket \psi$ to $A \ket \psi$. Like vectors, operators can be expanded over the basis $\{\ket i\}$, $A=\sum_{ij} A_{ij} \ket i \otimes \bra j.\tag{QM.3}$ Equivalently, an operator can be thought of (this is important for the connection to GR), as a map $\mc A$ from $\HH^\dagger \otimes \HH$ to $\mathbb C$, that maps a bra $\bra \varphi$ and a ket $\ket{\psi}$ to the complex number $\bra \varphi A \ket \psi$, $\mathcal A(\bra\varphi,\ket\psi)=\bra \varphi A \ket \varphi.$ To see the connection to an operator as a map from vectors to vectors, note that if we feed $\mc A$ only a ket instead of a bra and a ket, the result is again a vector, \begin{align*} \mc A(\cdot,\ket{\psi})=&A\ket\psi&\\ =& \sum_{ij} A_{ij} \psi_j \ket i.\tag{QM.4}& \end{align*} Because of the equivalence of the two pictures, I will use them interchangeably. The equivalence is also seen in GR.

GR. A $(1,1)$-tensor $T$ maps one dual vector and one vector to a real number. We can also write these tensors in the bases as described before, $T={T^{\mu}}_{\nu}\, \del_{\mu}\otimes \mrm dx^{\nu}\tag{GR.3}.$ Note that when we act with this tensor on a vector, the result is a vector, \begin{align*} T(\cdot,V)=&{T^{\mu}}_{\nu} \del_{\mu}\otimes \mrm dx^{\nu}\,\,( V^\gamma \del_\gamma)&\\\ =&{T^{\mu}}_{\nu}V^\gamma\,\, \del_{\mu}\otimes \underbrace{dx^{\nu}(\del_\gamma)}_{=\delta^\nu_{\gamma}\in \mathbb R}&\\ =&{T^{\mu}}_{\nu}V^\gamma \delta^\nu_{\gamma} \del_{\mu}&\\ =&{T^{\mu}}_{\nu}V^\nu\,\, \del_{\mu}.&\tag{GR.4} \end{align*} That is, the result of applying $T$ to $V$ is a new vector with components ${T^{\mu}}_{\nu}V^\nu$, very much like an operator in QM in the usual sense.

### Tensor product structure

QM. It gets more interesting for composite quantum systems. Consider $n$ identical quantum systems, each with Hilbert space $\HH$. States are vectors in the tensor product space $\mc H^{\otimes n}$, $\ket \psi = \sum_{i_1\ldots i_n} \psi_{i_1\ldots i_n} \ket{i_1}\otimes\ldots \otimes \ket{i_n}.\tag{QM.5}$ (Similarly for the bras.) Again, operators can be expanded over the basis, $A=\sum_{i_1j_1\ldots i_nj_n} A_{i_1j_i\ldots i_nj_n}(\ket{i_1}\otimes \bra{j_1}) \otimes \ldots \otimes (\ket{i_n}\otimes \bra{j_n})$. If we allow for the bras and kets to be shuffled around this can be written more suggestively as $$A=\sum_{i_1\ldots i_n, j_1 \ldots i_n} A_{i_1 \ldots j_n, j_1 \ldots i_n} \ket{i_1}\otimes \ldots \otimes \ket{i_n} \otimes \bra{j_1} \otimes \ldots \otimes \bra{j_n}.$$ We can go even further and construct '$(n,m)$-operators', $A=\sum_{i_1\ldots i_n, j_1 \ldots j_m} A_{i_1 \ldots i_n, j_1 \ldots i_m} \ket{i_1}\otimes \ldots \otimes \ket{i_n} \otimes \bra{j_1} \otimes \ldots \otimes \bra{j_m}.\tag{QM.6}$ I have never encountered such an object in QM but the definition is justified in the connection to GR. In the language of this section, the regular operators in QM are $(1,1)$-operators*, and super-operators are $(2,2)$-operators**.

GR. An $(n,m)$-tensor maps $n$ dual vectors and $m$ vectors to a real number. We can think of the collection of $m$ vectors the tensor acts upon as living in $T_p^{\times m}$, $V=V^{\mu_1}\ldots V^{\mu_m}\, \del_{\mu_{1}}\otimes \ldots\otimes \del_{\mu_m},\tag{GR.5}$ and similarly for the $n$ dual vectors. Note the structure of the coefficients. An $(n,m)$-tensor $T$ may be written as $T={T^{\mu_1\ldots \mu_n}}_{\nu_1 \ldots \nu_m} \del_{\mu_{1}}\otimes \ldots\otimes \del_{\mu_n}\otimes\mrm dx^{\nu_1}\otimes\ldots\otimes\mrm dx^{\nu_m}.\tag{GR.6}$

Differences. In QM, the composition of Hilbert spaces means we physically have multiple quantum systems put together. Also we are allowed to make linear combinations of vectors in $\HH^{\otimes n}$, and act on them with the operators. In GR, the tensor product structure 'just' exist to define linear functions that take multiple vectors an kets as input, and we do not consider arbitrary linear combinations of those. The multiple vectors (one-forms) are always taken from the same physical vector space $T_p$ ($T_p^*$).

### The metric

QM. In QM, we have for the inner product between $\ket \varphi$ and $\ket \psi$ that $\braket{\varphi}{\!\psi}=\sum_{i}\varphi^*_i \psi_i=\sum_{ij}\delta_{ij}\varphi^*_i \psi_j,\tag{QM.7}$ with $\delta_{ij}$ the Kronecker delta (added for comparison to GR). Because probabilities have to sum to 1, (i.e. $\sum_i |\psi_i|^2=1$ ), states in $\HH$ have norm one. That is, for a physical pure state, $\braket{ \psi}{\!\psi}=1.\tag{QM.8}$

GR. In GR the inner product is more general, as it allows for 'weighted inner products'. The weights are determined by the metric tensor $g$, $g(V,W)= g_{\mu\nu} V^{\mu}W^{\nu}.\tag{GR.7}$ In flat spacetime (Minkowski space) with regular coordinates $p=(t,x,y,z)$, the metric is such that $g_{00}=-1$ and $g_{11},g_{22},g_{33}=1$ (other elements vanish). In curved spacetimes, the coefficients depend on the point $p$ in spacetime, $g_{\mu\nu}=g_{\mu\nu}(p)$. For example, for points $p=(t,r,\varphi,\theta)$ outside a Schwarzschild black hole (and units where $c=1$), $g_{00}(p)=-\left(1 - \frac{R_S}{r}\right).$ Here $R_S$ is the Schwarzschild radius of the black hole (the location of the horizon), and $R_S-r$ the radial distance from the horizon. We see the weights in front of the time components even go to zero as the points $p$ approach $R_S$.

It is always possible to change coordinates to that of the instantaneous rest frame of a particle at $p$ that moves with velocity $V$. By the equivalence principle, in this frame $V$ equals $V=(-1,0,0,0)$ and the the metric components are equal to that of the Minkowski metric. Thus $g(V,V)=g_{\mu\nu}V^{\mu}V^{\nu}=-1.\tag{GR.8}$ (This holds in any coordinate frame.)

The metric tensor is a $(0,2)$-tensor, $g=g_{\mu\nu} \mrm d x^{\mu}\otimes \mrm d x^{\nu}$. Unlike the $(1,1)$-tensors that we described before, the action of a $(0,2)$-tensor on only one vector (instead of two) with components $\{V^{\mu}\}$ yields a one-form, with components $g_{\mu\nu}V^{\nu}\equiv V_\mu$, \begin{align} g(\cdot, V)=& g_{\mu\nu} \mrm d x^{\mu}\otimes \mrm d x^{\nu}(V^\gamma \del_\gamma)\\ =& (g_{\mu\nu} V^{\nu}) \mrm dx^{\mu}. \end{align} Since one-forms have lower indices and vectors have upper indices, the metric tensor can be used to 'raise and lower indices'. In QM this would mean 'to turn a bra into a ket', or equivalently a column vector into a row vector.

### Change of basis

QM. In QM, we can transform the basis $\{\ket i\}$ to obtain a new basis $\{\ket{i}'\}$. The vector components in the new basis $\psi_i'$, can be expressed in terms of the old vector components $\psi_i$ as $\psi_i'=\sum_j U_{ij} \psi_j. \tag{QM.9}$ Here $U$ is a unitary matrix if we insist (as usual) that the old and new bases are orthonormal. Similarly, the components of an operator $A$ transform as $A'_{ij}=\sum_{kl}U_{ik}A_{kl}U^{\dagger}_{lj}=\sum_{kl}U_{ik} U^{\dagger}_{lj} A_{kl}.\tag{QM.10}$ (Last step added for comparison to GR.)

GR. Consider two sets of coordinate functions, $\{x^{\mu}\}$ and $\{x^{\mu'}\}$, that describe points on same part of spacetime somewhere. A coordinate transformation means we write the new coordinates $\{x^{\mu'}\}$ as a function of the old coordinates $\{x^{\mu}\}$, or vice versa, so that we can translate between the two ways of describing points. At every point $p$, this transformation entails a change of basis of $T_p$ because in the new coordinates, $\del_{\mu'}=\frac{\del x^{\mu}}{\del x^{\mu'}}\del_\mu.$ Consequently, the components of a vector $V$ transform as $V^{\mu'} = \frac{\del x^{\mu'}}{\del x^{\mu}} V^{\mu}.\tag{GR.9}$ Here $\frac{\del x^{\mu'}}{\del x^{\mu}}$ can be thought of as an array of numbers, indexed by $\mu$ and $\mu'$, exactly like $U_{ij}$ in QM. The former is often not unitary, as opposed to the latter.

For the example of a $(1,1)$-tensor, ${T^{\mu'}}_{\nu'}=\frac{\del x^{\mu'}}{\del x^{\mu}} \frac{\del x^{\nu}}{\del x^{\nu'}} {T^{\mu}}_{\nu}, \tag{GR.10}$ and similarly for an $(n,m)$-tensor. Note that $\frac{\del x^{\nu}}{\del x^{\nu'}}$ is the transpose of $\frac{\del x^{\nu'}}{\del x^{\nu}}$.

* An $(n,n)$-operator can be thought of as as a map from (linear combinations of) $n$ bras (each from the space $\HH$) and $n$ kets to a complex number, or as a map from 1 ket in the space $\HH^{\otimes n}$, and 1 bra (of the same size) to a complex number. So whether you decide to call something a $(1,1)$-operator or an $(n,n)$-operator depends on the viewpoint. I stick with the former viewpoint.

** A super-operator is a linear map from operators on a Hilbert space to operators on a Hilbert space. An example is a quantum channel, which maps density operators to density operators. (There are other properties of quantum channels but those are not important here. Also I note that the dimension of the input operator need not equal the dimension of the output operator.) Since operators themselves are $(1,1)$-tensors, a super-operator is a $(2,2)$-tensor. For example, if we act with a quantum channel $\Phi$ on one density operator (and not two, in which case we would produce a c-number) we have, in component notation, $\si_{ij}=\sum_{ab}\Phi_{ib,ja}\rho_{ab}$. Or, in a notation inspired by GR, ${\si^i}_j={\Phi^{ib}}_{ja}{\rho^{a}}_{b}$.

Updated