Author: Anubhav Vardhan (anubhavvardhan@gmail.com)
For more information about QuTiP see http://qutip.org
In [1]:
%matplotlib inline
In [2]:
import numpy as np
In [3]:
from qutip import *
In [4]:
from qutip.qip.models.circuitprocessor import *
In [5]:
from qutip.qip.models.cqed import *
hamiltonian
The cavity-qubit model using a resonator as a bus can be implemented using the DispersivecQED class.
In [6]:
N = 3
qc = QubitCircuit(N)
qc.add_gate("ISWAP", targets=[0,1])
qc.png
Out[6]:
In [7]:
U_ideal = gate_sequence_product(qc.propagators())
U_ideal
Out[7]:
In [8]:
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[8]:
In [9]:
(U_ideal - U_physical).norm()
Out[9]:
The results obtained from the physical implementation agree with the ideal result.
In [10]:
p1.qc0.gates
Out[10]:
The gates are first transformed into the ISWAP basis, which is redundant in this example.
In [11]:
p1.qc1.gates
Out[11]:
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 [12]:
p1.qc2.gates
Out[12]:
The time for each applied gate:
In [13]:
p1.T_list
Out[13]:
The pulse can be plotted as:
In [14]:
p1.plot_pulses();
In [15]:
from qutip.ipynbtools import version_table
version_table()
Out[15]: