Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree routines #290

Merged
merged 75 commits into from
Apr 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
baa26b2
deploy qubit spectroscopy
Edoardo-Pedicillo Mar 23, 2023
1ea902b
Merge branch 'split_data_fit' into tree_routines
Edoardo-Pedicillo Mar 23, 2023
130cbb5
fix typos
Edoardo-Pedicillo Mar 23, 2023
4d55cc2
fix amplitude
Edoardo-Pedicillo Mar 23, 2023
b02cfde
Merge branch 'split_data_fit' into tree_routines
Edoardo-Pedicillo Mar 23, 2023
30705a2
add amplitude in qubit spectroscopy
Edoardo-Pedicillo Mar 23, 2023
b1aa3c0
fix amplitude in lorentzian_fit
Edoardo-Pedicillo Mar 23, 2023
6e672d3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 23, 2023
339ddf0
refresh update method
Edoardo-Pedicillo Mar 23, 2023
62f43b6
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
Edoardo-Pedicillo Mar 23, 2023
b7ec19f
Add rabi
andrea-pasquale Mar 23, 2023
d2ddd2b
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
andrea-pasquale Mar 23, 2023
6d93f46
Add runcard and remove reload_settings
andrea-pasquale Mar 23, 2023
f8025f8
deploy spectroscopy_plot function
Edoardo-Pedicillo Mar 23, 2023
0d0b249
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
Edoardo-Pedicillo Mar 23, 2023
7afd83b
deploy ramsey
Edoardo-Pedicillo Mar 27, 2023
8a9537d
fix bug
Edoardo-Pedicillo Mar 27, 2023
fbcf6b6
remove useless dependencies
Edoardo-Pedicillo Mar 27, 2023
1400e14
Add classification routine
andrea-pasquale Mar 27, 2023
921c49c
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
andrea-pasquale Mar 27, 2023
f780a72
Typo
andrea-pasquale Mar 27, 2023
280f8c4
deploy T1
Edoardo-Pedicillo Mar 27, 2023
ba15824
Add rabi length
andrea-pasquale Mar 27, 2023
5db6485
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
Edoardo-Pedicillo Mar 27, 2023
914e602
Simplify Rabis
andrea-pasquale Mar 27, 2023
00086f6
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
andrea-pasquale Mar 27, 2023
66c7106
deploy allXY
Edoardo-Pedicillo Mar 27, 2023
4425b94
Implement resonator flux dependence
andrea-pasquale Mar 28, 2023
dc1bf84
Add qubit flux dependence
andrea-pasquale Mar 28, 2023
a555622
Move flux dependence plot to utils
andrea-pasquale Mar 28, 2023
24f5f92
Add spin echo
andrea-pasquale Mar 28, 2023
3d97190
deploy allXY
Edoardo-Pedicillo Mar 28, 2023
c2fe799
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
andrea-pasquale Mar 28, 2023
1e1fd62
delete useless dependencies in drag_pulse_tuning
Edoardo-Pedicillo Mar 28, 2023
471e8d7
Add option to run low and high power resonator spectroscopy
andrea-pasquale Mar 28, 2023
cf464fb
Add flux dependence
andrea-pasquale Mar 28, 2023
465ebd1
Minor updates and push autocalibration runcard
andrea-pasquale Mar 28, 2023
767fe26
Minor correction and full runcard preparation
andrea-pasquale Mar 28, 2023
1461706
deploy flipping
Edoardo-Pedicillo Mar 29, 2023
af4b0f4
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
Edoardo-Pedicillo Mar 29, 2023
53b1dcc
Minor fixes and set default software average
andrea-pasquale Mar 29, 2023
ff5d149
Add ramsey detuned
andrea-pasquale Mar 29, 2023
bf57b35
Add attenuation routines
andrea-pasquale Apr 4, 2023
5ff0357
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 4, 2023
0e8e965
fix readout_freq
Edoardo-Pedicillo Apr 7, 2023
1c1ea81
change .to_dic() in .serial
Edoardo-Pedicillo Apr 7, 2023
d015afb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 7, 2023
8124e5e
Fix resonator flux dependence
andrea-pasquale Apr 11, 2023
c5696b0
Fix qubit flux dependence
andrea-pasquale Apr 11, 2023
dbbca4f
change - to -
Edoardo-Pedicillo Apr 11, 2023
c612e3a
change serial to raw
Edoardo-Pedicillo Apr 12, 2023
aa16ecd
fix flux routines aquisition bug
DavidSarlle Apr 12, 2023
dcac855
fix rabi lenght bug
DavidSarlle Apr 13, 2023
c17e17c
modified ramsey fitting units for drive_frequency to be compatible be…
DavidSarlle Apr 13, 2023
20ef626
fix misspeling
DavidSarlle Apr 13, 2023
f3c8eab
implement the res punchout _fit
Edoardo-Pedicillo Apr 14, 2023
e574f6b
implement the res punchout _plot
Edoardo-Pedicillo Apr 14, 2023
095f068
temporary fix to restore attenuation to original value after punchout
DavidSarlle Apr 14, 2023
26f3710
Merge branch 'tree_routines' of https://github.com/qiboteam/qibocal i…
DavidSarlle Apr 14, 2023
a315643
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 14, 2023
f393180
Fix minor issues with rabis and qubit spectroscopy
andrea-pasquale Apr 14, 2023
d6fa50d
minor fixes
Edoardo-Pedicillo Apr 14, 2023
3f79804
resonator punchout and punchout att fittings
DavidSarlle Apr 18, 2023
b9e359a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 18, 2023
bb59b83
return punchout freqs in hz to be consistent with rest of the methods…
DavidSarlle Apr 18, 2023
1b2b919
Merge branch 'tree_routines' of https://github.com/qiboteam/qibocal i…
DavidSarlle Apr 18, 2023
e4d7d6d
minor changes
DavidSarlle Apr 18, 2023
73c2ce7
Don't update drive amplitude after qubit spectroscopy
andrea-pasquale Apr 18, 2023
831c3eb
Add fidelity to classify shots
andrea-pasquale Apr 18, 2023
e3069ed
Add amplitude/duration parameter for duration/amplitude rabi (to be i…
andrea-pasquale Apr 18, 2023
e7fe263
Remove hardcoded value
andrea-pasquale Apr 18, 2023
4aaf5c9
Covert iq angle back to radians
andrea-pasquale Apr 18, 2023
c910e0a
Merge branch 'tree_routines' of https://github.com/qiboteam/qibocal i…
DavidSarlle Apr 19, 2023
c9e6034
Add mean gnd state for classification to fix Rodolfo's bug
andrea-pasquale Apr 19, 2023
9019844
Merge branch 'tree_routines' of github.com:qiboteam/qibocal into tree…
andrea-pasquale Apr 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions runcards/actions_qm.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
platform: qw5q_gold
platform: dummy

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

format: csv

actions:

resonator_spectroscopy:
freq_width: 40_000_000
freq_step: 100_000
nshots: 1000
relaxation_time: 50
software_averages: 1
# resonator_spectroscopy:
# freq_width: 40_000_000
# freq_step: 100_000
# nshots: 1000
# relaxation_time: 0
# software_averages: 1

#resonator_punchout:
# freq_width: 10_000_000
Expand All @@ -33,14 +33,14 @@ actions:
# relaxation_time: 50
# software_averages: 1

qubit_spectroscopy:
drive_amplitude: 0.005
drive_duration: 2000
freq_width: 100_000_000
freq_step: 100_000
nshots: 1000
relaxation_time: 20
software_averages: 1
# qubit_spectroscopy:
# drive_amplitude: 0.005
# drive_duration: 2000
# freq_width: 100_000_000
# freq_step: 100_000
# nshots: 1000
# relaxation_time: 0
# software_averages: 1

#qubit_spectroscopy_flux:
# drive_amplitude: 0.005
Expand All @@ -53,13 +53,13 @@ actions:
# relaxation_time: 20
# software_averages: 1

rabi_pulse_amplitude:
pulse_amplitude_start: 0.01
pulse_amplitude_end: 2.0
pulse_amplitude_step: 0.01
software_averages: 1
relaxation_time: 50000
nshots: 1000
# rabi_pulse_amplitude:
# pulse_amplitude_start: 0.01
# pulse_amplitude_end: 2.0
# pulse_amplitude_step: 0.01
# software_averages: 1
# relaxation_time: 0
# nshots: 1000

#rabi_pulse_length:
# pulse_duration_start: 16 # minimum 4ns
Expand Down Expand Up @@ -108,8 +108,8 @@ actions:
# software_averages: 1
# points: 10

#calibrate_qubit_states:
# nshots: 5000
# calibrate_qubit_states:
# nshots: 100

#allXY_drag_pulse_tuning:
# beta_start: -1
Expand Down
193 changes: 168 additions & 25 deletions runcards/auto_spectroscopy.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,183 @@
platform: dummy
platform: dummy #qw5q_gold_qblox

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

format: csv

actions:
- id: resonator_spectroscopy

- id: resonator_spectroscopy high power
priority: 0
operation: resonator_spectroscopy
next: resonator_punchout
main: resonator punchout
parameters:
freq_width: 30_000_000
freq_step: 1_000_000
amplitude: 0.01
freq_width: 10_000_000
freq_step: 500_000
amplitude: 0.4
power_level: high
nshots: 1024
relaxation_time: 0
software_averages : 1

- id: resonator_punchout
- id: resonator punchout
priority: 10
operation: resonator_punchout
#main: resonator_spectroscopy low power
parameters:
freq_width: 1_000_000
freq_step: 100_000
min_amp_factor: 0.01
max_amp_factor: 0.9
step_amp_factor: 0.02
nshots: 1000
freq_width: 5_000_000
freq_step: 1_000_000
min_amp_factor: 0.02
max_amp_factor: 2.4
step_amp_factor: 0.1
nshots: 1
relaxation_time: 0
software_averages: 1

# main: first
# - id: first
# priority: 100
# main: second
# - id: second
# main: third
# - id: third
# priority: 50

# - id: resonator_punchout_attenuation
# priority: 0
# operation: resonator_punchout_attenuation
# # main: resonator_spectroscopy low power
# next: resonator_punchout
# parameters:
# freq_width: 10_000_000
# freq_step: 500_000
# min_att: 4
# max_att: 60
# step_att: 4
# nshots: 1000
# relaxation_time: 0

# - id: resonator spectroscopy low power
# priority: 0
# operation: resonator_spectroscopy
# #main: qubit_spectroscopy
# parameters:
# freq_width: 10_000_000
# freq_step: 1_000_000
# amplitude: 0.4
# power_level: low
# nshots: 1024
# relaxation_time: 0 #50

# # - id: resonator flux dependence
# # priority: 10
# # operation: resonator_flux
# # main: qubit spectroscopy
# # parameters:
# # freq_width: 10_000_000
# # freq_step: 500_000
# # bias_width: 0.15
# # bias_step: 0.01
# # fluxlines: qubits
# # nshots: 1000
# # relaxation_time: 0

# - id: qubit spectroscopy
# priority: 30
# operation: qubit_spectroscopy
# next: rabi
# parameters:
# drive_amplitude: 0.005
# drive_duration: 2000
# freq_width: 100_000_000
# freq_step: 100_000
# nshots: 1000
# relaxation_time: 0

# # - id: qubit flux dependence
# # priority: 10
# # main: t1
# # operation: qubit_flux
# # parameters:
# # freq_width: 10_000_000
# # freq_step: 500_000
# # bias_width: 0.03 #0.1
# # bias_step: 0.003 # 0.001
# # drive_amplitude: 0.005
# # fluxlines: qubits
# # nshots: 1000
# # relaxation_time: 0

# - id: rabi
# priority: 0
# operation: rabi_amplitude
# #main: ramsey
# parameters:
# pulse_amplitude_start: 0.01
# pulse_amplitude_end: 2.0
# pulse_amplitude_step: 0.01
# software_averages: 1
# relaxation_time: 0
# nshots: 1000

# - id: t1
# priority: 0
# operation: t1
# #main: ramsey
# parameters:
# delay_before_readout_start: 16
# delay_before_readout_end: 500
# delay_before_readout_step: 20

# - id: ramsey
# priority: 0
# operation: ramsey
# # main: ramsey detuned
# parameters:
# delay_between_pulses_start: 16 # must be a multiple of 4 incl 0
# delay_between_pulses_end: 100
# delay_between_pulses_step: 4 # must be a multiple of 4

# - id: ramsey detuned
# priority: 0
# operation: ramsey
# #main: single shot classification
# parameters:
# n_osc: 10
# delay_between_pulses_start: 16 # must be a multiple of 4 incl 0
# delay_between_pulses_end: 100
# delay_between_pulses_step: 4 # must be a multiple of 4

# - id: single shot classification
# priority: 0
# # main: allXY
# operation: single_shot_classification
# parameters:
# nshots: 1024

# - id: allXY
# priority: 0
# operation: allxy
# #main: drag_pulse_tuning
# parameters:
# beta_param: null

# - id: drag_pulse_tuning
# priority: 0
# operation: drag_pulse_tuning
# #main: spin_echo
# parameters:
# beta_start: -0.1
# beta_end: 0.1
# beta_step: 0.05

# # - id: allXY 2 #Ideally this should be repeated with the correct beta
# # priority: 10
# # operation: allxy
# # main: drag_pulse_tuning
# # parameters:
# # beta_param: null

# - id: spin_echo
# priority: 0
# operation: spin_echo
# # main: flipping
# parameters:
# delay_between_pulses_start: 4
# delay_between_pulses_end: 10000
# delay_between_pulses_step: 200

# - id: flipping
# priority: 10
# operation: flipping
# parameters:
# nflips_max: 2
# nflips_step: 1
14 changes: 7 additions & 7 deletions runcards/dummy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ format: csv

actions:

resonator_spectroscopy: # wide
qubits: [0,1,2]
freq_width: 30_000_000
freq_step: 1_000_000
# resonator_spectroscopy: # wide
# qubits: [0,1,2]
# freq_width: 30_000_000
# freq_step: 1_000_000


# resonator_spectroscopy: # narrow
Expand Down Expand Up @@ -157,9 +157,9 @@ actions:
# software_averages: 2
# points: 5

# calibrate_qubit_states:
# nshots: 2048
# points: 1
calibrate_qubit_states:
nshots: 2048
points: 1

# allXY:
# beta_param: Null
Expand Down
15 changes: 2 additions & 13 deletions src/qibocal/fitting/methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,8 @@ def calibrate_qubit_states_fit(data, x, y, nshots, qubits):
iq_state1_translated = iq_state1 - origin
rotation_angle = np.angle(np.mean(iq_state1_translated))

iq_state1_rotated = iq_state1 * np.exp(-1j * rotation_angle)
iq_state0_rotated = iq_state0 * np.exp(-1j * rotation_angle)
iq_state1_rotated = iq_state1_translated * np.exp(-1j * rotation_angle)
iq_state0_rotated = iq_state0_translated * np.exp(-1j * rotation_angle)

real_values_state1 = iq_state1_rotated.real
real_values_state0 = iq_state0_rotated.real
Expand All @@ -1076,20 +1076,9 @@ def calibrate_qubit_states_fit(data, x, y, nshots, qubits):
)
argmax = np.argmax(cum_distribution_diff)
threshold = real_values_combined[argmax]
errors_state1 = nshots - cum_distribution_state1[argmax]
errors_state0 = cum_distribution_state0[argmax]
fidelity = cum_distribution_diff[argmax] / nshots
assignment_fidelity = 1 - (errors_state1 + errors_state0) / nshots / 2
# assignment_fidelity = 1/2 + (cum_distribution_state1[argmax] - cum_distribution_state0[argmax])/nshots/2

results = {
"rotation_angle": (-rotation_angle * 360 / (2 * np.pi)) % 360, # in degrees
"threshold": threshold,
"fidelity": fidelity,
"assignment_fidelity": assignment_fidelity,
"average_state0": iq_mean_state0,
"average_state1": iq_mean_state1,
"qubit": qubit,
}
parameters.add(results)
return parameters
28 changes: 28 additions & 0 deletions src/qibocal/protocols/characterization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,37 @@
from enum import Enum

from .allxy.allxy import allxy
from .allxy.allxy_drag_pulse_tuning import allxy_drag_pulse_tuning
from .allxy.drag_pulse_tuning import drag_pulse_tuning
from .classification import single_shot_classification
from .flipping import flipping
from .flux_depedence.qubit_flux_dependence import qubit_flux
from .flux_depedence.resonator_flux_dependence import resonator_flux
from .qubit_spectroscopy import qubit_spectroscopy
from .rabi.amplitude import rabi_amplitude
from .rabi.length import rabi_length
from .ramsey import ramsey
from .resonator_punchout import resonator_punchout
from .resonator_punchout_attenuation import resonator_punchout_attenuation
from .resonator_spectroscopy import resonator_spectroscopy
from .spin_echo import spin_echo
from .t1 import t1


class Operation(Enum):
resonator_spectroscopy = resonator_spectroscopy
resonator_punchout = resonator_punchout
resonator_punchout_attenuation = resonator_punchout_attenuation
resonator_flux = resonator_flux
qubit_spectroscopy = qubit_spectroscopy
qubit_flux = qubit_flux
rabi_amplitude = rabi_amplitude
rabi_length = rabi_length
ramsey = ramsey
t1 = t1
single_shot_classification = single_shot_classification
spin_echo = spin_echo
allxy = allxy
allxy_drag_pulse_tuning = allxy_drag_pulse_tuning
drag_pulse_tuning = drag_pulse_tuning
flipping = flipping
Loading