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#

QuantumNetworkClient.request_qubits(amount)

Creates the specified amount of qubits for the client's backend.

QuantumNetworkClient.run(qc[, shots])

Runs a QuantumCircuit on the client's backend.

QuantumNetworkClient.get_clear_qc()

Returns a QuantumCircuit containing all the qubits that belong to the client at the moment.

QuantumNetworkClient.send_qubits(recipient, ...)

Sends the specified qubits to another participant of the network.

QuantumNetworkClient.inbox()

Returns a list of tuples containing the received qubits and their annotations.

QuantumNetworkClient.get_overall_qc()

Retrieves the QuantumCircuit of all operations that happened in the network so far.