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

Qiskit / qiskit / 6240841904
88%

Build:
DEFAULT BRANCH: main
Ran 19 Sep 2023 09:28PM UTC
Jobs 1
Files 1268
Run time 23s
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

19 Sep 2023 07:41PM UTC coverage: 87.277% (+0.001%) from 87.276%
6240841904

push

github

web-flow
Use singletons for standard library unparameterized, non-controlled gates (#10314)

* Use singletons for standard library unparameterized, non-controlled gates

This commit adds a new class SingletonGate which is a Gate subclass that
reuses a single instance by default for all instances of a particular
class. This greatly reduces the memory overhead and significant improves
the construction speed for making multiple instances of the same gate.
The tradeoff is in the flexibility of use because it precludes having
any potentially mutable state in the shared instance. This is a large
change to the data model of qiskit because it previously could be
assumed that any gate instance was unique and there weren't any
unintended side effects from modifying it in isolation (for example
doing XGate().label = 'foo' wouldn't potentially break other code).
To limit the impact around this instances of SingletonGate do not allow
mutation of an existing instance. This can (and likely will) cause
unexpected issues as usage of the class is released. Specifically what
used to be valid will now raise an exception because it is a shared
instance. This is evident from the code modifications necessary to
most of the Qiskit code base to enable working with instances of
SingletonGates. The knock on effects of this downstream are likely
significant and managing how we roll this feature out is going to be
equally if not more important than the feature itself. This is why
I'm not personally convinced we want to do all this commit includes
in a single release. I've opened this as a pull request primarily to
start the conversation on how we want to do the roll out to try and
minimize and notify downstream users of the potential breakage to
avoid issues. The primary issue I have is this doesn't really follow
the Qiskit deprecation policy as there is no user facing notification
or documentation of this pending change and code that worked in the
previously release will not work in the ... (continued)

275 of 275 new or added lines in 29 files covered. (100.0%)

74315 of 85148 relevant lines covered (87.28%)

96472.5 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6240841904.1 19 Sep 2023 09:28PM UTC 0
87.28
GitHub Action Run
Source Files on build 6240841904
Detailed source file information is not available for this build.
  • Back to Repo
  • e62c86bb on github
  • Prev Build on main (#6209701566)
  • Next Build on main (#6246166195)
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