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
81db1b25
Commit
81db1b25
authored
3 years ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Added add_long_block and add_long_wait with lower sample rate
parent
162a8c5f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pulse_lib/sequence_builder.py
+34
-15
34 additions, 15 deletions
pulse_lib/sequence_builder.py
with
34 additions
and
15 deletions
pulse_lib/sequence_builder.py
+
34
−
15
View file @
81db1b25
...
...
@@ -109,7 +109,7 @@ class sequence_builder:
template
.
build
(
segment
,
reset
=
False
,
**
kwargs
)
self
.
_segments
.
append
(
cond_seg
)
def
wait
(
self
,
channels
,
t
,
amplitudes
,
reset_time
=
True
):
def
add_block
(
self
,
channels
,
t
,
amplitudes
,
reset_time
=
True
):
'''
Adds a block to each of the specified channels.
Args:
...
...
@@ -125,39 +125,58 @@ class sequence_builder:
if
reset_time
==
True
:
self
.
reset_time
()
def
add_block
(
self
,
channels
,
t
,
amplitudes
,
reset_time
=
True
):
def
add_ramp
(
self
,
channels
,
t
,
start_amplitudes
,
stop_amplitudes
,
reset_time
=
True
):
'''
Adds a
block
to each of the specified channels.
Adds a
ramp
to each of the specified channels.
Args:
t (float, loop_obj): duration of the block
channels (List[str]): channels to apply the block to
amplitudes (List[float, loop_obj]): amplitude per channel
start_amplitudes (List[float, loop_obj]): start amplitude per channel
stop_amplitudes (List[float, loop_obj]): stop amplitude per channel
reset_time (bool): if True resets segment time after block
'''
segment
=
self
.
_get_segment
()
for
channel
,
amplitude
in
zip
(
channels
,
amplitudes
):
segment
[
channel
].
add_
block
(
0
,
t
,
amplitude
)
for
channel
,
start_amp
,
stop_amp
in
zip
(
channels
,
start_amplitudes
,
stop_
amplitudes
):
segment
[
channel
].
add_
ramp_ss
(
0
,
t
,
start_amp
,
stop_amp
)
if
reset_time
==
True
:
self
.
reset_time
()
def
add_ramp
(
self
,
channels
,
t
,
start_amplitudes
,
stop_amplitudes
,
reset_time
=
True
):
def
add_long_block
(
self
,
channels
,
t
,
amplitudes
,
sample_rate
=
1e9
,
reset_time
=
True
):
'''
Adds a ramp to each of the specified channels.
Adds a long block to each of the specified channels.
Sample rate can be lowered to reduce the wavelength.
Number of samples must be > 2000.
Args:
t (float, loop_obj): duration of the block
channels (List[str]): channels to apply the block to
start_amplitudes (List[float, loop_obj]): start amplitude per channel
stop_amplitudes (List[float, loop_obj]): stop amplitude per channel
amplitudes (List[float, loop_obj]): amplitude per channel
reset_time (bool): if True resets segment time after block
'''
self
.
reset_time
()
self
.
_segment
=
None
segment
=
self
.
_get_segment
()
for
channel
,
start_amp
,
stop_amp
in
zip
(
channels
,
start_amplitudes
,
stop_amplitudes
):
segment
.
add_ramp_ss
(
0
,
t
,
start_amp
,
stop_amp
)
segment
.
sample_rate
=
sample_rate
for
channel
,
amplitude
in
zip
(
channels
,
amplitudes
):
segment
[
channel
].
add_block
(
0
,
t
,
amplitude
)
if
reset_time
==
True
:
self
.
reset_time
()
self
.
reset_time
()
self
.
_segment
=
None
def
add_long_wait
(
self
,
t_wait
,
sample_rate
=
1e9
):
'''
Inserts a long wait using a new segment with a specified sample rate.
Number of samples must be > 2000.
'''
self
.
reset_time
()
self
.
_segment
=
None
segment
=
self
.
_get_segment
()
segment
.
sample_rate
=
sample_rate
# just pick first channel to set wait time
segment
[
segment
.
channels
[
0
]].
wait
(
t_wait
)
self
.
reset_time
()
self
.
_segment
=
None
def
append
(
self
,
other
):
# close active segments in both sequences
...
...
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