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
4555b4e7
Commit
4555b4e7
authored
1 year ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Improved test to work on Qblox and Keysight
parent
b6d430b7
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/tests/segments/conditional_segments.py
+26
-7
26 additions, 7 deletions
pulse_lib/tests/segments/conditional_segments.py
with
26 additions
and
7 deletions
pulse_lib/tests/segments/conditional_segments.py
+
26
−
7
View file @
4555b4e7
...
...
@@ -6,9 +6,24 @@ from pulse_lib.tests.configurations.test_configuration import context
from
pulse_lib.segments.conditional_segment
import
conditional_segment
from
pulse_lib.segments.utility.measurement_ref
import
MeasurementRef
def
get_feedback_latency
(
backend
):
if
backend
in
[
'
Tektronix_5014
'
,
'
Keysight
'
]:
print
(
f
'
feedback not supported for
{
backend
}
'
)
return
None
elif
backend
==
'
Keysight_QS
'
:
feedback_latency
=
700
else
:
feedback_latency
=
300
return
feedback_latency
def
test1
():
pulse
=
context
.
init_pulselib
(
n_gates
=
2
,
n_qubits
=
2
,
n_sensors
=
2
)
feedback_latency
=
get_feedback_latency
(
pulse
.
_backend
)
if
feedback_latency
is
None
:
return
t_measure
=
500
s
=
pulse
.
mk_segment
(
'
seg1
'
)
...
...
@@ -17,7 +32,7 @@ def test1():
s
.
P1
.
add_block
(
10
,
20
,
-
10
)
s
.
wait
(
30
,
reset_time
=
True
)
s
.
SD1
.
acquire
(
0
,
t_measure
,
'
m1
'
,
threshold
=
0.0015
,
zero_on_high
=
True
,
wait
=
True
)
s
.
wait
(
300
,
reset_time
=
True
)
s
.
wait
(
feedback_latency
,
reset_time
=
True
)
s_true
=
pulse
.
mk_segment
()
s_false
=
pulse
.
mk_segment
()
...
...
@@ -40,6 +55,10 @@ def test1():
def
test2
():
pulse
=
context
.
init_pulselib
(
n_gates
=
2
,
n_qubits
=
2
,
n_sensors
=
2
)
feedback_latency
=
get_feedback_latency
(
pulse
.
_backend
)
if
feedback_latency
is
None
:
return
t_measure
=
500
s
=
pulse
.
mk_segment
(
'
seg1
'
)
...
...
@@ -47,10 +66,10 @@ def test2():
s
.
P1
.
add_block
(
10
,
20
,
-
10
)
s
.
wait
(
30
,
reset_time
=
True
)
s
.
SD1
.
acquire
(
0
,
t_measure
,
'
m0
'
,
threshold
=
0.002
5
,
zero_on_high
=
True
,
wait
=
True
)
s
.
wait
(
3
00
,
reset_time
=
True
)
s
.
SD1
.
acquire
(
0
,
t_measure
,
'
m1
'
,
threshold
=
0.002
5
,
zero_on_high
=
True
,
wait
=
True
)
s
.
wait
(
300
,
reset_time
=
True
)
s
.
SD1
.
acquire
(
0
,
t_measure
,
'
m0
'
,
threshold
=
0.002
4
,
zero_on_high
=
True
,
wait
=
True
)
s
.
wait
(
2
00
,
reset_time
=
True
)
s
.
SD1
.
acquire
(
0
,
t_measure
,
'
m1
'
,
threshold
=
0.002
4
,
zero_on_high
=
True
,
wait
=
True
)
s
.
wait
(
feedback_latency
,
reset_time
=
True
)
s_true
=
pulse
.
mk_segment
()
s_false
=
pulse
.
mk_segment
()
...
...
@@ -58,7 +77,7 @@ def test2():
s_false
.
q1
.
add_MW_pulse
(
10
,
20
,
80.0
,
2.450e9
)
s_false
.
wait
(
10
,
reset_time
=
True
)
cond_seg1
=
conditional_segment
(
MeasurementRef
(
'
m
0
'
),
[
s_false
,
s_true
],
name
=
'
cond
'
)
cond_seg1
=
conditional_segment
(
MeasurementRef
(
'
m
1
'
),
[
s_false
,
s_true
],
name
=
'
cond
'
)
sequence
=
pulse
.
mk_sequence
([
s1
,
cond_seg1
])
sequence
.
n_rep
=
3
...
...
@@ -75,4 +94,4 @@ if __name__ == '__main__':
context
.
init_coretools
()
# ds1 = test1()
ds2
=
test2
()
ds2
.
m1_1
(),
ds2
.
m1_2
(),
ds2
.
m1_3
(),
ds2
.
m1_4
()
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