forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor marginal_memory() hex to bin lookup table to be a true static (
Qiskit#8223) * Refactor marginal_memory() hex to bin lookup table to be a true static In the recently merged Qiskit#8051 we create a lookup table in Rust to speed up the hex->bin conversion used internally as part of the marginal_memory() function. This was previously done using the lazy_static crate which is used to lazily evaluate dynamic code to create a static at runtime on the first access. The typical use case for this is to create a static Vec or HashMap. However for the marginal_counts() usage we didn't need to do this because we were creating a fixed size array so the static can be evaulated at compile time assuming the array is constructed with a const function. This commit removes the lazy_static usage and switches to a true static to further improve the performance of the lookup table by avoiding the construction overhead. * Reduce number of empty entries in LUT Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c650341
commit f25a7ed
Showing
4 changed files
with
27 additions
and
32 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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