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

Qiskit / qiskit-terra / 5612493343
86%
main: 87%

Build:
Build:
LAST BUILD BRANCH: sparsepauliop_default_init
DEFAULT BRANCH: main
Ran 20 Jul 2023 03:25PM UTC
Jobs 1
Files 1266
Run time 39s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
5612493343

push

github

web-flow
Improve parameter-binding performance of large instructions (#10284)

* Improve parameter-binding performance of large instructions

Previously, the parameter-assignment methods of `QuantumCircuit` had
poor performance when an instruction had a complex definition that
involved many of the parameters being bound.  The strategy of binding
each parameter separately led to each definition being copied and
rebound multiple times, with each rebinding being recursive all the way
down.

This commit makes the definition rebinding happen only once per
instruction, and updates the data model used to make it a complete
recursion through `QuantumCircuit.assign_parameters`.  This has the side
effect of fixing an issue where internal global phases would not be
updated.

The algorithmic change that enables this (just rebind the definition at
the end) is rather simpler than the length of this patch suggests.  This
is just because the previous structure of separating out a single
`_assign_parameter` method made it harder to restructure the logic
without introducing unpleasant stateful coupling between the driver and
helper methods.  Instead, I inlined most of the helper functions into
the driver body, so we can treat some components of the binding in a
per-parameter way and some in a per-operation way, in whatever way is
better.

* Fix lint

* Reduce overhead from input normalisation

This reduces several costs in the input normalisation, and makes the
calculation of some properties lazy for the sequence-like inputs; for
many close-to-hardware circuits such as those used in PEC, the sequence
form of parameter input is more natural, and almost no instructions will
have internally parametrised definitions, nor will there be a
parametrised global phase or calibrations.  In these cases, we can avoid
overhead from eagerly normalising the input into the forms that's easier
for these less-common assignment operations to use.

As a side-effect of the abstraction, we can also a... (continued)

115 of 115 new or added lines in 8 files covered. (100.0%)

72939 of 84747 relevant lines covered (86.07%)

58907.03 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5612493343.1 20 Jul 2023 03:24PM UTC 0
86.07
GitHub Action Run
Source Files on build 5612493343
Detailed source file information is not available for this build.
  • Back to Repo
  • 7c1b8ee4 on github
  • Prev Build on gh-readonly-queue/main/pr-10406-94cb65e97fc11c602892c280ca5ae744c1286698 (#5612378836)
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