Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement two_qubit_decompose.num_basis_gates in rust (#11019)
* Use newer rust * Adding weyl chamber code in rust * Finish num_basis_gates in rust, but calculated values wrong * Fix bugs in weyl_coordinates * Upgrade faer from 0.12 to 0.13 * This will allow copyless convert of numpy complex matrix to faer * abs2 disappeared probably an error, so we work around here. * Use copyless conversion of complex matrix from numpy to faer * Fix thinko bugs so that existing tests pass * Add comment * Remove allocation * Replace loop with iterator * Silence clippy complaints * refactor * Run rustfmt * Slight refactor and format * Reorganize new code in crate accelerate * Moved `eigenvalues` into module `utils`. * Access num_basis_gates via module two_qubit_decompose * Remove some allocations * Run rustfmt * Raise faer version to 0.13.5, lower rustc to 1.67.0 faer 0.13.5 introduces a specific MSRV * Fix some conflicts with main branch * Fix more conflicts * More conflicts * More conflicts * Update crates/accelerate/src/two_qubit_decompose.rs Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Apply suggestions from code review Apply several suggested edits made in review Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Increase faer version and remove some cruft * We introduced to_num_complex, but this required upgrading faer. We chose 0.15 * Upgrade our code, in turn, for the upgrade to faer 0.15 * Remove a function exported via pyo3 that was only used for testing * Remove `def old_num_basis_gate` * Make __num_basis_gates more idiomatic * Explain use of `min_by` when `max_by` is expected * Replace myabs2 with faer_abs2 We recently increased the version of the faer dependency. The newer version has an abs2 in the api named `faer_abs2`. So we can delete `myabs2`. * Use alternative mod implementation following review requests * Make pyo3 function eigenvalues return ndarray rather than list Following review suggestion. * Bump faer version to latest 0.16 This was previously at 0.15 for accidental reasons. * Use rem_euclid for remainder * Fix black complaint * Fix pylint complaints * Apply suggestions from code review Co-authored-by: Matthew Treinish <mtreinish@kortar.org> * Remove nalgebra feature from faer * Use constants for fractions of pi --------- Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
- Loading branch information