Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/on-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: qctrl/reusable-workflows/.github/workflows/pytest.yaml@master
secrets: inherit
with:
python-versions: '["3.9", "3.10", "3.11"]'
python-versions: '["3.10", "3.11", "3.12", "3.13"]'

sphinx_documentation:
# Filter out PRs originating from this repository (triggers on-push.yml instead)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11"]
python: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
- name: Install Python dependencies
Expand Down
574 changes: 271 additions & 303 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ classifiers = [
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Visualization",
Expand All @@ -60,7 +61,7 @@ packages = [
]

[tool.poetry.dependencies]
python = ">=3.9,<3.12"
python = ">=3.10,<3.14"
numpy = ">=1.25.2"

[tool.poetry.group.dev.dependencies]
Expand Down
16 changes: 8 additions & 8 deletions qctrlopencontrols/dynamic_decoupling_sequences/predefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def new_ramsey_sequence(
offsets = duration * np.array([0.0, 1.0])
rabi_rotations = np.array([np.pi / 2, np.pi / 2])
azimuthal_angles = np.array([0.0, np.pi])
detuning_rotations = np.zeros((2,))
detuning_rotations = np.array([0, 0])
else:
offsets = np.array([])
rabi_rotations = np.array([])
Expand Down Expand Up @@ -812,27 +812,27 @@ def new_quadratic_sequence(

# remove the last entry corresponding to the duration
offsets = offsets[:-1]
rabi_rotations = rabi_rotations[:-1]
detuning_rotations = detuning_rotations[:-1]
_rabi_rotations = rabi_rotations[:-1]
_detuning_rotations = detuning_rotations[:-1]

azimuthal_angles = np.zeros(offsets.shape)

if pre_post_rotation:
(
offsets,
rabi_rotations,
_rabi_rotations,
azimuthal_angles,
detuning_rotations,
_detuning_rotations,
) = _add_pre_post_rotations(
duration, offsets, rabi_rotations, azimuthal_angles, detuning_rotations
duration, offsets, _rabi_rotations, azimuthal_angles, _detuning_rotations
)

return DynamicDecouplingSequence(
duration=duration,
offsets=offsets,
rabi_rotations=rabi_rotations,
rabi_rotations=_rabi_rotations,
azimuthal_angles=azimuthal_angles,
detuning_rotations=detuning_rotations,
detuning_rotations=_detuning_rotations,
name=name,
)

Expand Down
41 changes: 20 additions & 21 deletions tests/test_predefined_dynamical_decoupling.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,20 +393,15 @@ def test_quadratic_sequence():
_rabi_rotations[0:outer_offset_count, -1] = np.pi
_detuning_rotations[0 : (outer_offset_count + 1), 0:inner_offset_count] = np.pi

_offsets = np.reshape(_offsets, (-1,))
_rabi_rotations = np.reshape(_rabi_rotations, (-1,))
_detuning_rotations = np.reshape(_detuning_rotations, (-1,))
_reshaped_offsets = np.reshape(_offsets, (-1,))[0:-1]
_reshaped_rabi_rotations = np.reshape(_rabi_rotations, (-1,))[0:-1]
_reshaped_detuning_rotations = np.reshape(_detuning_rotations, (-1,))[0:-1]
_azimuthal_angles = np.zeros(_reshaped_offsets.shape)

_offsets = _offsets[0:-1]
_rabi_rotations = _rabi_rotations[0:-1]
_detuning_rotations = _detuning_rotations[0:-1]

_azimuthal_angles = np.zeros(_offsets.shape)

assert np.allclose(_offsets, sequence.offsets)
assert np.allclose(_rabi_rotations, sequence.rabi_rotations)
assert np.allclose(_reshaped_offsets, sequence.offsets)
assert np.allclose(_reshaped_rabi_rotations, sequence.rabi_rotations)
assert np.allclose(_azimuthal_angles, sequence.azimuthal_angles)
assert np.allclose(_detuning_rotations, sequence.detuning_rotations)
assert np.allclose(_reshaped_detuning_rotations, sequence.detuning_rotations)

sequence = new_quadratic_sequence(
duration=duration,
Expand All @@ -415,21 +410,25 @@ def test_quadratic_sequence():
pre_post_rotation=True,
)

_offsets = np.insert(_offsets, [0, _offsets.shape[0]], [0, duration])
_rabi_rotations = np.insert(
_rabi_rotations, [0, _rabi_rotations.shape[0]], [np.pi / 2, np.pi / 2]
_reshaped_offsets = np.insert(
_reshaped_offsets, [0, _reshaped_offsets.shape[0]], [0, duration]
)
_detuning_rotations = np.insert(
_detuning_rotations, [0, _detuning_rotations.shape[0]], [0, 0]
_reshaped_rabi_rotations = np.insert(
_reshaped_rabi_rotations,
[0, _reshaped_rabi_rotations.shape[0]],
[np.pi / 2, np.pi / 2],
)
_reshaped_detuning_rotations = np.insert(
_reshaped_detuning_rotations, [0, _reshaped_detuning_rotations.shape[0]], [0, 0]
)

_azimuthal_angles = np.zeros(_offsets.shape)
_azimuthal_angles = np.zeros(_reshaped_offsets.shape)
_azimuthal_angles[-1] = np.pi

assert np.allclose(_offsets, sequence.offsets)
assert np.allclose(_rabi_rotations, sequence.rabi_rotations)
assert np.allclose(_reshaped_offsets, sequence.offsets)
assert np.allclose(_reshaped_rabi_rotations, sequence.rabi_rotations)
assert np.allclose(_azimuthal_angles, sequence.azimuthal_angles)
assert np.allclose(_detuning_rotations, sequence.detuning_rotations)
assert np.allclose(_reshaped_detuning_rotations, sequence.detuning_rotations)


def test_x_concatenated_sequence():
Expand Down