QuantumNetworkClient#
- class QuantumNetworkClient(name, socket_ip, port=None)[source]#
This class allows connecting to Qrisp quantum networks.
- Parameters
- namestr
A nickname such as “Alice” or “Bob”, which is used to direct the communication of other users to you.
- socket_ipstr
The IP adress of the QuantumNetworkServer.
- portint, optional
The port of the QuantumNetworkServer. The default is 7070.
Examples
We create a QuantumNetworkServer listening on the localhost IP-address and connect the client.
>>> from qrisp.quantum_network import QuantumNetworkServer, QuantumNetworkClient >>> local_server = QuantumNetworkServer("127.0.0.1", background = True) >>> local_server.start() >>> client = QuantumNetworkClient(name = "alice", socket_ip = "127.0.0.1")
Methods#
Creates the specified amount of qubits for the client's backend. |
|
|
Runs a QuantumCircuit on the client's backend. |
Returns a QuantumCircuit containing all the qubits that belong to the client at the moment. |
|
|
Sends the specified qubits to another participant of the network. |
Returns a list of tuples containing the received qubits and their annotations. |
|
Retrieves the QuantumCircuit of all operations that happened in the network so far. |