## 4 Numerical Simulations
Moreover, the secret key rate cannot exceed  
Figure 3: (Color online)The optimal key rate (bits per pulse) in logarithmic scale versus transmission distance between Alice and Bob with weak randomness \(p_{1}=p_{2}=10^{-6}\) and without weak randomness \(p_{1}=p_{2}=0\) for different \(N=10^{x}(x=12,13,15)\) (curves from left to right), the dashed lines are results of weak randomness for different \(N\), and the solid lines are the results of non-weak randomness for different \(N\). The gray dotted line is the PLOB bound. the PLOB bound [11] when \(p_{1}(p_{2})\geq 10^{-6}\) with the finite-key size. In fact, temporal modes of photons become stretched due to the chromatic dispersion in the fiber. This phenomenon will impact the detection time windows. That is, the longer the fiber, the wider the time window should be. The duration of the secret key generation depends on the transmission distance as well as on the number of photons per pulse. Finally, we compare and analyze the effects of weak randomness on different QKD protocols, BB84, MDI-QKD and SNS TF-QKD. We simulate the largest weak randomness vulnerability that different protocols can tolerate. As shown in Figure 5, the blue lines are results of MDI-QKD: the solid line is the result of both [PERSON] and [PERSON] existing the weak randomness and the dashed line is the result of one party existing the weak randomness. The black line is the result of the BB84 protocol. The red lines are results of SNS TF-QKD: the solid line is the result of both [PERSON] and [PERSON] existing the weak randomness and the dashed line is the result of one party existing the weak randomness. We find that the largest weak randomness vulnerability that SNS TF-QKD can tolerate is \(10^{-2}\) which is greater than the BB84 and MDI-QKD \(10^{-3}\). Moreover, the achievable transmission distance is also longer than the BB84 protocol and the MDI-QKD protocol. Actually, the probability that the states prepared by [PERSON] ([PERSON]) in the BB84 and the MDI-QKD reach the detector is \(\eta\). For the SNS TF-QKD, it is \(\sqrt{\eta}\). Under the weak randomness model, in order to make sure not to be discovered, [PERSON] may attenuate the quantum states from non-random part with a certain probability, which is related to the fiber transmittance \(\eta\). The channel-loss dependence of the key rate in SNS TF-QKD is square root of channel transmittance \(R\sim O\sqrt{\eta}\) while it is linear in the BB84 and the MDI-QKD \(R\sim O(\eta)\), and that is why SNS TF-QKD can tolerate more weak randomness vulnerability than the BB84 protocol and the MDI-QKD. Compared with the BB84 protocol, the MDI-QKD is more sensitive to weak randomness which is rational since both [PERSON] and [PERSON] prepare quantum states. Compared with the MDI-QKD, the SNS TF-QKD is more robust to the weak randomness since just one party sends states and perform single photon interference in the quantum channel. Figure 4: (Color online) The optimal key rate (bits per pulse) in logarithmic scale versus transmission distance between [PERSON] and [PERSON] with weak randomness \(p_{1}=p_{2}=0,10^{-x}\)\((x=6,5,4,3)\) (curves from right to left) for different \(N=10^{13}\), \(N=10^{15}\), the dashed lines are results \(N=10^{13}\) with different weak randomness parameters, and the solid lines are the results of \(N=10^{15}\) with different weak randomness parameters. The gray dotted line is the PLOB bound. From the above simulation results, we can infer that SNS TF-QKD can still have the outstanding performance under the weak random condition. The secret key rate with the finite-key size is more sensitive to the weak randomness, and it performs differently for the different finite numbers of total pulses. Furthermore, SNS TF-QKD has an advantage of tolerance to the weak randomness compared to the BB84 protocol and the MDI-QKD protocol.