Skip to content

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

@swernli

Description

@swernli

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions