You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The work to generate QIR that is compliant with the Adaptive Profile specification can be divided into a few major categories.
Runtime Capabilities Analysis (RCA)
RCA is the process of determining the capabilities a quantum kernel needs to be able to run a particular program. RCA also identifies program elements that can be pre-computed before execution on a quantum kernel and does not consider these elements when determining the capabilities.
Once RCA has identified the capabilities needed to run a particular program, it can be used to check whether the program can run on a particular target, and if not, provide compile-time feedback to the user about why.
Partial evaluation is the process of generating a residual program by evaluating all purely classical computations. It starts with an entry expression for a program in the Flattened Intermediate Representation (FIR), uses RCA to identify purely classical computations and produces a program in the Residualized Intermediate Representation (RIR).
Some patterns might require enough complexity to eliminate or transform that they are better separated into RIR -> RIR transformation passes. This allows both the Partial Evaluation that precedes this step and the QIR Generation that follows to remain focused on their specific complexities.
Block optimization pass that eliminates trivial jumps (blocks with only one successor, where that successor has only one predecessor) (RIR simplify control flow pass #1407)
QIR Generation
Once the compiler has performed partial evaluation and transformed the program into RIR, the compiler uses it as input to the code generation step, which produces specification-compliant QIR in text form.
)
In order to support adaptive profile selection in VS we have to add
`Adaptive` as a compilation attribute in the std lib. This is a
workaround until we design a full solution to address #996. This PR adds
adaptive as a profile.
Functionality to enable adaptive profile VSCode is hidden behind a
config value, as is using the preview QIR code generation from VSCode.
QIR generation for Adaptive/Unrestricted from Python will continue to
raise exceptions.
Adaptive is a profile allowed in the Python APIs, but warnings will be
issued to users indicating that this functionality is in preview.
The language service will surface RCA errors in VSCode and Python, but
not the Notebooks (will be handled in a follow up PR).
Other integration features are being tracked in #1294 and this PR is not
expected to have all functionality enabled.
---------
Co-authored-by: Alex Hansen <[email protected]>
Co-authored-by: Stefan J. Wernli <[email protected]>
Co-authored-by: Mine Starks <[email protected]>
The work to generate QIR that is compliant with the Adaptive Profile specification can be divided into a few major categories.
Runtime Capabilities Analysis (RCA)
RCA is the process of determining the capabilities a quantum kernel needs to be able to run a particular program. RCA also identifies program elements that can be pre-computed before execution on a quantum kernel and does not consider these elements when determining the capabilities.
Runtime Capabilities Check Pass
Once RCA has identified the capabilities needed to run a particular program, it can be used to check whether the program can run on a particular target, and if not, provide compile-time feedback to the user about why.
Partial Evaluation
Partial evaluation is the process of generating a residual program by evaluating all purely classical computations. It starts with an entry expression for a program in the Flattened Intermediate Representation (FIR), uses RCA to identify purely classical computations and produces a program in the Residualized Intermediate Representation (RIR).
Backend
trait #1332).Controlled
functor in partial evaluation #1452).Unimplemented
error (Switch early return toUnimplemented
in Partial Eval #1544).RIR Transformation Passes
Some patterns might require enough complexity to eliminate or transform that they are better separated into RIR -> RIR transformation passes. This allows both the Partial Evaluation that precedes this step and the QIR Generation that follows to remain focused on their specific complexities.
QIR Generation
Once the compiler has performed partial evaluation and transformed the program into RIR, the compiler uses it as input to the code generation step, which produces specification-compliant QIR in text form.
Integration
As the other four major pieces are completed, they can start being integrated into the rest of the QDK.
Unrestricted
andBase
. (Initial integration of RCA, preview QIR gen, and adaptive profile #1347)End-to-end Testing
Release
Related Items
The text was updated successfully, but these errors were encountered: