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
738664c5
Commit
738664c5
authored
1 year ago
by
Sander de Snoo
Browse files
Options
Downloads
Patches
Plain Diff
removed unused code
parent
02519fa7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pulse_lib/keysight/qs_conditional.py
+0
-44
0 additions, 44 deletions
pulse_lib/keysight/qs_conditional.py
with
0 additions
and
44 deletions
pulse_lib/keysight/qs_conditional.py
+
0
−
44
View file @
738664c5
...
...
@@ -144,50 +144,6 @@ class QsConditionalSegment:
return
order
class
QsConditionalChannel
:
def
__init__
(
self
,
seg_channels
:
List
[
segment_base
],
conditional
:
conditional_segment
):
self
.
seg_channels
=
seg_channels
self
.
conditional
=
conditional
self
.
n_branches
=
len
(
seg_channels
)
condition
=
conditional
.
condition
start
=
time
.
perf_counter
()
refs
=
condition
if
isinstance
(
condition
,
Iterable
)
else
[
condition
]
# Lookup acquistions for condition
self
.
acquisition_names
=
self
.
get_acquisition_names
(
refs
)
self
.
order
=
self
.
get_branch_order
(
refs
)
duration
=
time
.
perf_counter
()
-
start
logger
.
debug
(
f
'
duration
{
duration
*
1000
:
6.3
f
}
ms
'
)
def
get_acquisition_names
(
self
,
refs
:
List
[
MeasurementRef
]):
acquisition_names
=
set
()
for
ref
in
refs
:
acquisition_names
.
update
(
ref
.
keys
)
acquisition_names
=
list
(
acquisition_names
)
logger
.
info
(
f
'
acquisitions:
{
acquisition_names
}
'
)
return
acquisition_names
def
get_branch_order
(
self
,
refs
):
# Assumes max 4 branches
# special case: 1 measurement, 2 acquisitions (and 2 options) => expand to 4 options
# this is handled gracefully by this code:
# 1 measurement: result contains only 0 and 1
# 2 measurements: result contains 0,1,2,3
# 0, 1, 2, 3 in binary representation on 2 acquisitions
all_values
=
np
.
array
([[
0
,
1
,
0
,
1
],[
0
,
0
,
1
,
1
]])
values
=
{
key
:
all_values
[
i
]
for
i
,
key
in
enumerate
(
self
.
acquisition_names
)}
order
=
np
.
zeros
(
4
,
dtype
=
int
)
for
ref
in
refs
:
order
=
2
*
order
+
ref
.
evaluate
(
values
)
logger
.
info
(
f
'
reordered branches:
{
order
}
'
)
return
order
class
QsConditionalMW
():
# sequencer: find common offset per sequencer, generate waveforms
# when uploading, generate extra entries in index table for conditional waveforms
...
...
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