Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pulse_lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
QuTech QDLabs
pulse_lib
Commits
ce04bc5f
Commit
ce04bc5f
authored
2 years ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Added read_channels (Currently Qblox only).
parent
f340caab
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pulse_lib/scan/read_input.py
+49
-0
49 additions, 0 deletions
pulse_lib/scan/read_input.py
pulse_lib/tests/acquire/test_read.py
+31
-0
31 additions, 0 deletions
pulse_lib/tests/acquire/test_read.py
with
80 additions
and
0 deletions
pulse_lib/scan/read_input.py
0 → 100644
+
49
−
0
View file @
ce04bc5f
def
read_channels
(
pulselib
,
t_measure
,
channels
=
None
,
sample_rate
=
None
,
iq_mode
=
'
Complex
'
):
'''
Reads the input channels without pulsing the AWG channels.
Args:
pulselib: pulselib object.
t_measure (float): measurement time [ns].
channels (Optional[list[name]]): pulselib names of channels to read.
sample_rate (Optional[float]): sample rate for time trace [Hz]
iq_mode (str):
when channel contains IQ data, i.e. iq_input=True or frequency is not None,
then this parameter specifies how the complex I/Q value should be returned:
'
Complex
'
: return IQ data as complex value.
'
I
'
: return only I value.
'
Q
'
: return only Q value.
'
amplitude
'
: return amplitude.
'
phase:
'
return phase [radians],
'
I+Q
'
, return I and Q using channel name postfixes
'
_I
'
,
'
_Q
'
.
'
amplitude+phase
'
. return amplitude and phase using channel name postfixes
'
_amp
'
,
'
_phase
'
.
Note:
The frequency and phase for IQ modulation is configured on the pulselib digitizer channel.
'''
# set sample rate for Keysight upload.
if
t_measure
>
200_000
:
awg_sample_rate
=
1e7
elif
t_measure
>
20_000
:
awg_sample_rate
=
1e8
else
:
awg_sample_rate
=
1e9
if
channels
is
None
:
channels
=
pulselib
.
digitizer_channels
.
keys
()
seg
=
pulselib
.
mk_segment
(
sample_rate
=
awg_sample_rate
)
for
ch
in
channels
:
seg
[
ch
].
acquire
(
0
,
t_measure
,
wait
=
True
)
sequence
=
pulselib
.
mk_sequence
([
seg
])
# sequence.set_hw_schedule() @@@ configure single shot and video mode schedules at pulselib init!!
sequence
.
n_rep
=
None
if
sample_rate
is
not
None
:
sequence
.
set_acquisition
(
sample_rate
=
sample_rate
)
param
=
sequence
.
get_measurement_param
(
upload
=
'
auto
'
,
iq_mode
=
iq_mode
)
return
param
This diff is collapsed.
Click to expand it.
pulse_lib/tests/acquire/test_read.py
0 → 100644
+
31
−
0
View file @
ce04bc5f
from
pulse_lib.tests.configurations.test_configuration
import
context
from
pulse_lib.scan.read_input
import
read_channels
#%%
def
test1
():
pulse
=
context
.
init_pulselib
(
n_gates
=
0
,
n_sensors
=
2
,
rf_sources
=
False
)
dc_param
=
read_channels
(
pulse
,
1000
)
return
context
.
run
(
'
read
'
,
dc_param
)
def
test2
():
pulse
=
context
.
init_pulselib
(
n_gates
=
0
,
n_sensors
=
2
,
rf_sources
=
False
)
dc_param
=
read_channels
(
pulse
,
100000
,
sample_rate
=
500e3
)
return
context
.
run
(
'
read
'
,
dc_param
)
def
test3
(
iq_mode
=
'
I+Q
'
):
pulse
=
context
.
init_pulselib
(
n_gates
=
0
,
n_sensors
=
2
,
rf_sources
=
True
)
dc_param
=
read_channels
(
pulse
,
10000
,
iq_mode
=
iq_mode
)
return
context
.
run
(
'
read_iq_
'
+
iq_mode
,
dc_param
)
#%%
if
__name__
==
'
__main__
'
:
ds1
=
test1
()
ds2
=
test2
()
ds3
=
test3
()
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment