Oxidize `synth_permutation_acg`
Summary
Closes #12226. This could in future be further improved by constructing the circuit in Rust directly.
Details and comments
A small benchmark for 1000 qubit circuit on random circuits with depth 1000 gives
(main) Took 46.50923681259155s for 10000 reps on 1000 qubits
(this PR) Took 16.09170889854431s for 10000 reps on 1000 qubits
It seems that 99% of this improvement comes from constructing the circuit in Rust, not from porting doing the permutation logic.
I'm happy about any comments or possible improvements, as this is my first Rust PR 🙂
One or more of the following people are relevant to this code:
- @Eric-Arellano
-
@Qiskit/terra-core -
@kevinhartman -
@mtreinish
Pull Request Test Coverage Report for Build 9463371888
Details
- 51 of 52 (98.08%) changed or added relevant lines in 2 files are covered.
- 27 unchanged lines in 2 files lost coverage.
- Overall coverage decreased (-0.03%) to 89.574%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/accelerate/src/permutation.rs | 50 | 51 | 98.04% |
| <!-- | Total: | 51 | 52 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| crates/qasm2/src/lex.rs | 9 | 92.11% |
| crates/qasm2/src/parse.rs | 18 | 96.69% |
| <!-- | Total: | 27 |
| Totals | |
|---|---|
| Change from base Build 9455662900: | -0.03% |
| Covered Lines: | 62525 |
| Relevant Lines: | 69803 |
💛 - Coveralls
Pull Request Test Coverage Report for Build 9501561495
Details
- 64 of 77 (83.12%) changed or added relevant lines in 2 files are covered.
- 33 unchanged lines in 3 files lost coverage.
- Overall coverage decreased (-0.05%) to 89.701%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/accelerate/src/permutation.rs | 62 | 75 | 82.67% |
| <!-- | Total: | 64 | 77 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| qiskit/synthesis/permutation/permutation_full.py | 3 | 83.33% |
| crates/qasm2/src/lex.rs | 6 | 91.6% |
| crates/qasm2/src/parse.rs | 24 | 96.23% |
| <!-- | Total: | 33 |
| Totals | |
|---|---|
| Change from base Build 9500158747: | -0.05% |
| Covered Lines: | 63425 |
| Relevant Lines: | 70707 |
💛 - Coveralls
Pull Request Test Coverage Report for Build 9546844359
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.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 64 of 77 (83.12%) changed or added relevant lines in 2 files are covered.
- 3 unchanged lines in 1 file lost coverage.
- Overall coverage decreased (-0.01%) to 89.743%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/accelerate/src/permutation.rs | 62 | 75 | 82.67% |
| <!-- | Total: | 64 | 77 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| crates/qasm2/src/lex.rs | 3 | 92.88% |
| <!-- | Total: | 3 |
| Totals | |
|---|---|
| Change from base Build 9500158747: | -0.01% |
| Covered Lines: | 63452 |
| Relevant Lines: | 70704 |
💛 - Coveralls
Pull Request Test Coverage Report for Build 9549394978
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.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 65 of 78 (83.33%) changed or added relevant lines in 2 files are covered.
- 18 unchanged lines in 2 files lost coverage.
- Overall coverage decreased (-0.04%) to 89.718%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/accelerate/src/permutation.rs | 62 | 75 | 82.67% |
| <!-- | Total: | 65 | 78 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| crates/qasm2/src/lex.rs | 6 | 91.35% |
| crates/qasm2/src/parse.rs | 12 | 97.15% |
| <!-- | Total: | 18 |
| Totals | |
|---|---|
| Change from base Build 9500158747: | -0.04% |
| Covered Lines: | 63434 |
| Relevant Lines: | 70704 |
💛 - Coveralls
Pull Request Test Coverage Report for Build 9579566605
Details
- 65 of 78 (83.33%) changed or added relevant lines in 2 files are covered.
- 3 unchanged lines in 1 file lost coverage.
- Overall coverage decreased (-0.009%) to 89.76%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/accelerate/src/permutation.rs | 62 | 75 | 82.67% |
| <!-- | Total: | 65 | 78 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| crates/qasm2/src/lex.rs | 3 | 92.62% |
| <!-- | Total: | 3 |
| Totals | |
|---|---|
| Change from base Build 9578841868: | -0.009% |
| Covered Lines: | 63612 |
| Relevant Lines: | 70869 |
💛 - Coveralls
Let's merge #12605 first to have the right directory structure.
Pull Request Test Coverage Report for Build 9610372304
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.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 61 of 74 (82.43%) changed or added relevant lines in 2 files are covered.
- 66 unchanged lines in 4 files lost coverage.
- Overall coverage decreased (-0.05%) to 89.72%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/accelerate/src/permutation.rs | 58 | 71 | 81.69% |
| <!-- | Total: | 61 | 74 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| crates/qasm2/src/lex.rs | 3 | 92.37% |
| crates/qasm2/src/parse.rs | 12 | 97.15% |
| qiskit/circuit/quantumcircuit.py | 23 | 95.69% |
| qiskit/visualization/pulse_v2/device_info.py | 28 | 39.71% |
| <!-- | Total: | 66 |
| Totals | |
|---|---|
| Change from base Build 9578841868: | -0.05% |
| Covered Lines: | 63597 |
| Relevant Lines: | 70884 |
💛 - Coveralls
Pull Request Test Coverage Report for Build 9761267322
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.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 63 of 64 (98.44%) changed or added relevant lines in 4 files are covered.
- 392 unchanged lines in 9 files lost coverage.
- Overall coverage decreased (-0.03%) to 89.795%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| crates/accelerate/src/synthesis/permutation/utils.rs | 40 | 41 | 97.56% |
| <!-- | Total: | 63 | 64 |
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| crates/qasm2/src/expr.rs | 1 | 94.02% |
| crates/qasm2/src/lex.rs | 1 | 92.88% |
| crates/qasm2/src/parse.rs | 12 | 97.15% |
| crates/circuit/src/circuit_data.rs | 21 | 90.81% |
| crates/circuit/src/circuit_instruction.rs | 31 | 95.09% |
| crates/circuit/src/dag_node.rs | 32 | 83.67% |
| qiskit/dagcircuit/dagcircuit.py | 56 | 92.15% |
| qiskit/transpiler/passes/synthesis/unitary_synthesis.py | 58 | 88.35% |
| crates/circuit/src/operations.rs | 180 | 78.96% |
| <!-- | Total: | 392 |
| Totals | |
|---|---|
| Change from base Build 9751520597: | -0.03% |
| Covered Lines: | 64527 |
| Relevant Lines: | 71860 |
💛 - Coveralls
Pull Request Test Coverage Report for Build 9762022533
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.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 70 of 70 (100.0%) changed or added relevant lines in 4 files are covered.
- 399 unchanged lines in 8 files lost coverage.
- Overall coverage decreased (-0.06%) to 89.77%
| Files with Coverage Reduction | New Missed Lines | % |
|---|---|---|
| crates/qasm2/src/lex.rs | 3 | 92.11% |
| crates/qasm2/src/parse.rs | 18 | 95.77% |
| crates/circuit/src/circuit_data.rs | 21 | 90.81% |
| crates/circuit/src/circuit_instruction.rs | 31 | 95.09% |
| crates/circuit/src/dag_node.rs | 32 | 83.67% |
| qiskit/dagcircuit/dagcircuit.py | 56 | 92.15% |
| qiskit/transpiler/passes/synthesis/unitary_synthesis.py | 58 | 88.35% |
| crates/circuit/src/operations.rs | 180 | 78.96% |
| <!-- | Total: | 399 |
| Totals | |
|---|---|
| Change from base Build 9751520597: | -0.06% |
| Covered Lines: | 64514 |
| Relevant Lines: | 71866 |