Skip to content

Commit cf9ea93

Browse files
BrFleHGSilveriHaroldErbinRafaelMALimaa-corni
authored
Draw layout and register on the same plot (#772)
* Hotfix: Preserve qubit IDs and order in Register.with_automatic_layout() (#759) * Preserve qubit IDs and order in Register.with_automatic_layout() * Bump version to v1.1.1 * Fail for registers with differentiable coordinates * Bump version to 1.2dev1 * Add pyproject.toml to all packages (#758) * Add pyproject.toml to all packages * Improve the publishing workflow * Fix typo in docstring of draw (#766) * Fix typo in docstring of draw * Fix mypy error * Reverting __repr__ for Channels to default from dataclass, old __repr__ now on __str__ (#770) * Fixes to the amplitude noise implementation (#768) * Include the beam's propagation direction in Channel * Apply amplitude fluctuations from run to run instead of pulse to pulse * Correct emulation of finite-waist effects on amplitude * Fix handling or laser_waist to/from SimConfig * UTs for the noise * Include propagation_dir in the JSON schema * Fix error in conversion between SimConfig and NoiseModel * Add the pulser version to serialized devices * Missing UT for Channel * Adopting review suggestions * Draw the phase curve by default in Sequence.draw() (#771) * Set draw_phase_curve to True by default * Fix phase curve * Always display phase in draw_phase_area * Add method to Sequence to estimate delay introduced before adding pulse (#773) * Add estimate_add_delay * Fix test coverage * Add testing of DMM * Address review comments * Fix test * Deprecate usage of int in QubitIds (#774) * Deprecate usage of int * Fix tutorials * Fix targets * Update warning message * Fix tutorials * Revert "Fix tutorials" This reverts commit a99d615. * Fix tutorial * Fix typing with qubitID=str * Fix tests * Fix typing * Fix tests * Fix built in values for register generation * Fix tests * Address review comments * Converting the Conventions page to markdown (#777) * Setting up Markdown support * Convert Conventions page to markdown * Attempt to use auto-generated labels * Update displayed device specs (#763) * Add all missing specs * Add property specs * Move _specs to BaseDevice In this way, _specs and print_specs can also be called for virtual devices. * Fix syntax for compatibility with older Python * Fix style * Add missing docstring * Fix dosctring style * Improve specs method * Update to fix mypy errors * Fix mypy error * Add tests for BaseDevice.specs property * Fix import order * Various minor improvements One change is to use a string instead of joining elements of a list to get the final string. The reason is that lists were cumbersome to use when there were conditional statements. * Split _specs method in different methods Create one _specs method for each sections (register, layout, device, channels). The layout section is defined only in Device, such that it is not displayed for VirtualDevice. This commit also goes back to using lists for storing the lines. * Remove line * Fix typo in strings * Return list[str] instead of str for specs blocks Also move texts for layout to BaseDevice, since virtual devices can have some layouts properties. --------- Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> * Allow definition of a custom phase jump time + Suppress output modulation for phase (#779) * Adding Channel.custom_phase_jump_time * Restrict phase jump time for EOM mode * Eliminate modulation for phase * Unit tests * Improve docstring * Upgrade pulser-simulation to qutip 5 (#783) * Qutip 4 compatible changes * Qutip 5 breaking changes * Fix test, handling of exception in NoiseModel * Convert all Qobj to CSR * Fix typing * Fix typing * Fix lint * Delete print * Address nit * Convert initial state to CSR --------- Co-authored-by: HGSilveri <henrique.silverio@tecnico.ulisboa.pt> Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> * Add shortcut to find out if an AbstractArray is differentiable (#784) * Define AbstractArray.is_differentiable * Remove warnings.simplefilter that was overriding pytest filterwarnings * Rename is_differentiable -> requires_grad * Bump version to v1.2.0 * Bump version to 1.3dev0 * Fix test broken by scipy 1.15 (#788) * Fix typing of initial state in EmulatorConfig, fix normalization with qutip 5 (#792) * Delete no-normalization output * Normalize initial state * Bump to v1.2.1 * Add tanh function to ParamObj (#798) * added tanh function to paramobj * Update tests/test_parametrized.py Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> * fixed test --------- Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> * Allow switch_device to work when Channel uses BaseEOM (#804) * Allow switch_device to work when Channel uses BaseEOM * Bump to v1.2.2 * Bump to v1.3dev2 * Refactor methods in RemoteConnections and PasqalCloud (#796) * Refactor methods in RemoteConnections and PasqalCloud for new connections * Move validate_job_params back to QPUBackend, make add_measurement_to_sequence private * Fixing bug --------- Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> * Upgrades to AnalogDevice specs (#807) * Add show option to `RegisterLayout.draw()` (#808) * Fix drawing of interpolated waveform on DMM (#809) * Documentation Upgrade (#811) * Setting up Markdown support * Convert Conventions page to markdown * Attempt to use auto-generated labels * Introduce section about hardware * Redirect api core * Add pulse section * Direct to API core instead of pulse * Add some elements about pulser.devices * Create getting started notebook (#776) * Create initial notebook * Add temporary links * Add programming section * Fix installation of mermaid * Fix figure caption * Taking into account review comments * Fix doc * Try mermaid with mkdown * Address review comments * Fix doc * Add picture * Addressing review comments * Add figure, vector on the bloch sphere, complement to the Device * Make introduction * Add programming.md in ref * Add label * delete ref * Fix programming * Create tutorial Excitation to rydberg state * Address review comments * Add AFM state prep * Fix programming.md * Address review * Delete docs, add hbar * Fix picture * Fixing programming * Transfer cell as raw * Fix sequence * 4-hand fixing * Final fixes * Add paragraph along br * Address review comment * Fix referencing * Fix the notebook * Add note about neighbouring atoms * Creating notebook for hardware section, reorganising specs display in Device, adding the presence of EOM in Channel display * Fix typing * Fix build * fix typing * Fix flake8 * Fix reference * Fix ref * Fix figure * Re-reading myself * Fix rendering * Fix rendering * Fix build * Available devices * Address review comments * Add page on Register creation and Rydberg-Atom interactions + Retire old tutorials (#790) * Deleting tutorials * Adding the Register user manual * Adding links * Undo deleting the tutorials for the repo * Retire tutorials instead * Do the same for the tutorials deleted in #776 * Address review comments * Fix notebook reference * Clear all outputs * Adressing review comments * Address review comments * Add section in conventions on indexed operator notation * Small fixes * Improve formula rendering * Shuffle the description of the arguments * Trying new raw cells * Add remove-input tag to last cell * Fix typing * Add no-index * Delete no-members * Dlete no-index * Reintroduce :noindex: * Improve description of device * Try fixing link to * Fix device and channel description, try hidding the input * Try fixing build * Fix tags to hide_input * Change device descr to "Args", stop trying to mask input * Add link to backend * Move Attributes to Args in Device * Add mention to API doc * Apply some Pasqal branding to the HTML documentation * Use Pulser logo :) * Remove obsolete file * Add seealso sections in programming * Deleting the-channels * Tag The-Channels * referencing to html instead * Going for hardware.ipynb * Add page on Pulses and Waveforms (#793) * Add tutorial on Pulses and Waveforms * Address review comments * Reference fundamentals pages in Programming * Remove signatures from autosummary * API Reference Rework (#722) * Improving autodoc typehints generation * Improving the Register API doc * WIP: New API reference for pulser-core * Try to pass RTD build * Adding `pulser-simulation` module to the API ref * Adding pulser_pasqal ref * Import sorting * Fix UTs * Fix links in new pages * Adding the Sequence page (#802) * WIP * Getting links to work at top-level pulser API * Writing Sequence page * Address review comments * Fix typo * Merge remote-tracking branch 'origin' into docs-v2 * Modifications to the TOC tree (#806) * Reorder pages in Extended Usage * Retire tutorial on AFM state preparation * Slight modifications to the Backend page * Move and update the XY Hamiltonian page * Fix broken links * Fix typo Co-authored-by: Antoine Cornillot <61453516+a-corni@users.noreply.github.com> --------- Co-authored-by: Antoine Cornillot <61453516+a-corni@users.noreply.github.com> * Create introduction to Extended Usage (#800) * Add tanh function to ParamObj (#798) * added tanh function to paramobj * Update tests/test_parametrized.py Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> * fixed test --------- Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> * Create extended usage doc * Fix doc * Post-rereading correction * Allow switch_device to work when Channel uses BaseEOM (#804) * Allow switch_device to work when Channel uses BaseEOM * Bump to v1.2.2 * Bump to v1.3dev2 * Addressing the confusion btw Weighted Analog and XY * Add more specific links, descr of digital qc * Address review comments * Testing with : * Try with #- * Fix reference * Fix links to sections * Fix hamiltonian * Fix apidoc ref --------- Co-authored-by: Vytautas Abramavicius <145791635+vytautas-a@users.noreply.github.com> Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> Co-authored-by: HGSilveri <henrique.silverio@tecnico.ulisboa.pt> --------- Co-authored-by: a_corni <antoine.cornillot@pasqal.com> Co-authored-by: Antoine Cornillot <61453516+a-corni@users.noreply.github.com> Co-authored-by: Benjamin Becquet <benjamin.becquet@pasqal.com> Co-authored-by: Benjamin Becquet <benjamin.becquet@gmail.com> Co-authored-by: Vytautas Abramavicius <145791635+vytautas-a@users.noreply.github.com> * Defining the new Backend API classes (#764) * Introducing the Results class * Defining State and Operator ABCs * Defining the Observable ABC * Updates to State and Operator ABCs * Introducing EmulationConfig * Define the default observables * Define the EmulatorBackend ABC * Implement more flexible evaluation time matching * Finish up changes in the config base classes * Include total sequence duration in Results * Import sorting * Fix typing issues * Applying review suggestions * Rename QubitDensity -> Occupation * Change State to require `probabilities()` instead of `sample()` * Docstring updates * Removing 'custom_operators' option * Definition of QutipState * Definition of QutipOp * Remove Results.meas_basis * Revert to having `State.sample()` as the abstractmethod * Incorporating UUIDs in observables * Add Results.get_tagged_results() * Misc adjustments * First UTs for pulser.backend classes * UTs for QutipState and QutipOperator * Unit tests for observables * Unit tests for Results * Make UT compatible with Python 3.9 * Fix docs build * Expose relevant new classes * Check interaction matrix is symmetric * Separate times and result values in Results * Check that evaluation times are unique * Finishing touches * Enforce evaluation times to be in ascending order * Explicitly enforce that results are stored with asceding evaluation times * Implementing review suggestion * Rename SecondMomentOfEnergy -> EnergySecondMoment * Add review suggestion * Add warnings * Change cutoffs * Fix docs * Improve handling of ParamObj in InterpolatedWaveform (#813) * Improve gestion of ParamObj in InterpolatedWaveform * Fix regex * Fix tests * Address review comments * Reverting __new__ signature * Fix black * Bump version to 1.3.0 * Bump version to 1.4dev0 * Add time-ordering operator in programming.md (#817) Time ordering operator missing in the integral definition of the final state * Define Code Owners for pulser-simulation (#816) * Fix drawing of legends for local qubit quantities (#825) * Add global phase shift (#829) * Add _phase_shift implementation without targets * Update docstrings * Add phase shift to test_switch_device * Add support for (de)serialization * Add warning and filter these in tests * Change to pytest.warn where possible * Address comments * Make catch_phase_shift_warning fixture * [DevEx] Replacing ValueError with more specific errors wherever possible (#828) * [DevEx] Replacing ValueError with more specific errors wherever possible - resolves #819 This should make it easier for client libraries to catch error we raise and do something useful with them. * Applying feedback * fix tutorial effectve noise channel with qutip 5 (#830) * fix tutorial effectve noise channel with qutip 5 * Fix linting --------- Co-authored-by: Aurelien Nober <aurelien.nober@pasqal.com> Co-authored-by: a_corni <antoine.cornillot@pasqal.com> * Support State and Operator serialization (#832) * Support State serialization * Add serialization support in Operator * Move repr info out of __init__ * Check imag explicitly * Apply review suggestion * Wrap around _from_state_amplitudes * Wrap around _from_operator_repr * Use overlap to safeguard against in-place modifications of State * Fix sampling weights sum assertion (#823) Because of large weights vector, sometimes the sum (which should be 1 for np.random.multinomial) doesn't pass the assert. Use custom code for sampling instead, with equivalent performance. Co-authored-by: Anton Quelle <anton.quelle@pasqal.com> * Store result from tag and uuid (#836) * store raw * fix tests * Remove pulser-pasqal from repo (#834) * Remove pulser-pasqal from repo * Completing UTs * Allow additional parameters in EmulationConfig (#838) * Support EmulationConfig serialization (#826) * to absract repr on observables * add state operator from string classes * fix flake and black * fix mypy * eigenstates in StateFromString * comments fix * first basic test * refining tests for obs and config serialization * StateRepr class * add comment to config * fix mypy * fix test and mypy * simplify obs repr * remove operator serialization * add schema and optional validation * update config-schema * update config-schema * add OperatorRepe * add not_from_amplitude test * fix schema 1/2 * update config-schema to support complex * new check in validate eigenstates * state repr docstring * add example docstring for StateRepr and OperatorRepr * test suggestion * fix test * update StateRepr and OperatorRepr dump load tests * better test scoping * fix required in schema * config repr test * parametrize config test * additionalproperties false * stateresult not supported * better error AbstractReprError * Numpy v2 support (#837) * Edit requirements to allow for numpy v2 * Add ruff to check for numpy v2 rule * Add copy kwarg to abstract array * Fix test binary ops * Add copy logic on __array__ * Make __array__ a bit nicer * Fix mypy errors * Add ruff to CI * Remove ruff version pinning * Add ruff to dev_requirements * Fix ruff command in CI * Add test for array copy * Add skipif for failing tests in np2 * Update CI to test v1 and v2 of numpy * Add no-cover on numpy v2 code * Try to fix ci * Fix after review * Add numpy matrix to PR actions * Fix gh workflow syntax * Only vary numpy version on 'with-torch' * Fix syntax * try different order * Another attempt to fix ci config * Use exclude instead of include * Check if tests run on all platforms * Check if macos-latest runs on python3.9 again * Reduce testing matrix regarding numpy versions * Revert "Check if tests run on all platforms" This reverts commit b5de95c. * Add (de)serializer to Results (#833) * json encoder and test * formatting * 100% coverage again * code review * added validation * docstring formatting and manifest * more code review comments * line break * move test * Support Python 3.13 (#840) * Support Python 3.13 * Upgrade minimal torch version * Go back to testing always on macos-latest * [TEMP] Run full CI tests * Accomodate numpy version * Revert "[TEMP] Run full CI tests" This reverts commit 5c81cb5. * Remove Windows marker * Enforce numpy 2 on 'numpy-v2' CI tag * [DevEx] Rework (de)serialization exceptions (#835) * [DevEx] Rework (de)serialization exceptions * Applying feedback * [FIX] Fix definition of InterpolatedWaveform with values as Variable (#841) * Fix init of InterpolatedWaveform with Variable values * Fix black * take into account ParamObj * Add EmulationConfig deserializer (#839) * Add EmulationConfig deserializer * update state repr test * _convert_complex respect tuples * test deserializer StateRepr and OperatorRepr * coverage for weird error * update config deserialization test * exeption deprecation * format * test config not from str * test config repr * additional kwargs --------- Co-authored-by: stefano.grava <stefano.grava@pasqal.com> * Release v1.4.0 * Bump to v1.5dev0 * Add QutipBackendV2: using Qutip with new API (#847) Co-authored-by: HGSilveri <henrique.silverio@tecnico.ulisboa.pt> * Replace wheel with build for packaging (#853) * Replace wheel with build for packaging * Fix dist path * Update release instructions (#855) * Update release instructions * Update link to portal * Update instructions * Optimize the size of the doc homepage animation (#860) * Factorize eigenstates and FullOp validation (#859) Don't want to have to do that in e.g. emu-mps * Add constraints on the minimum layout filling fraction (#856) * Add constraints on the minimum layout filling fraction * Fix test * Updating JSON schema * Implement suggestion * Fix typo * Improve docstring --------- Co-authored-by: Pim Venderbosch <pim.venderbosch@pasqal.com> * Allow general callback in EmulationConfig (#862) * FIX: Clarify “No DMM” error message (#864) * fix: clarify “No DMM” error message * fix: adjust test_dmm_declaration in test_sequence to expect full “No DMM called…” error message * Use sequence.device instead of _device, fix black * Fix linting --------- Co-authored-by: igoreduardobraga <igoredubraga@gmail.com> * Update tutorial on QUBO, Pulse Optimization, Create tuto on MWIS (#821) * Update tutorial on QUBO, Create tuto on MWIS * Add mwis tuto to index * Fix reference in QUBO tutorial * Delete Ref in QUBO tuto * Take into account review comments * Delete QAOA, improve QAA for QUBO, MWIS, fix and simplify Optim * Fix links, replace attachments by files * Fix link * Fixing link * Adding links to other notebooks in MWIS and QAA * Adding QAA notebook to doc, QAOA to retired notebooks * Fix cell output * Link to Documentation instead of github * Delete cell content, take into review comments --------- Co-authored-by: Henrique Silvério <29920212+HGSilveri@users.noreply.github.com> Co-authored-by: HGSilveri <henrique.silverio@tecnico.ulisboa.pt> Co-authored-by: Harold Erbin <harold.erbin@gmail.com> Co-authored-by: RafaelMALima <81188798+RafaelMALima@users.noreply.github.com> Co-authored-by: Antoine Cornillot <61453516+a-corni@users.noreply.github.com> Co-authored-by: a_corni <antoine.cornillot@pasqal.com> Co-authored-by: Vytautas Abramavicius <145791635+vytautas-a@users.noreply.github.com> Co-authored-by: Benjamin Becquet <benjamin.becquet@pasqal.com> Co-authored-by: Benjamin Becquet <benjamin.becquet@gmail.com> Co-authored-by: Louis-PaulHenry <79902647+Louis-PaulHenry@users.noreply.github.com> Co-authored-by: Pim Venderbosch <pim.venderbosch@pasqal.com> Co-authored-by: David Teller <D.O.Teller@gmail.com> Co-authored-by: AurelienNober <aurelien.nober@dataiku.com> Co-authored-by: Aurelien Nober <aurelien.nober@pasqal.com> Co-authored-by: Pablo Le Hénaff <pablo.le-henaff@pasqal.com> Co-authored-by: Anton Quelle <anton.quelle@pasqal.com> Co-authored-by: Stefano Grava <stefano0grava@gmail.com> Co-authored-by: David Teller <david.teller@pasqal.com> Co-authored-by: stefano.grava <stefano.grava@pasqal.com> Co-authored-by: igoreduardobraga <igoredubraga@gmail.com>
1 parent f392db6 commit cf9ea93

200 files changed

Lines changed: 14639 additions & 5185 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ show_missing = True
2020
source =
2121
pulser-core/pulser/
2222
pulser-simulation/pulser_simulation/
23-
pulser-pasqal/pulser_pasqal/

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pulser-simulation/ @pasqal-io/emulation-team
2+
tests/pulser_simulation/* @pasqal-io/emulation-team

.github/scripts/package.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ packages=$(cat packages.txt)
1515
for pkg in $packages
1616
do
1717
echo "Packaging $pkg"
18-
python $pkg/setup.py -q bdist_wheel -d "../dist"
18+
python -m build $pkg --wheel -o "dist"
1919
rm -r $pkg/build
2020
done
2121

2222
# Build the pulser metapackage
23-
python setup.py -q bdist_wheel -d "dist"
23+
python -m build --wheel -o "dist"
2424
rm -r build
2525

2626
echo "Built wheels:"

.github/workflows/ci.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ jobs:
3030
extra-packages: black
3131
- name: Check formatting with black
3232
run: black --check --diff .
33+
ruff:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Check out Pulser
37+
uses: actions/checkout@v4
38+
- name: pulser + ruff install
39+
uses: ./.github/workflows/pulser-setup
40+
with:
41+
extra-packages: ruff
42+
- name: Check numpy v2 compatibility with ruff
43+
run: ruff check
3344
isort:
3445
runs-on: ubuntu-latest
3546
steps:
@@ -58,8 +69,19 @@ jobs:
5869
strategy:
5970
fail-fast: false
6071
matrix:
61-
python-version: ["3.9", "3.12"]
72+
python-version: ["3.9", "3.13"]
6273
with-torch: ["with-torch", "no-torch"]
74+
numpy: ["numpy-v1", "numpy-v2"]
75+
include:
76+
- python-version: "3.12"
77+
numpy: "numpy-v1"
78+
with-torch: "with-torch"
79+
exclude:
80+
# Numpy v1 does not support Python 3.13
81+
- python-version: "3.13"
82+
numpy: "numpy-v1"
83+
- numpy: "numpy-v1"
84+
with-torch: "no-torch"
6385
steps:
6486
- name: Check out Pulser
6587
uses: actions/checkout@v4
@@ -69,11 +91,12 @@ jobs:
6991
python-version: ${{ matrix.python-version }}
7092
extra-packages: pytest
7193
with-torch: ${{ matrix.with-torch }}
94+
numpy: ${{ matrix.numpy }}
7295
- name: Run the unit tests & generate coverage report
73-
if: ${{ matrix.with-torch == 'with-torch' }}
96+
if: ${{ matrix.with-torch == 'with-torch' && matrix.numpy == 'numpy-v1'}}
7497
run: pytest --cov --cov-fail-under=100
7598
- name: Run the unit tests without torch installed
76-
if: ${{ matrix.with-torch != 'with-torch' }}
99+
if: ${{ matrix.with-torch != 'with-torch' || matrix.numpy != 'numpy-v1'}}
77100
run: pytest --cov
78101
- name: Test validation with legacy jsonschema
79102
run: |

.github/workflows/publish.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ jobs:
2323
- name: Install Python dependencies
2424
run: |
2525
python -m pip install --upgrade pip
26-
pip install setuptools wheel
26+
pip install -U setuptools build
2727
- name: Build packages
2828
shell: bash
2929
run: ./.github/scripts/package.sh
3030
- name: Publish to TestPyPI
3131
uses: pypa/gh-action-pypi-publish@release/v1
3232
with:
3333
repository-url: https://test.pypi.org/legacy/
34+
skip-existing: true # Allows repeating the action
35+
attestations: false # Otherwise an attestation is added to dist/
3436
- name: Install from TestPyPI
3537
timeout-minutes: 5
3638
shell: bash
@@ -66,7 +68,7 @@ jobs:
6668
fail-fast: false
6769
matrix:
6870
os: [ubuntu-latest, macos-latest, windows-latest]
69-
python-version: ["3.9", "3.10", "3.11", "3.12"]
71+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
7072
steps:
7173
- name: Check out Pulser
7274
uses: actions/checkout@v4

.github/workflows/pulser-setup/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ inputs:
1313
description: Whether to include pytorch
1414
required: false
1515
default: "with-torch"
16+
numpy:
17+
description: Which version of numpy to install
18+
required: false
19+
default: "numpy-v2"
1620
runs:
1721
using: "composite"
1822
steps:
@@ -33,6 +37,16 @@ runs:
3337
run: |
3438
python -m pip install --upgrade pip
3539
make dev-install-no-torch
40+
- name: Install numpy v1
41+
if: ${{ inputs.numpy == 'numpy-v1'}}
42+
shell: bash
43+
run: |
44+
pip install numpy==1.26
45+
- name: Install numpy v2
46+
if: ${{ inputs.numpy == 'numpy-v2'}}
47+
shell: bash
48+
run: |
49+
pip install numpy>=2
3650
- name: Install extra packages from the dev requirements
3751
if: "${{ inputs.extra-packages != '' }}"
3852
shell: bash

.github/workflows/test.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,16 @@ jobs:
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
# Python 3.9 does not run on macos-latest (14)
19-
# Uses macos-13 for 3.9 and macos-latest for >=3.10
20-
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
18+
os: [ubuntu-latest, macos-latest, windows-latest]
19+
numpy: ["numpy-v1", "numpy-v2"]
2120
with-torch: ["with-torch", "no-torch"]
22-
python-version: ["3.9", "3.10", "3.11", "3.12"]
21+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
2322
exclude:
24-
- os: macos-latest
25-
python-version: "3.9"
26-
- os: macos-13
27-
python-version: "3.10"
28-
- os: macos-13
29-
python-version: "3.11"
30-
- os: macos-13
31-
python-version: "3.12"
23+
# Numpy v1 does not support Python 3.13
24+
- python-version: "3.13"
25+
numpy: "numpy-v1"
26+
- numpy: "numpy-v1"
27+
with-torch: "no-torch"
3228
steps:
3329
- name: Check out Pulser
3430
uses: actions/checkout@v4
@@ -37,6 +33,7 @@ jobs:
3733
with:
3834
python-version: ${{ matrix.python-version }}
3935
extra-packages: pytest
36+
numpy: ${{ matrix.numpy }}
4037
with-torch: ${{ matrix.with-torch }}
4138
- name: Run the unit tests & generate coverage report
4239
run: pytest --cov

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ _build
1313
__pycache__/
1414
build/
1515
docs/build/
16+
_autosummary/
1617
dist/
1718
env*
1819
*.egg-info/

.mypy.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
files =
33
pulser-core/pulser,
44
pulser-simulation/pulser_simulation,
5-
pulser-pasqal/pulser_pasqal,
65
tests
76
python_version = 3.11
87
warn_return_any = True

.pre-commit-config.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,17 @@ repos:
55
- id: black-jupyter
66

77
- repo: https://github.com/PyCQA/flake8
8-
rev: 4.0.1
8+
rev: 7.1.1
99
hooks:
1010
- id: flake8
1111

12+
# Ruff only checks numpy v2 compatibility at this moment
13+
- repo: https://github.com/astral-sh/ruff-pre-commit
14+
rev: v0.11.1
15+
hooks:
16+
- id: ruff
17+
args: [ --fix ]
18+
1219
- repo: https://github.com/pycqa/isort
1320
rev: 5.12.0
1421
hooks:

0 commit comments

Comments
 (0)