def main(): # In this example, we are Bob. myName = "Repeater1" # This file defines the network of virtual quantum nodes simulaqron_path = get_simulaqron_path.main() virtualFile = os.path.join(simulaqron_path, "config/virtualNodes.cfg") # This file defines the nodes acting as servers in the classical communication network classicalFile = "repeater1_classical_net.cfg" # Read configuration files for the virtual quantum, as well as the classical network virtualNet = socketsConfig(virtualFile) classicalNet = socketsConfig(classicalFile) # Check if we should run a local classical server. If so, initialize the code # to handle remote connections on the classical communication network if myName in classicalNet.hostDict: lNode = localNode(classicalNet.hostDict[myName], classicalNet) logging.debug("LOCAL %s: Initialise a classical server..: %s.", myName, lNode) else: lNode = None logging.debug("LOCAL %s: No initialisation of classical server..: %s.", myName, lNode) # Set up the local classical server if applicable, and connect to the virtual # node and other classical servers. Once all connections are set up, this will # execute the function runClientNode setup_local(myName, virtualNet, classicalNet, lNode, runClientNode)
def main(): # In this example, we are YOURNAME myName = "Charlie" # This file defines the network of virtual quantum nodes simulaqron_path = get_simulaqron_path.main() virtualFile = os.path.join(simulaqron_path, "config/virtualNodes.cfg") # This file defines the nodes acting as servers in the classical communication network classicalFile = os.path.join(os.path.dirname(__file__), "classicalNet.cfg") # Read configuration files for the virtual quantum, as well as the classical network virtualNet = socketsConfig(virtualFile) classicalNet = socketsConfig(classicalFile) # Check if we should run a local classical server. If so, initialize the code # to handle remote connections on the classical communication network if myName in classicalNet.hostDict: lNode = localNode(classicalNet.hostDict[myName], classicalNet) else: lNode = None # Set up the local classical server if applicable, and connect to the virtual # node and other classical servers. Once all connections are set up, this will # execute the function runClientNode setup_local(myName, virtualNet, classicalNet, lNode, runClientNode)
def main(): # In this example, we are Bob. myName = "Bob" # This file defines the network of virtual quantum nodes network_file = simulaqron_settings.network_config_file # This file defines the nodes acting as servers in the classical communication network classicalFile = "classicalNet.cfg" # Read configuration files for the virtual quantum, as well as the classical network virtualNet = socketsConfig(network_file) classicalNet = socketsConfig(classicalFile) # Check if we should run a local classical server. If so, initialize the code # to handle remote connections on the classical communication network if myName in classicalNet.hostDict: lNode = localNode(classicalNet.hostDict[myName], classicalNet) else: lNode = None # Set up the local classical server if applicable, and connect to the virtual # node and other classical servers. Once all connections are set up, this will # execute the function runClientNode setup_local(myName, virtualNet, classicalNet, lNode, runClientNode)
def setup_node(name, node_code, classical_net_file, send_end): # This file defines the network of virtual quantum nodes virtualFile = os.path.join(os.path.dirname(__file__), "configs", "network.json") # This file defines the nodes acting as servers in the classical communication network classicalFile = os.path.join(os.path.dirname(__file__), "configs", classical_net_file) # Read configuration files for the virtual quantum, as well as the classical network virtualNet = SocketsConfig(virtualFile) classicalNet = SocketsConfig(classicalFile) # Check if we should run a local classical server. If so, initialize the code # to handle remote connections on the classical communication network if name in classicalNet.hostDict: lNode = localNode(classicalNet.hostDict[name], classicalNet) else: lNode = None # Set up the local classical server if applicable, and connect to the virtual # node and other classical servers. Once all connections are set up, this will # execute the function runClientNode setup_local(name, virtualNet, classicalNet, lNode, node_code, send_end)