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

Reimplement SabreSwap heuristic scoring in Rust #7977

Merged
merged 44 commits into from
Jul 19, 2022
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f091709
Reimplement SabreSwap heuristic scoring in multithreaded Rust
mtreinish Apr 22, 2022
8095c24
Make sabre_swap a separate Rust module
mtreinish Apr 22, 2022
6f80e93
Fix lint
mtreinish Apr 22, 2022
3e0fad6
Remove unnecessary parallel iteration
mtreinish Apr 22, 2022
b76284e
Revert change to DECAY_RESET_INTERVAL behavior
mtreinish Apr 22, 2022
eef49df
Avoid Bit._index
mtreinish Apr 22, 2022
e39181a
Merge remote-tracking branch 'origin/main' into RabreRwap
mtreinish Apr 22, 2022
5ae5572
Add __str__ definition for DEBUG logs
mtreinish Apr 22, 2022
ccce496
Cleanup greedy swap path
mtreinish Apr 22, 2022
ee2ed4f
Preserve insertion order in SwapScores
mtreinish Apr 22, 2022
40285e7
Work with virtual indices win obtain swap
mtreinish Apr 22, 2022
f3e5599
Simplify decay reset() method
mtreinish Apr 22, 2022
1b8c082
Fix lint
mtreinish Apr 22, 2022
556b128
Fix typo
mtreinish Apr 22, 2022
9640ed1
Rename nlayout methods
mtreinish Apr 26, 2022
ce0ca51
Update docstrings for SwapScores type
mtreinish Apr 26, 2022
4b608db
Merge remote-tracking branch 'origin/main' into RabreRwap
mtreinish Apr 26, 2022
f78547e
Use correct swap method for _undo_operations()
mtreinish Apr 26, 2022
4bb0ac8
Merge remote-tracking branch 'origin/main' into RabreRwap
mtreinish May 10, 2022
3c732bf
Merge branch 'main' into RabreRwap
mtreinish May 12, 2022
5f03888
Merge branch 'main' into RabreRwap
mtreinish Jun 14, 2022
2baae34
Merge remote-tracking branch 'origin/main' into RabreRwap
mtreinish Jun 29, 2022
72c6718
Fix rebase error
mtreinish Jun 29, 2022
f550200
Revert test change
mtreinish Jun 29, 2022
8f95204
Reverse if condition in lookahead cost
mtreinish Jun 29, 2022
e07d09a
Fix missing len division on lookahead cost
mtreinish Jun 29, 2022
3dacfab
Merge branch 'main' into RabreRwap
mtreinish Jun 29, 2022
0df24b8
Remove unused EXTENDED_SET_WEIGHT python global
mtreinish Jun 29, 2022
5b4d951
Switch to serial iterator for heuristic scoring
mtreinish Jun 29, 2022
a736105
Return a 2d numpy array for best swaps and avoid conversion cost
mtreinish Jun 29, 2022
7a161c1
Migrate obtain_swaps to rust
mtreinish Jun 30, 2022
6360d3e
Remove unused SwapScores class
mtreinish Jun 30, 2022
17b995a
Fix module metadata path
mtreinish Jun 30, 2022
40a03bb
Add release note
mtreinish Jun 30, 2022
b9d88c5
Add rust docstrings
mtreinish Jun 30, 2022
b4ce264
Pre-allocate candidate_swaps
mtreinish Jun 30, 2022
6b5d1cb
Double swap instead of clone
mtreinish Jun 30, 2022
6b21b49
Remove unnecessary list comprehensions
mtreinish Jun 30, 2022
78531bb
Move random choice into rust
mtreinish Jun 30, 2022
39c303b
Use int32 for max default rng seed for windows compat
mtreinish Jun 30, 2022
9ef8dfd
Fix bounds check on custom sequence type's __getitem__
mtreinish Jul 18, 2022
235e9a6
Merge remote-tracking branch 'origin/main' into RabreRwap
mtreinish Jul 18, 2022
3ce5ff8
Only run parallel sort if not in a parallel context
mtreinish Jul 18, 2022
f90b4d6
Merge branch 'main' into RabreRwap
mtreinish Jul 19, 2022
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
9 changes: 5 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ numpy = "0.16.2"
rand = "0.8"
rand_pcg = "0.3"
rand_distr = "0.4.3"
indexmap = "1.9.1"
ahash = "0.7.6"
num-complex = "0.4"
num-bigint = "0.4"
Expand All @@ -32,6 +31,10 @@ features = ["rayon"]
version = "0.12.1"
features = ["rayon"]

[dependencies.indexmap]
version = "1.9.1"
features = ["rayon"]

[profile.release]
lto = 'fat'
codegen-units = 1
1 change: 1 addition & 0 deletions qiskit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
# manually define them on import so people can directly import
# qiskit._accelerate.* submodules and not have to rely on attribute access
sys.modules["qiskit._accelerate.stochastic_swap"] = qiskit._accelerate.stochastic_swap
sys.modules["qiskit._accelerate.sabre_swap"] = qiskit._accelerate.sabre_swap
sys.modules["qiskit._accelerate.pauli_expval"] = qiskit._accelerate.pauli_expval
sys.modules["qiskit._accelerate.dense_layout"] = qiskit._accelerate.dense_layout
sys.modules["qiskit._accelerate.sparse_pauli_op"] = qiskit._accelerate.sparse_pauli_op
Expand Down
Loading