I dont undestand how to apply a phase shift gate to a qubit. By example how to map $|\psi_0\rangle = \cos (30^\circ) |0\rangle + \sin (30^\circ) |1\rangle$ to $|\psi_1\rangle = \cos(-15^\circ) |0\rangle + \sin(-15^\circ) |1\rangle$

# [Physics] Quantum gate: Phase shift

quantum mechanicsquantum-computerquantum-information

#### Related Solutions

Here's a calculation to get you started.$\def\ket#1{\lvert#1\rangle}$

Define $\ket{h_j} = H\ket{j}$: $$\begin{align*} \ket{h_0} &= \tfrac1{\sqrt 2}\Bigl(\ket0 + \ket1\Bigr) \\ \ket{h_1} &= \tfrac1{\sqrt 2}\Bigl(\ket0 - \ket1\Bigr) \end{align*}$$

Compute (for example) $ \ket{h_0}\ket{h_1}$ by distributing the tensor product over the addition and subtraction: $$ \ket{h_0}\ket{h_1} = \tfrac12 \Big( \ket0\ket0 - \ket0\ket1 + \ket1\ket0 - \ket1\ket1 \Bigr) $$

Compute the effect of

**CNOT**on this state, distributing*it*over the additions and subtractions, applying it to each standard basis state in the expression: $$\begin{align*} \mathbf{CNOT} \ket{h_0}\ket{h_1} &= \tfrac12\Bigl( \mathbf{CNOT} \ket0\ket0 - \mathbf{CNOT} \ket0\ket1 + \mathbf{CNOT} \ket1\ket0 - \mathbf{CNOT} \ket1\ket1 \Bigr) \\ &= \tfrac12\Bigl( \ket0\ket0 - \ket0\ket1 + \ket1\ket1 - \ket1\ket0 \Bigr) \\ &= \tfrac12\Bigl( \ket0\ket0 - \ket0\ket1 - \ket1\ket0 + \ket1\ket1 \Bigr) \end{align*} $$Identify which state $\ket{h_j}\ket{h_k}$ (if any) this output represents. It may be useful to compute them ahead of time, for the purposes of comparison.

Alternatively, there is another way you can do it: compute $(H \otimes H) \mathbf{CNOT} (H \otimes H)^\dagger $ and determine what operation it performs on the *standard* basis — this is a more direct way of solving the problem.

The rotation $R(\theta)$ in the Deutsch gate should be a rotation about the $X$ axis, not about the $Z$ axis, i.e., $$ R(\theta)\vert k \rangle = i\cos(\theta) \vert k \rangle + \sin(\theta)\vert 1-k\rangle\ , $$ $k=0,1$, as e.g. described on Wikipedia.

Then, setting $\theta=\pi/2$ one immediately obtains the Toffoli gate.

Note that if $R(\theta)$ were a phase shift, the Deutsch gate would not be universal, as it would be diagonal, and thus would only allow to obtain diagonal gates.

## Best Answer

A phase gate will not map between the two vectors you give. A phase gate changes the phase of the $\left|1\right>$ component, which is not what you want since for your example all components are real.

Your two vectors lie in the X-Z plane of the Bloch sphere. To map from your first vector to your second vector, you need to rotate about the Y axis. The following unitary does the job, with $\theta=(-15)-30=-45$. $$ \left[ \begin{array}[rr] \textrm{cos}(\theta) & -\textrm{sin}(\theta) \\ \textrm{sin}(\theta) & \textrm{cos}(\theta) \end{array} \right] $$