Below is an excerpt from the docstring for the QEdward class called NbTrolsModel. The excerpt gives the quantum circuit for the NbTrolsModel

```
...
Below we represent them in Qubiter ASCII
picture notation in ZL convention, for nb=3 and na=4
[--nb---] [----na-----]
NbTrols (nb Controls) model:
|0> |0> |0> |0> |0> |0> |0>
NOTA P(x) next
|---|---|---|---|---|---Ry
|---|---|---|---|---Ry--%
|---|---|---|---Ry--%---%
|---|---|---Ry--%---%---%
NOTA P(y|x) next
|---|---Ry--%---%---%---%
|---Ry--%---%---%---%---%
Ry--%---%---%---%---%---%
M M M
A gate |---|---Ry--%---%---%---% is called an MP_Y Multiplexor,
or plexor for short. In Ref.1 (Qubiter repo at github), see Rosetta Stone
pdf and Quantum CSD Compiler folder for more info about multiplexors.
```

If you look up the definition of a multiplexor in the Qubiter repo and references therein, you will notice that a multiplexor is a real-valued gate. Hence this model, since it only uses multiplexor gates, does not parametrize the full family of complex-valued amplitudes that are allowed in quantum mechanics. The NbTrolsModel does parametrize the whole family of possible (real-valued) probability distributions P(y|x) and P(x), where and , where is an element of 0, 1 for i=0,1,2,…6

So how can we generalize the model NbTrolsModel so that it parametrizes all possible complex-valued amplitudes too. One possibility is as follows. (call it the C_NbTrolsModel)

```
|0> |0> |0> |0> |0> |0> |0>
NOTA A(x) next
|---|---|---|---|---|---Ry
|---|---|---|---|---|---%
|---|---|---|---|---Ry--%
|---|---|---|---|---%---%
|---|---|---|---Ry--%---%
|---|---|---|---%---%---%
|---|---|---Ry--%---%---%
|---|---|---%---%---%---%
NOTA A(y|x) next
|---|---Ry--%---%---%---%
|---|---%---%---%---%---%
|---Ry--%---%---%---%---%
|---%---%---%---%---%---%
Ry--%---%---%---%---%---%
%---%---%---%---%---%---%
M M M
```

This new model contains twice as many layers as the old one. Each multiplexor gate from the old model has been followed by a “diagonal unitary” gate consisting of only % or | symbols, for instance,

`|---|---|---%---%---%---%`

```
```

`. You can look up the definition of such a gate in the Qubiter repo, in the same places where you found the def of a multiplexor. In this example, D = `

` %---%---%---%`

represents a 2^4=16 dimensional diagonal unitary matrix and =

` |---|---|`

represents the 2^3=8 dimensional unit matrix. The whole gate is , which is a 2^7=128 diagonal unitary matrix.

To motivate what is going on in this C_NbTrolsModel model, let me claim without proof that the first two lines of the circuit parametrize a complex amplitude , the next two lines , the next two and so forth.

If and , then

.

This is just a generalization of the chain rule for probabilities which for 3 random variables is

To go from the chain rule for probabilities to the chain rule for amplitudes, we just take the square root of all the probabilities and add a bunch of relative phase factors, leading to

Warning: Note that the expansion of a multiplexor (and of a diagonal unitary) into elementary gates (cnots and single qubit rotations) contains a huge number of gates (exp in the number of controls). However, such expansions can be shortened by approximating the multiplexor (or the diagonal unitary) using, for instance, the technique of Ref.2: Oracular Approximation of Quantum Multiplexors and Diagonal Unitary Matrices, by Robert R. Tucci, https://arxiv.org/abs/0901.3851 Another possible source of simplification: just like

represents a fully connected graph which simplifies to

if c is independent of b, in the same way, the chain rule in these QdEdward models might simplify due to certain conditional independences in the data.

In Qubiter, the Quantum CSD Compiler decomposes an arbitrary unitary matrix into a product of multiplexors and diagonal unitaries. Qubiter also allows you to decompose multiplexors and diagonal unitaries into elementary ops (CNOTs and single qubit rotations). For example, Qubiter's CSD compiler will expand an arbitrary 3 qubit unitary matrix into the following:

```
%---%---%
%---%---Ry
%---%---%
%---Ry--%
%---%---%
%---%---Ry
%---%---%
Ry--%---%
%---%---%
%---%---Ry
%---%---%
%---Ry--%
%---%---%
%---%---Ry
%---%---%
```

Hence, a QNN is like a portion of the expansion of an arbitrary unitary matrix.

When one uses complex-valued layers, the definition of ELBO must be in terms of density matrices, not classical prob distributions.

]]>Ian Andtek (once called Simon Bemudez) is a talented pianist and all around musician plus a highly skilled AI/Machine-Learning and graphics programmer. Born and raised in Venezuela, he is now a proud Canadian citizen. He will be giving a concert with his one-man, AI simulated orchestra at our usual venue/hangout, Zero Gravity Labs (free pizza? yes)

We are really pleased and honored that Ian is a member of our company artiste-qb.net. Our company is now more than just a company dedicated to quantum computing software. We aim to become an all around AI/ML company, with special emphasis in Bayesian Networks and TensorFlow, both quantum and classical. So combining music and AI falls well within our Jeff Bezos-Ian sized plans.

Below is Ian playing a musical piece composed by himself, called Ilusiones (Illusions)

]]>http://www.ar-tiste.com/quantum_ed_talk/QuantumEdwardTalk.pdf

Typical slide from deck. I chose a pastel background color scheme to remind the audience of ice cream, gelato, etc.

]]>

Judea Pearl, UCLA professor, winner of the Turing Prize in Computer Science, is a hero to all Bayesian Network fans like me. Pearl has several books on B nets, as you can see at his Amazon page.. This blog post is to alert my readers to his most recent book, written in collaboration with Dana Mackenzie, released about a week ago, mid May 2018, entitled “The Book of Why: The New Science of Cause and Effect”.

To commemorate the release of the new book, I also wrote, besides this blog post, a small comment about the new book at the Edward Forum, and Dustin Tran, main author of Edward, responded with a comment that cites a very nice paper, less than 6 months old, by Dustin and Prof. Blei, Dustin’s thesis advisor at Columbia Univ, about the use of Judea Pearl’s causality ‘do-calculus’ within Edward.

I’ve been interested in the do-calculus for a long time, and have written two arxiv papers on the subject:

- Introduction to Judea Pearl’s Do-Calculus, by Robert R. Tucci (Submitted on 26 Apr 2013)
- An Information Theoretic Measure of Judea Pearl’s Identifiability and Causal Influence, by Robert R. Tucci (Submitted on 21 Jul 2013)

This paper is for classical Bayesian Networks, but it can easily be generalized to quantum Bayesian Networks, by replacing probability distributions by density matrices in the information measure proposed there.

There exist more than a dozen packages written in R that implement at least partially the do-calculus. They are available at CRAN (the main R repository, named after cranberries).

This 2017 paper contains a nice table of various R packages dealing with do-calculus.

It’s also interesting to note that BayesiaLab, a commercial software package that I love and recommend, already implements some of Pearl’s do-calculus. (full disclosure: the B net company that I work at, artiste-qb.net, has no business connections with BayesiaLab.)

By the way, artiste-qb.net provides a nice cloud service that allows you to run all these open-source do-calculus R packages on your browser, without any installation hassles. How? you ask, and if not, I’m going to tell you anyway.

***Beep, Beep, Commercial Alert***

artiste-qb.net is a multilingual (R, Python, Java, C++, English, German, Spanish, Chinese, Italian, French, you name it, we speak it) quantum open source software company.

We offer an image on AWS (the Amazon cloud service) called BayesForge.com.

BayesForge.com comes fully loaded with the Python distribution Anaconda, all of R, etc.

Bayesforge comes with most major Artificial Intelligence/Bayesian Networks, open-source packages installed, both classical ones (eg. TensorFlow, Edward, PyMC, bnlearn, etc) and quantum ones (eg., IBM Qiskit, DWave stuff, Rigetti and Google stuff, our own Quantum Fog, Quantum Edward, Qubiter, etc).

BayesForge allows you to run jupyter notebooks in Python, R, Octave (an open source matlab clone) and Bash. You can also combine Python and R within one notebook using Rmagic.

We have succeeded in dockerzing the BayesForge image and will be offering it very soon on other cloud services besides AWS, including a non-AWS cloud service in China, where AWS is so slow it is non-usable. One of our co-founders, Dr. Tao Yin, lives in ShenZhen, China, and is in charge of our China branch.

]]>One of our main projects is to program The NYC Matrix. We are almost done, thank you. In this picture, one of our elite programmers, Simón Bermúdez, is experimenting with quantum cloning of himself. Just like in The Matrix movies, but the real thing. Simón gets quite a lot of work done for us by slipping into this multiverse mode.

Google, IBM, Rigetti, DWave and Alibaba, you have been checkmated. artiste-qb.net is the only quantum computing firm that has mastered quantum cloning of employees.

Simón was born and raised in Venezuela, but now he lives in Toronto, Canada. He used to work at the illustrious Creative Destruction Lab (part of the U of Toronto) (hence the shirt in the photo). Now he works for artiste-qb.net. Thanks to Simón for letting me use this TOP SECRET photo. I lowered the resolution of the photo, the original one is even better.

]]>But one can easily come up with a BBVI that trains a qc by maximizing with respect to a parameter lambda, a “quantum ELBO” (one defined by replacing the classical probability distributions of the classical ELBO by density matrices and sums by traces). I call this second strategy “quantum supervised learning” by a qc.

One more distinction. In Version 1 of Quantum Edward, we do C. Supervised Learning by a simulated (on a classical computer, analytical) qc. More generally, one could do (C. or Q.) Supervised Learning by a (real or simulated) qc

C. or Q. Supervised Learning by a simulated qc is immune to the quantum noise that plagues current qc’s which have almost no quantum error correction. So we definitely should explore that type of learning today.

It will be interesting to compare classification performance for various models (for either layered or DAG models with varying amounts of entanglement) for

- C. supervised learning by a classical computer (e.g., for Classical Neural Net layered models or for Bayesian network DAG models)
- (C. or Q.) supervised learning by (simulated or real) qc (e.g., for Quantum Neural Network models or for Quantum Bayesian Network models)

Nerd Nirvana will only be achieved once we can do Q. Supervised Learning by an error corrected real qc.

References:

1. R. Ranganath, S. Gerrish, D. M. Blei, “Black Box Variational

Inference”, https://arxiv.org/abs/1401.0118

# Quantum Edward

Quantum Edward at this point is just a small library of Python tools for

doing classical supervised learning on Quantum Neural Networks (QNNs).

An analytical model of the QNN is entered as input into QEdward and the training

is done on a classical computer, using training data already available (e.g.,

MNIST), and using the famous BBVI (Black Box Variational Inference) method

described in Reference 1 below.

The input analytical model of the QNN is given as a sequence of gate

operations for a gate model quantum computer. The hidden variables are

angles by which the qubits are rotated. The observed variables are the input

and output of the quantum circuit. Since it is already expressed in the qc’s

native language, once the QNN has been trained using QEdward, it can be

run immediately on a physical gate model qc such as the ones that IBM and

Google have already built. By running the QNN on a qc and doing

classification with it, we can compare the performance in classification

tasks of QNNs and classical artificial neural nets (ANNs).

Other workers have proposed training a QNN on an actual physical qc. But

current qc’s are still fairly quantum noisy. Training an analytical QNN on a

classical computer might yield better results than training it on a qc

because in the first strategy, the qc’s quantum noise does not degrade the

training.

The BBVI method is a mainstay of the “Edward” software library. Edward uses

Google’s TensorFlow lib to implement various inference methods (Monte Carlo

and Variational ones) for Classical Bayesian Networks and for Hierarchical

Models. H.M.s (pioneered by Andrew Gelman) are a subset of C.B. nets

(pioneered by Judea Pearl). Edward is now officially a part of TensorFlow,

and the original author of Edward, Dustin Tran, now works for Google. Before

Edward came along, TensorFlow could only do networks with deterministic

nodes. With the addition of Edward, TensorFlow now can do nets with both

deterministic and non-deterministic (probabilistic) nodes.

This first baby-step lib does not do distributed computing. The hope is that

it can be used as a kindergarten to learn about these techniques, and that

then the lessons learned can be used to write a library that does the same

thing, classical supervised learning on QNNs, but in a distributed fashion

using Edward/TensorFlow on the cloud.

The first version of Quantum Edward analyzes two QNN models called NbTrols

and NoNbTrols. These two models were chosen because they are interesting to

the author, but the author attempted to make the library general enough so

that it can accommodate other akin models in the future. The allowable

models are referred to as QNNs because they consist of ‘layers’,

as do classical ANNs (Artificial Neural Nets). TensorFlow can analyze

layered models (e.g., ANN) or more general DAG (directed acyclic graph)

models (e.g., Bayesian networks).

References

———-

1. R. Ranganath, S. Gerrish, D. M. Blei, “Black Box Variational

Inference”, https://arxiv.org/abs/1401.0118

2. https://en.wikipedia.org/wiki/Stochastic_approximation

discusses Robbins-Monro conditions

3. https://github.com/keyonvafa/logistic-reg-bbvi-blog/blob/master/log_reg_bbvi.py

]]>The Toronto Quantum Computing Meetup is the largest meetup in the world dedicated to quantum computing, so we claim the title of Quantum Meetup Supremacy, at least for now. (currently we have 1101 Supremos as members. The second biggest club is in London with 951 Brexiters members. The ~~Quitters~~ Brexiters have been growing fast lately. We see what you are doing: trying to sneak up on us and steal our crown. You guys are pathetic! It will never happen! Never! Grow up, you bunch of Peter Paners! )

We cordially invite you to our next meeting on Friday, April 20, 2018. The Event will feature 3 local stars, “Tres Amigos”, speaking about 3 different quantum computing related topics:

- Colin Lupton (from Black Brane Systems Inc.)
- Turner Silverthorne (from Zero Gravity Labs, part of Loyalty One)
- Hassan Bhatti (from CDL- Creative Destruction Lab, part of U of Toronto’s Rotman School of Management)

There will be FREE PIZZA, courtesy of ZGL

We are eternally grateful to ZGL (Zero Gravity Lab) for providing the venue for the event. ZGL is the super cool research lab of Loyalty One.

Loyalty One is one of the largest loyalty marketers in Canada.

]]>]]>

- Zapata (U of Toronto, Aspuru-Guzik)
- Strangeworks (Austin TX, Whurley)
- QXbranch (Australia, M. Brett)
- Quantum Benchmark (Waterloo Canada, Lazaridis)
- QCWare (Ames-NASA)
- Q-CTRL (Univ. of Sidney, Biercuk)
- Cambridge Quantum Computing (London, Ilyas Khan)
- 1QBit (Vancouver)

It seems that the main thing these startups are getting is free access, which is not granted to everyone, to the 50 qubit IBM quantum computer. Not exactly like winning the lottery though. I suspect that in a few weeks, Google will grant everyone free access to their 72 qubit quantum computer.

The first company to be mentioned is Zapata, which starts with the letter Z. huh?? Inverse alphabetical order? You’ve got to be kidding me. Isn’t Zapata soon going to be one of IBM’s main competitors in the quantum chemistry arena? Isn’t IBM betting their qc farm on quantum chemistry? I hope, for IBM’s sake, that the master mind at IBM who conceived this program knows what he is doing.

Zapata has been much in the news lately.

Aspuru-Guzik, prof at Harvard for almost a decade and famous for his work using quantum computers to do chemistry, is moving to the U of Toronto in July. (I suspect that Matthias Troyer, another quantum chemistry eminence, will be offered and will accept the position at Harvud being vacated by Aspuru. If that happens, this will totally, completely deplete Microsoft’s quantum chemistry brain trust. He he).

Aspuru started Zapata a few months ago. Yesterday, Zapata announced that it obtained $5.4M in seed funding!!

All this Zapata news is very good news for us, artiste-qb.net. Our business plan has nothing to do with quantum chemistry, so there is very little overlap between Zapata and us. Zapata will attract qc talent to Toronto, artiste-qb.net’s home town. Such a high valuation for Zapata makes Artiste a real bargain.

3 of the 8 companies in the above list got their original funding less than 5 years ago by promising to investors that they would write software that would run on Dwave’s annealer quantum computer. But now they claim they were IBM’s best buddies and gate model experts all along. Gate model and annealer softwares look nothing alike. Judases!

All this IBM press coverage must have Microsoft stewing with envy. MS won’t have an anyon quantum computer for at least 5 years, if ever. But MS could easily compete with Google and IBM in the transmon quantum computer arena by buying Rigetti (or some similar, alternative startup, like Yale QC). The price of Rigetti is pocket change to MS. I’m sure such a sale is being actively discussed behind closed doors. After all, very few Silicon Valley startups ever reach IPO; instead, they either go bankrupt or are bought out by one of the giant Valley companies.

]]>