Closed kevinhartman closed 2 months ago
One or more of the following people are relevant to this code:
@Qiskit/terra-core
@kevinhartman
@mtreinish
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.
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
crates/circuit/src/dag_circuit.rs | 67 | 72 | 93.06% | ||
<!-- | Total: | 67 | 72 | 93.06% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
crates/qasm2/src/lex.rs | 3 | 92.73% | ||
crates/circuit/src/interner.rs | 4 | 92.0% | ||
crates/circuit/src/packed_instruction.rs | 8 | 96.56% | ||
crates/qasm2/src/parse.rs | 12 | 97.15% | ||
crates/circuit/src/circuit_data.rs | 26 | 92.18% | ||
crates/circuit/src/dag_circuit.rs | 300 | 89.02% | ||
<!-- | Total: | 353 | --> |
Totals | |
---|---|
Change from base Build 10563485346: | -0.01% |
Covered Lines: | 71646 |
Relevant Lines: | 80320 |
Summary
This has a bit of a click-bait title since they're technically already ported (the calls to
DAGCircuit::depth
andDAGCircuit::size
made by the Python passes are already in Rust). But, this PR avoids anisinstance
call that was being done for every node in the DAG on calls to these methods when therecurse
parameter was specified astrue
, which should resolve the performance issues we were seeing with these passes.I've also done this for
DAGCircuit::count_ops
.Details
Resolves #12272, #12273