qrisp.quantum_network.QuantumNetworkClient.get_clear_qc#

QuantumNetworkClient.get_clear_qc()[source]#

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

Note that the qubit names of the run QuantumCircuit are internally extended by the string “@client_name” (if they aren’t extended in this way already). This is to allow multiple clients to submit circuits with matching qubit names.

Note that

Returns
QuantumCircuit

An empty QuantumCircuit containing the qubits, this client may operate on.

Examples

We set up a quantum network, run some QuantumCircuits and retrieve the clear QuantumCircuit:

>>> 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")
>>> from qrisp import QuantumCircuit
>>> qc_0 = QuantumCircuit(1)
>>> qc_0.x(0)
>>> print(qc_0)
      ┌───┐
qb_8: ┤ X ├
      └───┘
>>> client.run(qc_0)
>>> qc_1 = QuantumCircuit(1)
>>> qc_1.h(0)
>>> print(qc_1)
       ┌───┐
qb_26: ┤ H ├
       └───┘
>>> client.run(qc_1)
>>> print(client.get_clear_qc().qubits)
[Qubit(qb_58@alice), Qubit(qb_77@alice)]