• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 9757352540

02 Jul 2024 08:13AM UTC coverage: 89.811% (-0.01%) from 89.825%
9757352540

push

github

web-flow
Enable avoiding Python operation creation in transpiler (#12692)

* Avoid Python operation creation in transpiler

Since #12459 accessing `node.op` in the transpiler eagerly creates a
Python object on access. This is because we now are no longer storing a
Python object internally and we need to rebuild the object to return the
python object as expected by the api. This is causing a significant
performance regression because of the extra overhead. The longer term
goal is to move as much of the performance critical passes to operate in
rust which will eliminate this overhead. But in the meantime we can
mitigate the performance overhead by changing the Python access patterns
to avoid the operation object creation. This commit adds some new getter
methods to DAGOpNode to give access to the inner rust data so that we
can avoid the extra overhead. As a proof of concept this updates the
unitary synthesis pass in isolation. Doing this fixes the regression
caused by #12459 for that pass. We can continue this migration for
everything else in follow up PRs. This commit is mostly to establish the
pattern and add the python space access methods.

* Remove unused import

* Add path to avoid StandardGate conversion in circuit_to_dag

* Add fast path through dag_to_circuit

127 of 181 new or added lines in 9 files covered. (70.17%)

2 existing lines in 1 file now uncovered.

64513 of 71832 relevant lines covered (89.81%)

300582.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.67
/crates/circuit/src/dag_node.rs


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc