-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Split out quantum-info and synthesis crates from accelerate #14342
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
Split out quantum-info and synthesis crates from accelerate #14342
Conversation
One or more of the following people are relevant to this code:
|
This commit completes the decomposition of thw qiskit-accelerate crate into separate compilation units based on functionality. There are two new creates created in this commit, qiskit-synthesis and qiskit-quantum-info. The logical split between the crates is synthesis is the crate used to synthesize mathematical operations into quantum circuits, while the quantum-info crate is used to contain the data structures and functions used to model quantum information. In an earlier draft synthesis was just a submodule inside the quantum-info crate, but before finalizing this commit it was split out because the external dependencies of the functionality were distinct enough that keeping them seperate provide real advantages. Concretely this was primarily driven by being able to exclude pulling in faer and faer-ext when building the cext crate, since cext only depends currently on qiskit-quantum-info and qiskit-circuit. This commit finishes the migration to the new internal dependency structure so that accelerate is towards the end of the tree and nothing depends on it accept for the Python interface crate. qiskit-pyext ├── qiskit-accelerate ├── qiskit-transpiler ├── qiskit-cext ├── qiskit-quantum-info ├── qiskit-circuit ├── qiskit-transpiler ├── qiskit-synthesis ├── qiskit-quantum-info ├── qiskit-circuit ├── qiskit-synthesis ├── qiskit-quantum-info ├── qiskit-circuit ├── qiskit-quantum-info ├── qiskit-circuit ├── qiskit-circuit
e36d991
to
6166bc0
Compare
Pull Request Test Coverage Report for Build 15170092988Details
💛 - Coveralls |
Thanks for re-organizing!
|
I left them where they were because it's not a full synthesis implementation. I only ported some of the numerics from the isometry code last year (which is both of the files). It was just enough to avoid buggy pieces in Apple's accelerate BLAS implementation that were causing spurious failures on arm64 macOS. I think we should be saving the synthesis crate for full synthesis algorithms, not partial things like these. If we port the full isometry code to Rust then I'd say we should move it over to qiskit-synthesis. |
05fdb5c
to
f7dbf41
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for re-organizing the code. I only have a few questions:
- why
rayon_ext.rs
was moved to quantum_info? - why
test.rs
was moved to quantum_info? perhaps it would be good to update the file name to something more meaningful. pauli_exp_val.rs
andsampled_exp_val.rs
- should they be moved to quantum_info?optimize_1q_gates
- should it be moved to qiskit_transplier?
This is an implementation of traits for the rayon data parallelism library that is used in the sparse pauli op code. It's only used there and is specific to that code. It doesn't make sense to live anywhere else.
This is specifically test code for the above rayon module. I can rename it but I'd rather do that in a follow up just to try and minimize the diff here since the more code we change in this PR makes potential future issues difficult to bisect or revert.
This is a similar reason to isometry. It accelerates some of the internal quaternion calculations used in the transpiler pass. It's not a standalone pass and doesn't work without python which is part of what accelerate is for. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanation. I see now that the code in accelerate is not ready to be moved to other parts.
One last follow-up question:
should sampled_exp_val.rs
be moved into accelerate/results
?
Potentially, the directory based split never really caught on in accelerate, so we never really have add a 1:1 mapping of the Python directory structure in the rust crates. That being said it does seem to make sense there since it's about result post-processing. I'd suggest we do that in a separate PR to minimize the diff here about the crate re-organization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the explanations. I've approved your PR. Let's merge it carefully, since everyone will have to rebase their PRs afterwards :)
…4342) * Split out quantum-info and synthesis crates from accelerate This commit completes the decomposition of thw qiskit-accelerate crate into separate compilation units based on functionality. There are two new creates created in this commit, qiskit-synthesis and qiskit-quantum-info. The logical split between the crates is synthesis is the crate used to synthesize mathematical operations into quantum circuits, while the quantum-info crate is used to contain the data structures and functions used to model quantum information. In an earlier draft synthesis was just a submodule inside the quantum-info crate, but before finalizing this commit it was split out because the external dependencies of the functionality were distinct enough that keeping them seperate provide real advantages. Concretely this was primarily driven by being able to exclude pulling in faer and faer-ext when building the cext crate, since cext only depends currently on qiskit-quantum-info and qiskit-circuit. This commit finishes the migration to the new internal dependency structure so that accelerate is towards the end of the tree and nothing depends on it accept for the Python interface crate. qiskit-pyext ├── qiskit-accelerate ├── qiskit-transpiler ├── qiskit-cext ├── qiskit-quantum-info ├── qiskit-circuit ├── qiskit-transpiler ├── qiskit-synthesis ├── qiskit-quantum-info ├── qiskit-circuit ├── qiskit-synthesis ├── qiskit-quantum-info ├── qiskit-circuit ├── qiskit-quantum-info ├── qiskit-circuit ├── qiskit-circuit * Update dependency package in cbindgen config * Remove unused requirements * Bump cargo.lock
Summary
This commit completes the decomposition of thw qiskit-accelerate crate into separate compilation units based on functionality. There are two new creates created in this commit, qiskit-synthesis and qiskit-quantum-info. The logical split between the crates is synthesis is the crate used to synthesize mathematical operations into quantum circuits, while the quantum-info crate is used to contain the data structures and functions used to model quantum information. In an earlier draft synthesis was just a submodule inside the quantum-info crate, but before finalizing this commit it was split out because the external dependencies of the functionality were distinct enough that keeping them seperate provide real advantages. Concretely this was primarily driven by being able to exclude pulling in faer and faer-ext when building the cext crate, since cext only depends currently on qiskit-quantum-info and qiskit-circuit.
Details and comments
This commit finishes the migration to the new internal dependency structure so that accelerate is towards the end of the tree and nothing depends on it accept for the Python interface crate. Here is the new dependency tree of
qiskit-*
crates ofqiskit-pyext
: