netqasm.backend.qnodeos
Quantum node controller interface for simulators.
This module provides the QNodeController class which can be used by simulators as a base class for modeling the quantum node controller.
- class netqasm.backend.qnodeos.QNodeController(name, instr_log_dir=None, flavour=None, **kwargs)
Bases:
objectClass for representing a Quantum Node Controller in a simulation.
A QNodeController represents a physical quantum node controller that handles messages coming from the Host, lets the Executor execute subroutines, and sends results back to the Host.
- Parameters:
name (
str)instr_log_dir (
Optional[str])flavour (
Optional[Flavour])
- __init__(name, instr_log_dir=None, flavour=None, **kwargs)
QNodeController constructor.
- Parameters:
name (
str) – name used for logging purposesinstr_log_dir (
Optional[str]) – directory used to write log files toflavour (
Optional[Flavour]) – which NetQASM flavour this quantum node controller should expect and be able to interpret
- abstract stop()
- Return type:
None
- property finished: bool
- handle_netqasm_message(msg_id, msg)
- Parameters:
msg_id (
int)msg (
Message)
- Return type:
Generator[Any,None,None]
- property has_active_apps: bool
- property network_stack: BaseNetworkStack | None
- add_network_stack(network_stack)
- Parameters:
network_stack (
BaseNetworkStack)- Return type:
None