Skip to content

Commit

Permalink
more pytest fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jykhoo1987 committed Mar 24, 2024
1 parent a08fe22 commit febaa7f
Show file tree
Hide file tree
Showing 8 changed files with 535 additions and 44 deletions.
20 changes: 7 additions & 13 deletions src/qibolab/instruments/simulator/backends/qutip_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ def __init__(self, model_config: dict, sim_opts: Optional[Options] = None):
options are used.
"""
self.model_config = model_config
if sim_opts is not None:
self.sim_opts = sim_opts
else:
self.sim_opts = get_default_qutip_sim_opts()

if sim_opts is None:
sim_opts = get_default_qutip_sim_opts()
self.sim_opts = sim_opts
self.update()

def update_sim_opts(self, updated_sim_opts: Options):
Expand Down Expand Up @@ -183,14 +181,10 @@ def update(self):

### drive ###
for channel_name, op_instruction_list in self.model_config["drive"].items():
print(op_instruction_list)
for i, op_instruction in enumerate(op_instruction_list):
if i == 0:
self.operators.update(
{channel_name: self.make_operator(op_instruction)}
)
else:
self.operators[channel_name] += self.make_operator(op_instruction)
channel_op = Qobj(dims=[self.nlevels_HS, self.nlevels_HS])
for op_instruction in op_instruction_list:
channel_op += self.make_operator(op_instruction)
self.operators.update({channel_name: channel_op})

### dissipation ###
for op_instruction in self.model_config["dissipation"]["t1"]:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
nqubits: 5
description: IBM 5-qubit device FakeBelem, q0 and q1 only

settings:
nshots: 4096
#sampling_rate: 4500000000 #1e9
relaxation_time: 300_000
#time_of_flight: 280
#smearing: 0
#Fast_reset: False
#chip: ibmfakebelem5q

qubits: [0, 1] #, 2, 3, 4]
couplers: []

topology: [[0, 1]] #, [1, 2], [1, 3], [3, 4]]

native_gates:
single_qubit:
0: # qubit number
RX:
duration: 160 #80 #
amplitude: 0.24045125169257026 #0.051 #
frequency: 5090167234.445013 #1131148274.321114
shape: Drag(4, -2.4305800297101414) #Rectangular() #
type: qd # qubit drive
start: 0
phase: 0
MZ:
duration: 22400
amplitude: 0.03
frequency: 7301661824.000001 #1622591516.4444447
shape: Rectangular()
type: ro # readout
start: 0
phase: 1.5636758979377372

1: # qubit number
RX:
duration: 160 #80 #
amplitude: 0.24840043468596693 #0.040985 #
frequency: 5245306068.285917 #1165623570.7302039
shape: Drag(4, 0.6571522139248822) #Rectangular() #
type: qd # qubit drive
start: 0
phase: 0
MZ:
duration: 22400
amplitude: 0.056500000000000015
frequency: 7393428047.0 #1642984010.4444444
shape: Rectangular()
type: ro # readout
start: 0
phase: -3.022547221302854

two_qubit:
0-1: # qubit numbers (order is independent as of v0.1.4)
CZ: # actually CX
- type: virtual_z
phase: -3.141592653589793
qubit: 0
- type: virtual_z
phase: -1.5707963267948966
qubit: 1

- duration: 160
amplitude: 0.11622814090041741
frequency: 5090167234.445013
shape: Drag(4, -2.4030014266125312)
type: qd
relative_start: 0
phase: 1.6155738267853115
qubit: 0
- duration: 160
amplitude: 0.11976666126366188
frequency: 5245306068.285917
shape: Drag(4, 0.6889687213780946)
type: qd
relative_start: 0
phase: 0.02175043021781017
qubit: 1

- duration: 1584
amplitude: 0.023676707660000004
frequency: 5090167234.445013
shape: GaussianSquare(6.4, 1328) #Gaussian(6.4) #
type: qd
relative_start: 160
phase: 0.16645972884560645
qubit: 0
- type: virtual_z
phase: -1.5707963267948966 #-3.141592653589793
qubit: 1
- duration: 1584
amplitude: 0.14343084605450945
frequency: 5090167234.445013
shape: GaussianSquare(6.4, 1328) #Gaussian(6.4) #
type: qd
relative_start: 160
phase: -2.9352017171062608
qubit: 1 #U(q1,w0)

- type: virtual_z
phase: 1.5707963267948966
qubit: 1
- duration: 160
amplitude: 0.24840043468596693
frequency: 5245306068.285917
shape: Drag(4, 0.6571522139248822) #GaussianSquare(6.4, 1328)
type: qd
relative_start: 1744
phase: 0.0
qubit: 1

- duration: 1584
amplitude: 0.023676707660000004
frequency: 5090167234.445013
shape: GaussianSquare(6.4, 1328) #Gaussian(6.4) #
type: qd
relative_start: 1904
phase: -2.975132924744187
qubit: 0
- type: virtual_z
phase: -1.5707963267948966
qubit: 1
- duration: 1584
amplitude: 0.14343084605450945
frequency: 5090167234.445013
shape: GaussianSquare(6.4, 1328) #Gaussian(6.4) #
type: qd
relative_start: 1904
phase: 0.20639093648353235
qubit: 1 #U(q1,w0)

- type: virtual_z
phase: -1.5707963267948966
qubit: 0
- type: virtual_z
phase: 1.5707963267948966
qubit: 1
- duration: 160
amplitude: 0.11622814090041741
frequency: 5090167234.445013
shape: Drag(4, -2.4030014266125312)
type: qd
relative_start: 3488
phase: 0.04477749999041481
qubit: 0
- duration: 160
amplitude: 0.11976666126366188
frequency: 5245306068.285917
shape: Drag(4, 0.6889687213780946)
type: qd
relative_start: 3488
phase: -1.549045896577087
qubit: 1

characterization:
single_qubit:
0:
readout_frequency: 7301661824.000001
#resonator_polycoef_flux: []
drive_frequency: 5090167234.445013
anharmonicity: 0
Ec: 0
Ej: 0
g: 0
T1: 0.0
T2: 0.0
sweetspot: 0
# filter: {}
mean_gnd_states: 1.5417+0.1817j
mean_exc_states: 2.5332-0.5914j
# parameters for single shot classification
threshold: 1.5435
iq_angle: 2.602
anharmonicity: 217_492_000
1:
readout_frequency: 7393428047.0
#resonator_polycoef_flux: []
drive_frequency: 5245306068.285917
anharmonicity: 0
Ec: 0
Ej: 0
g: 0
T1: 0.0
T2: 0.0
sweetspot: 0
# filter: {}
mean_gnd_states: (0+0j)
mean_exc_states: (0+0j)
#"c0":
# sweetspot: 0.0
# filter: {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# frequency in Hz
# time in s

device_name: 'ibmfakebelem_q01'

topology: [[0,1]] #, [1,2], [1,3], [3,4]] # as per runcard

nqubits: 2 #5

ncouplers: 0

qubits_list: ['0','1'] #,'2','3','4']

couplers_list: []

#runcard_qubits_list: [0, 1] #, 2, 3, 4]

#runcard_couplers_list: []

sampling_rate: 4.5e+9

readout_error: # same key datatype as per runcard
0: [0.01, 0.02]
1: [0.01, 0.02]

drive_freq:
'0': 5.090167234445013e+9
'1': 5.245306068285918e+9
# '2': 5.360982724462909e+9
# '3': 5.170821930361108e+9
# '4': 5.2582999816725895e+9

T1:
'0': 88.57848970762537e-6 #0.0 #
'1': 78.05043996837796e-6 #0.0 #
# '2': 69.32578590725382e-6 #
# '3': 53.61400062698815e-6 #
# '4': 110.55756502325885e-6 #

T2:
'0': 106.79794866226273e-6 #0.0 #
'1': 63.765780044465714e-6 #0.0 #
# '2': 38.623766504632776e-6 #
# '3': 56.469814445204655e-6 #
# '4': 131.6820368187947e-6 #

lo_freq:
'0': 5.090167234445013e+9
'1': 5.245306068285918e+9
# '2': 5.360982724462909e+9
# '3': 5.170821930361108e+9
# '4': 5.2582999816725895e+9

rabi_freq:
'0': 0.12545753819061986e+9
'1': 0.12144270034090286e+9
# '2': 0.3136228781185627e+9
# '3': 0.1211253479285698e+9
# '4': 0.10114289565231858e+9

#CR_rabi_freq:
# '0_1': 0.2e+9

anharmonicity:
'0': -0.3361230051821652e+9
'1': -0.316572131412737e+9
# '2': -0.3306274884584929e+9
# '3': -0.33373922611368106e+9
# '4': -0.33134514323712794e+9

coupling_strength:
'1_0': 1.8736137364449845e+6 #0. #
# '2_1': 2.0062596172337286e+6
# '3_1': 2.003997660987222e+6
# '4_3': 1.673771918215291e+6
Loading

0 comments on commit febaa7f

Please sign in to comment.