qrisp.quantum_network.QuantumNetworkSession.send_qv#

QuantumNetworkSession.send_qv(qv, recipient)[source]#

Sends a QuantumVariable to another participant of the network.

Parameters
qvQuantumVariable

The QuantumVariable to send.

recipientstr

The name of the recipient.

Examples

We create a QuantumNetworkServer and connect a QuantumNetworkSession to it.

>>> from qrisp.quantum_network import QuantumNetworkServer, QuantumNetworkSession
>>> example_server = QuantumNetworkServer(socket_ip = "127.0.0.1", background = True)
>>> example_server.start()
>>> alice_session = QuantumNetworkSession(socket_ip = "127.0.0.1", port = 7070, name = "alice")
>>> bob_session = QuantumNetworkSession(socket_ip = "127.0.0.1", port = 7070, name = "bob")

We create a QuantumFloat and perform some arithmetic

>>> from qrisp import QuantumFloat
>>> qf = QuantumFloat(4, qs = alice_session)
>>> qf += 3
>>> alice_session.send_qv(qf, "bob")