From 39fbf73cee251f2895042cde46a189f1ce7e553f Mon Sep 17 00:00:00 2001 From: Hristo Georgiev Date: Mon, 9 May 2022 22:53:38 +0100 Subject: [PATCH] Remove redundant q.reset() calls and unused import --- ch03/bb84.py | 3 +-- ch03/qkd.py | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ch03/bb84.py b/ch03/bb84.py index e8e230f..c94f596 100644 --- a/ch03/bb84.py +++ b/ch03/bb84.py @@ -20,7 +20,6 @@ def sample_random_bit(device: QuantumDevice) -> bool: with device.using_qubit() as q: q.h() result = q.measure() - q.reset() return result def prepare_message_qubit(message: bool, basis: bool, q: Qubit) -> None: @@ -114,4 +113,4 @@ def apply_one_time_pad(message: List[bool], key: List[bool]) -> List[bool]: decrypted_message = apply_one_time_pad(encrypted_message, key) print(f"Eve decrypted to get: {convert_to_hex(decrypted_message)}.") - \ No newline at end of file + diff --git a/ch03/qkd.py b/ch03/qkd.py index 2dc4211..5b68c3f 100644 --- a/ch03/qkd.py +++ b/ch03/qkd.py @@ -12,7 +12,6 @@ ## from interface import QuantumDevice, Qubit -from simulator import SingleQubitSimulator def prepare_classical_message(bit: bool, q: Qubit) -> None: if bit: @@ -25,7 +24,6 @@ def send_classical_bit(device: QuantumDevice, bit: bool) -> None: with device.using_qubit() as q: prepare_classical_message(bit, q) result = eve_measure(q) - q.reset() assert result == bit