qiskit icon indicating copy to clipboard operation
qiskit copied to clipboard

Oxidize `synth_permutation_acg`

Open Cryoris opened this issue 1 year ago • 8 comments

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 🙂

Cryoris avatar Jun 11 '24 09:06 Cryoris

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

  • @Eric-Arellano
  • @Qiskit/terra-core
  • @kevinhartman
  • @mtreinish

qiskit-bot avatar Jun 11 '24 09:06 qiskit-bot

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 Coverage Status
Change from base Build 9455662900: -0.03%
Covered Lines: 62525
Relevant Lines: 69803

💛 - Coveralls

coveralls avatar Jun 11 '24 10:06 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 Coverage Status
Change from base Build 9500158747: -0.05%
Covered Lines: 63425
Relevant Lines: 70707

💛 - Coveralls

coveralls avatar Jun 13 '24 14:06 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.

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 Coverage Status
Change from base Build 9500158747: -0.01%
Covered Lines: 63452
Relevant Lines: 70704

💛 - Coveralls

coveralls avatar Jun 17 '24 11:06 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.

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 Coverage Status
Change from base Build 9500158747: -0.04%
Covered Lines: 63434
Relevant Lines: 70704

💛 - Coveralls

coveralls avatar Jun 17 '24 14:06 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 Coverage Status
Change from base Build 9578841868: -0.009%
Covered Lines: 63612
Relevant Lines: 70869

💛 - Coveralls

coveralls avatar Jun 19 '24 09:06 coveralls

Let's merge #12605 first to have the right directory structure.

Cryoris avatar Jun 21 '24 07:06 Cryoris

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.

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 Coverage Status
Change from base Build 9578841868: -0.05%
Covered Lines: 63597
Relevant Lines: 70884

💛 - Coveralls

coveralls avatar Jun 21 '24 08:06 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.

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 Coverage Status
Change from base Build 9751520597: -0.03%
Covered Lines: 64527
Relevant Lines: 71860

💛 - Coveralls

coveralls avatar Jul 02 '24 13:07 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.

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 Coverage Status
Change from base Build 9751520597: -0.06%
Covered Lines: 64514
Relevant Lines: 71866

💛 - Coveralls

coveralls avatar Jul 02 '24 14:07 coveralls