You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This recreates the entire dict (which could be 100s of qubits + clbits) on every lookup.
I actually expected it to have more of an impact on transpiler performance, but it seems like we only have a couple of transpiler passes that touch them - the disjoint utils and the "remove final X" passes. I think those are sufficient non-critical we can ignore it for this first PR, but it's definitely a performance pitfall we should rectify for user passes.
At the moment, the Rust-space input_map and output_map properties recreate Python dictionaries on every access, meaning operations like [dag.input_map[qubit] for qubit in dag.qubits] have suddenly become quadratic in the number of qubits, rather than linear. This doesn't bite us too much in practice in the transpiler immediately, but it's absolutely a performance pitfall waiting to happen in the current structure.
The text was updated successfully, but these errors were encountered:
I actually expected it to have more of an impact on transpiler performance, but it seems like we only have a couple of transpiler passes that touch them - the disjoint utils and the "remove final X" passes. I think those are sufficient non-critical we can ignore it for this first PR, but it's definitely a performance pitfall we should rectify for user passes.
Originally posted by @jakelishman in #12550 (comment)
At the moment, the Rust-space
input_map
andoutput_map
properties recreate Python dictionaries on every access, meaning operations like[dag.input_map[qubit] for qubit in dag.qubits]
have suddenly become quadratic in the number of qubits, rather than linear. This doesn't bite us too much in practice in the transpiler immediately, but it's absolutely a performance pitfall waiting to happen in the current structure.The text was updated successfully, but these errors were encountered: