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
3948166c
Commit
3948166c
authored
2 years ago
by
Sander Snoo
Browse files
Options
Downloads
Patches
Plain Diff
Removed zero phase phase-shifts
parent
c5990ebe
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/segments/data_classes/data_pulse.py
+8
-7
8 additions, 7 deletions
pulse_lib/segments/data_classes/data_pulse.py
with
8 additions
and
7 deletions
pulse_lib/segments/data_classes/data_pulse.py
+
8
−
7
View file @
3948166c
...
...
@@ -67,9 +67,9 @@ class pulse_delta:
@property
def
is_near_zero
(
self
):
# near zero if |step| <
0.001 u
V and |ramp| < 1e-9 mV/ns (= 1 mV/s)
# near zero if |step| <
1e-9 m
V and |ramp| < 1e-9 mV/ns (= 1 mV/s)
# note: max ramp: 2V/ns = 2000 mV/ns, min ramp: 1 mV/s = 1e-9 mV/ns. ~ 12 orders of magnitude.
# max step: 2000 mV, min step: 1e9 mV. ~ 12 order of magnitude.
# max step: 2000 mV, min step: 1e
-
9 mV. ~ 12 order of magnitude.
# Regular floats have 16 digits precision.
return
abs
(
self
.
step
)
<
1e-9
and
abs
(
self
.
ramp
)
<
1e-9
...
...
@@ -137,8 +137,7 @@ class PhaseShift:
@property
def
is_near_zero
(
self
):
# near zero if |shift| < 2*pi/2**31
eps
=
2
*
np
.
pi
/
2
**
32
eps
=
1e-9
return
-
eps
<
self
.
phase_shift
<
eps
# Changed [v1.6.0] time,duration -> start,stop
...
...
@@ -207,8 +206,9 @@ class pulse_data(parent_data):
self
.
_update_end_time
(
custom_pulse
.
stop
)
def
add_phase_shift
(
self
,
phase_shift
:
PhaseShift
):
self
.
_phase_shifts_consolidated
=
False
self
.
phase_shifts
.
append
(
phase_shift
)
if
not
phase_shift
.
is_near_zero
:
self
.
_phase_shifts_consolidated
=
False
self
.
phase_shifts
.
append
(
phase_shift
)
self
.
_update_end_time
(
phase_shift
.
time
)
@property
...
...
@@ -574,7 +574,8 @@ class pulse_data(parent_data):
if
self
.
_phase_shifts_consolidated
:
return
if
len
(
self
.
phase_shifts
)
>
1
:
# consolidate also if there is only 1 phase shift. It can be 0.0.
if
len
(
self
.
phase_shifts
)
>
0
:
self
.
phase_shifts
.
sort
(
key
=
lambda
p
:
p
.
time
)
new_shifts
=
[]
last
=
self
.
phase_shifts
[
0
]
...
...
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