simulaqron.run package

Submodules

simulaqron.run.run module

simulaqron.run.run.reset(save_loggers=False)[source]

Resets the SimulaQron simulation to a clean state, leaving it ready for a new application execution.

Parameters:

save_loggers (bool) – Whether to save the NetQASM’s struct logs in a file or not.

simulaqron.run.run.run_applications(app_instance: ApplicationInstance, num_rounds: int = 1, network_cfg: str | PathLike | Path = None, nv_cfg: Any = None, log_cfg: LogConfig = None, formalism: Formalism = Formalism.DM, use_app_config: bool = True, post_function: Callable | None = None, enable_logging: bool = True, hardware: Any = None, init_func: Callable = None) List[Dict[str, Any]][source]

Executes functions containing quantum applications.

Parameters:
  • app_instance (ApplicationInstance) – A netqasm.runtime.Application instance containing the names of the nodes and the function that implements the application. The easiest way to create this object is by using the default_app_instance from the netqasm.runtime.application module. Please check the documentation from that method to get more information.

  • num_rounds (int) – Number executions for this simulation.

  • network_cfg (str | Path | PathLike | None) – Path of the network configuration file.

  • nv_cfg (Any) – Unused argument. Any parameter given here will be ignored.

  • log_cfg (LogConfig) – Configuration object for the logging. Check the documentation of LogConfig for more information abut how to configure the logging.

  • formalism (Formalism) – Qubit formalism to use for the simulation. The SimulaQron backend to use depends on this value.

  • use_app_config (bool) – Whether to give app_config as argument to app’s main().

  • post_function (Optional[Callable]) – Function to execute after all rounds have been executed.

  • enable_logging (bool) – Whether to enable logging.

  • hardware (Any) – Unused argument. Any parameter given here will be ignored.

  • init_func (Callable) – Function to execute to initialize the state of the child processes. The implemented executor uses the spawn method for creating new processes. In this sense, the child processes do not receive a copy of the full memory, but only what is needed. In particular, all modules will be reimported in the child processes, hence any state of the classes will not transfer to the child processes.

Returns:

List of dictionaries describing the application names and the simulation results. The i-th entry of the list will correspond to the i-th execution round of the simulation.

Return type:

List[Dict[str, Any]]

Module contents