concept BB84 protocol in category quantum computing
appears as: BB84 protocol, BB84 protocol

This is an excerpt from Manning's book Learn Quantum Computing with Python and Q#.
There are many protocols that we can use to implement the general QKD scheme. In this chapter we will be working with one of the most common QKD protocols BB84, but there are many others as well that we won’t have time to get in to. We will build up to this throughout this chapter, but you can see in the steps to the BB84 protocol.
Figure 3.3. Timing diagram for the BB84 protocol, a particular variant of a QKD protocol.
![]()
Listing 3.10. BB84 protocol for sending a single classical bit between two parties.
def send_single_bit_with_bb84( your_device: QuantumDevice, eve_device: QuantumDevice ) -> tuple: [your_message, your_basis] = [ sample_random_bit(your_device) for _ in range(2) #1 ] eve_basis = sample_random_bit(eve_device) #2 with your_device.using_qubit() as q: prepare_message_qubit(your_message, your_basis, q) #3 # QUBIT SENDING... #4 eve_result = measure_message_qubit(eve_basis, q) #5 return ((your_message, your_basis), (eve_result, eve_basis)) #1