-
-
Notifications
You must be signed in to change notification settings - Fork 49
♻️ Replace pybind11 with nanobind
#1383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 145 commits
Commits
Show all changes
150 commits
Select commit
Hold shift + click to select a range
823226b
Switch IR bindings to nanobind
denialhaag 38f0fe3
Switch FoMaC bindings to nanobind
denialhaag 1aa9833
Switch NA bindings to nanobind
denialhaag b882d10
Switch DD bindings to nanobind
denialhaag 1babd3e
Add necessary nanobind/stl headers
denialhaag 5b22fad
Fix iterator implementations
denialhaag 78c840c
Remove pybind11 dependency
denialhaag 7fa342c
Merge branch 'main' into nanobind
denialhaag 05e1ee8
Do not lint nanobind/stl includes
denialhaag d7e77b4
Do not lint comparison pairs
denialhaag d034b25
Do not lint NB_MODULE
denialhaag fb71055
Fix inclusion errors
denialhaag 82c6a2d
Hopefully fix linter errors related to pointers
denialhaag 016f250
Target stable ABI
denialhaag 1d5fbae
Enable stub generation
denialhaag d65c4bd
Include memory
denialhaag f33f337
Fix more linter errors
denialhaag ace60c0
Check if not linting NB_MODULE is still necessary
denialhaag e62daf8
Maybe fix conversion errors bur probably not
denialhaag 6fe1ada
Stop NOLINTing NB_MODULE
denialhaag 22023ff
Check if not linting nanobind/stl includes is still necessary
denialhaag 3517614
Revert "Check if not linting nanobind/stl includes is still necessary"
denialhaag 8f31a72
Fix remaining fixable linter errors
denialhaag 99bb3a2
Include nanobind/stl/unique_ptr.h
denialhaag dc85238
Move docstrings from operations.pyi to bindings files
denialhaag 17b16ee
Move docstrings from __init__.pyi to bindings files
denialhaag 0b540bd
Move docstrings from registers.pyi to bindings file
denialhaag 22d17ac
Move docstrings from symbolic.pyi to bindings files
denialhaag 85d7e42
Move docstrings from fomac.pyi to bindings file
denialhaag a76def3
Move docstrings from na/fomac.pyi to bindings file
denialhaag fe9aee1
Move docstrings from dd.pyi to bindings files
denialhaag 16903e0
Remove old stub files
denialhaag 979c066
Fix stub generation
denialhaag 8159443
Use build-time stubs for now
denialhaag a93dd3a
Begin to improve typing
denialhaag 6c968f3
Fix install-time stub generation
denialhaag fe96d74
Fix Site comparison
denialhaag d44c0c3
Add py.typed markers and include privates again
denialhaag cb350b6
Add script for generating stub files
denialhaag ad2e576
Fix Operation comparison
denialhaag 8f6120e
Fix remaining typing issues
denialhaag bfb40ca
Fix linter errors that I know how to fix
denialhaag 28e4262
Improve Permutation bindings
denialhaag 63b77d3
Enable free threading
denialhaag b1e5dea
Improve docstrings
denialhaag 3730bf7
Improve stub-generation script
denialhaag 338bdc4
Fix enum definitions
denialhaag adb2eda
Use nb::hash
denialhaag 78ebb46
Call mcrz and not mcrx
denialhaag 11c3629
Add nb::keep_alive to Permutation.__iter__()
denialhaag 3cd92bd
Check for nullptr in CompoundOperation.__init__()
denialhaag 0c120cd
Improve IfElseOperation bindings
denialhaag 5fcb397
Remove print statement
denialhaag 7f61e6a
Remove dead install() calls
denialhaag 0d3fc39
Fix more docstrings
denialhaag 1a729f4
Further improve stub-generation script
denialhaag 266ec5d
Improve custom Control type
denialhaag 011c986
Simplify Expression constructor
denialhaag 52e02bf
Always mark nb::module_ as const
denialhaag a0ccd14
Fix implementations of __getitem__
denialhaag e5b62f4
Configure stub-generation script to fail on errors
denialhaag f5f2cde
Fix linter errors
denialhaag 0bfd882
Fix __delitem__() implementations
denialhaag 6750774
Fix function name
denialhaag 5119eab
Improve Control helpers
denialhaag 2002e46
Fix linter errors
denialhaag ea6ed14
Verify Operations lists
denialhaag 7d25109
Make qubit and type_ read-only
denialhaag b8b3532
Limit num_qubits in getMatrix()
denialhaag fb9b79f
Make Permutation unhashable
denialhaag 3b0360f
Fix symbolic right divisions
denialhaag b5793f3
Add nb::keep_alive to Device.submit_job()
denialhaag ccc036d
Fix capitalization of Device.Status members
denialhaag 474fce8
Initialize lists using ...
denialhaag 214690f
Fix argument name of Expression.__getitem__()
denialhaag ea40398
Do not export enum values
denialhaag e7aef98
Fix right division
denialhaag dcd3a49
Document MemoryError
denialhaag 58a8f45
Mark arithmetic operations
denialhaag f023049
Validate register attributes
denialhaag d3046a3
Fix usage of std::ranges::sort
denialhaag 0210d3a
Update lock file
denialhaag facc879
Merge branch 'main' into nanobind
denialhaag b6f40b7
Fully remove right division
denialhaag 395a676
Throw an error if control qubit index is negative
denialhaag 903bf81
Fix error messages
denialhaag 39443b3
Fix linter errors
denialhaag 5fb1c5a
Fix docstring
denialhaag cc81d6a
Improve consistency
denialhaag 682c784
Improve size validation
denialhaag 18369f2
Validate keys and values
denialhaag 4080b19
Fix dangling references
denialhaag c9ecdf8
⬆️ upgraded nanobind to version 2.10.2
burgholzer 69a7484
⏪ restore `na/__init__.py`
burgholzer 36d9266
⬆️ upgrade maximum tested CMake version to 4.2
burgholzer 5ed4344
🔧 Explicitly search for the StableABI component if scikit-build-core …
burgholzer 46a7784
🔧Enable Stable ABI builds for CPython 3.12+
burgholzer 6ada5ad
🔧 add ABI3 checks to cibuildwheel repair wheel step
burgholzer 98566c3
🔧 the explicit marker file we already have is fine
burgholzer 2a236d7
Remove CMake stub generation
denialhaag f2cd1ca
Install stub files for better IDE support
denialhaag c0daa5e
Add pattern file and improve stub-generation script
denialhaag 867bb16
Merge branch 'main' into nanobind
denialhaag 2d7fe9f
Update changelog and upgrade guide
denialhaag cb0ac44
Merge branch 'main' into nanobind
denialhaag d4da0ab
Fix installation locations
denialhaag 1270a05
Add quotes to stub-generation script
denialhaag 4d940c7
Test new workflows version
denialhaag b43988b
Dummy change to test if check-stubs works
denialhaag 7e10e9e
Fix comment
denialhaag 0206fd4
Further improve stub-generation script
denialhaag dd1f962
Add bindings-specific clang-tidy config
denialhaag 571acd5
Move up license-tools hook
denialhaag 0f780b0
Further improve stub-generation script
denialhaag ac2ec20
Improvements to make the rabbit happy
denialhaag 08e10a0
Specify rv_policy in FoMaC bindings
denialhaag 63e42c0
Fix upgrade guide
denialhaag 57d39af
Revert "Dummy change to test if check-stubs works"
denialhaag f248f2b
Update to new workflows version
denialhaag 350cad3
Set up MLIR for the C++ linter
denialhaag 8768a1a
🐛 fix empty link libs for QIR Runner target
burgholzer bab4c56
🚚 create dedicated `mqt.core.na` submodule to closely follow the stru…
burgholzer 65cc21a
⬆️ upgrade `ty` dependency to version 0.0.5
burgholzer f094707
♻️ replace `generate-stubs` script with new `nox` session
burgholzer 96940e1
Merge branch 'main' into nanobind
burgholzer cf279dd
⬆️ upgrade reusable workflows to version v1.17.6
burgholzer fca6ec2
🚨 fix clang-tidy warning
burgholzer 24f40d2
♻️ refine stubs session
burgholzer 026ceaf
👌 address code rabbit comments
burgholzer 493e505
🚨 one less ruff rule exclusion for stubs
burgholzer 5e3c0c3
🚨 one less ruff rule exclusion for stubs
burgholzer 10b3a94
🚨 disable `*-prefer-static-over-anonymous-namespace` rule
burgholzer acb3225
🚨 fix compiler warnings
burgholzer c9e22b5
🚨 fix compiler warnings
burgholzer 74dfb25
♻️ simplify function calls and enforce matrix shape annotations in DD…
burgholzer bb1cff8
♻️ enforce keyword-only arguments in session and library functions
burgholzer e0fa893
🚨 ignore `*-pro-bounds-avoid-unchecked-container-access` in bindings
burgholzer 1a38576
♻️ simplify permutation bindings
burgholzer a961cda
🚨 fix some linter warnings
burgholzer d4b5715
🐛 fix wrong method being bound for `p` gate
burgholzer 4a48766
✏️ streamline docstring
burgholzer 91608d4
🏷️ include `PathLike[str]` in `qasm2` and `qasm3` methods
burgholzer 5ff3329
🏷️ solve `Control | int` type hint without performance hit
burgholzer 5efd34c
👌 address CodeRabbit comments and linter warnings
burgholzer cf79be3
👥 add to changelog entry for nanobind migration
burgholzer 31c8445
👌 address further CodeRabbit comments
burgholzer 0e7be5d
♻️ refactor control type handling in bindings for improved simplicity…
burgholzer 07206d3
👌 next batch of CodeRabbit comments
burgholzer 861b730
Merge branch 'main' into nanobind
burgholzer 5f7c1f4
🚨 fix clang-tidy warnings
burgholzer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ | |
| ".*\\.tex", | ||
| "uv\\.lock", | ||
| "py\\.typed", | ||
| ".*build.*" | ||
| ".*build.*", | ||
| "core_patterns.txt" | ||
| ] | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| InheritParentConfig: true | ||
| Checks: | | ||
| -*-avoid-c-arrays, | ||
| -cppcoreguidelines-owning-memory, | ||
| -misc-redundant-expression, | ||
| -*-pro-bounds-avoid-unchecked-container-access |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| _hashable_values_: | ||
|
|
||
| _unhashable_values_map_: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.