# I Mapping between rotations and operations: sign & handedness

1. Mar 14, 2016

### Strilanc

I have a toy quantum circuit simulator that I work on. I want to visually represent operations in multiple ways: as a Hamiltonian, as a unitary matrix, and as a Bloch sphere rotation. I want to double-check that I haven't flipped anything.

I'll focus a concrete example: is this animation correct?

We're in a right-handed coordinate system. Z points up, X points right, and Y points away. I have a qubit; perhaps embodied in the spin of an electron. I begin rotating the qubit around the X axis at 0.5 Hz, so that after a quarter second it's at been rotated by +45 degrees.

The Hamiltonian for this operation is $H = X = \begin{bmatrix} 0&1\\1& 0\end{bmatrix}$ (I think). The unitary form is:

\begin{align} U(t) &= \exp(-i t H)\\&= \exp(-i t X)\\&= \exp(-i t (1)) \frac{1}{2} \begin{bmatrix} 1&1\\1&1 \end{bmatrix} + \exp(-i t (-1)) \frac{1}{2} \begin{bmatrix} 1&-1\\-1&1 \end{bmatrix} \\&=\frac{1}{2} \begin{bmatrix} e^{-it}+e^{it} & e^{-it}-e^{it} \\ e^{-it}-e^{it} & e^{-it}+e^{it} \end{bmatrix}\\&=\begin{bmatrix} \cos t & -i \sin t \\ -i \sin t & \cos t \end{bmatrix}\end{align}

Does that all sound right? Did I make a sign error or a handedness error? The thing I'm most unsure about is the minus sign in $\exp(-i t H)$. It seems... really unnecessary.

2. Mar 15, 2016

### haruspex

Should det U = 1? If so, you must have a sign error in your last equation.

3. Mar 15, 2016

### Strilanc

When I calculate the determinant, I get 1:

\begin{align} \det \begin{bmatrix} \cos t & -i \sin t \\ -i \sin t & \cos t \end{bmatrix} &= (\cos t)^2 - (-i \sin t)^2 \\&= \cos^2 t - (-i)^2 \sin^2 t \\&= \cos^2 t - (-1) \sin^2 t \\&= \cos^2 t + \sin^2 t \\&= 1 \end{align}

4. Mar 15, 2016

### haruspex

Sorry, you're right. I lost track of the number of negations.