Program

class squidasm.sim.stack.program.ProgramContext(netqasm_connection, csockets, epr_sockets, app_id)

Container object for providing the correct NetQASM connection and sockets to a program.

property connection: BaseNetQASMConnection

Returns the NetQASM connection for the host.

property csockets: Dict[str, Socket]

Returns a dictionary of available classical sockets for the program. The dictionary keys are the stack names.

property epr_sockets: Dict[str, EPRSocket]

Returns a dictionary of available epr sockets for the program. The dictionary keys are the stack names.

property app_id: int

Returns the ID of the app.

class squidasm.sim.stack.program.ProgramMeta(name, csockets, epr_sockets, max_qubits)

Contains various meta information regarding the program.

name: str

Name of the program.

csockets: List[str]

List of nodes names with whom the program uses a classical connection.

epr_sockets: List[str]

List of nodes names with whom the program uses a quantum connection.

max_qubits: int

The number of qubits that the program requires.

class squidasm.sim.stack.program.Program

Base class defining an interface for application programs to adhere to.

property meta: ProgramMeta

Request program meta information.

run(context)

Run the program.

Parameters:

context (ProgramContext) – The context objects for the Program. The context objects are specific for a node.

Return type:

Dict[str, Any]

Returns:

A dictionary of outputs desired for postprocessing.