microsoft / microsoft/qdk

Instruction coersion in QRE

Open
#2,904 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

Instructions in QRE are a primitive, and carry a natural the structure of a type system (all arrow types). As such there is a natural notion of subtypes and supertypes. An already implemented example is H_XZ (ID 0x10) is a subtype of ONE_QUBIT_CLIFFORD (ID 0x50), which in turn is a subtype of GENERIC (ID 0xFFFF). While generally converting one instruction to another requires synthesis (and hence belongs to ISATransform), doing this for simple coersions such as the above is very heavyweight.

A natural approach to coersion would be to add a static database (presumably along with the predefined instruction IDs) that implements valid coersions. The database would need to provide functionality for user added IDs. Querying for valid coersion could be added to the Instruction class. Generators for iterating over superclasses could also be added to the Instruction class, best as a wrapper around such an iterator directly implemented in the database.

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 by locating the Instruction implementation, the predefined instruction IDs, and the existing ISATransform path. Review how H_XZ, ONE_QUBIT_CLIFFORD, and GENERIC are represented, then determine how a coercion database could support both predefined and user-added IDs. Done means valid superclass queries and coercion checks are available through Instruction without requiring synthesis.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, quantum-computing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.