Skip to content

Instruction coersion in QRE #2904

@brad-lackey

Description

@brad-lackey

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.

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