qiskit/crates/accelerate
Jake Lishman 373e8a68c8
Encapsulate Python sequence-like indexers (#12669)
This encapsulates a lot of the common logic around Python sequence-like
indexers (`SliceOrInt`) into iterators that handle adapting negative
indices and slices in `usize` for containers of a given size.

These indexers now all implement `ExactSizeIterator` and
`DoubleEndedIterator`, so they can be used with all `Iterator` methods,
and can be used (with `Iterator::map` and friends) as inputs to
`PyList::new_bound`, which makes code simpler at all points of use.

The special-cased uses of this kind of thing from `CircuitData` are
replaced with the new forms.  This had no measurable impact on
performance on my machine, and removes a lot noise from error-handling
and highly specialised functions.
2024-07-01 12:59:21 +00:00
..
src Encapsulate Python sequence-like indexers (#12669) 2024-07-01 12:59:21 +00:00
Cargo.toml Encapsulate Python sequence-like indexers (#12669) 2024-07-01 12:59:21 +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.