Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions specification/under_development/profiles/Adaptive_Profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
well as contributors to the [targeting
stage](../Compilation_And_Targeting.md#targeting) of the QIR compiler.

The Adaptive Profile specifies supersets of the [Base

Check warning on line 10 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (supersets)
Profile](./Base_Profile.md) that enable control flow based on mid-circuit
measurements and classical computations while quantum resources remain coherent.
A backend can support this profile by supporting a minimum set of features
Expand All @@ -20,7 +20,7 @@
1. It can execute a sequence of quantum instructions that transform the quantum
state.
2. A backend must support applying a measurement operation at any point in the
execution of the program. Qubits not undergoing the measurement should not

Check warning on line 23 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (Qubits)
have their state affected.
3. A backend must be able to apply quantum instructions conditionally on a
measurement outcome. Specifically, forward branching using the LLVM branch
Expand Down Expand Up @@ -84,16 +84,16 @@
[`irreversible` attribute](./Base_Profile.md#quantum-instruction-set) that
populates a value of type `%Result`. The available measurement functions are
defined by the executing backend as part of the QIS. Unlike the Base Profile,
the Adaptive Profile relieves a restriction that qubits can only be measured at

Check warning on line 87 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (qubits)
the end of the program and that no quantum operations can be performed after or
conditionally on a measurement outcome.

Within the Adaptive Profile, there are no restrictions on when these
measurements are performed during program execution. Correspondingly, it must be
possible to measure individual qubits, or subsets of qubits depending on the

Check warning on line 93 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (qubits)

Check warning on line 93 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (qubits)
supported QIS, without impacting the state of the non-measured qubits.

Check warning on line 94 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (qubits)
Furthermore, it must be possible to use the measured qubit(s) afterwards and

Check warning on line 95 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (qubit)
apply additional quantum instructions to the same qubit(s).

Check warning on line 96 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (qubit)

### Bullet 3: Forward Branching

Expand All @@ -115,9 +115,9 @@
control flow graph and reject any program with a cycle as invalid unless support
for backward branching is enabled.

While the Adaptive Profile requires that it must be possible to use a qubit

Check warning on line 118 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (qubit)
after it was measured, the availability of a `reset` instruction depends on the
QIS supported by the backend. If a single-qubit measurement is supported as part

Check warning on line 120 in specification/under_development/profiles/Adaptive_Profile.md

View workflow job for this annotation

GitHub Actions / Check spelling, linting and links

Unknown word (qubit)
of the QIS, it is always possible to reset that qubit, if needed for qubit reuse
later in the program, using forward branching as illustrated for example by the
following IR snippet:
Expand Down Expand Up @@ -660,6 +660,7 @@
| `fsub` | Subtracts two floating-point values. | |
| `fmul` | Multiplies two floating-point values. | |
| `fdiv` | Divides two floating-point values. | Division by zero leads to undefined behavior, no support for `NaN`. |
| `fcmp` | Compares two floating-point | Comparision options are `olt`, `ole`, `ogt`, `oge`, `oeq`, `one`, `ord`, `ult`, `ule`, `ugt`, `uge`, `ueq`, `une`, `uno`, `false`, `true`. |
| `fpext .. to` | Casts a value of floating-point type to a larger floating-point type. | May be used at any point in the program if classical computations on both the input and the output type are supported. May only be used as part of a call to an output recording function if computations on the output type are not supported. |
| `fptrunc .. to` | Casts a value of floating-point type to a smaller floating-point type. | May be used at any point in the program if classical computations on both the input and the output type are supported. May only be used as part of a call to an output recording function if computations on the output type are not supported. |

Expand Down Expand Up @@ -699,7 +700,7 @@

| Function | Signature | Description |
| :---------------------------------- | :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| __quantum__rt__float_record_output | `void(double,i8*)` | Records a floating-point value in the generated output. The second parameter defines the string label for the value. Depending on the output schema, the label is included in the output or omitted. |
| __quantum__rt__double_record_output | `void(double,i8*)` | Records a floating-point value in the generated output. The second parameter defines the string label for the value. Depending on the output schema, the label is included in the output or omitted. |

### Output Recording

Expand Down Expand Up @@ -813,8 +814,8 @@
reference to another metadata node that contains a tuple of string literals
of the supported/used floating-point precision(s). For example,
`!0 = !{i32 5, !"float_computations", !1}` and `!1 = !{!"float", !"double"}`.
The precision must be one of the LLVM IEEE-754 floating-point types
("half" (16-bit), "float" (32-bit), "double" (64-bit), "fp128" (128-bit)),
The precision must be one of the LLVM IEEE-754 floating-point types up to 64-bits
(`half` (16-bit), `float` (32-bit), `double` (64-bit)),
and classical computations on floating point numbers of all listed
precisions must be supported by the executing backend. An empty value
indicates that no floating-point computations are supported/used.
Expand Down
Loading