# Language Support

The following describes which Quil syntax is supported on Ankaa-1 and later QPUs.

## Instructions

<table><thead><tr><th width="206">Instruction</th><th width="419">Support</th><th>Updated</th></tr></thead><tbody><tr><td><code>ADD</code>, <code>SUB</code></td><td>Supported for <code>INTEGER</code>s and <code>REAL</code>s.<br><br>Wraps on overflow.<br><br>NB: Prior to November 2024, <code>ADD</code> and <code>SUB</code> were also unintentionally supported on <code>BIT</code>s.  This is not part of the Quil spec; the replacement for both <code>ADD</code> and <code>SUB</code> on <code>BIT</code>s is <code>XOR</code>.</td><td>Nov. 2024</td></tr><tr><td><code>CAPTURE</code></td><td><p>Supported. </p><p></p><p>See <a href="#waveforms">Waveforms</a> below for details.</p></td><td>Sep. 2020</td></tr><tr><td><code>DECLARE</code></td><td>Supported.<br><br>See <a href="#binary-representation">Binary Representation</a> below for details.</td><td></td></tr><tr><td><code>DELAY</code></td><td>Full support.</td><td>Sep. 2020</td></tr><tr><td><code>DIV</code>, <code>MUL</code></td><td><p>Supported:</p><ul><li>for operands of the same data type</li><li>when the latter operand is a literal power of two,  <span class="math">v: -2^{47} &#x3C; v &#x3C; 2^{47}</span>.</li></ul><p>Wraps on overflow.</p></td><td>Dec. 2023</td></tr><tr><td><code>FENCE</code></td><td>Supported.</td><td>Sep. 2020</td></tr><tr><td><code>LOAD</code>, <code>STORE</code></td><td>Supported. <br><br>The dynamic offset value is bounds-checked at runtime to ensure memory safety; if out of bounds, the program terminates with a fixed error code. The region and offset value are not specified in that error code and must be inferred by the program author.</td><td>Dec. 2023</td></tr><tr><td><code>RAW-CAPTURE</code></td><td><p>Supported, with caveats:</p><ul><li>One per program</li><li>No <code>CAPTURE</code> may be present in the program</li><li>Has a maximum duration which may vary based on the current implementation</li></ul><p>This adds a delay to the end of the basic block in which it is invoked, in order to allow enough time for the values to be read from the control system. This time is proportional to the duration of the instruction.<br><br>Some of these limitations are more fundamental than others; contact QCS support if they block you from a useful program.<br><br>Note that the signal read out in this instruction is not from one qubit alone, but from a group of qubits. The groups depend on the device architecture and can be inferred from the Quil frame definition (for Ankaa and later QPUs). Look for the following attribute:<br><br><code>ENABLE-RAW-CAPTURE: "true"</code></p></td><td>Sep. 2020</td></tr><tr><td><code>SET-FREQUENCY</code>, <code>SHIFT-FREQUENCY</code></td><td>Supported.<br><br>Unit: Hertz</td><td>Sep. 2020</td></tr><tr><td><code>SET-PHASE</code>, <code>SHIFT-PHASE</code></td><td>Supported.<br><br>Unit: Radians</td><td>Sep. 2020</td></tr><tr><td><code>SET-SCALE</code></td><td>Supported for literal values.<br><br>Unitless Factor <span class="math">s : -4 ≤ s ≤ 4</span><br><br>Parametric values estimated to be supported in 2024.</td><td>Dec. 2023</td></tr><tr><td><code>SWAP-PHASES</code></td><td>Supported in programs without <a data-mention href="dynamic-control-flow">dynamic-control-flow</a><br></td><td>Dec. 2023</td></tr><tr><td><code>MOVE</code></td><td>Supported between regions of the same data type.</td><td>Dec. 2023</td></tr><tr><td><code>AND</code>, <code>IOR</code>, <code>XOR</code></td><td>Supported for <code>INTEGER</code>s and <code>BIT</code>s.</td><td>Jul. 2024</td></tr><tr><td><code>SHL</code>, <code>SHR</code>, <code>ASHR</code></td><td>Supported for <code>INTEGER</code>s.</td><td>Feb. 2026</td></tr><tr><td><code>EQ</code>, <code>GE</code>, <code>GT</code>, <code>LE</code>, <code>LT</code></td><td>Supported between regions of the same data type.</td><td>Sep. 2024</td></tr><tr><td><code>NEG</code>, <code>NOT</code></td><td>Supported for <code>INTEGER</code> and <code>BIT</code>s.</td><td>Nov. 2024</td></tr><tr><td><code>NOP</code></td><td>Supported, but has no effect on the program.</td><td>Dec. 2023</td></tr><tr><td><code>CONVERT</code></td><td>Not supported.</td><td></td></tr><tr><td><code>LABEL</code><br><br><code>JUMP</code>, <code>JUMP-WHEN</code>, <code>JUMP-UNLESS</code><br><br><code>HALT</code></td><td>Supported.<br><br>Diverging from the Quil spec, jump condition operand may be of any Quil datatype, not only <code>BIT</code>.<br><br>Note that all of these instructions start a new basic block and thus no pulse program timing behavior is guaranteed across one.</td><td>Dec. 2023</td></tr><tr><td><code>EXCHANGE</code></td><td>Not supported.</td><td></td></tr></tbody></table>

## Binary Representation

* All values are encoded into 48 bits within our control system. The encoding depends on the *point of use*, irrespective of the Quil datatype:
  * The *point of use* is the way in which the value is consumed within the program. For example, memory values and literals used as phase values are encoded differently from those used as frequency values.
  * If the value is only used by the Quil program itself - such as a loop index - then it is encoded per its Quil datatype:
    * `BIT`, `OCTET`, `INTEGER` as signed 48-bit
    * `REAL` as s22.22 fixed-point

## PRAGMAs

Unsupported and unrecognized PRAGMAs result in translation errors.

<table><thead><tr><th width="407">PRAGMA</th><th width="341">Support</th></tr></thead><tbody><tr><td><code>FILTER-NODE &#x3C;qubit> "&#x3C;filter spec>"</code></td><td>Configures the execution post-processing pipeline.<br><br>Distributed with Quil calibrations and meant for use by QCS. Editing it is "safe" but may cause unexpected readout values to be returned from execution.</td></tr><tr><td><code>LOAD-MEMORY &#x3C;qubit> &#x3C;memory region></code> </td><td>Maps a qubit's readout stream to a memory regions to mimic shot-wise memory values.<br><br>This mapping is returned to the translation client (e.g. <code>pyquil</code>) for use on the client side. Does not affect program execution.</td></tr><tr><td><code>TSUNAMI-ASSEMBLY "&#x3C;assembly>"</code></td><td>Writes raw control system assembly into the compiled program. Limited to select users; requires special authorization and knowledge for proper use.</td></tr></tbody></table>

## Waveforms
