Show that
$$ \begin{align} H|0\rangle &= |+\rangle\\ H|1\rangle &= |-\rangle \end{align} $$where
$$ H = \frac{1}{\sqrt{2}} \left(\begin{array}{cc} 1& 1\\1& -1 \end{array} \right) $$is the Hadamard gate.
Recall that $|\pm\rangle = (|0\rangle\pm |1\rangle)/\sqrt{2}$ is an eigenstate of the Pauli-$X$ operator.
Show that (up to a global phase)
$$ \begin{align} H &= e^{-i\frac{\pi}{2} \sigma_{\hat{i}}} \end{align} $$where $ \hat{i} = \frac{1}{\sqrt{2}}\left( \begin{array}{c} 1\\0\\1 \end{array} \right) $.
Show that the following circuit performs a SWAP operation:
from qiskit import QuantumCircuit
from qiskit.circuit import Gate
qc = QuantumCircuit(2)
qc.cx(0,1)
qc.cx(1,0)
qc.cx(0,1)
qc.draw()
┌───┐ q_0: ──■──┤ X ├──■── ┌─┴─┐└─┬─┘┌─┴─┐ q_1: ┤ X ├──■──┤ X ├ └───┘ └───┘
Using the identities above, which two-qubit gate is the following quantum circuit equivalent to?
from qiskit import QuantumCircuit
from qiskit.circuit import Gate
qc = QuantumCircuit(2)
qc.h(1)
qc.cz(0,1)
qc.h(1)
qc.draw()
q_0: ──────■────── ┌───┐ │ ┌───┐ q_1: ┤ H ├─■─┤ H ├ └───┘ └───┘
In real-world experiments, qubits often do not have all-to-all connectivities. For example, the quantum circuit below performs effectively a two-qubit gate between q_1 and q_2 by using q_0 as an auxiliary qubit. Which two-qubit gate is it and prove that this is indeed the case.
from qiskit import QuantumCircuit
from qiskit.circuit import Gate
qc = QuantumCircuit(3)
qc.cz(0,1)
qc.h(0)
qc.cz(0,2)
qc.h(0)
qc.draw()
┌───┐ ┌───┐ q_0: ─■─┤ H ├─■─┤ H ├ │ └───┘ │ └───┘ q_1: ─■───────┼────── │ q_2: ─────────■──────
Quantum Fourier transform (QFT) is an essential primitive for many quantum algorithms. It is a unitary transformation that maps
$$ |X\rangle = \sum_{j=0}^{N-1} x_j |j\rangle $$to
$$ |Y\rangle = \sum_{k=0}^{N-1} y_k |k\rangle$$, where $ y_k = \frac{1}{\sqrt{N}} \sum_{j=0}^{N-1} x_j \omega_N^{jk}$ and $ \omega_N^{jk}=e^{2\pi i \frac{jk}{N}}$. $N=2^n$ represents the size of the Hilbert space spanned by $n$ qubits.
Show that the Hadamard gate is a 1-qubit QFT.
Typically, a CNOT gate performed on a control qubit q_c and a target qubit q_t results in a change in the state of q_t depending on the state of q_c. Show that in the $X$-basis, instead, the state of q_c changes depending on the state of q_t. This phenomenon is called phase kickback, a mechanism essential to the quantum phase estimation algorithm as you will see in lab.