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

Port TwoQubitBasisDecomposition to Rust #12004

Closed
Tracked by #8774 ...
mtreinish opened this issue Mar 13, 2024 · 0 comments · Fixed by #12010
Closed
Tracked by #8774 ...

Port TwoQubitBasisDecomposition to Rust #12004

mtreinish opened this issue Mar 13, 2024 · 0 comments · Fixed by #12010
Assignees
Labels
performance Rust This PR or issue is related to Rust code in the repository synthesis

Comments

@mtreinish
Copy link
Member

No description provided.

@mtreinish mtreinish added performance synthesis Rust This PR or issue is related to Rust code in the repository labels Mar 13, 2024
@mtreinish mtreinish self-assigned this Mar 13, 2024
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Mar 13, 2024
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Mar 14, 2024
This commit is the second part of migrating the default 2q unitary
synthesis method to leverage parallel rust as described in Qiskit#8774. The
Eventual goal is to be able to run unitary synthesis in parallel for all
the unitary matrices in a single call from the `UnitarySynthesis` pass.
The TwoQubitBasisDecomposer class is one of the default decomposers used
by the unitary synthesis plugin. After this we can build an interface
that will run the decomposition in parallel for a given decomposer.

This commit re-implements the TwoQubitBasisDecomposer class in rust. It
keeps the same algorithm from the previous python version but implements
it in rust. This builds off of Qiskit#11946 and for the operation of the
decomposer class the TwoQubitWeylDecomposition class is used solely
through rust.

This commit depends on Qiskit#11946 and will need to be rebased after Qiskit#11946
is merged.

Fixes Qiskit#12004
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Mar 14, 2024
This commit is the second part of migrating the default 2q unitary
synthesis method to leverage parallel rust as described in Qiskit#8774. The
Eventual goal is to be able to run unitary synthesis in parallel for all
the unitary matrices in a single call from the `UnitarySynthesis` pass.
The TwoQubitBasisDecomposer class is one of the default decomposers used
by the unitary synthesis plugin. After this we can build an interface
that will run the decomposition in parallel for a given decomposer.

This commit re-implements the TwoQubitBasisDecomposer class in rust. It
keeps the same algorithm from the previous python version but implements
it in rust. This builds off of Qiskit#11946 and for the operation of the
decomposer class the TwoQubitWeylDecomposition class is used solely
through rust.

This commit depends on Qiskit#11946 and will need to be rebased after Qiskit#11946
is merged.

Fixes Qiskit#12004
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Mar 14, 2024
This commit adds a new inner rust function that performs 1q euler
decomposition in multiple threads to attempt to improve the performance
of the synthesis. The numerical component of the 1q synthesis has no
data dependency when run with multiple unitary matrices and we can
potentially better leverage multiple CPUs by performing the calculations
in parallel. We are still required to serially manipulate the DAGCircuit
though which will potentially limit the efficacy of this change. Longer
term if we move the core structural representation of DAGCircuit into
qiskit._accelerate we can potentially also parallelize the dag
manipulation (albeit with some locking).

This is the 1q component of Qiskit#12007, we'll need to add similar interfaces
for TwoQubitBasisDecomposer, after Qiskit#12004 is implemented, and
XXDecomposer, after Qiskit#12005 is complete. The benefits of this are
expected to be much smaller compared to the 2q decomposers because the
computational effort in the numerical component of 1q euler
decomposition is very small.
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Mar 14, 2024
This commit is the second part of migrating the default 2q unitary
synthesis method to leverage parallel rust as described in Qiskit#8774. The
Eventual goal is to be able to run unitary synthesis in parallel for all
the unitary matrices in a single call from the `UnitarySynthesis` pass.
The TwoQubitBasisDecomposer class is one of the default decomposers used
by the unitary synthesis plugin. After this we can build an interface
that will run the decomposition in parallel for a given decomposer.

This commit re-implements the TwoQubitBasisDecomposer class in rust. It
keeps the same algorithm from the previous python version but implements
it in rust. This builds off of Qiskit#11946 and for the operation of the
decomposer class the TwoQubitWeylDecomposition class is used solely
through rust.

This commit depends on Qiskit#11946 and will need to be rebased after Qiskit#11946
is merged.

Fixes Qiskit#12004
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Mar 26, 2024
This commit adds a new inner rust function that performs 1q euler
decomposition in multiple threads to attempt to improve the performance
of the synthesis. The numerical component of the 1q synthesis has no
data dependency when run with multiple unitary matrices and we can
potentially better leverage multiple CPUs by performing the calculations
in parallel. We are still required to serially manipulate the DAGCircuit
though which will potentially limit the efficacy of this change. Longer
term if we move the core structural representation of DAGCircuit into
qiskit._accelerate we can potentially also parallelize the dag
manipulation (albeit with some locking).

This is the 1q component of Qiskit#12007, we'll need to add similar interfaces
for TwoQubitBasisDecomposer, after Qiskit#12004 is implemented, and
XXDecomposer, after Qiskit#12005 is complete. The benefits of this are
expected to be much smaller compared to the 2q decomposers because the
computational effort in the numerical component of 1q euler
decomposition is very small.
github-merge-queue bot pushed a commit that referenced this issue Mar 28, 2024
* Oxidize TwoQubitBasisDecomposer

This commit is the second part of migrating the default 2q unitary
synthesis method to leverage parallel rust as described in #8774. The
Eventual goal is to be able to run unitary synthesis in parallel for all
the unitary matrices in a single call from the `UnitarySynthesis` pass.
The TwoQubitBasisDecomposer class is one of the default decomposers used
by the unitary synthesis plugin. After this we can build an interface
that will run the decomposition in parallel for a given decomposer.

This commit re-implements the TwoQubitBasisDecomposer class in rust. It
keeps the same algorithm from the previous python version but implements
it in rust. This builds off of #11946 and for the operation of the
decomposer class the TwoQubitWeylDecomposition class is used solely
through rust.

This commit depends on #11946 and will need to be rebased after #11946
is merged.

Fixes #12004

* Fix errors after rebase

* Fix traces method

* Fix pulse optimized synthesis

* Add release notes

* Fix lint

* Use consts for static decomposition arrays

* Run cargo fmt

* Handle basis_fidelity inside unitary synthesis path

* Cast input to TwoQubitBasisDecomposer.num_basis_gates

* Use statics instead of consts

* Pre-allocate 2q circuit sequence outside the pulse optimal path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Rust This PR or issue is related to Rust code in the repository synthesis
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant