diff --git a/benchmarks/benchmark_protocols.py b/benchmarks/benchmark_protocols.py index affbb79f..a59e9b10 100644 --- a/benchmarks/benchmark_protocols.py +++ b/benchmarks/benchmark_protocols.py @@ -30,7 +30,7 @@ def teleport(sender, receiver): for i in range(10): q1 = Qubit(sender) sender.send_teleport(receiver.host_id, q1, await_ack=False, no_ack=True) - q2 = receiver.get_data_qubit(sender.host_id, q1.id, wait=-1) + q2 = receiver.get_qubit(sender.host_id, q1.id, wait=-1) _ = q2.measure() diff --git a/dev_requirements.txt b/dev_requirements.txt index 056d55d9..7d9d8979 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -7,7 +7,7 @@ Babel==2.9.1 backcall==0.1.0 bitstring==3.1.6 bleach==3.3.0 -certifi==2019.6.16 +certifi==2022.12.7 cffi==1.14.0 chardet==3.0.4 Click==7.0 @@ -23,14 +23,14 @@ docutils==0.15.2 entrypoints==0.3 eqsn==0.0.8 flake8==3.7.9 -future==0.18.2 +future==0.18.3 hyperlink==19.0.0 idna==2.8 imagesize==1.1.0 importlib-metadata==1.1.0 incremental==17.5.0 ipykernel==5.1.3 -ipython==7.10.1 +ipython==7.16.3 ipython-genutils==0.2.0 jedi==0.15.1 jeepney==0.4.3 @@ -38,20 +38,20 @@ Jinja2==2.11.3 json5==0.8.5 jsonschema==3.2.0 jupyter-client==6.1.3 -jupyter-core==4.6.3 +jupyter-core==4.11.2 keyring==21.2.1 kiwisolver==1.1.0 MarkupSafe==1.1.1 matplotlib==3.1.2 mccabe==0.6.1 -mistune==0.8.4 +mistune==2.0.3 more-itertools==8.0.0 nbconvert==5.6.1 nbformat==4.4.0 networkx==2.4 nose2==0.9.1 -notebook==6.4.1 -numpy==1.18.1 +notebook==6.4.12 +numpy==1.22.0 packaging==19.1 pandocfilters==1.4.2 parso==0.5.1 @@ -99,7 +99,7 @@ tornado==6.0.3 tqdm==4.46.1 traitlets==4.3.3 twine==3.1.1 -Twisted==20.3.0 +Twisted==22.10.0 urllib3==1.26.5 wcwidth==0.1.7 webencodings==0.5.1 diff --git a/docs/_sources/components/host.rst.txt b/docs/_sources/components/host.rst.txt index bfac628d..4b7738af 100644 --- a/docs/_sources/components/host.rst.txt +++ b/docs/_sources/components/host.rst.txt @@ -17,9 +17,9 @@ The most commonly used methods for Hosts are: * Add a classical and quantum connection to the host with id *host_id* * :code:`get_classical(host_id, wait=N)` * Get a classical message from sender with host_id *host_id* and wait *N* seconds for it -* :code:`get_data_qubit(host_id, wait=N)`: +* :code:`get_qubit(host_id, wait=N)`: * Get a data qubit from sender with host_id *host_id* and wait *N* seconds for it -* :code:`get_data_qubits(host_id)`: +* :code:`get_qubits(host_id)`: * Get all data qubits from sender with host_id *host_id* * :code:`get_epr(host_id, q_id=q_id)`: * Get EPR pair with qubit ID *q_id* from sender with host_id *host_id*. If *q_id=None* then get the first free EPR pair diff --git a/docs/_sources/examples/QKD_B92.rst.txt b/docs/_sources/examples/QKD_B92.rst.txt index 4475fc92..7aa7db18 100644 --- a/docs/_sources/examples/QKD_B92.rst.txt +++ b/docs/_sources/examples/QKD_B92.rst.txt @@ -105,7 +105,7 @@ Bob sends Alice a classical message after the measurement and tells her whether while received_counter < key_size: base = randint(0,1) # 0 means rectilinear basis and 1 means diagonal basis - qubit = bob.get_data_qubit(sender,wait = wait_time) + qubit = bob.get_qubit(sender,wait = wait_time) if qubit is not None: if base == 1: qubit.H() @@ -276,7 +276,7 @@ The full example is given below. while received_counter < key_size: base = randint(0, 1) # 0 means rectilinear basis and 1 means diagonal basis - qubit = bob.get_data_qubit(sender, wait=wait_time) + qubit = bob.get_qubit(sender, wait=wait_time) if qubit is not None: if base == 1: qubit.H() diff --git a/docs/_sources/examples/QKD_BB84.rst.txt b/docs/_sources/examples/QKD_BB84.rst.txt index 1152e542..d83e8707 100644 --- a/docs/_sources/examples/QKD_BB84.rst.txt +++ b/docs/_sources/examples/QKD_BB84.rst.txt @@ -121,9 +121,9 @@ the same bit again, until the transmission works. measurement_base = random.randint(0, 1) # wait for the qubit - q_bit = eve.get_data_qubit(sender, wait=wait_time) + q_bit = eve.get_qubit(sender, wait=wait_time) while q_bit is None: - q_bit = eve.get_data_qubit(sender, wait=wait_time) + q_bit = eve.get_qubit(sender, wait=wait_time) # measure qubit in right measurement basis if measurement_base == 1: @@ -305,7 +305,7 @@ The full example is below: # wait for the qubit q_bit = eve.get_data_qubit(sender, wait=wait_time) while q_bit is None: - q_bit = eve.get_data_qubit(sender, wait=wait_time) + q_bit = eve.get_qubit(sender, wait=wait_time) # measure qubit in right measurement basis if measurement_base == 1: diff --git a/docs/_sources/examples/anonymous_transfer.rst.txt b/docs/_sources/examples/anonymous_transfer.rst.txt index b41cedea..44fe495b 100644 --- a/docs/_sources/examples/anonymous_transfer.rst.txt +++ b/docs/_sources/examples/anonymous_transfer.rst.txt @@ -78,7 +78,7 @@ Finally, we establish the behaviour of the receiver. The receiver here behaves a print('established secret EPR') host.add_epr(s, q, q_id=epr_id) - q = host.get_data_qubit(s, wait=10) + q = host.get_qubit(s, wait=10) host.empty_classical() print('Received qubit %s in the %d state' % (q.id, q.measure())) @@ -142,7 +142,7 @@ Full example: print('established secret EPR') host.add_epr(s, q, q_id=epr_id) - q = host.get_data_qubit(s, wait=10) + q = host.get_qubit(s, wait=10) host.empty_classical() print('Received qubit %s in the %d state' % (q.id, q.measure())) diff --git a/docs/_sources/examples/packet_sniffing.rst.txt b/docs/_sources/examples/packet_sniffing.rst.txt index 74647276..08b92786 100644 --- a/docs/_sources/examples/packet_sniffing.rst.txt +++ b/docs/_sources/examples/packet_sniffing.rst.txt @@ -56,7 +56,7 @@ her messages and measures her qubits. print("Eve Received classical: %s." % alice_message.content) for i in range(amount_to_transmit): - q = host.get_data_qubit('Alice', wait=10) + q = host.get_qubit('Alice', wait=10) m = q.measure() print("Eve measured: %d." % m) @@ -166,7 +166,7 @@ The full example is below. print("Eve Received classical: %s." % alice_message.content) for i in range(amount_transmit): - q = host.get_data_qubit('Alice', wait=10) + q = host.get_qubit('Alice', wait=10) m = q.measure() print("Eve measured: %d." % m) diff --git a/docs/_sources/examples/quantum_coin_flipping.rst.txt b/docs/_sources/examples/quantum_coin_flipping.rst.txt index df74aa0b..349c0b3c 100644 --- a/docs/_sources/examples/quantum_coin_flipping.rst.txt +++ b/docs/_sources/examples/quantum_coin_flipping.rst.txt @@ -78,11 +78,11 @@ received and stored in *partner_qubits*. # send and get q1 from our partner host.send_qubit(partner_id, q1, await_ack=True) - partner_q1 = host.get_data_qubit(partner_id) + partner_q1 = host.get_qubit(partner_id) # send and get q2 from our partner host.send_qubit(partner_id, q2, await_ack=True) - partner_q2 = host.get_data_qubit(partner_id) + partner_q2 = host.get_qubit(partner_id) partner_qubits[i, j, 0] = partner_q1 partner_qubits[i, j, 1] = partner_q2 @@ -124,7 +124,7 @@ and the host returns the quantum state :math:`\Psi_{\bar{a}_j}`. psi_a[i, j] = partner_qubits[i, j, 1] # The partner should send the qubit Ψ_b_j_bar back. - psi_b_bar[i, j] = host.get_data_qubit(partner_id, wait=10) + psi_b_bar[i, j] = host.get_qubit(partner_id, wait=10) After this procedure, the host has m qubits of the state :math:`\Psi_{\bar{b}_j}` and m qubits of :math:`\Psi_{a_j}`, for all j. @@ -284,11 +284,11 @@ The full example is given below. # send and get q1 from our partner host.send_qubit(partner_id, q1, await_ack=True) - partner_q1 = host.get_data_qubit(partner_id) + partner_q1 = host.get_qubit(partner_id) # send and get q2 from our partner host.send_qubit(partner_id, q2, await_ack=True) - partner_q2 = host.get_data_qubit(partner_id) + partner_q2 = host.get_qubit(partner_id) partner_qubits[i, j, 0] = partner_q1 partner_qubits[i, j, 1] = partner_q2 @@ -317,7 +317,7 @@ The full example is given below. psi_a[i, j] = partner_qubits[i, j, 1] # The partner should send the qubit Ψ_b_j_bar back. - psi_b_bar[i, j] = host.get_data_qubit(partner_id, wait=10) + psi_b_bar[i, j] = host.get_qubit(partner_id, wait=10) for j in range(m): # Send own random bits b_j to partner diff --git a/docs/_sources/examples/quantum_money.rst.txt b/docs/_sources/examples/quantum_money.rst.txt index 2fed4e8c..8ccbfae1 100644 --- a/docs/_sources/examples/quantum_money.rst.txt +++ b/docs/_sources/examples/quantum_money.rst.txt @@ -83,7 +83,7 @@ After the bank distributes the money, the customer possesses the money. def receive_money(): for serial in range(NO_OF_SERIALS): for bit_no in range(QUBITS_PER_MONEY): - q = host.get_data_qubit(banker, wait=10) + q = host.get_qubit(banker, wait=10) money_qubits[serial].append(q) print('Customer received money') @@ -135,7 +135,7 @@ that there is a cheating attempt. If measurement results are correct, the bank v print('Serial received by Bank') serial_to_be_checked = message.content for qubit_no in range(QUBITS_PER_MONEY): - q = host.get_data_qubit(customer, wait=10) + q = host.get_qubit(customer, wait=10) if bank_basis[serial_to_be_checked][qubit_no] == 1: q.H() @@ -240,7 +240,7 @@ The full example is below: print('Serial received by Bank') serial_to_be_checked = message.content for qubit_no in range(QUBITS_PER_MONEY): - q = host.get_data_qubit(customer, wait=10) + q = host.get_qubit(customer, wait=10) if bank_basis[serial_to_be_checked][qubit_no] == 1: q.H() @@ -272,7 +272,7 @@ The full example is below: def receive_money(): for serial in range(NO_OF_SERIALS): for bit_no in range(QUBITS_PER_MONEY): - q = host.get_data_qubit(banker, wait=10) + q = host.get_qubit(banker, wait=10) money_qubits[serial].append(q) print('Customer received money') diff --git a/docs/_sources/examples/send_data.rst.txt b/docs/_sources/examples/send_data.rst.txt index 5d86f09b..def0f32f 100644 --- a/docs/_sources/examples/send_data.rst.txt +++ b/docs/_sources/examples/send_data.rst.txt @@ -74,7 +74,7 @@ Dean can safely access the qubit that Alice sent without having to wait. q_id, ack_arrived = host_alice.send_qubit('Dean', q, await_ack=True) # Get the qubit on Dean's side from Alice - q_rec = host_dean.get_data_qubit('Alice', q_id, wait=0) + q_rec = host_dean.get_qubit('Alice', q_id, wait=0) # Ensure the qubit arrived and then measure and print the results. if q_rec is not None: @@ -133,7 +133,7 @@ The full example is below: q_id, _ = host_alice.send_qubit('Dean', q, await_ack=True) # Get the qubit on Dean's side from Alice - q_rec = host_dean.get_data_qubit('Alice', q_id) + q_rec = host_dean.get_qubit('Alice', q_id) # Ensure the qubit arrived and then measure and print the results. if q_rec is not None: diff --git a/docs/_sources/quick_start.rst.txt b/docs/_sources/quick_start.rst.txt index 99f3feb4..9e12fcdd 100644 --- a/docs/_sources/quick_start.rst.txt +++ b/docs/_sources/quick_start.rst.txt @@ -65,7 +65,7 @@ of commands that are built into hosts, see the [Design Overview section](https:/ # Here we write the protocol code for another host. for _ in range(5): # Wait for a qubit from Alice for 10 seconds. - q = host.get_data_qubit(sender, wait=10) + q = host.get_qubit(sender, wait=10) # Measure the qubit and print the result. print('%s received a qubit in the %d state.' % (host.host_id, q.measure())) diff --git a/docs/components/host.html b/docs/components/host.html index 335d814c..178fb3ea 100644 --- a/docs/components/host.html +++ b/docs/components/host.html @@ -244,14 +244,14 @@

Host
  • -
    get_data_qubit(host_id, wait=N):
      +
      get_qubit(host_id, wait=N):
      • Get a data qubit from sender with host_id host_id and wait N seconds for it

  • -
    get_data_qubits(host_id):
    -
    -get_data_qubit(host_id, q_id=None, wait=0)
    +
    +get_qubit(host_id, q_id=None, wait=0)

    Gets the data qubit received from another host in the network. If qubit ID is specified, qubit with that ID is returned, else, the last qubit received is returned.

    @@ -785,10 +785,10 @@

    Host

    -
    -get_data_qubits(host_id, remove_from_storage=False)
    +
    +get_qubits(host_id, remove_from_storage=False)

    Return the dictionary of data qubits stored, just for the information regarding which qubits are stored. -Optional to remove the qubits from storage like get_data_qubit does with remove_from_storage field.

    +Optional to remove the qubits from storage like get_qubit does with remove_from_storage field.

    Parameters