3333
3434from simulaqron .local .setup import setup_local , assemble_qubit
3535from simulaqron .general .host_config import SocketsConfig
36- from simulaqron .settings import simulaqron_settings
36+ from simulaqron .settings import simulaqron_settings , network_config , LOCAL_SIMULAQRON_SETTINGS , LOCAL_NETWORK_SETTINGS
37+ from simulaqron .settings .network_config import NodeConfigType
3738from simulaqron .toolbox .stabilizer_states import StabilizerState
3839from twisted .internet .defer import inlineCallbacks
3940from twisted .spread import pb
@@ -116,15 +117,15 @@ def remote_recover_teleport(self, a, b, virtualNum):
116117 (realRho , imagRho ) = yield eprB .callRemote ("get_qubit" )
117118 state = np .array (assemble_qubit (realRho , imagRho ), dtype = complex )
118119 elif simulaqron_settings .sim_backend .value == "projectq" :
119- realvec , imagvec = yield self .virtRoot .callRemote ("get_register_RI" , eprB )
120+ _ , ( realvec , imagvec ) = yield self .virtRoot .callRemote ("get_register_RI" , eprB )
120121 state = [r + (1j * j ) for r , j in zip (realvec , imagvec )]
121122 elif simulaqron_settings .sim_backend .value == "stabilizer" :
122123 array , _ , = yield self .virtRoot .callRemote ("get_register_RI" , eprB )
123124 state = StabilizerState (array )
124125 else :
125126 ValueError (f"Unknown backend { simulaqron_settings .sim_backend } " )
126127
127- print (f"Qubit is:\n { state } " )
128+ print (f"Qubit is: \n { state } " )
128129
129130
130131#####################################################################################################
@@ -137,14 +138,20 @@ def main():
137138 myName = "Bob"
138139
139140 # This file defines the network of virtual quantum nodes
140- network_file = simulaqron_settings .network_config_file
141+ # network_file = simulaqron_settings.network_config_file
142+ # virtualNet = SocketsConfig(network_file)
141143
142144 # This file defines the nodes acting as servers in the classical communication network
143- classicalFile = "classicalNet.cfg"
145+ # classicalFile = "classicalNet.cfg"
146+ # classicalNet = SocketsConfig(classicalFile)
147+
148+ # We load the local configuration files
149+ simulaqron_settings .load_from_file (LOCAL_SIMULAQRON_SETTINGS )
150+ network_config .read_from_file (LOCAL_NETWORK_SETTINGS )
144151
145152 # Read configuration files for the virtual quantum, as well as the classical network
146- virtualNet = SocketsConfig (network_file )
147- classicalNet = SocketsConfig (classicalFile )
153+ virtualNet = SocketsConfig (network_config , config_type = NodeConfigType . VNODE )
154+ classicalNet = SocketsConfig (network_config , config_type = NodeConfigType . APP )
148155
149156 # Check if we should run a local classical server. If so, initialize the code
150157 # to handle remote connections on the classical communication network
0 commit comments