simulaqron package¶
Subpackages¶
- simulaqron.general package
- simulaqron.local package
- simulaqron.netqasm_backend package
- Submodules
- simulaqron.netqasm_backend.executioner module
NetworkStackUnknownQubitErrorVanillaSimulaQronExecutionerVanillaSimulaQronExecutioner.ROTATION_AXISVanillaSimulaQronExecutioner.SIMULAQRON_OPSVanillaSimulaQronExecutioner.add_factory()VanillaSimulaQronExecutioner.add_return_msg_func()VanillaSimulaQronExecutioner.apply_rotation()VanillaSimulaQronExecutioner.apply_single_qubit_gate()VanillaSimulaQronExecutioner.apply_two_qubit_gate()VanillaSimulaQronExecutioner.cmd_epr()VanillaSimulaQronExecutioner.cmd_epr_recv()VanillaSimulaQronExecutioner.cmd_measure()VanillaSimulaQronExecutioner.cmd_new()VanillaSimulaQronExecutioner.cmd_reset()VanillaSimulaQronExecutioner.factoryVanillaSimulaQronExecutioner.get_error_class()VanillaSimulaQronExecutioner.get_qubit_state()VanillaSimulaQronExecutioner.get_virt_qubit()VanillaSimulaQronExecutioner.get_virt_qubit_num()VanillaSimulaQronExecutioner.new_ent_id()VanillaSimulaQronExecutioner.node_idVanillaSimulaQronExecutioner.remove_qubit_id()VanillaSimulaQronExecutioner.send_epr_half()VanillaSimulaQronExecutioner.send_epr_outcome_half()
VirtualQubitRef
- simulaqron.netqasm_backend.factory module
- simulaqron.netqasm_backend.qnodeos module
- Module contents
- simulaqron.run package
- simulaqron.sdk package
- simulaqron.settings package
- Submodules
- simulaqron.settings.network_config module
NetworkConfigNetworksConfigurationNetworksConfiguration.add_network()NetworksConfiguration.add_network_config()NetworksConfiguration.add_node()NetworksConfiguration.get_node_names()NetworksConfiguration.get_nodes()NetworksConfiguration.network_namesNetworksConfiguration.networksNetworksConfiguration.nodesNetworksConfiguration.read_from_file()NetworksConfiguration.read_from_known_sources()NetworksConfiguration.read_from_legacy_files()NetworksConfiguration.remove_all_networks()NetworksConfiguration.remove_network()NetworksConfiguration.remove_node()NetworksConfiguration.used_socketsNetworksConfiguration.using_default_network()NetworksConfiguration.write_to_file()
NodeConfigNodeConfigTypeget_default_network_config_file()
- simulaqron.settings.simulaqron_config module
SimBackendSimulaqronConfigSimulaqronConfig.conn_max_retriesSimulaqronConfig.conn_retry_timeSimulaqronConfig.default_settings()SimulaqronConfig.log_levelSimulaqronConfig.max_app_waiting_timeSimulaqronConfig.max_qubitsSimulaqronConfig.max_registersSimulaqronConfig.noisy_qubitsSimulaqronConfig.read_from_file()SimulaqronConfig.read_from_known_sources()SimulaqronConfig.recv_max_retriesSimulaqronConfig.recv_retry_timeSimulaqronConfig.recv_timeoutSimulaqronConfig.sim_backendSimulaqronConfig.t1SimulaqronConfig.write_to_file()
get_default_simulaqron_config_file()
- Module contents
- simulaqron.start package
- simulaqron.toolbox package
- Submodules
- simulaqron.toolbox.stabilizer_states module
StabilizerStateStabilizerState.Pauli2boolStabilizerState.Pauli_phase_tracking()StabilizerState.add_qubit()StabilizerState.apply_CNOT()StabilizerState.apply_CZ()StabilizerState.apply_H()StabilizerState.apply_K()StabilizerState.apply_S()StabilizerState.apply_X()StabilizerState.apply_Y()StabilizerState.apply_Z()StabilizerState.apply_sqrt_IZ()StabilizerState.apply_sqrt_minIX()StabilizerState.bool2PauliStabilizerState.bool2phaseStabilizerState.boolean_gaussian_elimination()StabilizerState.check_symplectic()StabilizerState.contains()StabilizerState.find_SQC_equiv_graph_state()StabilizerState.measure()StabilizerState.num_qubitsStabilizerState.phase2boolStabilizerState.put_in_standard_form()StabilizerState.tensor_product()StabilizerState.to_array()StabilizerState.to_string()
- Module contents
- simulaqron.virt_node package
- Submodules
- simulaqron.virtual_node.basics module
NoQubitErrorQuantumEngineQuantumEngine.absorb()QuantumEngine.absorb_parts()QuantumEngine.add_fresh_qubit()QuantumEngine.add_qubit()QuantumEngine.apply_CNOT()QuantumEngine.apply_CPHASE()QuantumEngine.apply_H()QuantumEngine.apply_K()QuantumEngine.apply_T()QuantumEngine.apply_X()QuantumEngine.apply_Y()QuantumEngine.apply_Z()QuantumEngine.apply_onequbit_gate()QuantumEngine.apply_rotation()QuantumEngine.apply_twoqubit_gate()QuantumEngine.get_density_matrix_RI()QuantumEngine.get_register_RI()QuantumEngine.measure_qubit()QuantumEngine.measure_qubit_inplace()QuantumEngine.remove_qubit()QuantumEngine.replace_qubit()
QuantumErrorVirtNetError
- simulaqron.virtual_node.project_q_simulator module
ProjectQEngineProjectQEngine.absorb()ProjectQEngine.absorb_parts()ProjectQEngine.add_fresh_qubit()ProjectQEngine.add_qubit()ProjectQEngine.apply_CNOT()ProjectQEngine.apply_CPHASE()ProjectQEngine.apply_H()ProjectQEngine.apply_K()ProjectQEngine.apply_T()ProjectQEngine.apply_X()ProjectQEngine.apply_Y()ProjectQEngine.apply_Z()ProjectQEngine.apply_onequbit_gate()ProjectQEngine.apply_rotation()ProjectQEngine.apply_twoqubit_gate()ProjectQEngine.get_density_matrix_RI()ProjectQEngine.get_register_RI()ProjectQEngine.measure_qubit()ProjectQEngine.measure_qubit_inplace()ProjectQEngine.remove_qubit()ProjectQEngine.replace_qubit()
- simulaqron.virtual_node.quantum module
SimulatedQubitSimulatedQubit.isLocked()SimulatedQubit.lock()SimulatedQubit.make_fresh()SimulatedQubit.remote_apply_H()SimulatedQubit.remote_apply_K()SimulatedQubit.remote_apply_T()SimulatedQubit.remote_apply_X()SimulatedQubit.remote_apply_Y()SimulatedQubit.remote_apply_Z()SimulatedQubit.remote_apply_rotation()SimulatedQubit.remote_cnot_onto()SimulatedQubit.remote_cphase_onto()SimulatedQubit.remote_get_density_matrix_RI()SimulatedQubit.remote_get_details()SimulatedQubit.remote_get_number()SimulatedQubit.remote_get_numbers()SimulatedQubit.remote_get_qubit()SimulatedQubit.remote_get_register()SimulatedQubit.remote_get_register_RI()SimulatedQubit.remote_get_sim_number()SimulatedQubit.remote_isActive()SimulatedQubit.remote_isLocked()SimulatedQubit.remote_lock()SimulatedQubit.remote_measure()SimulatedQubit.remote_measure_inplace()SimulatedQubit.remote_unlock()SimulatedQubit.unlock()
- simulaqron.virtual_node.qutip_simulator module
QutipEngineQutipEngine.absorb()QutipEngine.absorb_parts()QutipEngine.add_fresh_qubit()QutipEngine.add_qubit()QutipEngine.apply_CNOT()QutipEngine.apply_CPHASE()QutipEngine.apply_H()QutipEngine.apply_K()QutipEngine.apply_T()QutipEngine.apply_X()QutipEngine.apply_Y()QutipEngine.apply_Z()QutipEngine.apply_onequbit_gate()QutipEngine.apply_rotation()QutipEngine.apply_twoqubit_gate()QutipEngine.get_density_matrix_RI()QutipEngine.get_qubits()QutipEngine.get_qubits_RI()QutipEngine.get_register_RI()QutipEngine.measure_qubit()QutipEngine.measure_qubit_inplace()QutipEngine.remove_qubit()QutipEngine.replace_qubit()
- simulaqron.virtual_node.stabilizer_simulator module
StabilizerEngineStabilizerEngine.absorb()StabilizerEngine.absorb_parts()StabilizerEngine.activeQubitsStabilizerEngine.add_fresh_qubit()StabilizerEngine.add_qubit()StabilizerEngine.apply_CNOT()StabilizerEngine.apply_CPHASE()StabilizerEngine.apply_H()StabilizerEngine.apply_K()StabilizerEngine.apply_T()StabilizerEngine.apply_X()StabilizerEngine.apply_Y()StabilizerEngine.apply_Z()StabilizerEngine.apply_onequbit_gate()StabilizerEngine.apply_rotation()StabilizerEngine.apply_twoqubit_gate()StabilizerEngine.get_density_matrix_RI()StabilizerEngine.get_register_RI()StabilizerEngine.measure_qubit()StabilizerEngine.measure_qubit_inplace()StabilizerEngine.remove_qubit()StabilizerEngine.replace_qubit()
- simulaqron.virtual_node.virtual module
BackendQubitNetQASMVirtualNodeVirtualNode.connectNet()VirtualNode.connect_to_node()VirtualNode.get_connection()VirtualNode.get_new_reg_num()VirtualNode.handle_connection()VirtualNode.handle_connection_error()VirtualNode.local_merge_regs()VirtualNode.remote_add_qubit()VirtualNode.remote_add_register()VirtualNode.remote_check_connections()VirtualNode.remote_clear_recv_queues()VirtualNode.remote_delete_register()VirtualNode.remote_get_global_lock()VirtualNode.remote_get_multiple_qubits()VirtualNode.remote_get_register()VirtualNode.remote_get_register_RI()VirtualNode.remote_get_register_del()VirtualNode.remote_get_state()VirtualNode.remote_get_virtual_ref()VirtualNode.remote_isLocked()VirtualNode.remote_lock_reg_qubits()VirtualNode.remote_merge_from()VirtualNode.remote_merge_regs()VirtualNode.remote_netqasm_add_epr_list()VirtualNode.remote_netqasm_add_recv_list()VirtualNode.remote_netqasm_get_epr_recv()VirtualNode.remote_netqasm_get_recv()VirtualNode.remote_netqasm_send_epr_half()VirtualNode.remote_netqasm_send_qubit()VirtualNode.remote_new_qubit()VirtualNode.remote_new_qubit_inreg()VirtualNode.remote_new_register()VirtualNode.remote_release_global_lock()VirtualNode.remote_remove_sim_qubit_num()VirtualNode.remote_send_qubit()VirtualNode.remote_sim_qubit_num_in_same_reg()VirtualNode.remote_stop_vnode()VirtualNode.remote_transfer_qubit()VirtualNode.remote_unlock_reg_qubits()VirtualNode.remote_update_virtual_merge()
VirtualQubitVirtualQubit.remote_apply_H()VirtualQubit.remote_apply_K()VirtualQubit.remote_apply_T()VirtualQubit.remote_apply_X()VirtualQubit.remote_apply_Y()VirtualQubit.remote_apply_Z()VirtualQubit.remote_apply_rotation()VirtualQubit.remote_cnot_onto()VirtualQubit.remote_cphase_onto()VirtualQubit.remote_get_density_matrix_RI()VirtualQubit.remote_get_number()VirtualQubit.remote_get_qubit()VirtualQubit.remote_get_register_RI()VirtualQubit.remote_get_simNode()VirtualQubit.remote_get_virtNode()VirtualQubit.remote_get_virt_num()VirtualQubit.remote_measure()
call_method()reraise_remote_error()
- Module contents
Submodules¶
simulaqron.cli module¶
- class simulaqron.cli.RunningSimulaQronDaemon(pidfile: Path)[source]¶
Bases:
RunDaemonSimulaQronDaemon class used to represent SimulaQron daemons that are already running. This class is useful to stop the already-running daemons without needed to read all the required configurations.
Initialize the daemon with a pidfile.
- class simulaqron.cli.SimulaQronDaemon(pidfile: Path, name: str, nodes: List[str], network_config_file: Path)[source]¶
Bases:
RunDaemonDaemon process that runs a SimulaQron network in the background.
This daemon spawns virtual nodes and QNodeOS servers for each node in the network configuration. It runs until explicitly stopped.
- Parameters:
pidfile (Path) – Path to the PID file used to track the daemon process.
name (str) – Name of the network (e.g., ‘default’).
nodes (List[str]) – List of node names to start (e.g., [‘Alice’, ‘Bob’]).
network_config_file (Path) – Path to the network configuration file.
simulaqron.math module¶
- simulaqron.math.assemble_qubit(realM: ndarray, imagM: ndarray) ndarray[source]¶
Reconstitute the qubit as array from its real and imaginary components given as a list.
- Parameters:
realM (np.ndarray) – Real component of the qubit.
imagM (np.ndarray) – Imaginary component of the qubit.
- Returns:
Assembled qubit as vector of complex numbers.
- Return type:
np.array
simulaqron.network module¶
- class simulaqron.network.Network(nodes: List[str], network_config_file: Path, network_name: str = 'default')[source]¶
Bases:
objectUsed to spin up a simulated network. This class uses the network configuration loaded in the global network_config object and starts the nodes mentioned in the constructor of this class.
- Parameters:
nodes (List[str]) – A list of strings with the node names to start.
network_config_file (str) – Path to network config file (required).
network_name (str) – The name of network to start. Defaults to “default”.
- property processes: List[ForkProcess]¶
- property running: bool¶
Checks whether the network up and running.
- Returns:
True if the network up and running. False otherwise
- Return type:
bool
- simulaqron.network.construct_topology_config(topology: str | Dict | None, nodes: List[str]) Dict[str, List[str]][source]¶
Constructs a dictionary that maps the node names with their neighbours, representing a network topology.
- Parameters:
topology (str | Dict) – The type of topology to generate. Should be one of the following: None, ‘complete’, ‘ring’, ‘random_tree’.
nodes (List[str]) – List of the names of the nodes.
- Returns:
A dictionary where keys are the names of the nodes and values are a list of strings of their neighbors
- Return type:
Dict[str, List[str]]
- simulaqron.network.get_random_connected(nodes: List[str], nr_edges: int) Dict[str, List[str]][source]¶
Constructs a dictionary describing a random connected graph with a specified number of edges, with the name of the vertices are taken from the ‘nodes’
- Parameters:
nodes (List[str]) – Name of the nodes to be used
nr_edges (int) – The number of edges that the graph should have.
- Returns:
A dictionary where keys are the names of the nodes and values are a list of strings of their neighbors
- Return type:
Dict[str, List[str]]
- simulaqron.network.get_random_tree(nodes: List[str]) Dict[str, List[str]][source]¶
Constructs a dictionary describing a random tree, with the name of the vertices are taken from the ‘nodes’
- Parameters:
nodes (List[str]) – Name of the nodes to be used
- Returns:
A dictionary where keys are the names of the nodes and values are a list of strings of their neighbors
- Return type:
Dict[str, List[str]]
simulaqron.reactor module¶
simulaqron.sim_util module¶
- simulaqron.sim_util.get_qubit_state(qubit: Qubit, reduced_dm: bool = True) ndarray[source]¶
Get the state of the qubit, only possible in simulation and can be used for debugging.
Note
The function gets the current state of the qubit(s). So make sure the subroutine is flushed before calling the method.
- Parameters:
qubit (Qubit) – The qubit(s) to get the state of.
reduced_dm (bool) – Unused; declared to keep compatibility with other simulation engines
- Returns:
The state as a density matrix.
- Return type:
np.array