Skip to content

RFC: structure of bloqade frontends #223

@jon-wurtz

Description

@jon-wurtz

I would like to think about bloqade "front ends" as a way of better directing requirements on the backend/kernel part of bloqade. The key point is that while we do have a front-end, it is mostly focused on building and representing programs through building kernels. We need to ensure that these pieces are easy to integrate with external workflows. I would distinguish the front end as existing primarily in python, with the representations as python scripts and executions within the python kernel.

I've broken down what I see as the major blocks/modules of bloqade, which loosely fits qiskit [1]. A block diagram is here, where boxes represent functions/programs etc. while arrows denote data and representations.

Image

My next step is to start writing out some RFCs for various blocks, which begin to dictate the high level functional requirements of the bloqade SDK. But first this RFC is just to make sure I'm not missing anything big in the general structure of building/executing/analysis.

Builders (representation)

Representing programs, hardware, models, as well as methods to transpile/transform/lower from one representation to another. The initial parts of this are beginning to be covered by Bloqade as it stands now (e.g. kernels generated from decorated Python functions) but there may be more to add, such as transpilation to other SDKs like Qiskit.

Interpreters (execution)

Actually executing or implementing the representation of programs built by the user, either through emulation or submission to hardware. This includes things like state-vector emulation, noise sampling, or error correction simulation.

Program Analysis (analysis)

Instead of literally executing the program as written (as would be done by an interpreter), inspect the program to get metadata and other information to improve the execution. This could include suites of debugging tools, performance analysis, [interactive] program visualization, error thresholds for fault tolerance (though this might be more of data analysis?)

Data Analysis

Tools for manipulating and understanding data generated from simulation and hardware. This is mostly stdlibs of computing expectation values on wavefunctions and bitstrings; computing fidelity, entanglement entropy, and other metrics; postselection and error mitigation; parameter inference and QML tasks.

Everything else (Utilities)

Most things should be (de)serializable as to make it easy to save and load workflows. I'm not sure what else goes here but I'll put out an RFC for it soon anyways.

RFC: Is there anything missing in this structure that I might be missing? Is this 4-block separation a good classification to start building code around?

[1] https://docs.quantum.ibm.com/guides/intro-to-patterns

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriagerequest for triage. A decision will be made on the issue or PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions