qcs_sdk.qpu.isa

class Architecture:

Represents the logical underlying architecture of a quantum processor.

The architecture is defined in detail by the nodes and edges that constitute the quantum processor. This defines the set of all nodes that could be operated upon, and indicates to some approximation their physical layout. The main purpose of this is to support geometry calculations that are independent of the available operations, and rendering ISA-based information. Architecture layouts are defined by the family, as follows.

The "Aspen" family of quantum processor indicates a 2D planar grid layout of octagon unit cells. The node_id in this architecture is computed as \( 100 p_y + 10 p_x + p_u \) where \( p_y \) is the zero-based Y position in the unit cell grid, \( p_x \) is the zero-based X position in the unit cell grid, and \( p_u \) is the zero-based position in the octagon unit cell and always ranges from 0 to 7.

The "Ankaa" architecture is based on a grid topology; having, in "vertical" orientation, qubits numbered starting from 0 at the top-left and increasing from left to right, then top to bottom, so the final qubit is in the bottom-right. Each qubit is connected with a tunable coupler to their direct vertical and horizontal neighbors, producing an edge. Edges are ordered top-left to bottom-right in this orientation as well, with horizontal rows alternating with vertical rows. Ankaa chips are, in vertical orientation, 7 qubits wide and 12 tall. This architecture may also be presented in "landscape" orientation, which is a simple 90-degree clockwise rotation of the vertical orientation.

Note that the operations that are actually available are defined entirely by Operation instances. The presence of a node or edge in the Architecture model provides no guarantee that any 1Q or 2Q operation will be available to users writing QUIL programs.

edges

A list of all computational edges in the instruction set architecture.

nodes

A list of all computational nodes in the instruction set architecture.

family

The architecture family. The nodes and edges conform to this family.

class Characteristic:

A measured characteristic of an operation.

error

The error in the characteristic value, or None otherwise.

value

The characteristic value measured.

node_ids

The list of architecture node ids for the site where the characteristic is measured, if that is different from the site of the enclosing operation. None if it is the same. The order of this or the enclosing node ids obey the definition of node symmetry from the enclosing operation.

parameter_values

The optional ordered list of parameter values used to generate the characteristic. The order matches the parameters in the enclosing operation, and so the lengths of these two lists must match.

timestamp

The date and time at which the characteristic was measured.

name

The name of the characteristic.

class Edge:

A degree-two logical connection in the quantum processor's architecture.

The existence of an edge in the ISA Architecture does not necessarily mean that a given 2Q operation will be available on the edge. This information is conveyed by the presence of the two node_id values in instances of Instruction.

Note that edges are undirected in this model. Thus edge \( (a, b) \) is equivalent to edge \( (b, a) \).

node_ids

The integer ids of the computational nodes at the two ends of the edge. Order is not important; an architecture edge is treated as undirected.

class Family:

The architecture family identifier of an InstructionSetArchitecture.

Value 'NONE' implies the architecture has no specific layout topology. Value 'FULL' implies that each node is connected to every other (a fully-connected architecture). For other values based on deployed architecture layouts (e.g. Aspen and Ankaa), refer to the architecture classes themselves for more details.

Note: Within an InstructionSetArchitecture, the family may be one of these, or may be a str for an unknown family, or may be None if the family is not specified. The latter in particular is distinct from the NONE value within this enumeration.

NONE = Family.NONE
FULL = Family.FULL
ASPEN = Family.ASPEN
ANKAA = Family.ANKAA
class InstructionSetArchitecture:

The native instruction set architecture (ISA) of a quantum processor, annotated with characteristics.

The operations described by the instructions field are named by their QUIL instruction name, while the operation described by the benchmarks field are named by their benchmark routine and are a future extension point.

The characteristics that annotate both instructions and benchmarks assist the user to generate the best native QUIL program for a desired task, and so are provided as part of the native ISA.

def from_raw(json):

Deserialize an InstructionSetArchitecture from a json representation.

Errors

Returns [SerializeIsaError] if the input string was not deserialized correctly.

def json(self, /, pretty=False):

Serialize the InstructionSetArchitecture to a json string, optionally pretty-printed.

If pretty is true, the json output should be pretty-printed with newlines and indents.

Errors

Returns [SerializeIsaError] if the ISA could not be serialized.

name

The name of the quantum processor.

architecture
benchmarks

The list of benchmarks that have characterized the quantum processor.

instructions

The list of native QUIL instructions supported by the quantum processor.

class Node:

A logical node in the quantum processor's architecture.

The existence of a node in the ISA Architecture does not necessarily mean that a given 1Q operation will be available on the node. This information is conveyed by the presence of the specific node_id in instances of Instruction.

node_id

An integer id assigned to the computational node.

The ids may not be contiguous and will be assigned based on the architecture family.

class Operation:

An operation, with its sites and site-independent characteristics.

node_count

The number of nodes that this operation applies to. None if unspecified.

parameters

The list of parameters. Each parameter must be uniquely named. May be empty.

name

The name of the operation.

characteristics

The list of site-independent characteristics of this operation.

sites

The list of sites at which this operation can be applied, together with its site-dependent characteristics.

class OperationSite:

A site for an operation, with its site-dependent characteristics.

characteristics

The list of site-dependent characteristics of this operation.

node_ids

The list of architecture node ids for the site.

The order of these node ids obey the definition of node symmetry from the enclosing operation.

class Parameter:

A parameter to an operation.

name

The name of the parameter, such as the name of a mathematical symbol.

class SerializeISAError(qcs_sdk.QcsSdkError):

Errors raised due to failure to serialize an ISA.

class GetISAError(qcs_sdk.QcsSdkError):

Errors raised due to failure to get an ISA.

def get_instruction_set_architecture(quantum_processor_id, client=None):

Fetch the InstructionSetArchitecture (ISA) for a given quantum_processor_id from the QCS API.

Parameters
  • quantum_processor_id: The ID of the quantum processor.
  • client: The Qcs client to use. Creates one using environment configuration if unset - see https: //docs.rigetti.com/qcs/references/qcs-client-configuration
Raises
  • LoadClientError: If client was not provided to the function, and failed to load internally.
  • GetISAError: If there was an issue fetching the ISA from the QCS API.
def get_instruction_set_architecture_async(quantum_processor_id, client=None):

Fetch the InstructionSetArchitecture (ISA) for a given quantum_processor_id from the QCS API.

Parameters
  • quantum_processor_id: The ID of the quantum processor.
  • client: The Qcs client to use. Creates one using environment configuration if unset - see https: //docs.rigetti.com/qcs/references/qcs-client-configuration
Raises
  • LoadClientError: If client was not provided to the function, and failed to load internally.
  • GetISAError: If there was an issue fetching the ISA from the QCS API.