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

Video Mode #180

Closed
wants to merge 148 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
148 commits
Select commit Hold shift + click to select a range
5b69aca
First commit from Arthur
TheoLaudatQM Nov 28, 2023
7929019
fixes to get it to work
TheoLaudatQM Nov 28, 2023
292aac5
Add get method
TheoLaudatQM Nov 28, 2023
edd1917
Handle param_index_var internally
TheoLaudatQM Nov 28, 2023
cc681f8
help + black + small changes
TheoLaudatQM Nov 28, 2023
7c1edff
small cleaning
TheoLaudatQM Nov 28, 2023
038043d
add job.halt when stop
TheoLaudatQM Nov 28, 2023
f58f17a
Updated documentation
arthurostrauss Nov 28, 2023
421df3b
Add initialization and PID example
TheoLaudatQM Nov 28, 2023
740065b
small updates
TheoLaudatQM Nov 28, 2023
e0c76f4
clearer test filte
TheoLaudatQM Nov 28, 2023
fe6ae47
Started tests and fixed issue with array loading
arthurostrauss Dec 5, 2023
e06c39d
initialize iovalues
TheoLaudatQM Dec 5, 2023
7898fda
Added other way of using variables in readme
arthurostrauss Dec 6, 2023
11e9c93
Added init file to make it a package
arthurostrauss Dec 6, 2023
6833c31
Added handling of rough console closing (without typing stop)
arthurostrauss Dec 8, 2023
d3eebb5
Fix the "done" command
TheoLaudatQM Dec 11, 2023
d2b76cc
small adustments
TheoLaudatQM Dec 11, 2023
af8f615
Cleaned PID test + print help and get at start
TheoLaudatQM Dec 11, 2023
443a9f4
notebook + frame_rotation
TheoLaudatQM Dec 11, 2023
622f127
Added test and additional check of param access
arthurostrauss Dec 12, 2023
aafc4e2
Added test and additional param check
arthurostrauss Dec 12, 2023
deeae59
Adjusted import in test file
arthurostrauss Dec 12, 2023
abc0be7
fix job and error with getting the "var" key
TheoLaudatQM Dec 12, 2023
0407d3b
Added docstrings
arthurostrauss Dec 18, 2023
536d8aa
Edited docstring
arthurostrauss Dec 18, 2023
5dea0a9
Docstring v3
arthurostrauss Dec 18, 2023
d03a181
Docstring v4
arthurostrauss Dec 18, 2023
d9881b6
First commit from Arthur
TheoLaudatQM Nov 28, 2023
adc96df
fixes to get it to work
TheoLaudatQM Nov 28, 2023
00f4b2f
Add get method
TheoLaudatQM Nov 28, 2023
4db0b94
Handle param_index_var internally
TheoLaudatQM Nov 28, 2023
8f8f498
help + black + small changes
TheoLaudatQM Nov 28, 2023
42f6fbc
small cleaning
TheoLaudatQM Nov 28, 2023
92ad30a
add job.halt when stop
TheoLaudatQM Nov 28, 2023
b69c050
Updated documentation
arthurostrauss Nov 28, 2023
e9c9385
Add initialization and PID example
TheoLaudatQM Nov 28, 2023
898a694
small updates
TheoLaudatQM Nov 28, 2023
0ba7eb7
clearer test filte
TheoLaudatQM Nov 28, 2023
2a6e656
Started tests and fixed issue with array loading
arthurostrauss Dec 5, 2023
be2a466
initialize iovalues
TheoLaudatQM Dec 5, 2023
3eb861e
Added other way of using variables in readme
arthurostrauss Dec 6, 2023
f83970b
Added init file to make it a package
arthurostrauss Dec 6, 2023
2f03b21
Added handling of rough console closing (without typing stop)
arthurostrauss Dec 8, 2023
3e9f208
Fix the "done" command
TheoLaudatQM Dec 11, 2023
e42ae08
small adustments
TheoLaudatQM Dec 11, 2023
eeb76d4
Cleaned PID test + print help and get at start
TheoLaudatQM Dec 11, 2023
8510518
notebook + frame_rotation
TheoLaudatQM Dec 11, 2023
891d0c3
Added test and additional check of param access
arthurostrauss Dec 12, 2023
6fd732e
Adjusted import in test file
arthurostrauss Dec 12, 2023
488ecf8
fix job and error with getting the "var" key
TheoLaudatQM Dec 12, 2023
0fdf0ea
Added docstrings
arthurostrauss Dec 18, 2023
3b02176
Edited docstring
arthurostrauss Dec 18, 2023
20ac2bd
Docstring v3
arthurostrauss Dec 18, 2023
8920e0b
Docstring v4
arthurostrauss Dec 18, 2023
bc01d5b
Updated docstring
TheoLaudatQM Dec 18, 2023
4848441
changelog
TheoLaudatQM Dec 18, 2023
70b657d
README + examples + black
TheoLaudatQM Dec 18, 2023
f775d18
main readme
TheoLaudatQM Dec 18, 2023
d57c367
Merge branch 'video_mode' of https://github.com/qua-platform/py-qua-t…
arthurostrauss Dec 18, 2023
0ec8e91
Reformat and corrected test
arthurostrauss Dec 19, 2023
8cd745a
Added clearer error message for mishandling of variable access
arthurostrauss Dec 19, 2023
ad767e8
Extra docstring for get_item
arthurostrauss Dec 19, 2023
b5370ee
Replicated get_parameters method in VideoMode
arthurostrauss Dec 19, 2023
680f758
Adjusted calling of the method within class
arthurostrauss Dec 19, 2023
32f60b6
First commit from Arthur
TheoLaudatQM Nov 28, 2023
11c9f8a
fixes to get it to work
TheoLaudatQM Nov 28, 2023
7cf7657
Add get method
TheoLaudatQM Nov 28, 2023
334b128
Handle param_index_var internally
TheoLaudatQM Nov 28, 2023
e7aeb2a
help + black + small changes
TheoLaudatQM Nov 28, 2023
8e589dd
small cleaning
TheoLaudatQM Nov 28, 2023
9961733
add job.halt when stop
TheoLaudatQM Nov 28, 2023
c44faf1
Updated documentation
arthurostrauss Nov 28, 2023
7af0a61
Add initialization and PID example
TheoLaudatQM Nov 28, 2023
3fa0aa3
small updates
TheoLaudatQM Nov 28, 2023
79f7122
clearer test filte
TheoLaudatQM Nov 28, 2023
b1dd38d
Started tests and fixed issue with array loading
arthurostrauss Dec 5, 2023
b1c08e8
initialize iovalues
TheoLaudatQM Dec 5, 2023
b03972e
Added other way of using variables in readme
arthurostrauss Dec 6, 2023
ad275c3
Added init file to make it a package
arthurostrauss Dec 6, 2023
4ea7b47
Added handling of rough console closing (without typing stop)
arthurostrauss Dec 8, 2023
c84eff1
Fix the "done" command
TheoLaudatQM Dec 11, 2023
4e14fa8
small adustments
TheoLaudatQM Dec 11, 2023
91e377b
Cleaned PID test + print help and get at start
TheoLaudatQM Dec 11, 2023
0e5b404
notebook + frame_rotation
TheoLaudatQM Dec 11, 2023
a134794
Added test and additional check of param access
arthurostrauss Dec 12, 2023
de3e756
Adjusted import in test file
arthurostrauss Dec 12, 2023
f8257de
fix job and error with getting the "var" key
TheoLaudatQM Dec 12, 2023
583ef96
Added docstrings
arthurostrauss Dec 18, 2023
2d15314
Edited docstring
arthurostrauss Dec 18, 2023
dd3a030
Docstring v3
arthurostrauss Dec 18, 2023
4fc481a
Docstring v4
arthurostrauss Dec 18, 2023
3d99dae
First commit from Arthur
TheoLaudatQM Nov 28, 2023
8aa1db7
fixes to get it to work
TheoLaudatQM Nov 28, 2023
efcf897
Add get method
TheoLaudatQM Nov 28, 2023
c477c3a
Handle param_index_var internally
TheoLaudatQM Nov 28, 2023
bab0f34
help + black + small changes
TheoLaudatQM Nov 28, 2023
7a49bf1
small cleaning
TheoLaudatQM Nov 28, 2023
913d41a
add job.halt when stop
TheoLaudatQM Nov 28, 2023
91900e1
Updated documentation
arthurostrauss Nov 28, 2023
6391747
Add initialization and PID example
TheoLaudatQM Nov 28, 2023
0679cdf
small updates
TheoLaudatQM Nov 28, 2023
aa10ea2
clearer test filte
TheoLaudatQM Nov 28, 2023
34ab3ab
Started tests and fixed issue with array loading
arthurostrauss Dec 5, 2023
e891201
initialize iovalues
TheoLaudatQM Dec 5, 2023
fe528b8
Added other way of using variables in readme
arthurostrauss Dec 6, 2023
2a04b64
Added init file to make it a package
arthurostrauss Dec 6, 2023
4c2981b
Added handling of rough console closing (without typing stop)
arthurostrauss Dec 8, 2023
f77b07a
Fix the "done" command
TheoLaudatQM Dec 11, 2023
5105b73
small adustments
TheoLaudatQM Dec 11, 2023
b9efac3
Cleaned PID test + print help and get at start
TheoLaudatQM Dec 11, 2023
87ee943
notebook + frame_rotation
TheoLaudatQM Dec 11, 2023
e77f00d
Added test and additional check of param access
arthurostrauss Dec 12, 2023
d80c63c
Adjusted import in test file
arthurostrauss Dec 12, 2023
1f508dc
fix job and error with getting the "var" key
TheoLaudatQM Dec 12, 2023
ac2431a
Added docstrings
arthurostrauss Dec 18, 2023
478e26e
Edited docstring
arthurostrauss Dec 18, 2023
245cfd2
Docstring v3
arthurostrauss Dec 18, 2023
d081f91
Docstring v4
arthurostrauss Dec 18, 2023
cf79e94
Updated docstring
TheoLaudatQM Dec 18, 2023
8e05e85
changelog
TheoLaudatQM Dec 18, 2023
ad21a84
README + examples + black
TheoLaudatQM Dec 18, 2023
17c6920
main readme
TheoLaudatQM Dec 18, 2023
64a534c
Reformat and corrected test
arthurostrauss Dec 19, 2023
3be9a6d
Added clearer error message for mishandling of variable access
arthurostrauss Dec 19, 2023
65e00fd
Extra docstring for get_item
arthurostrauss Dec 19, 2023
2ae62cc
Replicated get_parameters method in VideoMode
arthurostrauss Dec 19, 2023
2ad8327
Adjusted calling of the method within class
arthurostrauss Dec 19, 2023
c9c9b3c
fix merge
TheoLaudatQM Dec 19, 2023
c2e8e76
fixes after merge
TheoLaudatQM Dec 19, 2023
d3c2ea6
Changed names of example files
arthurostrauss Dec 20, 2023
4304cd8
Changed names of example files
arthurostrauss Dec 20, 2023
2a8534b
Specified order of parameters in readme
arthurostrauss Dec 20, 2023
fc81253
Added class private attributes for default IO values
arthurostrauss Dec 20, 2023
71527c1
Adapted README and main code for Python 3.8
arthurostrauss Dec 20, 2023
4491ec0
clean duplicates
TheoLaudatQM Dec 21, 2023
db86436
Separated get and print params + removed dataclass
arthurostrauss Dec 22, 2023
f446136
Changed interface of ParameterTable to store all info in a class
arthurostrauss Dec 22, 2023
e77dddd
Updated test
arthurostrauss Dec 22, 2023
1c1945e
Added compatibility for specifying directly QUA type
arthurostrauss Dec 24, 2023
a484ed8
Changed examples to match new type specification
arthurostrauss Dec 24, 2023
2a4e754
Modified docstring to match new type specification
arthurostrauss Dec 24, 2023
b52120a
Reformat
arthurostrauss Dec 25, 2023
7b7710f
fix docstring format and typos
TheoLaudatQM Jan 3, 2024
66c90f4
Update comment
TheoLaudatQM Jan 3, 2024
c69a846
Merge branch 'main' into video_mode
arthurostrauss Mar 4, 2024
973fd0b
Format
yonatanrqm Mar 4, 2024
e9b7a3f
Simplified import in notebook example
arthurostrauss Mar 22, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- External_frameworks/qcodes - Added ``update_qm()`` to update the quantum machine (close and re-open it) in case the config has been updated.
- External_frameworks/qcodes - Added ``live_plotting()`` to fetch and plot the OPX results while the program is running.
- Unit - Added `volts2dBm` and `dBm2volts`.
- Video_mode - New module to update some pre-defined parameters of a QUA program while fetching data from the OPX.

### Changed
- Eased package dependencies, requires python 3.8 or above
Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ It currently has a two-states discriminator for analyzing the ground and excited
* [Bakery](qualang_tools/bakery/README.md) - This library introduces a new framework for creating arbitrary waveforms and
storing them in the usual configuration file. It allows defining waveforms in a QUA-like manner while working with 1ns resolution (or higher).

* [External Frameworks](qualang_tools/external_frameworks/qcodes/README.md) - This library introduces drivers for integrating the OPX within external frameworks such as QCoDeS. Please refer to the [examples](./examples) section for more details about how to use these drivers.
* [External Frameworks](qualang_tools/external_frameworks/qcodes/README.md) - This library introduces drivers for integrating the OPX within external frameworks such as QCoDeS. Please refer to the [examples](./examples/Qcodes_drivers) section for more details about how to use these drivers.
* [Video Mode](qualang_tools/video_mode/README.md) - This module allows the user to update some pre-defined parameters of a QUA program while fetching data from the OPX for dynamic tuning. Please refer to the [examples](./examples/video_mode) section for more details about how to implement this module.

* Addons:
* [Calibrations](qualang_tools/addons/calibration/README.md) - This module allows to easily perform most of the standard single qubit calibrations from a single python file.
Expand Down Expand Up @@ -72,5 +73,3 @@ Feel like contributing code to this library? We're thrilled! Please follow [this
## Usage

Examples for using various tools can be found on the [QUA Libraries Repository](https://github.com/qua-platform/qua-libs).

Examples for using the Baking toolbox, including 1-qubit randomized benchmarking, cross-entropy benchmark (XEB), high sampling rate baking and more can be found [here](https://github.com/qua-platform/qua-libs/tree/main/examples/bakery).
106 changes: 35 additions & 71 deletions examples/Qcodes_drivers/advanced-driver/advanced_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,8 @@ def __init__(
def update_readout_parameters(self):
"""Update the config with the readout length and amplitude set with self.readout_pulse_length() and self.readout_pulse_amplitude()."""
if self.readout_pulse_length() % 4 != 0:
raise ValueError(
"The readout pulse length must be an integer multiple of 4ns."
)
self.config["pulses"]["readout_pulse"]["length"] = int(
self.readout_pulse_length()
)
raise ValueError("The readout pulse length must be an integer multiple of 4ns.")
self.config["pulses"]["readout_pulse"]["length"] = int(self.readout_pulse_length())
self.config["integration_weights"]["cosine_weights"]["cosine"] = [
(1.0, self.config["pulses"]["readout_pulse"]["length"])
]
Expand All @@ -159,9 +155,7 @@ def update_readout_parameters(self):
(-1.0, self.config["pulses"]["readout_pulse"]["length"])
]
# update readout pulse amplitude
pulse = self.config["elements"][self.readout_element()]["operations"][
self.readout_operation()
]
pulse = self.config["elements"][self.readout_element()]["operations"][self.readout_operation()]
wf = self.config["pulses"][pulse]["waveforms"]["I"]
self.config["waveforms"][wf]["sample"] = self.readout_pulse_amplitude()
# Open QM
Expand Down Expand Up @@ -200,10 +194,7 @@ def measurement_declaration(self):
Q1_arr,
Q2_arr,
]
elif (
self.acquisition_mode() == "full_integration"
or self.acquisition_mode() == "full_demodulation"
):
elif self.acquisition_mode() == "full_integration" or self.acquisition_mode() == "full_demodulation":
I = declare(fixed)
Q = declare(fixed)
I_st = declare_stream()
Expand Down Expand Up @@ -288,76 +279,49 @@ def stream_results(self):
"""Create the stream processing based on the measurement mode (self.acquisition_mode()) and OPX scan 0d, 1d or 2d (self.opx_scan())"""
variables = self.measurement_variables
if self.opx_scan() == "0d":
if (
self.acquisition_mode() == "full_integration"
or self.acquisition_mode() == "full_demodulation"
):
if self.acquisition_mode() == "full_integration" or self.acquisition_mode() == "full_demodulation":
variables[2].buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("I")
variables[3].buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("Q")
elif self.acquisition_mode() == "raw_adc":
variables.input1().buffer(self.n_avg()).map(
FUNCTIONS.average()
).save_all("adc1")
variables.input2().buffer(self.n_avg()).map(
FUNCTIONS.average()
).save_all("adc2")
elif (
self.acquisition_mode() == "sliced_integration"
or self.acquisition_mode() == "sliced_demodulation"
):
variables[2].buffer(variables[5]).buffer(self.n_avg()).map(
FUNCTIONS.average()
).save_all("I")
variables[3].buffer(variables[5]).buffer(self.n_avg()).map(
FUNCTIONS.average()
).save_all("Q")
variables.input1().buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("adc1")
variables.input2().buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("adc2")
elif self.acquisition_mode() == "sliced_integration" or self.acquisition_mode() == "sliced_demodulation":
variables[2].buffer(variables[5]).buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("I")
variables[3].buffer(variables[5]).buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("Q")
elif self.opx_scan() == "1d":
if (
self.acquisition_mode() == "full_integration"
or self.acquisition_mode() == "full_demodulation"
):
variables[2].buffer(self.axis1_npoints()).buffer(self.n_avg()).map(
if self.acquisition_mode() == "full_integration" or self.acquisition_mode() == "full_demodulation":
variables[2].buffer(self.axis1_npoints()).buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("I")
variables[3].buffer(self.axis1_npoints()).buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("Q")
elif self.acquisition_mode() == "raw_adc":
variables.buffer(self.axis1_npoints()).input1().buffer(self.n_avg()).map(FUNCTIONS.average()).save_all(
"adc1"
)
variables.buffer(self.axis1_npoints()).input2().buffer(self.n_avg()).map(FUNCTIONS.average()).save_all(
"adc2"
)
elif self.acquisition_mode() == "sliced_integration" or self.acquisition_mode() == "sliced_demodulation":
variables[2].buffer(variables[5]).buffer(self.axis2_npoints()).buffer(self.n_avg()).map(
FUNCTIONS.average()
).save_all("I")
variables[3].buffer(self.axis1_npoints()).buffer(self.n_avg()).map(
variables[3].buffer(variables[5]).buffer(self.axis2_npoints()).buffer(self.n_avg()).map(
FUNCTIONS.average()
).save_all("Q")
elif self.acquisition_mode() == "raw_adc":
variables.buffer(self.axis1_npoints()).input1().buffer(
self.n_avg()
).map(FUNCTIONS.average()).save_all("adc1")
variables.buffer(self.axis1_npoints()).input2().buffer(
self.n_avg()
).map(FUNCTIONS.average()).save_all("adc2")
elif (
self.acquisition_mode() == "sliced_integration"
or self.acquisition_mode() == "sliced_demodulation"
):
variables[2].buffer(variables[5]).buffer(self.axis2_npoints()).buffer(
self.n_avg()
).map(FUNCTIONS.average()).save_all("I")
variables[3].buffer(variables[5]).buffer(self.axis2_npoints()).buffer(
self.n_avg()
).map(FUNCTIONS.average()).save_all("Q")
elif self.opx_scan() == "2d":
if (
self.acquisition_mode() == "full_integration"
or self.acquisition_mode() == "full_demodulation"
):
if self.acquisition_mode() == "full_integration" or self.acquisition_mode() == "full_demodulation":
if self.outer_averaging_loop():
variables[2].buffer(self.axis1_npoints()).buffer(
self.axis2_npoints()
).buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("I")
variables[3].buffer(self.axis1_npoints()).buffer(
self.axis2_npoints()
).buffer(self.n_avg()).map(FUNCTIONS.average()).save_all("Q")
else:
variables[2].buffer(self.axis1_npoints()).buffer(self.n_avg()).map(
variables[2].buffer(self.axis1_npoints()).buffer(self.axis2_npoints()).buffer(self.n_avg()).map(
FUNCTIONS.average()
).buffer(self.axis2_npoints()).save_all("I")
variables[3].buffer(self.axis1_npoints()).buffer(self.n_avg()).map(
).save_all("I")
variables[3].buffer(self.axis1_npoints()).buffer(self.axis2_npoints()).buffer(self.n_avg()).map(
FUNCTIONS.average()
).buffer(self.axis2_npoints()).save_all("Q")
).save_all("Q")
else:
variables[2].buffer(self.axis1_npoints()).buffer(self.n_avg()).map(FUNCTIONS.average()).buffer(
self.axis2_npoints()
).save_all("I")
variables[3].buffer(self.axis1_npoints()).buffer(self.n_avg()).map(FUNCTIONS.average()).buffer(
self.axis2_npoints()
).save_all("Q")
else:
raise Exception(
"It is advises to use 'full_integration' or 'full_demodulation' only for performing 2d scans on the OPX to avoid memory overflow."
Expand Down
12 changes: 3 additions & 9 deletions examples/Qcodes_drivers/advanced-driver/hello_qcodes_advanced.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,11 @@
qc.config.core.db_location = db_file_path
initialise_or_create_database_at(db_file_path)
# Initialize qcodes experiment
experiment = load_or_create_experiment(
experiment_name=exp_name, sample_name=sample_name
)
experiment = load_or_create_experiment(experiment_name=exp_name, sample_name=sample_name)
# Initialize the qcodes station to which instruments will be added
station = qc.Station()
# Create the OPX instrument class
opx_instrument = OPXCustomSequence(
config, name="OPX_demo", host="127.0.0.1", cluster_name="my_cluster"
)
opx_instrument = OPXCustomSequence(config, name="OPX_demo", host="127.0.0.1", cluster_name="my_cluster")
# Add the OPX instrument to the qcodes station
station.add_component(opx_instrument)

Expand Down Expand Up @@ -142,9 +138,7 @@ def custom_sequence(self):
opx_instrument.outer_averaging_loop(False)
opx_instrument.n_avg(n_avg)
# Axis1 is the most inner loop
opx_instrument.set_sweep_parameters(
"axis1", pulse_lengths * 4, "ns", "pulse duration"
)
opx_instrument.set_sweep_parameters("axis1", pulse_lengths * 4, "ns", "pulse duration")
# Axis2 is the second loop
opx_instrument.set_sweep_parameters(
"axis2",
Expand Down
36 changes: 9 additions & 27 deletions examples/Qcodes_drivers/basic-driver/hello_qcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
qc.config.core.db_location = db_file_path
initialise_or_create_database_at(db_file_path)
# Initialize qcodes experiment
experiment = load_or_create_experiment(
experiment_name=exp_name, sample_name=sample_name
)
experiment = load_or_create_experiment(experiment_name=exp_name, sample_name=sample_name)
# Initialize the qcodes station to which instruments will be added
station = qc.Station()
# Create the OPX instrument class
Expand Down Expand Up @@ -204,12 +202,8 @@ def OPX_1d_scan(simulate=False):
ramp_to_zero("gate_1")

with stream_processing():
I_st.buffer(len(biases)).buffer(n_avg).map(FUNCTIONS.average()).save_all(
"I"
)
Q_st.buffer(len(biases)).buffer(n_avg).map(FUNCTIONS.average()).save_all(
"Q"
)
I_st.buffer(len(biases)).buffer(n_avg).map(FUNCTIONS.average()).save_all("I")
Q_st.buffer(len(biases)).buffer(n_avg).map(FUNCTIONS.average()).save_all("Q")
return prog


Expand All @@ -234,9 +228,7 @@ def OPX_1d_scan(simulate=False):
do0d(
opx_instrument.run_exp,
opx_instrument.resume,
opx_instrument.get_measurement_parameter(
scale_factor=[("I", 1235, "pA"), ("Q", 1235, "pA")]
),
opx_instrument.get_measurement_parameter(scale_factor=[("I", 1235, "pA"), ("Q", 1235, "pA")]),
opx_instrument.halt,
do_plot=True,
exp=experiment,
Expand Down Expand Up @@ -368,12 +360,8 @@ def OPX_sliced_scan(simulate=False):
ramp_to_zero("gate_1")

with stream_processing():
I_st.buffer(nb_of_slices).buffer(len(biases)).buffer(n_avg).map(
FUNCTIONS.average()
).save_all("I")
Q_st.buffer(nb_of_slices).buffer(len(biases)).buffer(n_avg).map(
FUNCTIONS.average()
).save_all("Q")
I_st.buffer(nb_of_slices).buffer(len(biases)).buffer(n_avg).map(FUNCTIONS.average()).save_all("I")
Q_st.buffer(nb_of_slices).buffer(len(biases)).buffer(n_avg).map(FUNCTIONS.average()).save_all("Q")
return prog


Expand Down Expand Up @@ -443,12 +431,8 @@ def OPX_reflectometry(simulate=False):
save(Q, Q_st)

with stream_processing():
I_st.buffer(len(frequencies)).buffer(n_avg).map(
FUNCTIONS.average()
).save_all("I")
Q_st.buffer(len(frequencies)).buffer(n_avg).map(
FUNCTIONS.average()
).save_all("Q")
I_st.buffer(len(frequencies)).buffer(n_avg).map(FUNCTIONS.average()).save_all("I")
Q_st.buffer(len(frequencies)).buffer(n_avg).map(FUNCTIONS.average()).save_all("Q")
return prog


Expand Down Expand Up @@ -484,9 +468,7 @@ def OPX_reflectometry(simulate=False):
# Get the results from the OPX
data = opx_instrument.get_res()
# Store the results in the scodes database
datasaver.add_result(
(VP1, VP1()), (OPX_param, np.array(list(data.values())))
)
datasaver.add_result((VP1, VP1()), (OPX_param, np.array(list(data.values()))))
# Halt the OPX program at the end
opx_instrument.halt()
# Get the full dataset
Expand Down
12 changes: 3 additions & 9 deletions examples/Qcodes_drivers/stability-diagram/raster_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
qc.config.core.db_location = db_file_path
initialise_or_create_database_at(db_file_path)
# Initialize qcodes experiment
experiment = load_or_create_experiment(
experiment_name=exp_name, sample_name=sample_name
)
experiment = load_or_create_experiment(experiment_name=exp_name, sample_name=sample_name)
# Initialize the qcodes station to which instruments will be added
station = qc.Station()
# Create the OPX instrument class
Expand Down Expand Up @@ -129,12 +127,8 @@ def raster_scan(simulate=False):
save(I, I_st)
save(Q, Q_st)
with stream_processing():
I_st.buffer(N1).buffer(N2).buffer(n_avg).map(FUNCTIONS.average()).save_all(
"I"
)
Q_st.buffer(N1).buffer(N2).buffer(n_avg).map(FUNCTIONS.average()).save_all(
"Q"
)
I_st.buffer(N1).buffer(N2).buffer(n_avg).map(FUNCTIONS.average()).save_all("I")
Q_st.buffer(N1).buffer(N2).buffer(n_avg).map(FUNCTIONS.average()).save_all("Q")

return prog

Expand Down
Loading