Ran
|
Jobs
1
|
Files
854
|
Run time
2min
|
Badge
Embed ▾
README BADGES
|
push
github
Move `QuantumCircuit.assign_parameters` to Rust (#12794) (#12878) * Move `QuantumCircuit.assign_parameters` to Rust This is (as far as I could tell), the last really major performance regression in our asv suite compared to 1.1.0, so with this commit, we should be at _not worse_ for important utility-scale benchmarks. This largely rewrites `ParamTable` (renamed back to `ParameterTable` because I kept getting confused with `Param`) to have more Rust-friendly interfaces available, so that `assign_parameters` can then use them. This represents a 2-3x speedup in `assign_parameters` performance over 1.1.0, when binding simple `Parameter` instances. Approximately 75% of the time is now spent in Python-space `Parameter.assign` and `ParameterExpression.numeric` calls; almost all of this could be removed were we to move `Parameter` and `ParameterExpression` to have their data exposed directly to Rust space. The percentage of time spent in Python space only increases if the expressions to be bound are actual `ParameterExpression`s and not just `Parameter`. Most changes in the test suite are because of the use of internal-only methods that changed with the new `ParameterTable`. The only discrepancy is a bug in `test_pauli_feature_map`, which was trying to assign using a set. * Add unit test of parameter insertion This catches a bug that was present in the parent commit, but this PR fixes. * Update crates/circuit/src/imports.rs * Fix assignment to `AnnotatedOperation` * Rename `CircuitData::num_params` to match normal terminology * Fix typos and :us: * Fix lint (cherry picked from commit a68de4f9f) Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
485 of 513 new or added lines in 5 files covered. (94.54%)
16 existing lines in 5 files now uncovered.66676 of 74130 relevant lines covered (89.94%)
232695.05 hits per line
Lines | Coverage | ∆ | File |
---|---|---|---|
1 |
93.54 |
-0.43% | qiskit/circuit/quantumcircuit.py |
1 |
95.46 |
-0.2% | qiskit/qasm3/exporter.py |
12 |
94.55 |
4.55% | crates/circuit/src/parameter_table.rs |
14 |
95.14 |
1.3% | crates/circuit/src/circuit_data.rs |
Lines | Coverage | ∆ | File |
---|---|---|---|
1 |
92.73 |
0.75% | crates/qasm2/src/lex.rs |
2 |
88.39 |
-0.36% | qiskit/transpiler/passes/synthesis/unitary_synthesis.py |
3 |
93.07 |
-2.97% | qiskit/circuit/library/standard_gates/u.py |
4 |
93.54 |
-0.43% | qiskit/circuit/quantumcircuit.py |
6 |
97.61 |
-0.46% | crates/qasm2/src/parse.rs |
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 10199425044.1 | 854 |
89.94 |
GitHub Action Run |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|