# Exponentials and logarithms of Pauli matrices

## Exponentiating Hamiltonian terms

Let $$A$$ and $$B$$ be one qubit unitaries (usually, Pauli matrices), acting on different qubits. They will therefore satisfy $$A^{2}=B^{2}=\mathbb{1}$$, $$AB=BA$$. Then, defining $$Q=\mathbb{1}+A+B+AB$$, we have $$Q^{2}=4Q$$. More generally, if $$A_{1},A_{2},...,A_{m}$$ are $$m$$ commuting unitaries, then the operator $$Q$$ defined as the sum of all their possible products, $$Q=\prod_{k=1}^{m}(1+A_{k}),$$ satisfies $$Q^{2}=2^{m}Q$$, as is easily seen from the fact that $$A_{i}Q=Q$$ for any $$i$$. It follows that $$e^{i\theta Q}=1+\frac{Q}{2^{m}}(e^{i\theta 2^{m}}-1)$$.

Let $$P$$ be a projector operator, that is, an operator satisfying $$P^{2}=P$$. Then its exponential is given by $$e^{i\theta P}=\mathbb{1}+P(e^{i\theta}-1)$$, or, for $$\theta=\pi$$, $$e^{i\pi P}=1-2P$$.

Operator relation Exponential
$$Q^{2}=\lambda Q$$ $$e^{i\theta Q}=1+\frac{Q}{\lambda}(e^{i\theta\lambda}-1)$$
$$P^{2}=P$$ $$e^{i\theta P}=1+P(e^{i\theta}-1)$$
$$P^{2}=P$$ $$e^{i\pi P}=1-2P$$
$$A^{2}=1$$ $$e^{i\frac{\pi}{2}(1-A)}=A$$
$$A^{2}=1$$ $$e^{i\theta A}=\cos\theta+i\sin\theta A$$

Using the above relations we see that $$e^{i\frac{\pi}{2}(1-\sigma_{i})}=ie^{-i\frac{\pi}{2}\sigma_{i}}=\sigma_{i}$$, for all Pauli matrices $$\sigma_{i}$$. More generally for any operator $$A$$ such that $$A^{2}=\mathbb{1}$$ we have $$\exp\left[i\frac{\pi}{2}(1-A)\right]=A$$. Another example is provided by the Heisenberg interaction term: $$H_{12}=X_{1}X_{2}+Y_{1}Y_{2}+Z_{1}Z_{2}$$. It can be checked that $$\left[(1-H_{12})/4\right]^{2}=(1-H_{12})/4$$, so that $$\exp\left[i\pi\left(\frac{1-H_{12}}{4}\right)\right]=\operatorname{SWAP}$$.

## Hamiltonians exponentiating to the same unitary

Let now $$A_{i}$$ denote a 1-qubit operator (e.g. a Pauli matrix) acting on the $$i$$-th qubit, and such that $$A_{i}^{2}=1$$. We therefore know that for every $$i$$ we have $$\exp\left[i\pi\left(\frac{1-A_{i}}{2}\right)\right]=A_{i}$$. For any $$i,j$$ we also have $$(A_{i}A_{j})^{2}=1$$, so that any such pair can similarly be written as an exponential: $$\exp\left[i\pi\left(\frac{1-A_{i}A_{j}}{2}\right)\right]=A_{i}A_{j}$$. The same reasoning can clearly be extended to the product of any number of 1-qubit matrices. On the other hand, by definition, $$A_{i}$$ and $$A_{j}$$ act on different qubits for $$i\neq j$$, therefore they commute, and the generator of their product must equal the sum of their individual generators, leading to the alternative expression:

$$A_{i}A_{j}=\exp\left[i\pi\left(\frac{1-A_{i}A_{j}}{2}\right)\right]=\exp\left[i\pi\left(\frac{2-A_{i}-A_{j}}{2}\right)\right].\nonumber \\$$

More generally, for the product of $$n$$ 1-qubit operators, one has the following:

$$A_{1}\cdots A_{n}=\exp\left[i\pi\left(\frac{1-A_{1}\cdots A_{n}}{2}\right)\right]=\exp\left[i\pi\left(\frac{n-(A_{1}+...+A_{n})}{2}\right)\right].\nonumber \\$$

However, notably, these two exponential expressions are only equal for $$\theta=\pi$$, in the sense that in general $$\exp\left[i\theta\left(\frac{1-A_{1}\cdots A_{n}}{2}\right)\right]\neq\exp\left[i\theta\left(\frac{n-(A_{1}+...+A_{n})}{2}\right)\right]$$. This can be seen explicitly by writing the closed expressions for these exponentials, which turn out to be (denoting for brevity $$c_{\theta}=\cos(\theta/2)$$ and $$s_{\theta}=\sin(\theta/2)$$):

$$\exp\left[i\theta\left(\frac{1-A_{1}\cdots A_{n}}{2}\right)\right]=e^{i\theta/2}\left[c_{\theta}-is_{\theta}(A_{1}\cdots A_{n})\right],\nonumber \\$$ $$\exp\left[i\theta\left(\frac{n-(A_{1}+...+A_{n})}{2}\right)\right]=e^{in\theta/2}\prod_{k=1}^{n}(c_{\theta}-is_{\theta}A_{k}).\nonumber \\$$

## Hamitonians with projectors

Let $$P$$ and $$Q$$ be two different projectors, $$P^{2}=P$$, $$Q^{2}=Q$$, $$PQ=QP=0$$. Then, for any pair of operators $$A$$ and $$B$$, we have

$$\exp[i\theta(AP+BQ)]=e^{i\theta AP}e^{i\theta BQ}=1+P\left(e^{i\theta A}-1\right)+Q\left(e^{i\theta B}-1\right).\nonumber \\$$

Moreover, if $$P+Q=1$$, then $$\exp[i\theta(AP+BQ)]=e^{i\theta A}P+e^{i\theta B}Q$$.

As a corollary, if $$P$$ and $$Q$$ are projectors such that $$P+Q=1$$, and $$A$$ and $$B$$ are operators that commute with $$P$$ and $$Q$$ and such that $$A^{2}=B^{2}=1$$, then

$$AP+BQ=\exp\left\{i\frac{\pi}{2}\left[(A-1)P+(B-1)Q\right]\right\}=\exp\left\{i\frac{\pi}{2}\left[AP+BQ-1\right]\right\}.\nonumber \\$$

In the particular case in which $$A=1$$, we get $$e^{i\theta AP}=Q+Pe^{i\theta A}$$.

## Exponentiating 1-qubit interactions

For any vector $$\boldsymbol{n}=(n_{1},n_{2},n_{3})$$ with unit norm, we have $$\exp\left[i\theta\left(\boldsymbol{n}\cdot\boldsymbol{\sigma}\right)\right]=\cos\theta+i\sin\theta(\boldsymbol{n}\cdot\boldsymbol{\sigma})$$. This solves the general case of exponentiating Hamiltonian containing only 1-qubit interactions. For example, if $$\mathcal{H}=\lambda(\boldsymbol{n}_{1}\cdot\boldsymbol{\sigma}_{1})+\mu(\boldsymbol{n}_{2}\cdot\boldsymbol{\sigma}_{2})$$, then $$e^{i\theta\mathcal{H}}=\left(\cos(\theta\lambda)+i\sin(\theta\lambda)(\boldsymbol{n}_{1}\cdot\boldsymbol{\sigma}_{1})\right)\left(\cos(\theta\mu)+i\sin(\theta\mu)(\boldsymbol{n}_{2}\cdot\boldsymbol{\sigma}_{2})\right)$$.

## Exponentiating 2-qubit interactions

Let $$A_{1}$$ be a sum of Pauli matrices acting on the first qubit (or equivalently, a traceless Hermitian matrix which squares to unity), and let $$P_{2}$$ be a projection operator acting on the second qubit. Then we have

$$\exp(i\theta A_{1}P_{2})=1+\left(e^{i\theta A_{1}}-1\right)P_{2}=e^{i\theta A_{1}}P_{2}+(1-P_{2}).\nonumber \\$$

Let $$A,B,C$$ be products of Pauli matrices such that $$AB=BA$$ and $$A^{2}=1$$ for any such operators. Then $$(A+B+C)^{2}=3+2(AB+BC+CA)$$, and more generally

$$(A+B+C)^{2n}=(c_{2n}+1)+c_{2n}(AB+BC+CA),\\ (A+B+C)^{2n+1}=(3c_{2n}+1)(A+B+C)+3c_{2n}ABC,\nonumber \\$$

where