Abstract
In this paper, we present AcausalNets.jl - a library supporting inference in a quantum generalization of Bayesian networks and their application to quantum games. The proposed solution is based on modern approach to numerical computing provided by Julia language. The library provides a high-level functions for Bayesian inference that can be applied to both classical and quantum Bayesian networks.
You have full access to this open access chapter, Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
Bayesian networks [10] are probabilistic models which, among their numerous use cases, allow to model complex systems of interconnected random events in games of chance and their influence on each other. There are several approaches to generalizing Bayesian probability theory into the quantum realm [7, 8, 10].
Introducing quantum probability into game theory opens up new opportunities for finding optimal strategies in various games of chance. Apart from well known work on representing quantum strategies as unitary gates [9] or applying quantum entanglement to find optimal strategies [2], there is also relatively new approach to apply quantum Bayesian networks for that purpose [5]. This new approach has not yet been fully explored, therefore we focus on methods, algorithms and numerical support for researchers working this topic.
Proper numerical tools are required due to high complexity of computations essential to perform such experiments. In particular, performing Bayesian inference in Acausal networks, a quantum generalization of Bayesian networks, is not yet fully supported among numerical libraries.
In this paper we present AcausalNets.jl - a library providing a high-level functions for Bayesian inference that can be applied to both classical and quantum Bayesian networks. The library takes advantage of the new approach to numerical computing offered by Julia language [1].
Organization of the Paper. The paper is organized as follows: in Sect. 2 we summarize relevant related work which provided basis and inspiration for this paper. In Sect. 3 we describe Bayesian networks and their usage in higher detail. We also briefly delve into the inference algorithms implemented in AcausalNets.jl. In Sect. 4 we provide in brief detail the principles we followed when implementing the library. Section 5 sums up our results when recreating and expanding experiments first conducted and described in [5]. In Sect. 6 we provide a brief overview of our ideas for further improvements and enhancements of AcausalNets.jl.
2 Related Work
Belief Propagation algorithms that we adapt for quantum Bayes networks in AcausalNets.jl library are covered to a fuller extent in [4] and [10]. The adaptation was done using theoretical foundations for generalizing Bayesian probability theory into the quantum realm described in [7, 8]. To our best knowledge, there is no numerical support for quantum version of that algorithm.
Additionally, our work was inspired by BayesNets.jlFootnote 1 - a Julia library designed for high-level operations on classical Bayesian Networks.
In general, there is a huge variety of software related to quantum information implemented in numerous programming languages, most notably QuantumInformation.jl [3] implemented in Julia. The set of functionalities these libraries provide, while wide, is focused mainly on low-level optimized matrix operations. AcausalNets.jl makes use of matrix operations implemented in QuantumInformation.jl in its implementation of Belief Propagation algorithms.
3 Classical and Quantum Bayesian Networks
Bayesian Networks are probabilistic graphical models used for describing systems of random variables and correlations between their probability distributions. Those networks take a form of a directed acyclic graph, where vertices denote the variables and edges - correlations between them. Bayesian network is usually represented using set of multivariate distributions, which accounts for both variables distributions and their correlations. Typical applications of Bayesian networks include: calculating probability of a given variable values configuration or inferring probability distributions of given variables based on known states of other variables in the network. The variable connection types differ depending on their relation is classical or quantum.
Classical Version - Conditional Dependence. In classical version, as in Fig. 1, the variables in a Bayesian Network may be causally dependent on one other, which means their distributions are conditional. If distribution of variable \(V_2\) is conditionally dependent on the distribution of variable \(V_1\), a happens-before relationship between \(V_1\) and \(V_2\) is implied.
Quantum Version - Acausal Relationships. When generalized to the quantum domain, Bayesian networks can also describe acausal relationships between variables, which may be interpreted as a quantum entanglement between them. As opposed to a causal relationship, such a system of variables is not described as one system at two times, but rather as two systems in a single time frame. An example of such a network is shown in Fig. 2.
Inference Algorithms. Inference in Bayesian networks - calculating the probability distribution of a subsystem of variables based on already known variables - is an NP-hard problem [6]. However, there are algorithms which successfully approximate such computations with considerably lower computational complexity. AcausalNets.jl provides implementations of two algorithms for performing inference in Bayesian networks: a non-optimal naive algorithm, as well as the Belief Propagation algorithm [4, 10]. Moreover, the second algorithm has been generalized to the quantum domain based on [7].
4 Design of the Library
AcausalNets.jl API has been designed with simplicity of computations regarding discrete quantum probability systems in mind. It allows the user to perform inference in Bayesian Networks described in Sect. 3.
Defining Bayesian Networks. To define a Bayesian network, one must first define systems of random variables which make up the network. Then a graph is built of those variables by inserting them in topological order. This requirement is essential, since Bayesian network is a directed acyclic graph. An example of the code which defines a network is shown in Fig. 3.
Performing Inference. Inference can be performed with or without evidence - the known state of some of the random variables in the network. Known states are represented by a system with appropriate variables and their known distribution. Next, function infer(network, variables, evidence, strategy) is used for conducting inference for variables and evidence passed as arguments. By default, naive inference algorithm is used, but it can be changed in library’s Inference module. The example code for Monty Hall game use case [5] is shown in the Fig. 4.
Usage of the Julia Language. The software benefits strongly from Julia typesystem [1], which allows to implement general operation on Bayesian Networks based on the type of the distributions the network is dealing with. It is possible because of Julia’s type parametrization properties. More specifically, as shown in the Fig. 5, BayesNet type is parametrized with the type of DiscreteSystem, which specifies the math operations to be perform on probability distributions of the variables. For example, in case of DiscreteQuantumSystem such operations are performed in accordance with definitions of quantum conditional operators [8].
AcausalNets.jl has been implemented in version 1.0 of Julia language [1]. Source code is publicly available onFootnote 2. The repository also contains more example use casesFootnote 3 in a convenient form of interactive Jupyter NotebooksFootnote 4.
5 Monty Hall Game Example Use Case
As a use case we use results of quantum Monty Hall game from [5] modeled as Bayesian network shown in Fig. 2. We consider a case where there occur quantum effects between the event A - the placement of the prize and B - the initial choice of the player. We choose two example quantum probability distributions. Equation (1) models the situation where A and B are entangled in the way that due to quantum effects the placement of the prize always turns out to be the same as the initial choice of the player.
Equation (2) models the situation where A and B are entangled in the way that due to quantum effects placement of the prize always turns out to be different that the initial choice of the player.
Next, we construct linear combination of these two situations for \(\lambda \in (0,1)\):
We aim to find how the probability of the player wining the game by staying with his initial choice depends on \(\lambda \). We construct the Bayesian network as on Fig. 2 with an appropriate \(\rho _{AB}\) and perform inference to obtain the probabilities. We show our results in Fig. 6.We find that for \(\lambda = 0.6\), the game is fair.
The above results show that using high level API of AcausalNets.jl library gives the same results as direct calculations presented in [5].
6 Conclusions and Future Work
High-level tools enable researchers to better organize, perform and document their experiments, although sometimes for the price of their flexibility. AcausalNets.jl has been created with aim to abstract out tedious calculations, provide a high-level API for quantum Bayesian inference and leverage the numerical potential of Julia language. We have successfully used our library to reproduce the results of experiments on the quantum version of Monty Hall originally presented in [5]. Moreover, through automating a lot of necessary computations, AcausalNets.jl helps experiment with more complex Bayesian networks. In the future we plan to fully implement the quantum version of Belief Propagation algorithm and test its efficiency on bigger networks. This may lead to interesting new research results in quantum information as well as machine learning in the future.
References
Bezanson, J., Edelman, A., Karpinski, S., Shah, V.: Julia: a fresh approach to numerical computing. SIAM Rev. 59(1), 65–98 (2017). https://doi.org/10.1137/141000671
Eisert, J., Wilkens, M., Lewenstein, M.: Quantum games and quantum strategies. Phys. Rev. Lett. 83, 3077–3080 (1999). https://doi.org/10.1103/PhysRevLett.83.3077
Gawron, P., Kurzyk, D., Pawela, Ł.: QuantumInformation.jl–a Julia package for numerical computation in quantum information theory. PLOS ONE 13(12), e0209358 (2018). https://doi.org/10.1371/journal.pone.0209358
Huang, C., Darwiche, A.: Inference in belief networks: a procedural guide. Int. J. Approx. Reason. 15(3), 225–263 (1996). https://doi.org/10.1016/S0888-613X(96)00069-2. http://www.sciencedirect.com/science/article/pii/S0888613X96000692
Kurzyk, D., Glos, A.: Quantum inferring acausal structures and the monty hall problem. Quantum Inf. Process. 15(12), 4927–4937 (2016). https://doi.org/10.1007/s11128-016-1431-8
Kwisthout, J.: Lecture notes: computational complexity of Bayesian networks (2015)
Leifer, M.S., Spekkens, R.W.: Towards a formulation of quantum theory as a causally neutral theory of Bayesian inference. Phys. Rev. A 88, 052130 (2013). https://doi.org/10.1103/PhysRevA.88.052130
Leifer, M., Poulin, D.: Quantum graphical models and belief propagation. Annals Phys. 323(8), 1899–1946 (2008). https://doi.org/10.1016/j.aop.2007.10.001
Meyer, D.A.: Quantum strategies. Phys. Rev. Lett. 82, 1052–1055 (1999). https://doi.org/10.1103/PhysRevLett.82.1052
Yedidia, J.S., Freeman, W.T., Weiss, Y.: Understanding belief propagation and its generalizations. In: Exploring Artificial Intelligence in the New Millennium, pp. 239–269. Morgan Kaufmann Publishers Inc., San Francisco (2003). http://dl.acm.org/citation.cfm?id=779343.779352
Acknowledgements
This research was partly supported by the National Science Centre, Poland – project number 2014/15/B/ST6/05204.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Przewięźlikowski, M., Grabowski, M., Kurzyk, D., Rycerz, K. (2019). Support for High-Level Quantum Bayesian Inference. In: Rodrigues, J., et al. Computational Science – ICCS 2019. ICCS 2019. Lecture Notes in Computer Science(), vol 11540. Springer, Cham. https://doi.org/10.1007/978-3-030-22750-0_76
Download citation
DOI: https://doi.org/10.1007/978-3-030-22750-0_76
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-22749-4
Online ISBN: 978-3-030-22750-0
eBook Packages: Computer ScienceComputer Science (R0)