Topological Quantum Walks on IBM Q

This notebook is based on the paper of Radhakrishnan Balu, Daniel Castillo, and George Siopsis, "Physical realization of topological quantum walks on IBM-Q and beyond" arXiv:1710.03615 [quant-ph](2017).

Contributors

Keita Takeuchi (Univ. of Tokyo) and Rudy Raymond (IBM Research - Tokyo)


Introduction: challenges in implementing topological walk

In this section, we introduce one model of quantum walk called split-step topological quantum walk.

We define Hilbert space of quantum walker states and coin states as $\mathcal{H}_{\mathcal{w}}=\{\vert x \rangle, x\in\mathbb{Z}_N\}, \mathcal{H}_{\mathcal{c}}=\{\vert 0 \rangle, \vert 1 \rangle\}$, respectively. Then, step operator is defined as

$$ S^+ := \vert 0 \rangle_c \langle 0 \vert \otimes L^+ + \vert 1 \rangle_c \langle 1 \vert \otimes \mathbb{I}\\ S^- := \vert 0 \rangle_c \langle 0 \vert \otimes \mathbb{I} + \vert 1 \rangle_c \langle 1 \vert \otimes L^-, $$

where

$$ L^{\pm}\vert x \rangle_{\mathcal w} := \vert (x\pm1)\ \rm{mod}\ N \rangle_{\mathcal w} $$

is a shift operator. The boundary condition is included. Also, we define the coin operator as

$$ T(\theta):=e^{-i\theta Y} = \begin{bmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix}. $$

One step of quantum walk is the unitary operator defined as below that uses two mode of coins, i.e., $\theta_1$ and $\theta_2$:

$$ W := S^- T(\theta_2)S^+ T(\theta_1). $$

Intuitively speaking, the walk consists of flipping coin states and based on the outcome of the coins, the shifting operator is applied to determine the next position of the walk.

Next, we consider a walk with two phases that depend on the current position:

$$ (\theta_1,\theta_2) = \begin{cases} (\theta_{1}^{-},\ \theta_{2}^{-}) & 0 \leq x < \frac{N}{2} \\ (\theta_{1}^{+},\ \theta_{2}^{+}) & \frac{N}{2} \leq x < N. \end{cases} $$

Then, two coin operators are rewritten as

$$ \mathcal T_i = \sum^{N-1}_{x=0}e^{-i\theta_i(x) Y_c}\otimes \vert x \rangle_w \langle x \vert,\ i=1,2. $$

By using this, one step of quantum walk is equal to

$$ W = S^- \mathcal T_2 S^+ \mathcal T_1. $$

In principle, we can execute the quantum walk by multiplying $W$ many times, but then we need many circuit elements to construct it. This is not possible with the current approximate quantum computers due to large errors produced after each application of circuit elements (gates).

Hamiltonian of topological walk

Altenatively, we can think of time evolution of the states. The Hamiltonian $H$ is regarded as $H=\lim_{n \to \infty}W^n$(See below for further details.).

For example, when $(\theta_1,\ \theta_2) = (0,\ \pi/2)$, the Schrödinger equation is

$$ i\frac{d}{dt}\vert \Psi \rangle = H_{\rm I} \vert \Psi \rangle,\ H_{\rm I} = -Y\otimes [2\mathbb I+L^+ + L^-]. $$

If Hamiltonian is time independent, the solution of the Schrödinger equation is

$$ \vert \Psi(t) \rangle = e^{-iHt} \vert \Psi(0) \rangle, $$

so we can get the final state at arbitrary time $t$ at once without operating W step by step, if we know the corresponding Hamiltonian.

The Hamiltonian can be computed as below.

Set $(\theta_1,\ \theta_2) = (\epsilon,\ \pi/2+\epsilon)$, and $\epsilon\to 0$ and the number of step $s\to \infty$ while $se=t/2$(finite variable). Then, \begin{align*} H_I&=\lim_{n \to \infty}W^n\\ \rm{(LHS)} &= \mathbb{I}-iH_{I}t+O(t^2)\\ \rm{(RHS)} &= \lim_{\substack{s\to \infty\\ \epsilon\to 0}}(W^4)^{s/4}= \lim_{\substack{s\to \infty\\ \epsilon\to0}}(\mathbb{I}+O(\epsilon))^{s/4}\\ &\simeq \lim_{\substack{s\to \infty\\ \epsilon\to 0}}\mathbb{I}+\frac{s}{4}O(\epsilon)\\ &= \lim_{\epsilon\to 0}\mathbb{I}+iY\otimes [2\mathbb I+L^+ + L^-]t+O(\epsilon). \end{align*} Therefore, $$H_{\rm I} = -Y\otimes [2\mathbb I+L^+ + L^-].$$

Computation model

In order to check the correctness of results of the implementation of quantum walk by using IBMQ, we investigate two models, which have different features of coin phases. Let the number of positions on the line $n$ is 4.

  • $\rm I / \rm II:\ (\theta_1,\theta_2) = \begin{cases} (0,\ -\pi/2) & 0 \leq x < 2 \\ (0,\ \pi/2) & 2 \leq x < 4 \end{cases}$
  • $\rm I:\ (\theta_1,\theta_2)=(0,\ \pi/2),\ 0 \leq x < 4$

That is, the former is a quantum walk on a line with two phases of coins, while the latter is that with only one phase of coins.

Figure 1. Quantum Walk on a line with two phases

The Hamiltonian operators for each of the walk on the line are, respectively, $$ H_{\rm I/II} = Y \otimes \mathbb I \otimes \frac{\mathbb I + Z}{2}\\ H_{\rm I} = Y\otimes (2\mathbb I\otimes \mathbb I + \mathbb I\otimes X + X \otimes X). $$

Then, we want to implement the above Hamiltonian operators with the unitary operators as product of two-qubit gates CNOTs, CZs, and single-qubit gate rotation matrices. Notice that the CNOT and CZ gates are \begin{align*} \rm{CNOT_{ct}}&=\left |0\right\rangle_c\left\langle0\right | \otimes I_t + \left |1\right\rangle_c\left\langle1\right | \otimes X_t\\ \rm{CZ_{ct}}&=\left |0\right\rangle_c\left\langle0\right | \otimes I_t + \left |1\right\rangle_c\left\langle1\right | \otimes Z_t. \end{align*}

Below is the reference of converting Hamiltonian into unitary operators useful for the topological quantum walk.

Table 1. Relation between the unitary operator and product of elementary gates
unitary operator product of circuit elements
$e^{-i\theta X_c X_j}$ $\rm{CNOT_{cj}}\cdot e^{-i\theta X_c t}\cdot \rm{CNOT_{cj}}$
$e^{-i\theta X_c Z_j}$ $\rm{CZ_{cj}}\cdot e^{-i\theta X_c t}\cdot \rm{CZ_{cj}}$
$e^{-i\theta Y_c X_j}$ $\rm{CNOT_{cj}}\cdot e^{i\theta Y_c t}\cdot \rm{CNOT_{cj}}$
$e^{-i\theta Y_c Z_j}$ $\rm{CNOT_{jc}}\cdot e^{-i\theta Y_c t}\cdot \rm{CNOT_{jc}}$
$e^{-i\theta Z_c X_j}$ $\rm{CZ_{cj}}\cdot e^{-i\theta X_j t}\cdot \rm{CZ_{cj}}$
$e^{-i\theta Z_c Z_j}$ $\rm{CNOT_{jc}}\cdot e^{-i\theta Z_c t}\cdot \rm{CNOT_{jc}}$

By using these formula, the unitary operators are represented by only CNOT, CZ, and rotation matrices, so we can implement them by using IBM Q, as below.

Phase I/II:

\begin{align*} e^{-iH_{I/II}t}=~&e^{-itY_c \otimes \mathbb I_0 \otimes \frac{\mathbb I_1 + Z_1}{2}}\\ =~& e^{-iY_c t}e^{-itY_c\otimes Z_1}\\ =~& e^{-iY_c t}\cdot\rm{CNOT_{1c}}\cdot e^{-i Y_c t}\cdot\rm{CNOT_{1c}} \end{align*}

Figure 2. Phase I/II on $N=4$ lattice$(t=8)$ - $q[0]:2^0,\ q[1]:coin,\ q[2]:2^1$



Phase I:

\begin{align*} e^{-iH_I t}=~&e^{-itY_c\otimes (2\mathbb I_0\otimes \mathbb I_1 + \mathbb I_0\otimes X_1 + X_0 \otimes X_1)}\\ =~&e^{-2itY_c}e^{-itY_c\otimes X_1}e^{-itY_c\otimes X_0 \otimes X_1}\\ =~&e^{-2iY_c t}\cdot\rm{CNOT_{c1}}\cdot\rm{CNOT_{c0}}\cdot e^{-iY_c t}\cdot\rm{CNOT_{c0}}\cdot e^{-iY_c t}\cdot\rm{CNOT_{c1}} \end{align*}

Figure 3. Phase I on $N=4$ lattice$(t=8)$ - $q[0]:2^0,\ q[1]:2^1,\ q[2]:coin$

Implementation


In [1]:
#initialization
import sys
import matplotlib.pyplot as plt
%matplotlib inline
import numpy as np

# importing QISKit
from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister
from qiskit import Aer, IBMQ, execute

from qiskit.wrapper.jupyter import *
from qiskit.backends.ibmq import least_busy

from qiskit.tools.visualization import matplotlib_circuit_drawer as circuit_drawer
from qiskit.tools.visualization import plot_histogram, qx_color_scheme

In [2]:
IBMQ.load_accounts()
sim_backend = Aer.get_backend('qasm_simulator')

device_backend = least_busy(IBMQ.backends(operational=True, simulator=False))
device_coupling = device_backend.configuration()['coupling_map']
print("the best backend is " + device_backend.name() + " with coupling " + str(device_coupling))


the best backend is ibmq_16_melbourne with coupling [[1, 0], [1, 2], [2, 3], [4, 3], [4, 10], [5, 4], [5, 6], [5, 9], [6, 8], [7, 8], [9, 8], [9, 10], [11, 3], [11, 10], [11, 12], [12, 2], [13, 1], [13, 12]]

Quantum walk, phase I/II on $N=4$ lattice$(t=8)$


In [3]:
t=8 #time

q1_2 = QuantumRegister(3)
c1_2 = ClassicalRegister(3)
qw1_2 = QuantumCircuit(q1_2, c1_2)

qw1_2.x(q1_2[2])
qw1_2.u3(t, 0, 0, q1_2[1])
qw1_2.cx(q1_2[2], q1_2[1])
qw1_2.u3(t, 0, 0, q1_2[1])
qw1_2.cx(q1_2[2], q1_2[1])

qw1_2.measure(q1_2[0], c1_2[0])
qw1_2.measure(q1_2[1], c1_2[2])
qw1_2.measure(q1_2[2], c1_2[1])

print(qw1_2.qasm())
circuit_drawer(qw1_2, style=qx_color_scheme())


OPENQASM 2.0;
include "qelib1.inc";
qreg q0[3];
creg c0[3];
x q0[2];
u3(8,0,0) q0[1];
cx q0[2],q0[1];
u3(8,0,0) q0[1];
cx q0[2],q0[1];
measure q0[0] -> c0[0];
measure q0[1] -> c0[2];
measure q0[2] -> c0[1];

Below is the result when executing the circuit on the simulator.


In [4]:
job = execute(qw1_2, sim_backend, shots=1000)
result = job.result()
plot_histogram(result.get_counts())


And below is the result when executing the circuit on the real device.


In [5]:
%%qiskit_job_status
HTMLProgressBar()
job = execute(qw1_2, backend=device_backend, coupling_map=device_coupling, shots=100)



In [6]:
result = job.result()
plot_histogram(result.get_counts())


Conclusion: The walker is bounded at the initial state, which is the boundary of two phases, when the quantum walk on the line has two phases.

Quantum walk, phase I on $N=4$ lattice$(t=8)$


In [7]:
t=8 #time

q1 = QuantumRegister(3)
c1 = ClassicalRegister(3)
qw1 = QuantumCircuit(q1, c1)

qw1.x(q1[1])
qw1.cx(q1[2], q1[1])
qw1.u3(t, 0, 0, q1[2])
qw1.cx(q1[2], q1[0])
qw1.u3(t, 0, 0, q1[2])
qw1.cx(q1[2], q1[0])
qw1.cx(q1[2], q1[1])
qw1.u3(2*t, 0, 0, q1[2])

qw1.measure(q1[0], c1[0])
qw1.measure(q1[1], c1[1])
qw1.measure(q1[2], c1[2])

print(qw1.qasm())
circuit_drawer(qw1, style=qx_color_scheme())


OPENQASM 2.0;
include "qelib1.inc";
qreg q1[3];
creg c1[3];
x q1[1];
cx q1[2],q1[1];
u3(8,0,0) q1[2];
cx q1[2],q1[0];
u3(8,0,0) q1[2];
cx q1[2],q1[0];
cx q1[2],q1[1];
u3(16,0,0) q1[2];
measure q1[0] -> c1[0];
measure q1[1] -> c1[1];
measure q1[2] -> c1[2];

Below is the result when executing the circuit on the simulator.


In [8]:
job = execute(qw1, sim_backend, shots=1000)
result = job.result()
plot_histogram(result.get_counts())


And below is the result when executing the circuit on the real device.


In [9]:
%%qiskit_job_status
HTMLProgressBar()
job = execute(qw1, backend=device_backend, coupling_map=device_coupling, shots=100)



In [10]:
result = job.result()
plot_histogram(result.get_counts())


Conclusion: The walker is unbounded when the quantum walk on the line has one phase.

We can see that the results from simulators match those from real devices. This hints that IBM Q systems can be used to experiments with topological quantum walk.


In [ ]: