|
27 | 27 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
28 | 28 | # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | 29 |
|
30 | | -import os |
31 | 30 | import logging |
32 | 31 |
|
33 | 32 | from simulaqron.local.setup import setup_local |
34 | 33 | from simulaqron.general.host_config import SocketsConfig |
35 | | -from simulaqron.settings import simulaqron_settings |
| 34 | +from simulaqron.settings import network_config |
36 | 35 | from twisted.internet.defer import inlineCallbacks |
37 | 36 | from twisted.spread import pb |
38 | 37 | from twisted.internet import reactor |
@@ -71,7 +70,7 @@ def runClientNode(qReg, virtRoot, myName, classicalNet): |
71 | 70 | # Send qubit B to Bob |
72 | 71 | # Instruct the virtual node to transfer the qubit |
73 | 72 | remoteNum = yield virtRoot.callRemote("send_qubit", qB, "Bob") |
74 | | - logging.debug("LOCAL {}: Remote qubit is %d.", myName, remoteNum) |
| 73 | + logging.debug("LOCAL %s: Remote qubit is %d.", myName, remoteNum) |
75 | 74 |
|
76 | 75 | # Tell Bob the number of the virtual qubit so the can use it locally |
77 | 76 | # and extend it to a GHZ state with Charlie |
@@ -120,15 +119,12 @@ def main(): |
120 | 119 | # In this example, we are Alice. |
121 | 120 | myName = "Alice" |
122 | 121 |
|
123 | | - # This file defines the network of virtual quantum nodes |
124 | | - network_file = simulaqron_settings.network_config_file |
| 122 | + # This file defines the network of virtual quantum nodes and the network used for classical communication |
| 123 | + network_config.read_from_file("classicalNet.json") |
125 | 124 |
|
126 | | - # This file defines the nodes acting as servers in the classical communication network |
127 | | - classicalFile = os.path.join(os.path.dirname(__file__), "classicalNet.cfg") |
128 | | - |
129 | | - # Read configuration files for the virtual quantum, as well as the classical network |
130 | | - virtualNet = SocketsConfig(network_file) |
131 | | - classicalNet = SocketsConfig(classicalFile) |
| 125 | + # Using the config, we then get the right sockets configuration type |
| 126 | + virtualNet = SocketsConfig(network_config, network_name="default", config_type="vnode") |
| 127 | + classicalNet = SocketsConfig(network_config, network_name="default", config_type="app") |
132 | 128 |
|
133 | 129 | # Check if we should run a local classical server. If so, initialize the code |
134 | 130 | # to handle remote connections on the classical communication network |
|
0 commit comments