qiskit/crates/accelerate
Matthew Treinish 65bb09efab
Make dense layout algorithm deterministic when run in parallel (#13133)
* Make dense layout algorithm deterministic when run in parallel

The dense layout algorithm is trying to find the densest k subgraph of
the connectivity graph. To do this it performs a BFS from each node in
the in graph of k nodes to determine the subgraph with the most number
of edges. But in cases of ties where there are subgraphs with the same
number of edges the exact output would be determined by the iteration
order that we're evaluating a BFS search. However, this algorithm runs
in parallel in most cases and the exact iteration order isn't going to
be stable when running in parallel. It will depend on which threads
finish first. This commit fixes this potential non-determinism in the
algorithm by defaulting to the lower node index's trial results instead
of relying on the execution order. This should mean we return identical
results regardless of how many threads are run or how quickly they
execute.

* Add release note

* Also handle the use_error case too
2024-09-19 15:47:45 +00:00
..
src Make dense layout algorithm deterministic when run in parallel (#13133) 2024-09-19 15:47:45 +00:00
Cargo.toml Add: `cache_py_gates` feature to `accelerate` crate. (#13183) 2024-09-18 19:41:47 +00:00
README.md Refactor Rust crates to build a single extension module (#12134) 2024-04-17 19:52:07 +00:00

README.md

qiskit-accelerate

This crate provides a bits-and-pieces Rust libary for small, self-contained functions that are used by the main Python-space components to accelerate certain tasks. If you're trying to speed up one particular Python function by replacing its innards with a Rust one, this is the best place to put the code. This is usually the right place to put new Rust/Python code.

The qiskit-pyext crate is what actually builds the C extension modules. Modules in here should define themselves has being submodules of qiskit._accelerate, and then the qiskit-pyext crate should bind them into its fn _accelerate when it's making the C extension.