]]>

]]>

Introduction Hybrid Quantum-Classical Computing (HQCC) (a.k.a. Variational Quantum Eigensolver (VQE)) is often touted as one of the main algorithms of Quantum AI. In fact, Rigetti, a Silicon Valley company which for several years has provided cloud access to their superconductive quantum computer, has designed its services around the HQCC paradigm.In this brief blog post, I will explain how HQCC can be understood in terms of quantum Bayesian networks. In the process, I will review some basic facts about classical and quantum Bayesian networks (bnets).HQCC is often symbolized by a feedback loop between a quantum computer and a classical computer.Classical Bayesian Networks First, let's review some basic facts about classical bnets.Consider the chain rule for conditional probabilities. For the case of a probability distribution P() that depends on 5 random variables x0, x1, ..., x4, one hasThis last equation can be represented graphically by the following bnet, a "fully connected" DAG (Directed Acyclic Graph) in which an arrow points into xj from all its predecessors xj-1, xj-2,..., x1, x0 for j=1, 2, ...,4: For definiteness, we have chosen the number of nodes nn=5. How to generalize this so that nn equals any integer greater than 1 is obvious.Henceforth, we will represent a random variable by an underlined letter and the values it assumes by a letter that is not underlined. For instance, x= x.Mathematicians often represent a random variable by an upper case letter and the values it assumes by a lower case letter. For instance, X= x. For a physicist like me, that convention is not very convenient because physicists use upper case letters to mean all sorts of things that aren't random variables. Likewise, they often want to use a lower case letter for a random variable. For this reason, I personally find the upper case letter convention for denoting random variables too burdensome. That is why I use the underlined letter convention instead.Mathematicians have a rigorous definition for a random variable, but for the purposes of this blog post, a random variable is just the name given to a node of a bnet. This will be true for both classical and quantum bnets.The arrows in a bnet denote dependencies. The fully connected bnet given above contains all possible dependencies. When each node depends only on its immediate predecessor, we get what is called a Markov chain. The Markov chain with nn=5 is:bnets are technically acyclic graphs, so feedback loops are forbidden. However, as long as you understand that the following diagram should be "unrolled" into a Markov chain in which there are 2 types of nodes (the ones with an even subscript and the ones with an odd subscript), one can represent this special type of Markov chain with two types of nodes by the following diagram, where j=0, 1, ..., nn-1:This last diagram is a special case of what is called in the business, a dynamical Bayesian network (DBN). An early type of DBN that you might already be familiar with is the famous Kalman filter.Note that in this brief intro to classical bnets, we have only used discrete nodes with a discrete random variable xj for j=0, 1, 2, ..., nn-1. However, any one of those nodes can be easily replaced by a continuous node with a continuous random variable xj. A continuous node xj has a probability density instead of a probability distribution as its transition matrix P(xj| parents of xj), and one integrates rather than sums over its states xj.The definition of classical bnets is very simple. In the final analysis, bnets are just a graphical way to display the chain rule for conditional probabilities. It's a simple but extremely productive definition. Classical bnets remind me of another simple but extremely productive definition, that of a Group in Mathematics. To paraphrase the bard Christopher Marlowe, the definition of a Group (and that of a bnet) is the definition that launched a thousand profound theorems.Quantum Bayesian Networks Next, we will review some basic facts about quantum bnets. A brief history of quantum bnets: The first paper about quantum bnets was this one by me. In that paper, quantum bnets are used to represent pure states only. In subsequent papers, for instance, this one, I explained how to use quantum bnets to represent mixed states too. Quantum bnets led me to the invention of the definition of squashed entanglement.Born's Rule says that in Quantum Mechanics, one gets a probability P by taking the absolute value squared of a complex-valued "probability amplitude" A. In other words, P=|A|2.To define a quantum bnet, we write a chain rule for conditional probability amplitudes (A's instead of P's). For example, for nn=5, one hasThis chain rule can be represented by the same diagram that we used above to represent the fully connected nn=5 classical bnet. However, note that now node xj has a complex-valued transition matrix A(xj|parents of xj) instead of a real-valued one P(xj|parents of xj). For that reason, henceforth, we will represent quantum nodes by a fluffy blue ball instead of the small brown balls that we have been using to represent classical nodes.Just like we defined Markov chains for classical bnets, one can define them for quantum bnets. In both cases, every node depends only on its immediate predecessor. For a quantum Markov chain with nn=5, one haswhich can be represented by the following quantum bnet:It's important to stress that quantum bnets have always, from the very beginning, been intended merely as a graphical way to represent the state vectors of quantum mechanics. They do not add any new constraints to the standard axioms of quantum mechanics. Furthermore, they are not intended to be a new interpretation of quantum mechanics.Coherent and Incoherent sums In this section, we will consider coherent and incoherent sums of quantum bnets. For simplicity, we will restrict the discussion of this section to quantum Markov chains, but everything we say in this section can be easily generalized to an arbitrary quantum bnet, including the fully connected one.Suppose we have a classical Markov chain with nodes x0, x1, ..., x4 and we want to calculate the probability distribution P(x4) of its last node. One does so by summing over all nodes except the last one:This last equation can be rewritten in terms of amplitudes in the equivalent form:In the classical case above, we sum over all the variables outside the magnitude squared. A sum over a variable that is placed outside the absolute value squared will be called an incoherent sum. But the axioms of quantum mechanics also allow and give a meaning to, sums of variables that are placed inside the magnitude squared. A sum over a variable that is placed inside the absolute value squared will be called a coherent sum. For example, in the last equation, if we replace all the incoherent sums by coherent ones, we get:But that's not the whole story. One does not have to sum over all variables in an incoherent way or over all variables in a coherent way. One can sum over some variables coherently and over others incoherently. For example, one might be interested in the following sums: (Footnote: The quantities called P(x4) and P(x3) in the equations of this section might require normalization before they are true probability distributions.)Quantum Bayesian Network point of viewThe last 2 equations can be represent using dynamical quantum bnets, as follows: and (Footnote: One can also consider 2 diagrams like the last 2 diagrams, but with coherent sums of the xj with j even (instead of odd) and incoherent sums of the xj with j odd (instead of even). Also, nn itself is usually very large to allow convergence to an equilibrium distribution of P(xnn-1) and P(xnn-2), and nn can be either odd or even.)The graphical part of the last two diagrams can be represented by the following feedback loop:This last feedback loop is equivalent to the feedback loop with the Fantasia cartoon of Mickey Mouse that we started this blog post with and that we described as a pictorial representation of HQCC.See More

The online conference, IBM Think 2020, was held in May 5-6 2020. During that conference, Dario Gil, IBM Research Director, was visibly, almost orgasmically, excited with his new toy, an IBM quantum computer.The IBM quantum computer already gives a clear quantum advantage to all IBM partners, as long as they rent the version that is mounted on a Mecha. What is a Mecha?, we asked. To explain, Dario shared with us this picture of his recent visit to the latest quantum startup and IBM quantum network partner, MegaBots Inc., in Hayward, California.See More

]]>

About 4 months ago, I wrote for this blog an article entitled "List of Quantum Clouds". In that article, I listed 17 "quantum clouds". By now, there are probably a few more. The "HWB" (hardware backed) quantum clouds of Dwave, Rigetti and IBM, offer access to already existing, on-line qc hardware. I'll call all the other quantum clouds "proxy" quantum clouds. Proxy quantum clouds can run a quantum circuit on a cloud hosted simulator or they can relay that quantum circuit to a HWB quantum cloud. Out of all the proxy quantum clouds, two of them are backed by two hungry, cruel giants called Amazon and Microsoft. The rest are backed by ants.Will proxy quantum clouds, including the ones run by the 2 cruel giants, ever become popular or profitable? It remains to be seen.Proxy quantum clouds are certainly not a guaranteed slam dunk from a business perspective. Users might decide to simulate their quantum circuits more cheaply by running them on their own PCs. And, if users want to run their quantum circuits on real qc hardware, they might choose to eliminate the proxy, and send their quantum circuits directly to a HWB quantum cloud. Users might eliminate the proxy middleman because it is slowing things down and charging the users a toll fee to do so.Another important reason why proxy quantum clouds may fail, is open source software such as z2jk (Zero to Jupyterhub with Kubernetes). z2jk is free, open source software that allows anyone, even someone with almost zero understanding of the underlying docker/kuberbetes technology, to set up their own jupyterhub cloud service in minutes.A jupyterhub, in case you are not familiar with the term, is software that can 'spawn' for many users, a personal file system in the browser of each user. This personal file system can open, run and save on the cloud many jupyter notebooks. So far, all quantum clouds are, deep down, jupyterhubs.z2jk is superbly well documented and maintained by UC Berkeley, where it is used to teach many courses. Furthermore, z2jk is very sophisticated. It uses the latest in Jupyter notebook and cloud technology (Docker containers and container orchestration via Kubernetes). Due to Kubernetes, z2jk can be run on anything from a single workstation to multiple cloud providers running concurrently (cloud providers such as Amazon AWS, Microsoft Azure, Google cloud, Digital Ocean, IBM cloud, etc.). Kubernetes magically and seamlessly balances the load among all servers. z2jk is also very flexible: it can be used to teach any data science or quantum computing course, or you can use it to set up your own jupyterhub quantum cloud service, only for yourself, or for you and a group of your peers.See More

Check out the following paper unveiled last night in ArXiv:An Open-Source, Industrial-Strength Optimizing Compiler for Quantum Programs, by Robert S. Smith, Eric C. Peterson, Mark G. Skilbeck, Erik J. Davis.This is an exciting development for me since I have been a proponent and practitioner of the art of quantum compilers for a long time.The new "optimized quantum compiler" by Rigetti is a computer program that tackles the problem of searching for the "shortest" quantum circuit. Note, however, that it comes with some caveats:This program doesn't generally find the optimal solution to this problem. Finding the optimal solution for this problem most probably requires an exp(number of qubits) number of operations to "finish". So for more than 5 to 10 qubits, an optimal program for this problem would be so slow that it would be well-nigh useless. The shortest circuit problem probably has many local minima. This program is not even guaranteed to find one of those local minima. It finds something that is optimal only within small segments of the circuit. "piecewise optimal"?What is the "shortest circuit" is somewhat debatable and device dependent. The output of this computer program is device dependent, as it favors gates that are native to the Rigetti qc.This program is written in Lisp, which is, to put it mildly, not one of the most popular or fastest-growing or newest or easiest to write, computer languages in town.To be fair, IBM's optimizing quantum compiler suffers from all the same difficulties, except that theirs is written in Python/C++ instead of Lisp. Microsoft's quantum compiler suffers from these difficulties too, but theirs is written in one or more of Microsoft's dead or dying languages C#, F#, Q#. (The # stands for a tombstone with a cross.) In fact, classical compilers suffer from similar difficulties too.(IBM calls their quantum compiler a transpiler instead of a compiler, but dozens of researchers that have preceded IBM in this field call this type of software a compiler.)Quantum compilers have a long history. Nowadays, Microsoft, IBM, Rigetti and Google, have one.The first paper to use the term "quantum compiler" in its title (and probably also in its body but I'm less sure about that) was mineA Rudimentary Quantum Compiler, by Robert R. Tucci.I quickly followed that paper with a beefier "second edition" with more "quantum compiler optimizations":A Rudimentary Quantum Compiler(2cnd Ed.), by Robert R. Tucci.Within a year of my "rudimentary quantum compiler" paper, I wrote a C++ program called Qubiter that implemented the algorithms of the paper, and I filed for a patent for Qubiter (It's item #2 in the list. The patent expires today, April 01, 2020). Later, I also applied for an ARO (Army Research Office) grant to enhance Qubiter. I applied for the grant jointly with a university professor that specializes in Linear Algebra. Sadly, the application was rejected. (That's an interesting story in itself, but for another time.)My original reason for studying quantum compiling was to "compile" the nodes of a quantum Bayesian network (i.e., to replace each of the nodes by a sequence of elementary gates). In fact, I wrote a paper explaining how to achieve that goalHow to Compile A Quantum Bayesian Net, by Robert R. Tucci.More recently, I wrote an open-source quantum simulator in Python, that I also called Qubiter. The new Qubiter includes a Python implementation of the old C++ Qubiter. It also includes, in a folder called LEGACY, the C++ code for the original Qubiter.My original use of the word "quantum compiler" has been expanded somewhat by others throughout the years. To be more specific, nowadays I call Qubiter's original quantum compiler a "quantum CSD compiler". CSD stands for Cosine-Sine Decomposition, a very famous, in its own right, decomposition in Linear Algebra. Here is the LAPACK implementation of CSD. My "rudimentary quantum compiler" paper was the first paper ever to use that decomposition to compile an arbitrary unitary matrix (i.e., to decompose it into a sequence of elementary gates such as single qubit rotations and CNOTs).Since I wrote my original paper on quantum compilers, I've written several other arxiv papers on the subject. I've also written numerous articles about quantum compiling for my blog, "Quantum Bayesian Networks".See More

Check out the following paper unveiled last night in ArXiv:An Open-Source, Industrial-Strength Optimizing Compiler for Quantum Programs, by Robert S. Smith, Eric C. Peterson, Mark G. Skilbeck, Erik J. Davis.This is an exciting development for me since I have been a proponent and practitioner of the art of quantum compilers for a long time.The new "optimized quantum compiler" by Rigetti is a computer program that tackles the problem of searching for the "shortest" quantum circuit. Note, however, that it comes with some caveats:This program doesn't generally find the optimal solution to this problem. Finding the optimal solution for this problem most probably requires an exp(number of qubits) number of operations to "finish". So for more than 5 to 10 qubits, an optimal program for this problem would be so slow that it would be well-nigh useless. The shortest circuit problem probably has many local minima. This program is not even guaranteed to find one of those local minima. It finds something that is optimal only within small segments of the circuit. "piecewise optimal"?What is the "shortest circuit" is somewhat debatable and device dependent. The output of this computer program is device dependent, as it favors gates that are native to the Rigetti qc.This program is written in Lisp, which is, to put it mildly, not one of the most popular or fastest-growing or newest or easiest to write, computer languages in town.To be fair, IBM's optimizing quantum compiler suffers from all the same difficulties, except that theirs is written in Python/C++ instead of Lisp. Microsoft's quantum compiler suffers from these difficulties too, but theirs is written in one or more of Microsoft's dead or dying languages C#, F#, Q#. (The # stands for a tombstone with a cross.) In fact, classical compilers suffer from similar difficulties too.(IBM calls their quantum compiler a transpiler instead of a compiler, but dozens of researchers that have preceded IBM in this field call this type of software a compiler.)Quantum compilers have a long history. Nowadays, Microsoft, IBM, Rigetti and Google, have one.The first paper to use the term "quantum compiler" in its title (and probably also in its body but I'm less sure about that) was mineA Rudimentary Quantum Compiler, by Robert R. Tucci.I quickly followed that paper with a beefier "second edition" with more "quantum compiler optimizations":A Rudimentary Quantum Compiler(2cnd Ed.), by Robert R. Tucci.Within a year of my "rudimentary quantum compiler" paper, I wrote a C++ program called Qubiter that implemented the algorithms of the paper, and I filed for a patent for Qubiter (It's item #2 in the list. The patent expires today, April 01, 2020). Later, I also applied for an ARO (Army Research Office) grant to enhance Qubiter. I applied for the grant jointly with a university professor that specializes in Linear Algebra. Sadly, the application was rejected. (That's an interesting story in itself, but for another time.)My original reason for studying quantum compiling was to "compile" the nodes of a quantum Bayesian network (i.e., to replace each of the nodes by a sequence of elementary gates). In fact, I wrote a paper explaining how to achieve that goalHow to Compile A Quantum Bayesian Net, by Robert R. Tucci.More recently, I wrote an open-source quantum simulator in Python, that I also called Qubiter. The new Qubiter includes a Python implementation of the old C++ Qubiter. It also includes, in a folder called LEGACY, the C++ code for the original Qubiter.My original use of the word "quantum compiler" has been expanded somewhat by others throughout the years. To be more specific, nowadays I call Qubiter's original quantum compiler a "quantum CSD compiler". CSD stands for Cosine-Sine Decomposition, a very famous, in its own right, decomposition in Linear Algebra. Here is the LAPACK implementation of CSD. My "rudimentary quantum compiler" paper was the first paper ever to use that decomposition to compile an arbitrary unitary matrix (i.e., to decompose it into a sequence of elementary gates such as single qubit rotations and CNOTs).Since I wrote my original paper on quantum compilers, I've written several other arxiv papers on the subject. I've also written numerous articles about quantum compiling for my blog, "Quantum Bayesian Networks".See More

]]>

Today, Google published the following paper:TensorFlow Quantum: A Software Framework for Quantum Machine Learning, TensorFlow Quantum is software for doing Quantum Bayesian Networks. QB nets have been a dream of mine for 24 years, although Google's paper, despite having 20 authors and 129 references, never cites any of my work. When I first had the idea of Quantum Bayesian Networks, I thought it was such a cool idea that, within a span of a year, I published a paper, filed for a patent and wrote a computer program called Quantum Fog about it (The original Quantum Fog was for the Mac. It was written in C++, with the GUI written using a C++ class library called PowerPlant. Much later, I re-wrote Quantum Fog in Python and released it as open source at github).It was the first paper I ever posted on arXiv, and the first patent I ever filed, and the first and last :) Macintosh program I ever wrote. The patent expired on 2016-01-11, but Google Tensorflow was first released to the public on Nov 2015, so maybe I can sue them for 5 bucks? :)My blog, now 12 years old, is called Quantum Bayesian Networks for a reason: my intense passion and belief in this dream of mine.Note that Tensorflow Quantum is a Tensorflow implementation of an earlier Google software called TensorNetwork. I am glad that they are now calling it Tensorflow instead of TensorNetwork. The word TensorNetwork implies an undirected graph whereas the word TensorFlow implies an acyclic directed graph (DAG). I wrote an earlier post about Google's TensorNetwork software Google's TensorNetwork software versus Quantum Bayesian NetworksScreen shots of Mac Application Quantum Fog, first released about 20 years ago: See More