Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QuantumCircuit.noop for instructionless qubit use #13774

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jakelishman
Copy link
Member

Summary

This closes a usability gap between the low-level construction of control-flow ops and the builder interface. In the builder interface, there was previously no way to consider a qubit to be "used" by the scope without adding some corresponding instruction on it. It was possible to express this already by manually constructing the blocks.

In general, this is not so useful for the control-flow operations that we already have present because the additional dependency is spurious and simply stymies some ability to perform optimisations. It is also a fair optimisation to remove the spurious data dependency in the transpiler. It becomes more useful with the upcoming box, however; this has additional semantics around its incident data dependencies.

Details and comments

Close #13767.

This closes a usability gap between the low-level construction of
control-flow ops and the builder interface.  In the builder interface,
there was previously no way to consider a qubit to be "used" by the
scope without adding some corresponding instruction on it.  It was
possible to express this already by manually constructing the blocks.

In general, this is not so useful for the control-flow operations that
we already have present because the additional dependency is spurious
and simply stymies some ability to perform optimisations.  It is also a
fair optimisation to remove the spurious data dependency in the
transpiler.  It becomes more useful with the upcoming `box`, however;
this has additional semantics around its incident data dependencies.
@jakelishman jakelishman added Changelog: New Feature Include in the "Added" section of the changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library labels Jan 31, 2025
@jakelishman jakelishman added this to the 2.0.0 milestone Jan 31, 2025
@jakelishman jakelishman requested a review from a team as a code owner January 31, 2025 13:50
@qiskit-bot
Copy link
Collaborator

One or more of the following people are relevant to this code:

  • @Qiskit/terra-core

@jakelishman
Copy link
Member Author

Medium priority because it's part of the high-priority box epic, but technically not an absolutely hard requirement for fulfilment of the minimal viable implementation.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 13074080595

Details

  • 11 of 11 (100.0%) changed or added relevant lines in 2 files are covered.
  • 19 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.02%) to 88.811%

Files with Coverage Reduction New Missed Lines %
crates/accelerate/src/two_qubit_decompose.rs 1 92.08%
crates/accelerate/src/unitary_synthesis.rs 1 92.97%
crates/qasm2/src/lex.rs 5 91.73%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 13072040346: -0.02%
Covered Lines: 79767
Relevant Lines: 89817

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog mod: circuit Related to the core of the `QuantumCircuit` class or the circuit library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add convenience method to include an idle bit in control-flow builders
3 participants