# Formal verification of quantum communication protocols using Petri nets

## Abstract

This paper presents a new formal method for verification of quantum communication protocols. By extending the symbolic system of Petri nets, we can define quantum pure states in Petri-net settings. Therefore, it is possible to emerge a framework from formalizing basic quantum phenomena, which are utilized to achieve communication tasks. We also present an example of applying this framework to the modeling and analyzing quantum communication protocols to show how it works.

Quantum communication, quantum protocols, Petri nets, formal methods.

## 1 Introduction

Quantum communication, as one of the most promising technologies in future, is well known for it providing a way to achieve many tasks that are impossible purely by classical means, such as quantum dense coding[1, 2] and teleportation[3, 4]. Among various quantum communication protocols, quantum key distribution[5] has become the focus of research all over the world and achieves a huge success. However, security proof of such protocols[6, 7] remains to be the biggest problem, which prevents them from serving the up-to-date information systems in an acceptable cost. Therefore, formal methods were introduced to model, analyze and verify quantum protocols as they are applied to the classical cryptographic protocols[8, 9, 10, 11, 12, 13, 14, 15]. In 2005, Nagarajan et al. opened the door of adopting process calculi[16] to quantum cryptographic protocols[8]. Later, qCCS, where a quantum protocol is formalized as configuration , have been proposed[9, 10, 11, 12, 13, 14, 15]. Recently, Kubota et al. claimed a way to achieve semi-automated verification of security proofs of quantum cryptographic protocols in the qCCS framework[17]. Independently, PRISM model checker[18] was employed to analyze the security of BB84[19], however, the weakness is also intuitive, it only takes into account the simplest attacking strategy, i.e., intercept and resend attack. Recently, it was reported that more attack strategies are allowed in the PRISM settings[20].

Although formal verifications of quantum cryptographic protocols have attracted most of the attentions, other quantum communication protocols were also investigated using formal methods. For example, Feng et al. formalized quantum teleportation and super dense coding protocols in qCCS[11]. Here, we will continue the work by introducing a new formal method, Petri nets[21], to modeling quantum communication protocols. Petri nets are a graphical and mathematical modeling tool applicable to many systems. It is often used to describe and analyze information processing systems that are characterized as being concurrent, asynchronous, distributed, parallel, nondeterministic, and stochastic. Obviously, quantum communication protocols are of such systems.

In this paper, we extend the symbolic system of Petri nets by a definition, which connects a quantum state with the elements of a typical Petri net. Next, we formalize several significant quantum phenomena, such as quantum interference, quantum entanglement, quantum measurement, and quantum Zeno effect, in order to construct a new framework. These models act as the fundamentals to describe various quantum communication protocols. As an example, we present a Petri net model of Salih et al.’s protocol, referred to as SLAZ2013[22]. The main contribution of our work is to bridge the gap between quantum protocols and Petri-net systems.

## 2 Fundamentals

Petri nets can be represented as follows:

PN = (P, T, F, W, )

is a finite set of places,

is a finite set of transitions,

is a set of arcs (flow relation),

is a weight function,

is the initial marking,

and .

In order to describe quantum protocols in Petri-nets settings, we need to map the quantum states to Petri-nets symbolic systems.

###### Definition 1 (Quantum state)

A quantum state, , in Petri-net settings is described as a finite set of places ,, by the following mapping,

(1) |

if we set , where is a positive number.

We should point out that, in real applications, the value of is most probably related to the computation complexity. For an instance, if is a real number, for , the probability amplitude of the eigenstate is equal to the token number of the place . This definition directly bridges the quantum systems and Petri nets. Now, it is easy to formulate quantum phenomena in the Petri-nets framework.

###### Corollaries 1 (Quantum inteference)

It is a natural application of the definition, since the function is linear. Therefore, quantum interference can be expressed by

(2) |

###### Corollaries 2 (Quantum measurement)

Defining an operator for a quantum state denoted by , we have , such that , if the eigenstates of are chosen as the measurement basis. Our solution to quantum measurement directly represents the essence of quantum collapse induced by disturbed measurement, and it can be easily applied to various applications, such as quantum key distribution. Fig. 1 is an example of simulating quantum measurement in a Petri net system.

###### Corollaries 3 (Quantum entanglement)

Quantum entanglement is a striking phenomenon explored to achieve many tasks in quantum information. Here, we can use a Petri net to draw the picture of quantum entanglement as showed in Fig. 2. Explicitly, we can use a Petri net to describe a two-qubit entangled system, say, a triplet state .

corresponds to a triplet state, such that

,

,

,

,

,

.

Now, let us see how quantum entanglement is drawn in this picture:

In the beginning, the system should be initialized before it is triggered, i.e., . Consequently, according to the rules of Petri nets systems, two possible results are going to be observed: (I) If the token flows to the place , i.e., , , , one immediately observes ; (II)If the token flows to the place , i.e., , , , one immediately observes . Interestingly, cases (I) and (II) can be translated to the components and of .

###### Corollaries 4 (Quantum Zeno effect)

Quantum Zeno effect[23] is a phenomenon in quantum physics where observing a particle prevents it from decaying as it would in the absence of the observation. A good example of employing quantum Zeno effect to quantum communication protocols is presented in Ref.[22], where a -cycle interferometer is introduced. Quantum Zeno effect is seen in the following scenario: After n cycles, the evolution of the initial state is expressed by

(3) |

In the end, will be detected with a probability of . Fig.3 is a Petri-net system correlated to this example, place stores the total cycle number denoted by , and represent the final states and , respectively. In other words, two quantum states, and , can be found in this Petri net. Running this system, we obtain , which is consistent with the result reduced from Eq. (3).

## 3 Verifying the direct counterfactual quantum communication protocol by Petri nets

In this section, we present a model of a typical quantum communication protocol proposed by Salih et al.[22], in order to verify the counterfactuality rate of this protocol. The model is comprised of two Petri nets, which represent two work modes related to Bob passing and blocking the photon, respectively. It is partially adapted from the prototype illustrated in Fig. 3, since quantum Zeno effect is introduced to this protocol and takes place in both modes. Without specially clarification, parameter is set to be as it was in the previous section.

### 3.1 Model

When the protocol works in the blocking mode, i.e., logic ”1” is transmitted, quantum Zeno effect is observed in the inner cycle. Due to the quantum interference in the outer cycle, the photon will trigger the corresponding detector (denoted here by ). It implies that the initial state finally evolves to .

A Petri net model of this mode is shown in Fig. 4. In order to show the principles, we divide the net into three subsystems denoted by , and . carries out the function of the inner cycle, and and respond to the outer cycle.

is described below.

Places: ;

Transitions: ;

The Weights of the arcs are set to 1 except the followings:

(a prefixed natural number indicating the inner cycle number) for and ;

for ;

for ;

for ;

for .

The resulted state after cycles is expressed by , which is input to the next outer cycle referred to and .

is described below.

Places: ;

Transitions: ;

The Weights of the arcs are set to 1 except the followings:

(a prefixed natural number indicating the outer cycle number) for ;

for ;

for ;

for .

The photon appears in the left hand side arm of the interferometer after cycles is expressed by .

is described below.

Places: ;

Transitions: ;

The Weights of the arcs are set to 1 except the followings:

for ;

for ;

for ;

for ;

for .

The photon appears in the right hand side arm after cycles is expressed also by . Consequently, the photon triggers detector with a probability of , leading to a result state . Note that, in the blocking mode, quantum Zeno effect occurs in the inner cycle.

When the protocol works in the passing mode, i.e., logic ”0” is transmitted, quantum Zeno effect is observed in the outer cycle. As a result, the photon will trigger the other detector (denoted by ). It implies that the initial state remains unchanged after being continuously observed.

A Petri net model of this mode is shown in Fig. 5. Similarly, it is divided into four subsystems denoted by , , and . and together carry out the function of the inner cycle with and responding to the outer cycle. According to principle of the protocol, Fig. 5 can be easily adapted from Fig. 4.

is described below.

Places: ;

Transitions: ;

The Weights of the arcs are set to 1 except the followings:

for and ;

for ;

for ;

for ;

for .

The resulted state after cycles is expressed by , which is input to the next outer cycle, i.e., and .

is described below.

Places: ;

Transitions: ;

The Weights of the arcs are set to 1 except the followings:

for ;

for ;

for ;

for .

The resulted state after cycles is expressed by , which is input to the next outer cycle, i.e., and .

is described below.

Places: ;

Transitions: ;

The Weights of the arcs are set to 1 except the followings:

for ;…

for ;

for ;

for .

The photon appears in the left hand side arm after cycles is expressed by .

is described below.

Places: ;

Transitions: ;

The Weights of the arcs are set to 1 except the followings:

for ;

for ;

for ;

for ;

for ;

for .

The photon appears in the right hand side arm after cycles is expressed also by . Since quantum Zeno effect takes place in the outer cycle, the photon triggers detector with a probability of , leading to a result state .

### 3.2 Verification results

In order to verify the correctness, the model is run in the Petri nets environment with different values of and , thus a list of results of the counterfaulity rates, which equal to the detection probabilities as well, is obtained. Meanwhile, the same terms are computed out in MATLAB. Comparing the data , we find that the computational results produced by the Petri net model are completely consistent with those from MATLAB. We have listed below a part of the results in Tab. 1 and 2.

N=320 | 0.906 | 0.952 | 0.968 | 0.976 | 0.984 |

N=500 | 0.906 | 0.952 | 0.968 | 0.976 | 0.984 |

N=1250 | 0.906 | 0.952 | 0.968 | 0.976 | 0.984 |

N=2500 | 0.906 | 0.952 | 0.968 | 0.976 | 0.984 |

N=320 | 0.912 | 0.831 | 0.758 | 0.693 | 0.582 |

N=500 | 0.943 | 0.887 | 0.836 | 0.788 | 0.702 |

N=1250 | 0.977 | 0.953 | 0.930 | 0.908 | 0.865 |

N=2500 | 0.997 | 0.994 | 0.991 | 0.988 | 0.982 |

## 4 Discussion

We should point out that the presented framework has limitations to describe more general quantum phenomena. For example, the model of quantum entanglement presented in Sec.2 is only suitable for a Bell state. Fortunately, it is not difficult to generalize it to a -particle entangled system. Thus, it is necessary to fertilize the framework by formalizing more quantum mechanics serving the quantum information in our future work.

We have presented a good example of modeling quantum communication protocols in Petri-net settings, it is still open that whether it is available to model and verify quantum cryptographic protocols using Petri-net models, since the security aspect of these protocols is more needed to be investigated. However, it is a big challenge to construct an automated reasoning system that performs the security proof in Petri nets. Also, we need to formalize various eavesdropping strategies, such as collective attacks, as is left for our future work. Another challenge is how to verify composed systems, where quantum communication protocols and classical ones are combined with each other to provide network services. Indeed, verifications of the composable security is also expected.

## 5 Conclusion

In this paper, we presented a Petri-net framework for modeling and analyzing quantum communication protocols, which opens a new door of verifying quantum protocols by formal methods. In order to make it possible to describe quantum protocols, we extended the Petri-net symbolic system using a mapping from Hilbert space to the place set. Therefore, quantum states can be defined in the Petri-net settings. Typical quantum phenomena were also formalized, so that they provide us fundamental tools to model quantum protocols, where these phenomena are usually used to achieve amazing tasks that are definitely impossible by classical means. At last, we presented a Petri-net model of SLAZ2013 protocol to show how this framework works.

## Acknowledgment

This work was supported by the National Natural Science Fundation of China with the project number 61300203.

### References

- C. H. Bennett and S. J. Wiesner, “Communication via one- and two-particle operators on einstein-podolsky-rosen states.” Physical Review Letters, vol. 69, no. 20, 1992, pp. 2881–2884.
- K. Mattle, H. Weinfurter, P. G. Kwiat, and A. Zeilinger, “Dense coding in experimental quantum communication.” Physical Review Letters, vol. 76, no. 25, 1996, pp. 4656–4659.
- C. H. Bennett, G. Brassard, C. Cr¨¦peau, R. Jozsa, A. Peres, and W. K. Wootters, “Teleporting an unknown quantum state via dual classical and einstein-podolsky-rosen channels.” Physical Review Letters, vol. 70, no. 13, 1993, pp. 1895–1899.
- D. Boschi, S. Branca, F. D. Martini, L. Hardy, and S. Popescu, “Experimental realization of teleporting an unknown pure quantum state via dual classical and einstein-podolsky-rosen channels,” in Rev. Lett, 1998, pp. 1121–1125.
- C. H. Bennett, “Quantum cryptography : Public key distribution and coin tossing,” in Proc. IEEE International Conference on Computers Systems and Signal Processing, 1984, pp. 175–179.
- D. Mayers, “Mayers, d.: Unconditional security in quantum cryptography. j. acm 48(3), 351-406,” Journal of the Acm, vol. 48, no. 3, 1998, pp. 351–406.
- P. W. Shor and J. Preskill, “Simple proof of security of the bb84 quantum key distribution protocol,” Physical Review Letters, vol. 85, no. 2, 2000, pp. 441–4.
- R. Nagarajan, N. Papanikolaou, G. Bowen, and S. Gay, “An automated analysis of the security of quantum key distribution,” Secco, 2005.
- L. M, “Relations among quantum processes: bisimilarity and congruence,” Mathematical Structures in Computer Science, vol. 16, no. 3, 2006, pp. 407–428.
- Y. Feng, R. Duan, Z. Ji, and M. Ying, “Probabilistic bisimulations for quantum processes,” Information Computation, vol. 205, no. 11, 2007, pp. 1608–1639.
- Y. Feng, R. Duan, and M. Ying, “Bisimulation for quantum processes,” Acm Sigplan Notices, vol. 46, no. 1, 2011, pp. 523–534.
- Y. Feng, Y. Deng, and M. Ying, “Symbolic bisimulation for quantum processes,” Acm Transactions on Computational Logic, vol. 15, no. 2, 2012, pp. 523–534.
- M. Ying, Y. Feng, R. Duan, and Z. Ji, “An algebra of quantum processes,” Acm Transactions on Computational Logic, vol. 10, no. 3, 2009, pp. 179–187.
- Y. Deng and Y. Feng, Open Bisimulation for Quantum Processes. Springer Berlin Heidelberg, 2012.
- P. Ado and P. Mateus, “A process algebra for reasoning about quantum security,” Electronic Notes in Theoretical Computer Science, vol. 170, 2007, pp. 3–21.
- R. Milner, “Communicating and mobile systems - the pi-calculus.” Cambridge University Press New York, vol. 42, no. 2-3, 1999, pp. 191–225.
- T. Kubota, Y. Kakutani, G. Kato, Y. Kawano, and H. Sakurada, “Semi-automated verification of security proofs of quantum cryptographic protocols,” Journal of Symbolic Computation, vol. 73, 2016.
- M. Kwiatkowska, G. Norman, and D. Parker, “Prism 4.0: Verification of probabilistic real-time systems,” in Computer Aided Verification - International Conference, CAV 2011, Snowbird, Ut, Usa, July 14-20, 2011. Proceedings, 2011, pp. 585–591.
- J. Y. Kim, H. M. Oh, S. C. Kwak, Y. H. Cheon, M. S. Lee, M. C. Rho, and J. Oh, “First international conference on the quantitative evaluation of systems qest 2004,” in Quantitative Evaluation of Systems, 2004. QEST 2004. Proceedings. First International Conference on the, 2004, pp. 322–323.
- F. Yang, G. Yang, and Y. Hao, “The modeling library of eavesdropping methods in quantum cryptography protocols by model checking,” International Journal of Theoretical Physics, vol. 55, no. 7, 2016, pp. 3414–3427.
- T. Murata, “Petri nets: Properties, analysis and applications,” Proceedings of the IEEE, vol. 77, no. 4, 1989, pp. 541–580.
- H. Salih, Z. H. Li, M. Alamri, and M. S. Zubairy, “Protocol for direct counterfactual quantum communication.” Physical Review Letters, vol. 110, no. 110, 2013, pp. 1–10.
- B. Misra and E. C. G. Sudarshan, “The zeno’s paradox in quantum theory,” Journal of Mathematical Physics, vol. 18, no. 18, 1977, pp. 756–763.