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

Remove faer usage from quantum_volume #13714

Closed
wants to merge 2 commits into from

Conversation

mtreinish
Copy link
Member

Summary

As part of #13665 this migrates the faer-rs usage in quantum_volume.rs to just use nalgebra instead. The only faer usage there was for the qr decomposition and everything else was done with fixed sized arrays or Array2. This migration is fairly simple but it's a good start towards the goal of eventually removing our faer-rs usage in Qiskit. It might improve performance because we remove one layer of heap allocated objects by moving from Array2 to Matrix4 for rust operations. Although we do need an equivalent heap allocation for generating the numpy arrays used in UnitaryGate so it might not really change anything significantly.

Details and comments

Part of #13665

As part of Qiskit#13665 this migrates the faer-rs usage in quantum_volume.rs
to just use nalgebra instead. The only faer usage there was for the qr
decomposition and everything else was done with fixed sized arrays
or Array2. This migration is fairly simple but it's a good start towards
the goal of eventually removing our faer-rs usage in Qiskit. It might
improve performance because we remove one layer of heap allocated
objects by moving from Array2 to Matrix4 for rust operations. Although
we do need an equivalent heap allocation for generating the numpy arrays
used in `UnitaryGate` so it might not really change anything
significantly.
@mtreinish mtreinish added Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository labels Jan 21, 2025
@mtreinish mtreinish requested a review from a team as a code owner January 21, 2025 23:48
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@coveralls
Copy link

coveralls commented Jan 22, 2025

Pull Request Test Coverage Report for Build 13169712982

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 13 of 13 (100.0%) changed or added relevant lines in 1 file are covered.
  • 14 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.02%) to 88.617%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 1 93.48%
crates/accelerate/src/unitary_synthesis.rs 1 92.97%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 13168373427: 0.02%
Covered Lines: 79349
Relevant Lines: 89542

💛 - Coveralls

Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Not an expert by any means on linear algebra in rust but this change seems straightforward enough.

@mtreinish
Copy link
Member Author

This is largely duplicated in #13765 but I used nalgebra slightly differently in that PR (I forgot I had this PR open when I wrote it). I'm fine merging this as is, and just rebasing #13765 on top of this. Or we can just close this and move proceed solely with #13765. I'll defer to what you think is best @ElePT.

@mtreinish
Copy link
Member Author

This has been superseded by: #13765

@mtreinish mtreinish closed this Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants