qp.backline.Placement¶
- class Placement(*, controller, coprocessors=(), transport, qec_code=None)[source]¶
Bases:
objectDeclarative placement for heterogeneous execution.
Contains a
controllernode, anycoprocessornodes, and thetransportthat carries data between them. Rather than constructing this directly, useBacklineto assemble a controller, coprocessors, and transport into a device; the resulting placement is available asplacement.Warning
Backlineis experimental and only usable through the Catalyst compiler.- Keyword Arguments:
controller (Controller) – The
Controllerrunning the QNode.coprocessors (Sequence[Coprocessor]) – The
coprocessing accelerators. Defaults to().transport (str | Transport) – Which transport carries data between nodes, as a
Transportor its registry name (e.g."rdma"). A name is resolved on construction, so this reads back as aTransport."none"places the controller alone and cannot be used with coprocessors.qec_code (str | None) – The quantum error-correcting code the circuit is encoded for. Defaults to
None, which leaves the circuit unencoded.
See also
Example
A placement is built for you by
Backlineand read back off the device:>>> con = qp.Controller(name="cpu-controller") >>> coproc = qp.Coprocessor(coprocessor_fn="decoder", endpoint=qp.Endpoint("127.0.0.1", 7760)) >>> dev = qp.Backline(controller=con, coprocessors=[coproc], transport="rdma") >>> dev.placement.transport Transport(name='rdma') >>> dev.placement.controller.name 'cpu-controller' >>> len(dev.placement.coprocessors) 1
coprocessorsaccepts any sequence and is normalized to a tuple, andtransportaccepts either a registry name or aTransport:>>> isinstance(dev.placement.coprocessors, tuple) True
Attributes
The quantum error-correcting code for logical qubit encoding, e.g.
"steane".The
Controllerrunning the QNode.Which transport carries data between nodes.
the controller's
in_byteswhen set, else the size its coprocessors' functions declare (message_bytes), elseDEFAULT_MESSAGE_BYTES.The size in bytes of each reply the controller receives, resolved like
in_bytes.- coprocessors = ()¶
The
coprocessing accelerators. Any sequence is accepted, and is stored as a tuple.
- qec_code = None¶
The quantum error-correcting code for logical qubit encoding, e.g.
"steane". Naming it here lets the compiler encode the circuit, and no separate lowering step is needed. Defaults toNone, which leaves the circuit unencoded.
- controller = <dataclasses._MISSING_TYPE object>¶
The
Controllerrunning the QNode.
- transport = <dataclasses._MISSING_TYPE object>¶
Which transport carries data between nodes. Accepts a
Transport, or its registry name (e.g."rdma"), which is resolved withget_transport()on construction - so this attribute always reads back as aTransport. The transport itself is implemented in the compiled runtime.
- in_bytes = <dataclasses._MISSING_TYPE object>¶
the controller’s
in_byteswhen set, else the size its coprocessors’ functions declare (message_bytes), elseDEFAULT_MESSAGE_BYTES.- Type:
The size in bytes of each message the controller sends to every coprocessor