Skip to content
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

Release 0.3.0 #443

Merged
merged 1,001 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1001 commits
Select commit Hold shift + click to select a range
bba8932
Fix ruff format error.
elenbaasc Nov 1, 2024
0a95711
Update libqasm version to 0.6.8.
rturrado Nov 6, 2024
b1a7802
Run:
rturrado Nov 6, 2024
4dc4bc5
Run poetry run mypy opensquirrel test --strict.
rturrado Nov 6, 2024
7b8fece
Update CONTRIBUTING.md.
rturrado Nov 6, 2024
7b18e6e
Add tests and reformulate logic
Nov 6, 2024
d8be3a2
Formatting
Nov 6, 2024
2ee0b9f
Move compilation passes to passes folder
Nov 7, 2024
d087d85
Formatting
Nov 7, 2024
ec62dd2
Merge pull request #369 from QuTech-Delft/CQT-115-pep8-naming
GuyPuts Nov 7, 2024
3d3ba5f
Apply ambitious do-over
Nov 7, 2024
a784c84
Fix merge conflicts
Nov 7, 2024
c134201
Merge branch 'develop' into CQT-250-implement-the-barrier-directive
juanboschero Nov 7, 2024
49fcf63
Apply ambitious do-over
Nov 7, 2024
39627a0
Merge branch 'CQT-250-implement-the-barrier-directive' of https://git…
Nov 7, 2024
db14c43
Happify ruff
Nov 7, 2024
62c395f
Apply review
Nov 7, 2024
c79b3c1
Ungatify barrier
Nov 7, 2024
6d46c43
Move tests, remove optimise call
Nov 8, 2024
4594653
Update opensquirrel/merger/general_merger.py
juanboschero Nov 8, 2024
31814d5
Modify merge statement
Nov 8, 2024
105ddc3
Apply suggestions from code review.
rturrado Nov 8, 2024
bb2f3d5
Address comments from code review.
rturrado Nov 8, 2024
6bd333f
Merge remote-tracking branch 'origin/CQT-252-Integrate-libQASM-0.6.8-…
rturrado Nov 8, 2024
af3c328
Remove unnecessary line.
rturrado Nov 8, 2024
2c72188
Fix default_gate_modifiers.py.
rturrado Nov 8, 2024
7d9f333
Merge branch 'refs/heads/develop' into CQT-252-Integrate-libQASM-0.6.…
rturrado Nov 8, 2024
b6dd271
Fix issues when updating to latest develop.
rturrado Nov 8, 2024
701cf0a
Apply suggestions from code review
juanboschero Nov 8, 2024
7961238
Fix reviews
Nov 8, 2024
0bcf8aa
Merge pull request #371 from QuTech-Delft/CQT-252-Integrate-libQASM-0…
elenbaasc Nov 8, 2024
37ee993
Revert (most of the) changes from [CQT-115] PEP8 naming.
rturrado Nov 8, 2024
9120939
Revert renaming of A, B, and C as gate_a, gate_b, and gate_c.
rturrado Nov 8, 2024
7b0193a
Revert type:ignore[override].
rturrado Nov 8, 2024
7d0ec80
Merge pull request #373 from QuTech-Delft/fix-PEP-8
rturrado Nov 8, 2024
fadf070
Create CNOT2CZDecomposer.
elenbaasc Nov 11, 2024
ebb5c41
Bump mkdocstrings from 0.26.2 to 0.27.0
dependabot[bot] Nov 11, 2024
8eef1d6
Sticky gate updates
Nov 13, 2024
8e02816
Sticky gate updates
Nov 13, 2024
3aa2b28
Merge branch 'develop' into CQT-250-implement-the-barrier-directive
juanboschero Nov 13, 2024
9f2b192
Reimplement rearrange_barriers.
rturrado Nov 13, 2024
6c4bd5e
Merge branch 'refs/heads/CQT-250-implement-the-barrier-directive' int…
rturrado Nov 13, 2024
379b69f
Fix merge_single_qubit_gates to work with barriers.
rturrado Nov 13, 2024
d6c5004
Remove flatten_irregular_list.
rturrado Nov 13, 2024
a0ce5dc
Allow asserts everywhere in the code.
rturrado Nov 13, 2024
903aab0
Run linters.
rturrado Nov 13, 2024
4af6a48
Remove rearrange_barriers call from within merge_single_qubit_gates.
rturrado Nov 13, 2024
9ff9d89
Modify flatten_irregular_list
Nov 13, 2024
2521ee2
Fix flatten_irregular_list
Nov 13, 2024
b7d32c7
Update check in group_linked_barriers.
rturrado Nov 13, 2024
ecae3a3
Merge remote-tracking branch 'origin/CQT-250-implement-the-barrier-di…
Nov 14, 2024
f75a62a
Merged + more tests
Nov 14, 2024
fa8047c
Remake test
Nov 14, 2024
89c7c8b
fix conflicts
Nov 14, 2024
a56bd14
Using substantives
Nov 14, 2024
2240b17
WIP:
rturrado Nov 14, 2024
a96f16b
CQT-250 add barrier directives (#370)
juanboschero Nov 15, 2024
2fd163d
Bump mypy from 1.12.0 to 1.13.0
dependabot[bot] Nov 15, 2024
00626bd
WIP:
rturrado Nov 15, 2024
fe3dddc
Merge branch 'develop' of https://github.com/QuTech-Delft/OpenSquirre…
Nov 15, 2024
a82ab9f
Formatting
Nov 15, 2024
e99439e
Bump coverage from 7.6.3 to 7.6.7
dependabot[bot] Nov 15, 2024
3850ffe
WIP:
rturrado Nov 15, 2024
e31aaab
WIP:
rturrado Nov 15, 2024
7bc4220
WIP:
rturrado Nov 15, 2024
e0dfb84
WIP:
rturrado Nov 15, 2024
59e44d5
Merge branch 'refs/heads/develop' into CQT-267-One-library-to-include…
rturrado Nov 15, 2024
dee592f
Delete default_directives.py.
rturrado Nov 15, 2024
b710943
IR:
rturrado Nov 18, 2024
4ec1e9c
Merge pull request #377 from QuTech-Delft/CQT-267-One-library-to-incl…
rturrado Nov 18, 2024
b23f1e8
Remove Comment from IR.
rturrado Nov 18, 2024
15e081c
Merge pull request #378 from QuTech-Delft/CQT-268-Remove-comments-fro…
rturrado Nov 19, 2024
8e3c38b
Change imports
Nov 19, 2024
0be441b
merge conflicts
Nov 19, 2024
17e9c19
Merge pull request #372 from QuTech-Delft/CQT-151-Disentangle-interna…
GuyPuts Nov 19, 2024
6f138be
Merge pull request #376 from QuTech-Delft/dependabot/pip/coverage-7.6.7
elenbaasc Nov 19, 2024
09ed328
Merge pull request #374 from QuTech-Delft/dependabot/pip/mkdocstrings…
elenbaasc Nov 19, 2024
b874119
Merge pull request #366 from QuTech-Delft/dependabot/pip/mypy-1.13.0
elenbaasc Nov 19, 2024
1274e5d
Reimplement InstructionLibrary as a singleton:
rturrado Nov 19, 2024
e6cba26
Fix minor typo.
rturrado Nov 19, 2024
adc24b1
Bump tox from 4.21.2 to 4.23.2
dependabot[bot] Nov 19, 2024
740a6fa
Bump pytest-cov from 5.0.0 to 6.0.0
dependabot[bot] Nov 19, 2024
163e259
Change InstructionLibrary.__call__ to get_instance.
rturrado Nov 19, 2024
fab5ff1
pyproject.toml: update libqasm to version 0.6.9.
rturrado Nov 20, 2024
4ae3c8c
Revert "Change InstructionLibrary.__call__ to get_instance."
rturrado Nov 20, 2024
3798b0c
Make Parser.{_get_gate_f,_get_non_unitary_f} static methods.
rturrado Nov 20, 2024
3af0d4c
Merge pull request #382 from QuTech-Delft/dependabot/pip/pytest-cov-6…
elenbaasc Nov 20, 2024
0b53e2d
Merge pull request #381 from QuTech-Delft/dependabot/pip/tox-4.23.2
elenbaasc Nov 20, 2024
ddd2043
Merge branch 'refs/heads/develop' into CQT-272-Integrate-libQASM-0.6.…
rturrado Nov 20, 2024
601ad19
Update poetry.lock.
rturrado Nov 20, 2024
68fdc48
Merge pull request #384 from QuTech-Delft/CQT-272-Integrate-libQASM-0…
rturrado Nov 20, 2024
2a5b087
Bump mkdocs-material from 9.5.40 to 9.5.45
dependabot[bot] Nov 20, 2024
3b1472b
Bump pymdown-extensions from 10.11.2 to 10.12
dependabot[bot] Nov 20, 2024
f434d5b
Address comments from code review.
rturrado Nov 20, 2024
d7f1135
Implement InstructionLibrary singleton as a module.
rturrado Nov 20, 2024
f5c0c7c
Merge branch 'refs/heads/develop' into CQT-146-Redesign-structure-of-…
rturrado Nov 21, 2024
4a4e21d
Merge pull request #386 from QuTech-Delft/dependabot/pip/pymdown-exte…
elenbaasc Nov 21, 2024
33af510
Merge pull request #385 from QuTech-Delft/dependabot/pip/mkdocs-mater…
elenbaasc Nov 21, 2024
a1c7a65
Merge pull request #380 from QuTech-Delft/CQT-146-Redesign-structure-…
rturrado Nov 21, 2024
3f06d74
Create Merger and SingleQubitGatesMerger classes, move merge function…
Nov 21, 2024
9f57a6d
Fix `mypy --strict` error.
rturrado Nov 22, 2024
76c920c
Merge branch 'refs/heads/develop' into CQT-129-use-supports-float-class
rturrado Nov 22, 2024
cae0389
Merge 'develop' changes into current branch.
rturrado Nov 22, 2024
2820255
Add Float and Int back to ANNOTATIONS_TO_TYPE_MAP.
rturrado Nov 22, 2024
4facc94
Add BitLike.
rturrado Nov 23, 2024
ae9ad06
Update exporter's visit_int and visit_float to look like writer's.
rturrado Nov 25, 2024
3384739
Pass linters.
rturrado Nov 25, 2024
cbb401d
Merge pull request #361 from QuTech-Delft/CQT-129-use-supports-float-…
rturrado Nov 25, 2024
d1b9333
Bump mkdocs-material from 9.5.45 to 9.5.46
dependabot[bot] Nov 25, 2024
955ca41
Bump coverage from 7.6.7 to 7.6.8
dependabot[bot] Nov 25, 2024
220925c
Intermediate commit
Nov 28, 2024
e74047b
Create Merger and SingleQubitGatesMerger classes
Nov 28, 2024
6d2cebf
Resolve conflicts
Nov 28, 2024
000dec0
Merge pull request #390 from QuTech-Delft/dependabot/pip/coverage-7.6.8
elenbaasc Nov 28, 2024
7769689
Merge pull request #389 from QuTech-Delft/dependabot/pip/mkdocs-mater…
elenbaasc Nov 28, 2024
8436260
[CQT-265] McKay decomposer issue with specific gate (#379)
juanboschero Nov 28, 2024
923fd0f
Update opensquirrel/circuit.py
GuyPuts Nov 29, 2024
ded9590
Update test/docs/test_tutorial.py
GuyPuts Nov 29, 2024
a1c2d1e
Update opensquirrel/passes/merger/general_merger.py
GuyPuts Nov 29, 2024
0bc3c92
Update test/merger/test_general_merger.py
GuyPuts Nov 29, 2024
b3cad8b
Update test/test_registers.py
GuyPuts Nov 29, 2024
cbc7853
Update test/test_registers.py
GuyPuts Nov 29, 2024
84dab93
Update test/test_registers.py
GuyPuts Nov 29, 2024
8f34099
Update test/test_measure.py
GuyPuts Nov 29, 2024
a39acbf
Update test/test_measure.py
GuyPuts Nov 29, 2024
bbaaa59
Update test/test_integration.py
GuyPuts Nov 29, 2024
125c3fb
Update test/test_integration.py
GuyPuts Nov 29, 2024
b656aa0
Update test/test_integration.py
GuyPuts Nov 29, 2024
d297b0b
Update test/test_integration.py
GuyPuts Nov 29, 2024
004121c
Update test/test_measure.py
GuyPuts Nov 29, 2024
0fe390a
Update test/test_measure.py
GuyPuts Nov 29, 2024
db36266
Update test/test_measure.py
GuyPuts Nov 29, 2024
5b31995
Make uses of Merger static
Nov 29, 2024
1c4699c
Apply suggestions from code review
GuyPuts Nov 29, 2024
ca53e2d
Remove duplicated tests
Nov 29, 2024
4477e2b
[CQT-254] Add instructions and directives to OpenSquirrel (#388)
elenbaasc Nov 29, 2024
d84c52b
Merge develop into branch
elenbaasc Nov 29, 2024
c9cc627
Add tests for the CNOT2CZ decomposer.
elenbaasc Nov 29, 2024
188f957
Fix integration tests.
elenbaasc Dec 2, 2024
fce95e7
Remove default_gates.py.
elenbaasc Dec 2, 2024
3e8f97b
Solve merge conflicts
Dec 2, 2024
44c81d2
Update opensquirrel/passes/merger/single_qubit_gates_merger.py
GuyPuts Dec 2, 2024
8d15e58
Update test/merger/test_single_qubit_gates_merger.py
GuyPuts Dec 2, 2024
8d6b6e1
Update test/test_integration.py
GuyPuts Dec 2, 2024
717c529
Update opensquirrel/circuit.py
GuyPuts Dec 2, 2024
5634c90
Add SWAP2CNOT decomposer.
elenbaasc Dec 2, 2024
fdf29db
Formatting
Dec 2, 2024
00f9685
Add tests
elenbaasc Dec 2, 2024
21a0027
Update opensquirrel/passes/decomposer/cnot2cz_decomposer.py
elenbaasc Dec 2, 2024
55ae5c1
Update opensquirrel/passes/decomposer/cnot2cz_decomposer.py
elenbaasc Dec 2, 2024
a101bd3
Update opensquirrel/passes/decomposer/cnot2cz_decomposer.py
elenbaasc Dec 2, 2024
8b09b6a
Update opensquirrel/passes/decomposer/cnot2cz_decomposer.py
elenbaasc Dec 2, 2024
a83b724
Update test/merger/test_single_qubit_gates_merger.py
GuyPuts Dec 2, 2024
a69693c
Bump pytest from 8.3.3 to 8.3.4
dependabot[bot] Dec 2, 2024
9ea6d58
Bump mkdocs-material from 9.5.46 to 9.5.47
dependabot[bot] Dec 2, 2024
3e3f232
Merge pull request #398 from QuTech-Delft/dependabot/pip/mkdocs-mater…
elenbaasc Dec 3, 2024
0dcc122
Merge pull request #397 from QuTech-Delft/dependabot/pip/pytest-8.3.4
elenbaasc Dec 3, 2024
c81fe95
change tests
Dec 3, 2024
0370817
Update test/merger/test_single_qubit_gates_merger.py
GuyPuts Dec 3, 2024
05b31bf
Update test/merger/test_single_qubit_gates_merger.py
GuyPuts Dec 3, 2024
1596176
Update test/merger/test_single_qubit_gates_merger.py
rturrado Dec 3, 2024
df87762
Update test/merger/test_single_qubit_gates_merger.py
rturrado Dec 3, 2024
057dfbc
Merge pull request #387 from QuTech-Delft/CQT-258-Integrate-merge-sin…
GuyPuts Dec 3, 2024
a636069
Add documentation on the CNOT to CZ decomposer.
elenbaasc Dec 3, 2024
438d3bc
Update branch.
elenbaasc Dec 3, 2024
0b3f9b2
Fix sentence in docs.
elenbaasc Dec 3, 2024
b5d5c0e
Merge develop into feature branch.
elenbaasc Dec 3, 2024
840ff63
Merge develop into feature branch.
elenbaasc Dec 3, 2024
253e549
Add documentation.
elenbaasc Dec 3, 2024
acc4165
[WIP] Resolve PR comments.
elenbaasc Dec 4, 2024
e35d1eb
Resolve review comments.
elenbaasc Dec 4, 2024
71d6c5b
Resolve review comments.
elenbaasc Dec 4, 2024
cb5c073
Initial commit, change __init__ files
Dec 5, 2024
8131a99
Merge pull request #396 from QuTech-Delft/CQT-230-Create-SWAP2CNOT-de…
elenbaasc Dec 5, 2024
6398151
Merge branch 'develop' into CQT-237-Create-CNOT2CZ-replacer
elenbaasc Dec 5, 2024
ce772f2
Import formatting
Dec 6, 2024
bfa7c07
Formatting
Dec 6, 2024
fd5c2f5
Remove import
Dec 6, 2024
d7b9090
Fix check for needing to swap theta 1 and theta 3.
rturrado Dec 6, 2024
89472b8
Pass linters.
rturrado Dec 6, 2024
6fee985
Use RUF022 to sort __all__ in __init__.py files.
rturrado Dec 6, 2024
2b582e7
Merge pull request #401 from QuTech-Delft/CQT-269-fix-sorting-of-init…
GuyPuts Dec 6, 2024
3374906
Remove RUF028 from the ignore list.
rturrado Dec 6, 2024
171a699
Merge pull request #402 from QuTech-Delft/CQT-269-remove-one-ruff-ignore
GuyPuts Dec 6, 2024
2268862
Fix Windows tests.
rturrado Dec 6, 2024
bceece8
Merge pull request #400 from QuTech-Delft/CQT-288-Bug-in-ZXZ-Decomposer
rturrado Dec 6, 2024
da4f928
Merge pull request #399 from QuTech-Delft/CQT-269-Revise-__init__.py-…
GuyPuts Dec 6, 2024
ed3f5b3
Merge develop into feature branch.
elenbaasc Dec 6, 2024
2429c6f
Update output spin backend integration test.
elenbaasc Dec 6, 2024
e01511f
Merge pull request #395 from QuTech-Delft/CQT-237-Create-CNOT2CZ-repl…
elenbaasc Dec 6, 2024
99b7c45
Bump coverage from 7.6.8 to 7.6.9
dependabot[bot] Dec 6, 2024
9489e04
Merge pull request #403 from QuTech-Delft/dependabot/pip/coverage-7.6.9
elenbaasc Dec 9, 2024
c43e71a
Bump mkdocs-material from 9.5.47 to 9.5.48
dependabot[bot] Dec 9, 2024
75cf244
Merge pull request #404 from QuTech-Delft/dependabot/pip/mkdocs-mater…
elenbaasc Dec 10, 2024
2c8cd20
Fix: default scheme for light mode
Dec 10, 2024
1e845a4
Add mkdocs-base.yaml
Dec 11, 2024
173a5fd
Empty mkdocs-base.yaml contents
Dec 11, 2024
efb20b6
delete mkdocs-base
Dec 11, 2024
16bf30d
Add has_valid_value() to Axis, update __init__, add tests
Dec 11, 2024
9b18e12
Formatting
Dec 11, 2024
be13026
Merge pull request #405 from QuTech-Delft/CQT-185-Minor-tweaks-to-doc…
GuyPuts Dec 12, 2024
883e7ea
Add single-qubit Clifford gates test.
elenbaasc Dec 13, 2024
fc63995
Fix Mckay
Dec 16, 2024
3a98e1f
[CQT-278] Fix `compose_bloch_sphere_rotations` (#394)
rturrado Dec 16, 2024
5f73810
Bump mkdocs-material from 9.5.48 to 9.5.49
dependabot[bot] Dec 16, 2024
069db83
Merge pull request #410 from QuTech-Delft/dependabot/pip/mkdocs-mater…
elenbaasc Dec 17, 2024
a5112ff
Bump pymdown-extensions from 10.12 to 10.13
dependabot[bot] Dec 23, 2024
f3f9120
Bump coverage from 7.6.9 to 7.6.10
dependabot[bot] Dec 27, 2024
c96ca0f
Bump mypy from 1.13.0 to 1.14.1
dependabot[bot] Dec 30, 2024
571c949
Bump abatilo/actions-poetry from 3 to 4
dependabot[bot] Jan 2, 2025
637be6e
Merge pull request #417 from QuTech-Delft/dependabot/github_actions/a…
elenbaasc Jan 6, 2025
00c53b3
Merge pull request #416 from QuTech-Delft/dependabot/pip/mypy-1.14.1
elenbaasc Jan 6, 2025
34fc57e
Merge pull request #415 from QuTech-Delft/dependabot/pip/coverage-7.6.10
elenbaasc Jan 6, 2025
8c43855
Merge pull request #414 from QuTech-Delft/dependabot/pip/pymdown-exte…
elenbaasc Jan 6, 2025
3d4adc9
Bump pymdown-extensions from 10.13 to 10.14
dependabot[bot] Jan 7, 2025
ac65d23
Merge pull request #418 from QuTech-Delft/dependabot/pip/pymdown-exte…
elenbaasc Jan 8, 2025
f068875
Merge develop into CQT-294
elenbaasc Jan 8, 2025
6af057e
Remove comment from tests
elenbaasc Jan 8, 2025
9008717
Merge pull request #409 from QuTech-Delft/CQT-294-Fix-McKay-decompose…
elenbaasc Jan 8, 2025
b56c810
Restructure Axis and Axis testing
Jan 8, 2025
e1f6a20
Merge branch 'develop' of https://github.com/QuTech-Delft/OpenSquirre…
Jan 8, 2025
4dd8f1c
Bump ruff from 0.5.7 to 0.6.8 (#340)
dependabot[bot] Jan 9, 2025
96623a2
Bump ipython from 7.34.0 to 8.18.1 (#306)
dependabot[bot] Jan 9, 2025
faf04e9
Revert actions-poetry to v3 in action yamls. (#421)
elenbaasc Jan 11, 2025
f341ed7
Bump abatilo/actions-poetry from 3 to 4 (#423)
dependabot[bot] Jan 14, 2025
0792006
Adapt code structure and testing
Jan 14, 2025
70e0762
Merge branch 'develop' of https://github.com/QuTech-Delft/OpenSquirre…
Jan 14, 2025
a17be09
Remove item(0
Jan 15, 2025
231268c
[CQT-266] Routing checker pass (#411)
rares1609 Jan 15, 2025
17e4c5f
type checking
Jan 15, 2025
4a98e09
Merge pull request #406 from QuTech-Delft/CQT-289-Avoid-creating-an-A…
GuyPuts Jan 16, 2025
d1642be
change anonymous gate check
Jan 16, 2025
e2a5d38
Add is_named_gate()
Jan 16, 2025
961f903
[CQT-259] Integrate wait and barrier directives in cQASMv1 exporter (…
elenbaasc Jan 21, 2025
35a4ca9
Bump mkdocs-material from 9.5.49 to 9.5.50 (#429)
dependabot[bot] Jan 21, 2025
ae7a712
Mae minor adjustements to fit with compiler config. (#430)
elenbaasc Jan 21, 2025
089a5a3
[CQT-297] Check that composing bloch sphere rotations is done correct…
elenbaasc Jan 22, 2025
1f959cc
Bump abatilo/actions-poetry from 3 to 4 (#435)
dependabot[bot] Jan 22, 2025
0538ca0
Update changelog and version number in pyproject.toml. (#434)
elenbaasc Jan 22, 2025
18ea6ce
Bump tox from 4.23.2 to 4.24.1 (#437)
dependabot[bot] Jan 22, 2025
9f9bb90
Bump pymdown-extensions from 10.14 to 10.14.1 (#436)
dependabot[bot] Jan 22, 2025
4744255
Make is_named_gate public
Jan 24, 2025
b4efce8
Remove cast to bool
Jan 27, 2025
09ba895
Merge pull request #426 from QuTech-Delft/CQT-277-Improve-is-anonymou…
GuyPuts Jan 27, 2025
9d60f2c
[CQT-309] Create native gate checker (#427)
rares1609 Jan 27, 2025
583ab74
Bump ruff from 0.6.9 to 0.9.3 (#438)
dependabot[bot] Jan 27, 2025
1a53181
Relax NumPy version requirement to >=1.26. (#441)
elenbaasc Jan 30, 2025
20e15c9
Bump pymdown-extensions from 10.14.1 to 10.14.2 (#442)
dependabot[bot] Jan 30, 2025
e2c85a6
Update version number and Changelog.
elenbaasc Jan 30, 2025
c0f986d
Merge main into test.
elenbaasc Jan 30, 2025
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/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
python-version: "3.11"
- name: Install poetry
uses: abatilo/actions-poetry@v3
uses: abatilo/actions-poetry@v4
with:
poetry-version: "1.8.3"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
python-version: "3.11"
- name: Install poetry
uses: abatilo/actions-poetry@v3
uses: abatilo/actions-poetry@v4
with:
poetry-version: "1.3.2"
- name: Install tox
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v3
uses: abatilo/actions-poetry@v4
with:
poetry-version: "1.3.2"
- name: Install tox
Expand Down
42 changes: 40 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,45 @@ This project adheres to [Semantic Versioning](http://semver.org/).
* **Removed** for now removed features.


## [ 0.2.0 ] - [ xxxx-yy-zz ]
## [ 0.3.0 ] - [ 2025-01-30 ]

### Added
- Restore SGMQ notation for barrier groups in cQASMv1 Exporter.

- `NativeGateValidator` validator pass

### Changed

- Relaxed NumPy version requirement to `>=1.26` for all supported Python versions

### Fixed

- Fixed order of merging Bloch sphere rotations


## [ 0.2.0 ] - [ 2025-01-21 ]

### Added

- `init` non-unitary instruction
- `SWAP` two-qubit unitary instruction
- `barrier` and `wait` control instructions
- `SingleQubitGatesMerger` merger pass
- `SWAP2CNOTDecomposer` decomposer pass
- `CNOT2CZDecomposer` decomposer pass
- `RoutingChecker` routing pass
- Restore SGMQ notation for barrier groups in cQASMv1 Exporter

### Changed

- Importing modules, classes, and functionalities simplified
- `merge_single_qubit_gates` method of `Circuit` class,
changed to general `merge` method that accepts custom merger passes
- libQASM 0.6.9 integrated (updated from 0.6.7)
- Refactor: code base adheres to the PEP8 style guide
- Refactor: instruction library simplified
- Refactor: comment nodes removed from IR

### Fixed

- Bug in ABA-decomposer
- Bug in McKay-decomposer (all single-qubit Clifford gates are verified)
11 changes: 8 additions & 3 deletions opensquirrel/circuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
from opensquirrel.ir import IR, Gate
from opensquirrel.passes.decomposer import Decomposer
from opensquirrel.passes.mapper import Mapper
from opensquirrel.passes.merger.general_merger import Merger
from opensquirrel.passes.router.general_router import Router
from opensquirrel.passes.merger import Merger
from opensquirrel.passes.router import Router
from opensquirrel.passes.validator import Validator
from opensquirrel.register_manager import RegisterManager


Expand Down Expand Up @@ -87,8 +88,12 @@ def qubit_register_name(self) -> str:
def bit_register_name(self) -> str:
return self.register_manager.get_bit_register_name()

def validate(self, validator: Validator) -> None:
"""Generic validator pass. It applies the given validator to the circuit."""
validator.validate(self.ir)

def route(self, router: Router) -> None:
"""Generic router pass. It applies the given Router to the circuit."""
"""Generic router pass. It applies the given router to the circuit."""
router.route(self.ir)

def merge(self, merger: Merger) -> None:
Expand Down
14 changes: 9 additions & 5 deletions opensquirrel/ir.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def __init__(self, *axis: AxisLike) -> None:

axis: An ``AxisLike`` to create the axis from.
"""
axis_to_parse = axis[0] if len(axis) == 1 else cast(AxisLike, axis)
axis_to_parse = axis[0] if len(axis) == 1 else cast("AxisLike", axis)
self._value = self.normalize(self.parse(axis_to_parse))

@property
Expand Down Expand Up @@ -281,7 +281,7 @@ def __getitem__(self, s: slice, /) -> list[np.float64]: ...

def __getitem__(self, index: int | slice, /) -> np.float64 | list[np.float64]:
"""Get the item at `index`."""
return cast(np.float64, self.value[index])
return cast("np.float64", self.value[index])

def __len__(self) -> int:
"""Length of the axis, which is always 3."""
Expand Down Expand Up @@ -519,9 +519,13 @@ def name(self) -> str:
return self.generator.__name__
return "Anonymous gate: " + self.__repr__()

@property
def is_named_gate(self) -> bool:
return not (self.generator is None or self.generator.__name__ is None)

@property
def is_anonymous(self) -> bool:
return self.generator is None
return not self.is_named_gate

@staticmethod
def _check_repeated_qubit_operands(qubits: Sequence[Qubit]) -> bool:
Expand Down Expand Up @@ -706,7 +710,7 @@ def named_gate(gate_generator: Callable[..., ControlledGate]) -> Callable[..., C


def named_gate(gate_generator: Callable[..., Gate]) -> Callable[..., Gate]:
return cast(Callable[..., Gate], instruction_decorator(gate_generator))
return cast("Callable[..., Gate]", instruction_decorator(gate_generator))


@overload
Expand All @@ -730,7 +734,7 @@ def non_unitary(non_unitary_generator: Callable[..., Wait]) -> Callable[..., Wai


def non_unitary(non_unitary_generator: Callable[..., NonUnitary]) -> Callable[..., NonUnitary]:
return cast(Callable[..., NonUnitary], instruction_decorator(non_unitary_generator))
return cast("Callable[..., NonUnitary]", instruction_decorator(non_unitary_generator))


def compare_gates(g1: Gate, g2: Gate) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion opensquirrel/parser/libqasm/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _check_analysis_result(result: Any) -> None:
def _get_gate_f(instruction: cqasm.semantic.GateInstruction) -> Callable[..., Gate]:
gate_name = instruction.gate.name
if gate_name in ["inv", "pow", "ctrl"]:
modified_gate_f = cast(Callable[..., BlochSphereRotation], Parser._get_gate_f(instruction.gate))
modified_gate_f = cast("Callable[..., BlochSphereRotation]", Parser._get_gate_f(instruction.gate))
if gate_name == "inv":
return InverseGateModifier(modified_gate_f)
if gate_name == "pow":
Expand Down
4 changes: 2 additions & 2 deletions opensquirrel/passes/decomposer/aba_decomposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def _set_a_b_c_axes_values(self, axis: AxisLike) -> tuple[Any, Any, Any]:
Returns:
A triplet (a, b, c) where a, b, and c are the values of x, y, and z reordered.
"""
_axis = Axis(axis)
return _axis[self.index_a], _axis[self.index_b], _axis[self._find_unused_index()]
axis_ = Axis(axis)
return axis_[self.index_a], axis_[self.index_b], axis_[self._find_unused_index()]

@staticmethod
def _are_b_and_c_axes_in_negative_octant(b_axis_value: float, c_axis_value: float) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion opensquirrel/passes/decomposer/cnot_decomposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def decompose(self, g: Gate) -> list[Gate]:
# See https://threeplusone.com/pubs/on_gates.pdf

# Try special case first, see https://arxiv.org/pdf/quant-ph/9503016.pdf lemma 5.5
controlled_rotation_times_x = general_merger.compose_bloch_sphere_rotations(X(target_qubit), g.target_gate)
controlled_rotation_times_x = general_merger.compose_bloch_sphere_rotations(g.target_gate, X(target_qubit))
theta0_with_x, theta1_with_x, theta2_with_x = ZYZDecomposer().get_decomposition_angles(
controlled_rotation_times_x.axis,
controlled_rotation_times_x.angle,
Expand Down
2 changes: 1 addition & 1 deletion opensquirrel/passes/exporter/cqasmv1_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def _dump_barrier_group(indices: list[int]) -> str:


def _get_barrier_index(line: str) -> int:
barrier_index_match = re.search("\d+", line)
barrier_index_match = re.search(r"\d+", line)
if not barrier_index_match:
msg = "expecting a barrier index but found none"
raise CqasmV1ExporterParseError(msg)
Expand Down
18 changes: 13 additions & 5 deletions opensquirrel/passes/merger/general_merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@

def compose_bloch_sphere_rotations(bsr_a: BlochSphereRotation, bsr_b: BlochSphereRotation) -> BlochSphereRotation:
"""Computes the Bloch sphere rotation resulting from the composition of two Bloch sphere rotations.
The first rotation is applied and then the second.
If the final Bloch sphere rotation is anonymous, we will try to match it to a default gate.
The first rotation (A) is applied and then the second (B):

As separate gates:
A q
B q

A linear operations:
(B * A) q

If the final Bloch sphere rotation is anonymous, we try to match it to a default gate.

Uses Rodrigues' rotation formula (see https://en.wikipedia.org/wiki/Rodrigues%27_rotation_formula).
"""
Expand All @@ -40,7 +48,7 @@ def compose_bloch_sphere_rotations(bsr_a: BlochSphereRotation, bsr_b: BlochSpher
* (
sin(bsr_a.angle / 2) * cos(bsr_b.angle / 2) * bsr_a.axis.value
+ cos(bsr_a.angle / 2) * sin(bsr_b.angle / 2) * bsr_b.axis.value
+ sin(bsr_a.angle / 2) * sin(bsr_b.angle / 2) * np.cross(bsr_a.axis, bsr_b.axis)
+ sin(bsr_a.angle / 2) * sin(bsr_b.angle / 2) * np.cross(bsr_b.axis, bsr_a.axis)
)
),
order_of_magnitude,
Expand Down Expand Up @@ -119,8 +127,8 @@ def can_move_before(statement: Statement, statement_group: list[Statement]) -> b
first_statement_from_group = statement_group[0]
if not isinstance(first_statement_from_group, Barrier):
return False
instruction = cast(Instruction, statement)
return can_move_statement_before_barrier(instruction, cast(list[Instruction], statement_group))
instruction = cast("Instruction", statement)
return can_move_statement_before_barrier(instruction, cast("list[Instruction]", statement_group))


def group_linked_barriers(statements: list[Statement]) -> list[list[Statement]]:
Expand Down
4 changes: 2 additions & 2 deletions opensquirrel/passes/merger/single_qubit_gates_merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def merge(self, ir: IR, qubit_register_size: int) -> None:
statement = ir.statements[statement_index]

# Accumulate consecutive Bloch sphere rotations
instruction: Instruction = cast(Instruction, statement)
instruction: Instruction = cast("Instruction", statement)
if isinstance(instruction, BlochSphereRotation):
already_accumulated = accumulators_per_qubit[instruction.qubit]
composed = compose_bloch_sphere_rotations(instruction, already_accumulated)
composed = compose_bloch_sphere_rotations(already_accumulated, instruction)
accumulators_per_qubit[instruction.qubit] = composed
del ir.statements[statement_index]
continue
Expand Down
4 changes: 2 additions & 2 deletions opensquirrel/passes/router/routing_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def __init__(self, connectivity: dict[str, list[int]]) -> None:
def route(self, ir: IR) -> None:
non_executable_interactions = []
for statement in ir.statements:
instruction: Instruction = cast(Instruction, statement)
instruction: Instruction = cast("Instruction", statement)
args = instruction.arguments
if args and len(args) > 1 and all(isinstance(arg, Qubit) for arg in args):
qubit_args = [arg for arg in args if isinstance(arg, Qubit)]
Expand All @@ -22,7 +22,7 @@ def route(self, ir: IR) -> None:

if non_executable_interactions:
error_message = (
f"The following qubit interactions in the circuit prevent a 1-to-1 mapping:"
f"the following qubit interactions in the circuit prevent a 1-to-1 mapping:"
f"{set(non_executable_interactions)}"
)
raise ValueError(error_message)
6 changes: 6 additions & 0 deletions opensquirrel/passes/validator/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Init file for the validator passes."""

from opensquirrel.passes.validator.general_validator import Validator
from opensquirrel.passes.validator.native_gate_validator import NativeGateValidator

__all__ = ["NativeGateValidator", "Validator"]
10 changes: 10 additions & 0 deletions opensquirrel/passes/validator/general_validator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from abc import ABC, abstractmethod

from opensquirrel.ir import IR


class Validator(ABC):
@abstractmethod
def validate(self, ir: IR) -> None:
"""Base validate method to be implemented by inheriting validator classes."""
raise NotImplementedError
26 changes: 26 additions & 0 deletions opensquirrel/passes/validator/native_gate_validator.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from opensquirrel.ir import IR, Unitary
from opensquirrel.passes.validator import Validator


class NativeGateValidator(Validator):
def __init__(self, native_gate_set: list[str]) -> None:
self.native_gate_set = native_gate_set

def validate(self, ir: IR) -> None:
"""
Check if all unitary gates in the circuit are part of the native gate set.

Args:
ir (IR): The intermediate representation of the circuit to be checked.

Raises:
ValueError: If any unitary gate in the circuit is not part of the native gate set.
"""
gates_not_in_native_gate_set = [
statement.name
for statement in ir.statements
if isinstance(statement, Unitary) and statement.name not in self.native_gate_set
]
if gates_not_in_native_gate_set:
error_message = f"the following gates are not in the native gate set: {set(gates_not_in_native_gate_set)}"
raise ValueError(error_message)
Loading
Loading