QuTiP example: Physical implementation of Cavity-Qubit model

Author: Anubhav Vardhan (anubhavvardhan@gmail.com)

For more information about QuTiP see http://qutip.org


In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
from qutip import *

In [3]:
from qutip.qip.models.circuitprocessor import *

In [4]:
from qutip.qip.models.cqed import *

Hamoltonian:

hamiltonian

The cavity-qubit model using a resonator as a bus can be implemented using the DispersivecQED class.

Circuit Setup


In [5]:
N = 3
qc = QubitCircuit(N)

qc.add_gate("ISWAP", targets=[0,1])

qc.png


Out[5]:

In [6]:
U_ideal = gate_sequence_product(qc.propagators())

U_ideal


Out[6]:
Quantum object: dims = [[2, 2, 2], [2, 2, 2]], shape = [8, 8], type = oper, isherm = False\begin{equation*}\left(\begin{array}{*{11}c}1.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 1.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 1.0j & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 1.0j & 0.0 & 0.0\\0.0 & 0.0 & 1.0j & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 1.0j & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 1.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 1.0\\\end{array}\right)\end{equation*}

Dispersive cQED Model Implementation:


In [7]:
p1 = DispersivecQED(N, correct_global_phase=True)

U_list = p1.run(qc)

U_physical = gate_sequence_product(U_list)

U_physical.tidyup(atol=1e-3)


Out[7]:
Quantum object: dims = [[2, 2, 2], [2, 2, 2]], shape = [8, 8], type = oper, isherm = False\begin{equation*}\left(\begin{array}{*{11}c}1.000 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 1.000 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 1.000j & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 1.000j & 0.0 & 0.0\\0.0 & 0.0 & 1.000j & 0.0 & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 1.000j & 0.0 & 0.0 & 0.0 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 1.000 & 0.0\\0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 0.0 & 1.000\\\end{array}\right)\end{equation*}

In [8]:
(U_ideal - U_physical).norm()


Out[8]:
4.7506788969364782e-07

The results obtained from the physical implementation agree with the ideal result.


In [9]:
p1.qc0.gates


Out[9]:
[Gate(ISWAP, targets=[0, 1], controls=None)]

The gates are first transformed into the ISWAP basis, which is redundant in this example.


In [10]:
p1.qc1.gates


Out[10]:
[Gate(ISWAP, targets=[0, 1], controls=None)]

An RZ gate, followed by a Globalphase, is applied to all ISWAP and SQRTISWAP gates to normalize the propagator matrix. Arg_value for the ISWAP case is pi/2, while for the SQRTISWAP case, it is pi/4.


In [11]:
p1.qc2.gates


Out[11]:
[Gate(ISWAP, targets=[0, 1], controls=None),
 Gate(RZ, targets=[0], controls=None),
 Gate(RZ, targets=[1], controls=None),
 Gate(GLOBALPHASE, targets=None, controls=None)]

The time for each applied gate:


In [12]:
p1.T_list


Out[12]:
[2500.0000000000027, 0.013157894736842106, 0.013157894736842106]

The pulse can be plotted as:


In [13]:
p1.plot_pulses();


Software versions:


In [14]:
from qutip.ipynbtools import version_table
version_table()


Out[14]:
SoftwareVersion
IPython2.0.0
Cython0.20.1post0
OSposix [linux]
QuTiP3.0.0.dev-11ff7e7
Numpy1.8.1
matplotlib1.3.1
SciPy0.13.3
Python3.4.1 (default, Jul 7 2014, 05:33:58) [GCC 4.8.3]
Mon Jul 14 13:49:25 2014 JST