# Qubit-Based Clock Synchronization for QKD Systems Using a Bayesian Approach
## 1 Introduction  
Introduced in 1984 [1], quantum key distribution (QKD) is a symmetric encryption protocol that promises unconditional information security founded on the fundamental laws of physics, rather than on the difficulty of computational problems. [PERSON] and [PERSON] established the first QKD protocol (BB84), which used the polarization degree of freedom of single photons to transmit information. Subsequently developed protocols have extended QKD to different types of systems [2] and relaxed the requirement for a true single-photon source [3], paving the way for practical implementations of quantum cryptography. For the sake of concreteness, we consider a polarization-based prepare-and-measure protocol. Here, one user ([PERSON]) prepares and transmits a periodic sequence of quantum states with period \(\tau_{A}\) encoded in at least two mutually unbiased orthonormal bases. In our example system, we use two bases: horizontal/vertical (H/V) polarization and left circular/right (L/R) circular polarization. We also use the decoy-state protocol where [PERSON] occasionally sends the vacuum quantum state. A second user ([PERSON]), measures each quantum state randomly in one of the two bases and records the result. After the measurement phase is complete, [PERSON] and [PERSON] publish their basis choices for each measurement and keep only the measurements where [PERSON] registers a click with his single-photon counting detectors and they use the same basis. This process, called sifting, allows distilling a raw key, which, after error correction and privacy amplification [4], becomes the secret classicalkey securely shared between [PERSON] and [PERSON]. Because qubits are lost to the environment via transmission loss and environmental radiation is detected due to stray light and thermal effects, our system is formally considered open. However, the security of the system is still guaranteed using privacy amplification based on the quantum bit error rate (QBER). Our example system uses a pulsed stochastic photonic source with decoy states [3], where the decoys are photonic wavepackets with a lower mean photon number. To simplify the example system and make it more efficient, we only transmit one state in the monitoring basis, which gives an equivalent secure key rate in comparison to transmitting both states in this basis [5; 6]. A practical issue in quantum communication protocols is synchronizing [PERSON] and [PERSON]'s two data streams. If [PERSON] does not know precisely when [PERSON] begins data transmission, he must begin recording measurements early or else risk missing some of [PERSON]'s transmission. In either case, because some signals do not arrive at [PERSON] due to channel loss, and extraneous events are caused by stray light and detector dark counts, the first event [PERSON] records is unlikely to be the first event [PERSON] sends, resulting in some timing offset that must be determined. Correcting this offset is an essential precursor to sifting: If [PERSON] and [PERSON] do not agree on the timing of the events, they will compare basis choices from different events, resulting in a high QBER and likely share no information. In addition, determining which time bins correspond to [PERSON]'s wavepacket arrival and which do not allows timing-based noise filtering. Further complicating the communication protocol is that the relative clock offset may not be a constant due to drift in the relative phase and frequency between the transmitter and receiver clocks. [PERSON] has a communication protocol temporal bin width \(\tau_{A}\) that may be different from [PERSON]'s bin width \(\tau_{B}\). The timing offset between their clocks \(\Delta\) at the \(n\)th communication time bin since the most recent clock synchronization is given by  
\[\Delta=t_{0}+(\tau_{A}-\tau_{B})n+\varepsilon \tag{1}\]  
for an initial timing offset \(t_{0}\) and higher-order timing error \(\varepsilon\).