Skip to content

Commit b6536ad

Browse files
authored
Remove new_predefined_dds (#125)
1 parent 4b7c69a commit b6536ad

File tree

6 files changed

+117
-360
lines changed

6 files changed

+117
-360
lines changed

examples/creating-a-driven-control.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@
380380
"name": "python",
381381
"nbconvert_exporter": "python",
382382
"pygments_lexer": "ipython3",
383-
"version": "3.7.3"
383+
"version": "3.6.4"
384384
},
385385
"toc": {
386386
"base_numbering": 1,
@@ -397,5 +397,5 @@
397397
}
398398
},
399399
"nbformat": 4,
400-
"nbformat_minor": 2
400+
"nbformat_minor": 4
401401
}

examples/creating-a-dynamical-decoupling-sequence.ipynb

Lines changed: 23 additions & 20 deletions
Large diffs are not rendered by default.

qctrlopencontrols/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
new_carr_purcell_sequence,
4141
new_cpmg_sequence,
4242
new_periodic_sequence,
43-
new_predefined_dds,
4443
new_quadratic_sequence,
4544
new_ramsey_sequence,
4645
new_spin_echo_sequence,
@@ -60,7 +59,6 @@
6059
"new_corpse_in_scrofulous_control",
6160
"new_corpse_in_sk1_control",
6261
"new_modulated_gaussian_control",
63-
"new_predefined_dds",
6462
"new_predefined_driven_control",
6563
"new_primitive_control",
6664
"new_scrofulous_control",

qctrlopencontrols/constants.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -77,33 +77,3 @@
7777

7878
# Matplotlib format of data for plotting
7979
MATPLOTLIB = "matplotlib"
80-
81-
# Ramsey sequence
82-
RAMSEY = "Ramsey"
83-
84-
# Spin echo (SE) dynamical decoupling sequence
85-
SPIN_ECHO = "spin echo"
86-
87-
# Carr-Purcell (CP) dynamical decoupling sequence
88-
CARR_PURCELL = "Carr-Purcell"
89-
90-
# Carr-Purcell-Meiboom-Gill (CPMG) dynamical decoupling sequence
91-
CARR_PURCELL_MEIBOOM_GILL = "Carr-Purcell-Meiboom-Gill"
92-
93-
# Uhrig (single-axis) dynamical decoupling sequence
94-
UHRIG_SINGLE_AXIS = "Uhrig single-axis"
95-
96-
# Periodical dynamical decoupling sequence
97-
PERIODIC_SINGLE_AXIS = "periodic single-axis"
98-
99-
# Walsh dynamical decoupling sequence
100-
WALSH_SINGLE_AXIS = "Walsh single-axis"
101-
102-
# Quadratic dynamical decoupling sequence
103-
QUADRATIC = "quadratic"
104-
105-
# X-Concatenated dynamical decoupling sequence
106-
X_CONCATENATED = "X concatenated"
107-
108-
# XY-Concatenated dynamical decoupling sequence
109-
XY_CONCATENATED = "XY concatenated"

qctrlopencontrols/dynamic_decoupling_sequences/predefined.py

Lines changed: 0 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,6 @@
2323

2424
import numpy as np
2525

26-
from ..constants import (
27-
CARR_PURCELL,
28-
CARR_PURCELL_MEIBOOM_GILL,
29-
PERIODIC_SINGLE_AXIS,
30-
QUADRATIC,
31-
RAMSEY,
32-
SPIN_ECHO,
33-
UHRIG_SINGLE_AXIS,
34-
WALSH_SINGLE_AXIS,
35-
X_CONCATENATED,
36-
XY_CONCATENATED,
37-
)
3826
from ..exceptions import ArgumentsValueError
3927
from .dynamic_decoupling_sequence import DynamicDecouplingSequence
4028

@@ -160,86 +148,6 @@ def _add_pre_post_rotations(
160148
return offsets, rabi_rotations, azimuthal_angles, detuning_rotations
161149

162150

163-
def new_predefined_dds(scheme=SPIN_ECHO, **kwargs):
164-
"""
165-
Creates a new instance of one of the predefined dynamic decoupling sequences.
166-
167-
Parameters
168-
----------
169-
scheme : string
170-
The name of the sequence. The available options are:
171-
172-
- 'Ramsey'
173-
- 'spin echo'
174-
- 'Carr-Purcell'
175-
- 'Carr-Purcell-Meiboom-Gill'
176-
- 'Uhrig single-axis'
177-
- 'Periodic single-axis'
178-
- 'Walsh single-axis'
179-
- 'quadratic'
180-
- 'X concatenated'
181-
- 'XY concatenated'
182-
183-
Defaults to 'spin echo'.
184-
kwargs : dict, optional
185-
Additional keyword argument to create the sequence.
186-
187-
Returns
188-
------
189-
qctrlopencontrols.dynamic_decoupling_sequences.DynamicDecouplingSequence
190-
A dynamical decoupling sequence corresponding to `scheme`.
191-
192-
Raises
193-
-----
194-
ArgumentsValueError
195-
Raised when an argument is invalid.
196-
"""
197-
198-
if scheme == RAMSEY:
199-
sequence = new_ramsey_sequence(**kwargs)
200-
elif scheme == SPIN_ECHO:
201-
sequence = new_spin_echo_sequence(**kwargs)
202-
elif scheme == CARR_PURCELL:
203-
sequence = new_carr_purcell_sequence(**kwargs)
204-
elif scheme == CARR_PURCELL_MEIBOOM_GILL:
205-
sequence = new_cpmg_sequence(**kwargs)
206-
elif scheme == UHRIG_SINGLE_AXIS:
207-
sequence = new_uhrig_sequence(**kwargs)
208-
elif scheme == PERIODIC_SINGLE_AXIS:
209-
sequence = new_periodic_sequence(**kwargs)
210-
elif scheme == WALSH_SINGLE_AXIS:
211-
sequence = new_walsh_sequence(**kwargs)
212-
elif scheme == QUADRATIC:
213-
sequence = new_quadratic_sequence(**kwargs)
214-
elif scheme == X_CONCATENATED:
215-
sequence = new_x_concatenated_sequence(**kwargs)
216-
elif scheme == XY_CONCATENATED:
217-
sequence = new_xy_concatenated_sequence(**kwargs)
218-
# Raise an error if the input sequence is not known
219-
else:
220-
raise ArgumentsValueError(
221-
"Unknown predefined sequence scheme. Allowed schemes are: "
222-
+ ", ".join(
223-
[
224-
RAMSEY,
225-
SPIN_ECHO,
226-
CARR_PURCELL,
227-
CARR_PURCELL_MEIBOOM_GILL,
228-
UHRIG_SINGLE_AXIS,
229-
PERIODIC_SINGLE_AXIS,
230-
WALSH_SINGLE_AXIS,
231-
QUADRATIC,
232-
X_CONCATENATED,
233-
XY_CONCATENATED,
234-
]
235-
)
236-
+ ".",
237-
{"sequence_name": scheme},
238-
)
239-
240-
return sequence
241-
242-
243151
def _check_duration(duration: Optional[float] = None) -> float:
244152
"""
245153
Validates sequence duration.

0 commit comments

Comments
 (0)