Quantum Bayesian Networks

January 21, 2019

Qubiter TODO/Proposal: Loop Dependent Evaluation of Placeholder Variables (quantum programming languages, loops)

Filed under: Uncategorized — rrtucci @ 7:24 pm

This article is a proposal for a feature that I think would be cool for Qubiter to have. I’m not sure that there is a pressing need or strong interest for this feature in the community of qc programmers, so I will delay adding it to Qubiter until enough people ask for it. Color me doubtful that anybody will.

So this is the plan:

Below, we will use the language that Qubiter uses in its “English Files”. That language is explained succinctly in Qubiter’s Rosetta Stone pdf document:


Qubiter already has loops implemented. The beginning of a loop called 5 with 15 repetitions is indicated in an English File by the line


and the end of loop 5 is indicated by


In fact, Qubiter already accepts loops embedded inside loops, with an arbitrary number of embeddings possible.

Qubiter already has Placeholder variables implemented too. Their usage is illustrated in the following Jupyter notebook


The plan is to combine loops and placeholder variables. Here is a simple example that conveys the potential of this plan. Suppose we have an English File that looks like this:

ROTX #1 AT 0
ROTX #2 AT 0

Then we can feed to the simulator constructor a dictionary that looks like this

var_values =
(0, _): {#1: 0.1, #2: _}
(1, _): {#1: 0.2, #2: _}
(0, 0): {#1: _, #2: 0.0}
(0, 1): {#1: _, #2: 0.1}
(0, 2): {#1: _, #2: 0.2}
(1, 0): {#1: _, #2: 0.3}
(1, 1): {#1: _, #2: 0.4}
(1, 2): {#1: _, #2: 0.5}

The `var_value` dictionary gives the values that the placeholder variables `#1` and `#2` will be assigned for each repetition of the loops. The keys of the `var_value` dictionary are a pair of numbers indicating which repetition is being serviced. The first number is the repetition index of LOOP 1, and the second number is the rep index of LOOP 2.

Update (Jan 22, 2019): I was thinking of possible applications of single and nested loops in quantum languages. Implementing the Trotter approximation, Grover’s algorithm, and the algorithm commonly referred to as QAOA, with a single loop are 3 obvious applications. Implementing the Trotter-Suzuki approximation would require not just one loop, but several nested loops. Last night, I wrote a simple jupyter notebook investigating further the implementation of Trotter-Suzuki with nested loops. Here it is


The importance of loops in quantum languages begs the question, why do they arise at all? In classical programming languages, loops embody determistic repetitive (possibly adaptive repetitive) tasks. In quantum programming languages, they embody Markov chains. Both are ubiquitous in Nature. Nested loops describe tree structures, also very common in Nature.

Update (Feb.3, 2019): I decided to do this anyway. Here is a Jupyter notebook explaining what I did



January 20, 2019

Bad Chemistry Between the 3 Quantum Chemistry Supremos

Filed under: Uncategorized — rrtucci @ 6:43 am

On Oct 2017, a year and 3 months ago, I reported in this blog on some news that was making the competition in quantum computing between Microsoft, Google and IBM, resemble, at least to me, a fierce, vicious Sea Battle between 3 avaricious sea superpowers. Think Battle of Trafalgar.

A year later, things have only gotten worse. These 3 superpowers are now engaged in what the French call a Mêlée à Trois, a truel instead of a duel, a situation that resembles the Three Kingdoms Period (220–280 A.D.) in the history of China, when China was divided into 3 kingdoms of similar size, each having an emperor who claimed that he ruled over all of China.

As an example, take a look at their war of supremacy over the use of quantum computers to do Chemistry.

Google has a qc Chemistry library called OpenFermion. To their credit, they wrote an arxiv paper on October 2017 describing it. https://arxiv.org/abs/1710.07629
Here is the header of that paper.

As you can see, the paper has more than 30 authors, and not a single one of them is from IBM or Microsoft. And if you visit the github repo for OpenFermion today, you can read a more recent list of contributors that again shows no trace of Microsoft or IBM.

Not only that, but that list of OpenFermion contributors doesn’t show the names of Matthias Troyer (Microsoft) or Aspuru-Guzik (Zapata), two famous people in the qc Chemistry world that are often included in such collaborations.

Microsoft has also written its own qc Chemistry library with no apparent help from the other 2 Kingdoms (MS did enlist the help and rely on the old software of a DOE lab situated in Washington state, the Pacific Northwest National Laboratory)

About two weeks ago, IBM released their own qc chemistry library (qiskit-chemistry) and that one, once again, shows no hint of cooperation with the other 2 Kingdoms.

When I first started writing the Python version of Qubiter, I wrote some quantum chemistry code for Qubiter, but I soon sensed that the qc Chemistry community was very political and that those people would never welcome me or my software in their midst, so I stopped writing qc Chemistry software. Knowing now what has transpired since then, I think I made the right call then! Nowadays, I like to imagine our open-source software aggregator http://www.Bayesforge.com as a carrier pigeon, or a drone that flies high above several medieval, fortified, walled cities, taking messages from one to the other. The walled cities are called Microsoft, Google, IBM, Rigetti, IonQ etc.

IBM Qiskit major update, Qubiter follows suit 2 weeks later

Filed under: Uncategorized — rrtucci @ 2:22 am

Hello my fellow quantum computerists, this is my “State of the Qubiter” address delivered from a chamber of my House of Representatives.

In case you missed it, IBM recently released a major two-fer-one improvement to their quantum computer. On Jan 2, they delivered a new Batman inspired skin for their hardware (I reported on that in this blog post). Then on Jan. 7, they done gone released some major improvements to their software. (They wrote a nice blog post here about their new software releases for Qiskit-terra and Qiskit-aqua). From that blog post, I learned that they have added NOTs with multiple controls and a function that draws an ASCII picture of the circuit. BRAGGING: I’m glad they have done this, but let me point out to potential investors in our company Artiste-qb.net that Qubiter has had those 2 features for the last 2 years or longer. In fact, I wrote a short article 10 years ago in this very blog about ASCII pictures of quantum circuits. And I have been equally vociferous in advocating the need for qc simulators that support NOTs with an arbitrary number of controls.

Another important advance in the new release of the Qiskit software is that what IBMq now calls Terra is really a Python front end to what they had before, which was a language minted by them that they called qasm 2.0, quite independent of Python, for specifying quantum circuits. Qubiter, Rigetti Pyquil, and Google Cirq have always had a Python front-end for specifying quantum circuits, so this is just IBM belatedly joining all of us. Welcome IBM, better late than never.

IBM has essentially chosen to store a quantum circuit in memory as a Python list with gates as items. This is what PyQuil and Cirq have been doing from day one. This is not, however, what Qubiter normally does. Qubiter stores the circuits in text files. Or at least, that is what it used to do. In the last week, I have added a new class to Qubiter called EngFileLineList. This class can read a Qubiter English file and store that as a list with single gates as items. The class EngFileLineList owns such a list, and it has methods for reading and writing files of the English and Picture types used by Qubiter. So now Qubiter can store quantum circuits both as files and as lists in memory. Storing the whole circuit in memory is more convenient than storing it in a file, for some purposes, but for other purposes, the opposite is true. Luckily, now Qubiter can do both.

In the last week, Qubiter has been updated in many other ways besides adding the EngFileLineList class.

We have added Placeholder Variables, as reported in this blog post. This is an extremely useful feature, especially for doing hybrid classical-quantum Noisy quantum computing. Now Qubiter, PyQuil and Cirq have this feature, but IBM Qiskit still doesn’t, as far as I can see.

I have also updated Qubiter’s translation classes that translate Qubiter to the 3 target languages PyQuil, Cirq and IBM Qiskit. They now take into account and support all the most recent changes in Qubiter and in the 3 target languages. I admit it, I love ROSA (wRite Once, Simulate Anywhere). You will love her too.

Check out Qubiter’s new jupyter notebooks illustrating its new Placeholder and translation services.



January 13, 2019

Qubiter compared with other wines

Filed under: Uncategorized — rrtucci @ 4:49 am

The following cartoon by the famous author James Thurber makes me think of Qubiter as a young upstart wine and of myself as a wine lover.

Here is a table pointing out several cool features that Qubiter already has but that the 3 other most popular quantum computer languages don’t all have. (Having a feature is indicated by a gold star). I am sure that the big 3 will eventually catch up with Qubiter, but it may take a long time because big generic software/wine manufacturers can sometimes move as slowly as molasses.


I have previously compared Qubiter with the 3 other major qc languages using analogies to sea vessels


January 11, 2019

Qubiter now has Placeholders for gate angles

Filed under: Uncategorized — rrtucci @ 5:38 am


The word “Placeholder” is used in Qubiter (we are in good company, Tensorflow uses this word in the same way) to mean a variable for which we delay/postpone assigning a numerical value (evaluating it) until a later time. In the case of Qubiter, it is useful to define gates with placeholders standing for angles. One can postpone evaluating those placeholders until one is ready to call the circuit simulator, and then pass the values of the placeholders as an argument to the simulator’s constructor. Placeholders of this type can be useful, for example, with quantum neural nets (QNNs): in some QNN algorithms, the circuit gate structure is fixed but the angles of the gates are varied many times, gradually, trying to lower a cost function each time.

This brief blog post is to announce that Qubiter now has such placeholders. Hurray! Placeholders is a nice feature that Google’s qc simulator Cirq and Rigetti’s qc simulator PyQuil, already have (they call them parametric or symbolic gates), so it has been irking me for some time that Qubiter didn’t have them too. Got to keep up with the Joneses and the Kardashians, you know.

Qubiter implements placeholders via a class called PlaceholderManager. You can already read an example of placeholder usage in the main() method at the end of that class. I also intend to write a Jupyter notebook, probably this weekend, illustrating their use.

January 10, 2019

IBM Relases 20 Qubit Commercial Quantum Computer, Code Name “batbeer tank”

Filed under: Uncategorized — rrtucci @ 6:53 pm

On Jan 8, IBM unveiled the “World’s First Integrated Quantum Computing System for Commercial Use”. Just imagine, deep down in a shadowy batcave in Yorktown Heights, New York (conveniently located next to Gotham City), in a dank, dark corner of an already dark cave, amid the otherwordly din of bat squeaks and the flapping sound of their wings, and the overpowering smell of bat urine, sits a brewing tank for producing inky black batbeer, made with mysterious black waters found in the cave. Here is what it looks like (bat beer logo by Tony Matýšek)

There is a vast amount of prior research about the scientific subject of batbeer . Here is a small fraction of such work. This list was provided to us by U.S. Supreme Court Justice Brett Kavanaugh, compiled by him during one of the rare moments when he is sober and not barfing, or lifting weights with his buddies “P.J., and Squi, and Handsy Hank, and Gang-Bang Greg” (SNL/Matt Damon verified fact) , or dutifully filling his 2019 calendar/lab notebook. You can Google the keyword “batbeer” yourself and obtain a more complete reference list.


January 5, 2019

Daphne Koller: “Use the Bayesian-Network-Force, Luke. Let Go!”

Filed under: Uncategorized — rrtucci @ 7:47 pm

Daphne Koller, Stanford Prof., writer with Nir Friedman of a monumental and ground breaking book on Bayesian Networks, inventor of the concept of Markov blankets (my favorite security blanket) and much else related to B nets, cofounder with Andrew Ng of the Coursera MOOC company, where she taught a course based on her B net book, is at it again. On May 2018, she founded the startup Insitro (home page, crunchbase page) which promises to leverage the power of Bayesian Networks for drug discovery. At artiste-qb.net, we are big advocates of applying quantum bayesian nets (invented in 1997, also the name of this 10 year old blog) to quantum computing.

January 4, 2019

A quantum computing paradox, Generalized Toffoli Gates

Filed under: Uncategorized — rrtucci @ 12:32 am

Call me Simplicio.

Let a Generalized Toffoli (GT) gate be a quantum gate, acting coherently on N+1 qubits, that rotates a target qubit subject to the state of the other N qubits acting as controls. If you calculate, with a classical computer, the effect of a GT gate on an input state vector, the larger N is, the fewer multiplications you will have to perform. On the other hand, if you expand a GT gate into a sequence of single qubit rotations and CNOTs, the minimal number of CNOTs in such an expansion will grow exponentially in N. Huh?

This paradox seems to imply that it behooves quantum computerists to find a way of implementing GT gates in their hardware in a single step, as I advocated in this previous blog post of mine.

January 3, 2019

Primo job opportunity, Quantum Computing Job at Tencent America

Filed under: Uncategorized — rrtucci @ 8:12 pm

At artiste-qb.net, we admire Tencent very much. Our Bayesforge docker image is on the Tencent cloud. See


So we want to alert our friends to the following job opening:

Senior Researcher – Quantum Computing
Company Name: Tencent America
Location: Palo Alto, CA, US

Posted 3 weeks ago


Nostradamucci Prediction for 2019: Qubit Ring Molecules and Generalized Toffoli Gates will be crucial for quantum AI

Filed under: Uncategorized — rrtucci @ 5:09 am

Nerdy, speculative blog post ahead. Better skip this one and go on to the next one. Or, if you want really speculative, stoner lit., read a Quanta Magazine article instead.

Read this at your own peril!

December 26, 2018

I bring you good tidings on this Christmas Day! Bayesforge is now listed on the Tencent Cloud (t’was previously listed on Amazon Cloud)

Filed under: Uncategorized — rrtucci @ 3:32 pm

Today on Christmas day 2018 (or a day after, but close), our internal Slack channel brings us good tidings from the East. Our man in Shenzhen, Artiste-qb.net cofounder Dr. Tao Yin, informs us that Bayesforge.com is now available on the Tencent cloud.


Previously, it was only available on the Amazon cloud (AWS), but our Chinese users complained that the Amazon cloud service in China is too slow.

December 25, 2018

Merry Christmas 2018, our best wishes for you from artiste-qb.net

Filed under: Uncategorized — rrtucci @ 12:03 am

December 24, 2018

To all Quantum Computing Startups Partnering With Microsoft, have a Merry Microsoft Christmas

Filed under: Uncategorized — rrtucci @ 6:24 pm

Microsoft has recently been touting its partnership with several qc startups.

Copycats. IBM and Rigetti have been touting bigger lists than that of qc startups for over a year. And IBM and Rigetti have actual qc hardware to offer their partners, whereas Microsoft is hardware-less.

Microsoft has been compared to Star War’s Evil Empire since the first Star Wars movie came out in 1977. And the comparison has stuck until today because it fits so well.

As a member of a qc startup (artiste-qb.net) which is not in the above partners list, I have to wonder, could a partnership with Microsoft be a trap?

As a Microsoft partner, you qc startups get no money from Microsoft. What you do get is that MS now expects you to write software for them, for free, in their opaque language Q# (aka Krysta’s Curse), a qc language that is as popular as the Zune. Q# is a Rube Goldberg contraption that will soon come crashing down

To all qc startups partnering with Microsoft, here is what happens if your faith in Q# waivers

Darth Vader GIF - Find & Share on GIPHY

And if you have any good ideas of your own, or an employee that is key to your company, will Microsoft appropriate them and cast you aside? Did MS get to be a giant monopoly by nurturing young competitors? “Do you still believe in Santa?, because, at seven, it’s marginal.” (Quote from the 45th president of the USA, Donald J. Dump)

Here is what it must feel like to be an MS partner.

(Xmas card by Peter Cross)

December 16, 2018

Galactic Battle now going on in Quantum Space Between our Google OverLords and Dubai Inc.

Filed under: Uncategorized — rrtucci @ 6:41 pm

Recently, the company IonQ announced that they have already built and are operating an ion trap quantum computer with 160 FULLY CONNECTED high fidelity qubits. The device’s 1-qubit and 2-qubit gate fidelities are reported to be 99.97% and 99%, resp. See IonQ’s press release, and Gizmodo article.

The thing that may have escaped the attention of casual readers because it is rarely emphasized, although it isn’t hidden (see Wikipedia article on IonQ), is that IonQ’s main investor is GV=Google Ventures, which is a wholly owned subsidiary of Alphabet, the umbrella company that owns all Googlish subsidiaries. A tree diagram of all Alphabet companies is quite impressive (and scary). In other words, IonQ is really just a branch of Google in disguise. So Google is betting big on both an ion trap and a Josephson junction quantum computer. Don’t know about you, but in the last five years, I have grown highly dependent on Android (a Google product) with its mostly proprietary Google apps, Google search, Chrome, Gmail, Google Maps, Google Drive, YouTube, Google News, TensorFlow, … I seem to find Google under every rock these days. And they are now aiming to control what I call the ‘Holy Trinity’: cloud, AI and quantum computing.

Meanwhile, in another sector of quantum space, Rigetti computing is getting ready to attack our Google Over Lords. Rigetti started in 2014. At that time, it seemed to me to be a joke company started by a $2.5M seed investment from the controversial billionaire Tim Draper. But since then, Rigetti has been funded to the tune of $120M, according to Crunchbase. So where did this flash flood of money come from? According to Wikipedia, the main Rigetti investors are Vy Capital (> $40M) and Andreesen Horovitz (> $24M). Vy Capital is based in Dubai, United Arab Emirates. It is reasonable to assume that Vy Capital’s extravagant spending habits and penchant for high risk is fueled by super rich Arab investors. So Vy Capital, aka Dubai Inc., is the main investor of Rigetti.

So you see, there is indeed a galactic battle going on between 2 Google quantum clones and Dubai Inc. But it gets better:

Like I said before, at first I considered Rigetti to be somewhat of a joke, but now that so much money has been invested in them, it is much harder for me to be dismissive about them. Once Dubai Inc invested the $40M in Rigetti, many smaller “lemming” VC’s followed, because they realize that now Rigetti has become too big to fail as an investment. And Rigetti/Dubai Inc have promised some very attractive sweeteners this year: A 128 qubit qc by next year, a cloud service for hybrid quantum-classical AI, and a $1M prize for the first proof of a quantum advantage. My suspicion is that Dubai Inc. is prepping up Rigetti, making it attractive, so that Microsoft buys it for a few billion dollars. Microsoft might fall for it, because they won’t have a topological qc for many years, if ever, and their obscure quantum language q# is flopping badly, as I predicted. This is actually a common practice in Silicon Valley. They like to jack up the valuation of a startup, and then, instead of doing an IPO, sell it to one of the giant monopolies like Microsoft, Apple, Facebook, Google, Amazon (MAFGA, a portmanteau of MAFIA and MAGA)

December 10, 2018

Scotty: “Captain, the quantum entanglement wormhole tunnel that you requested is now operational”

Filed under: Uncategorized — rrtucci @ 9:13 pm

Many prestigious physicists believe that the phenomenon of quantum entanglement is at the very heart of quantum computing and quantum information theory. For example, John Preskill of Caltech uses the word entanglement in every title of every talk and paper he ever writes, or so it seems. Lately, other very famous particle physicists, for instance, Leonard Susskind and Ed Witten, have also begun to sing the praises of quantum entanglement. And it’s not only old timers that babble about it. It seems almost everyone does, young and old, knowledgeable and clueless.

If you Google “quantum entanglement”, and look at the images, you will find a plethora of attempts to illustrate q entanglement graphically. Some illustrations are very whimsical and cute, some are very wrong too, in my opinion. But I won’t be judgemental. Visual analogies are an important part of the fun of doing physics. We start with analogies that are a bit off, but, hopefully, as time goes on, we refine them. When I was a kid, I used to like to picture an alpha particle as a daisy with 4 petals, 2 proton ones and two neutron ones. Hey, not very sophisticated, but at least it allowed me to remember a few basic facts about the Helium nucleus. This morning, I got inspired to try my own hand at picturing quantum entanglement. Here is the doodle I arrived at:

BRIEF EXPLANATION OF IMAGE, only for the theoretically inclined: Starship Ada and Starship Bayes are in separate universes, pictured here as (half) diamond shaped areas called Penrose diagrams. A and B are both adjacent to a black hole which is also portrayed as a Penrose diagram, except that the space and time coordinates are swapped. The two walls of the black hole’s (half) diamond are its event horizon and the dashed line labelled singularity is all the times in the life of the center of the black hole. The two starships are exchanging “entanglement signals” across the event horizon of the black hole. A wormhole is normally defined as a tunnel that connects two Penrose diagrams that overlap at a single corner vertex. The wormhole occupies the single common vertex of the two universes. If you fold the above figure about its middle vertical axis, then the Penrose diagrams of Ada and Bayes sit on top of each other, and are identified as the same universe. Also, the original single black hole becomes two black holes with a wormhole connecting the bottom black hole to the top one. Now you can envision Ada and Bayes as existing in the same universe, but one Starship is close to the top black hole and the other Starship to the bottom one. This is all standard black hole physics. People actually believe this shit.

To paraphrase Mark Twain: “Everybody talks about q entanglement, but nobody does anything about it”. In particular, for me, a programmer with a Ph.D. in physics, I would like a nice software library for calculating various quantities related to quantum entanglement. Just calculations of down to earth, widely accepted theory. Nothing fringy. I looked around for such a library and found none that I liked so I wrote my own. My software library “Q Entanglement Lab” is now finished and it works like a charm. I suspect it could become some of the most influential work I’ve ever done. I had to invent several new, fairly clever if I may say so, algorithms for calculating entanglement. I am very pleased with how well they work. Of course, at first, they didn’t work at all, so I had to sweat bullets to refine and debug them until they did work.

I still haven’t decided when or how to release “Q Entanglement Lab”. I want it to be open source eventually, but first, I will seek to patent it in China, with the assistance of Dr. Tao Yin. Tao is a cofounder of our company artiste-qb.net, and he runs a separate company, an “affiliate” of artiste, based in Shenzhen, where he lives. If I get that patent in China, I will also try to convince some of our friends that work at Sunway Taihu Light to run an HPC version of my “Q Entanglement Lab”. I spoke about this in a previous blog post

« Previous PageNext Page »

Create a free website or blog at WordPress.com.

%d bloggers like this: