microsoft / microsoft/qdk

Warn or Fail QIR generation when program uses no qubits/measurements

Open
#2,906 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs triage
Dominant language
Rust
Stars
1k
Forks
212
Avg merge
3d 8h
Merged PRs (30d)
65

Description

A quantum program that uses no qubits or performs no measurements is almost never valid, and many backends reject or fail on such programs. Given that, would it make sense to warn or fail earlier during local processing? For example, since we annotate the QIR with the number of qubits and number of measurements, we could emit a Python warning if generating QIR results in a program that is effectively a no-op because of either of those counts being zero. If we want to be even more strict, we could reject these cases entirely and fail QIR codegen with an error for such programs.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at QIR generation, specifically the annotation of qubit and measurement counts described in the issue. Determine the appropriate behavior for programs with zero qubits or zero measurements, then verify the chosen warning or failure behavior for those cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers, quantum-computing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.