Quantum Bayesian Networks

September 20, 2016

In Love With Jupyter Notebooks, Post-Processing Your Lab Notebook

Filed under: Uncategorized — rrtucci @ 6:16 pm

I am pleased to announce on behalf of http://www.artiste-qb.net artiste-logothat our open source BSD licensed programs Qubiter and Quantum Fog now have some Jupyter Notebooks (JN’s), the first of hopefully many JN’s to come in the future. So far, Qubiter has 2 notebooks explaining Teleportation and the IBM Quantum Experience, whereas Quantum Fog has a notebook testing some ideas on how best to plot a quantum density matrix.

The way I see it, JN’s represent a method of using software that seems better suited for scientific investigations than the older method of “GUI (graphical user interface) rich” software.

Typically, GUI rich programs allow you to save some files with the fruits of your labor, but there are often several of those files, perhaps written in different formats, some human readable text formats and some propietary non-human readable ones. A JN, on the other hand, merges all those files into a single one that is stored in an open, very common, multimedia, browser readable format called JSON. The JN also records the commands that led to each of the files that are being merged plus it allows you to insert rich text comments between those files. All this makes JN’s, in my opinion, a much more unified, clear and complete way of documenting your thought process, both for yourself, and for others who might be interested in following your work.

Consider the lab or work notebooks of famous scientists (DaVinci, Darwin, Newton, Feynman, …). I for one find those brain storming and data recording documents endlessly fascinating and hope they continue to be written on paper and by hand till the end of humanity, but even those historic documents would have benefitted from some post-processing using the full panoply of modern computer tools now available to us. Imagine a Leonardo or a Darwin or a Feynman notebook with simulations and some plots and statistical analysis. Raw data can be post-processed using statistical packages. Thorny equations can be post-processed too, with symbolic manipulation programs, numeric algorithms programs and plotting programs. Such post-processing is what JN’s allow us to do.

The idea of writing software for creating such notebooks is not new. Although probably not the first software to use them, Wolfram’s Mathematica did much to popularize them. Even if you have never heard of JN’s, you probably have encountered Mathematica notebooks by now, wonderful multimedia files that can contain and execute Mathematica code, plots, animations, text with Latex equations embedded in it, etc. JN apps do all of that too, but they are open source under BSD license. They are much more adaptable to other platforms. They also rely more on browser and internet software resources (HTML, JavaScript, MathJax for LaTeX rendering, JSON format…) so they are ideally suited for an application running on the cloud, although they can also be run autonomously on a single PC.

JN’s were originally built as an app that ran on top of IPython, a command shell for Python, but the app has been carefully written so that it can be easily assimilated by other computer languages. 30 to 40 computer languages already have JN’s, including many languages that are not interpreted languages. Interpreted languages are languages like Python and Mathematica that are designed to run one line at a time.

Home of project Jupyter:

The original programmer of IPython and JN is Fernando Perez. Here is blog post by him describing JN history.

August 28, 2016

Toronto is Hosting a Galactic Jamboree: Quantum Computing from a Business Perspective

Filed under: Uncategorized — rrtucci @ 7:28 am

I’m proud to announce that the Toronto quantum computing meetup group will meet again on Sept 7 at a room that belongs to the Creative Destruction Lab, which is part of the Rotman Business School of the Univ. of Toronto. This meetup is being run by Henning Dekant (Henning and I recently founded a quantum computing software startup called artiste-qb.net).

We hope that this Sept 7 meeting, because it will be held at a business school venue, will encourage dialogue between technical and business people, the pocket protector and suit & tie wearers, with a common interest in quantum computing. And of course, rich investors, the Gucci shoe wearers, are welcome to this humble gathering too. If you are an entrepreneur who wants to start your own quantum computing company, or an investor mulling over investing in one, this meeting is a once in a lifetime opportunity for you.

Let me note that Silicon Valley also has a Quantum Computing meetup, but theirs is of inferior quality compared to the Toronto one. Their group probably loves Uber, the Silicon Valley based company with the worst customer support in the history of mankind, whereas Toronto has been in the forefront of curbing Uber. So you can see why the Toronto Quantum Computing meetup is far superior to the Silicon Valley one. In 200 years, George Bailey will become George Jetson and he’ll be flying down the road observing billboards such as this



August 14, 2016

Quantum Fog on the verge of becoming Sentient: it can now distinguish between (the words) “Good” and “Evil”

Filed under: Uncategorized — rrtucci @ 7:29 pm

midnigh-garden_good_evilYou have to start somewhere. First those 2 words, then … the Oxford Dictionary?

I am pleased to announce that I and http://www.artiste-qb.net have added a new, major addition to Quantum Fog. QFog can now learn classical (and quantum) Bayesian Networks from data fairly well by today’s standards.

As far as I am concerned, the gold standard for software that learns bnets from data is bnlearn, by Marco Scutari. To show my readers how the current Quantum Fog and the current bnlearn compare, I took a snapshot of a portion of the home page of http://www.bnlearn.com, the portion that enumerates the various algorithms that bnlearn can do, and I put a red check-mark next to those that QFog can now do too. As you can see, QFog is still behind bnlearn, but not by too much.


So why am I trying to replicate bnlearn, isn’t that silly? Because bnlearn is in R, whereas I want to write something in Python, using Pandas. Furthermore, I want to write a software library that allows you to analyze BOTH, classical and quantum bnets alongside each other.

Pandas is a Python library that replicates many of the statistical capabilities of R. R is super popular among statisticians, but Pandas, less than a decade old, has also received many plaudits from that community. The original author of Pandas, Wes McKinney, has written a wonderful book about Pandas, numpy and, more generally, about doing data science with Python.

There are very close ties between the R and Python communities, and it’s fairly easy to call R subroutines from Python and vice versa. Pandas was Wes McKinney’s love poem to R. In the future, I and http://www.artiste-qb.net are planning to use bnlearn subroutines often. At first, I’m sure that most bnlearn subroutines will perform better than those of Quantum Fog and that we can improve QFog a lot by comparing its performance, architecture, and output with that of bnlearn.

There are certain aspects of bnlearn that we haven’t replicated yet. For example, bnlearn does continuous (just Gaussian) bnets whereas we don’t yet. In the quantum case, Gaussian continuous distributions would entail coherent and squeezed coherent states. Let the LIGO people worry about that.

On the other had, at this point, QFog’s inference capabilities are better than those of bnlearn. QFog can do the message passing join tree algorithm and bnlearn can’t. (At present, bnlearn can do inference only using Monte Carlo)

And then there is the Judea Pearl do-calculus, both for classical and quantum bnets. Neither bnlearn nor QFog can do that yet, but some day soon… BayesiaLab is way ahead of everyone else in that regard. They already have a beautiful graphical implementation of the Judea Pearl do-calculus stuff for classical bnets.

Added later: Judea Pearl do-calculus has also been implemented in the following R package. Thanks to M.S. for telling me about this:

July 26, 2016

Toronti, la nuova Roma di computazione quantistica

Filed under: Uncategorized — rrtucci @ 6:40 am

Sono un principiante in Italiano, ma lo amo.

Toronto is Canada’s most populous city with 2.6 million people. It is a 1.5 hour drive from Waterloo, Canada, home of the IQC (Institute for Quantum Computing, a misnomer, should be Institute for Quantum Cryptography) and PI (Perimeter Institute, where Justin Trudeau works). The University of Toronto, Canada’s largest university, is well known for its expertise in AI and Bayesian networks too. Geoffrey Hinton, a famous Deep Learning, Neural Networks researcher, worked at the Univ. of Toronto before he was hired by Google in 2013. Also, IBM, a mayor competitor in the race to build a gate model qc, has substantial research facilities in the Toronto area.

Henning Dekant (in Toronto) and I (in Boston) recently started a quantum computer software company called artiste-qb.net (our company logo artiste-logo)

I am writing this blog post to announce that

  • artiste-qb.net is now hiring 2 student interns (at almost minimum wage, sorry) to write software, open source of course
  • Henning is starting a quantum computing Meetup in Toronto

    Quantum Computing and Data Science

    Toronto, ON
    1 Members

    The future of computing has come out of the labs. Software development for quantum computing is happening in the GTA, and this meetup aims at bringing people from this fledgli…

    Check out this Meetup Group →

Some say the most powerful weapon in the Galaxy is the Death Star, but this is better.

July 14, 2016

Quantum Fog, a quantum computer simulator based on quantum Bayesian networks, can now Think (at least better than a rock)

Filed under: Uncategorized — rrtucci @ 6:51 pm

Today, I added a folder called “learning” to Quantum Fog. QFog is a quantum computer simulator based on Bayesian Networks (bnets). Classical Bayesian networks are what earned Judea Pearl a Turing Prize. Quantum Fog implements seamlessly both classical Bayesian networks and their quantum generalization, quantum Bayesian networks.

The way I see it, the field of classical Bayesian networks has had 2 Springs.

The first Spring was about 20 years ago and it was motivated by the discovery of the join tree message passing algo which decreased significantly the complexity of doing inference with bnets. That complexity is exponential regardless, but the join tree algo makes it exponential in the size of the largest clique of the graph.

The second Spring is occurring right now, and it is motivated by the discovery of various algorithms for learning bnets by computer from the data. Immediately after the first Spring, bnet inference could be done fairly quickly, but the bnet had to be divined manually by the user, a formidable task for bnets with more than a handful of nodes. But nowadays, that situation has improved considerably, as you can see by looking at my 2 favorite open source libraries for learning bnets from data:

  1. bnlearn. Very polished, R language. Written by Marco Scutari
  2. neuroBN, a less polished but very pedagogically helpful to me. Python language. Written by Nicholas Cullen

Its new ”learning” folder gives Quantum Fog a rudimentary capability for learning both classical bnets and quantum bnets from data.(so far QFog can only do Naive Bayes and Chow Liu Tree algos. Soon will add Hill Climbing, Tabu, GrowShrink, IAMB and PC algos) Previous workers like Scutari and Cullen only consider cbnets. Quantum Fog aims to cover both cbnets and qbnets seamlessly. We hope QFog can eventually generate ”programs” (instruction sequences) that can be run on real quantum computer hardware.

Quantum Fog goes to pet school


June 24, 2016

Qubiter’s Excellent Adventure, an Out of Body Quantum Experience with IBM

Filed under: Uncategorized — rrtucci @ 9:20 pm

On the first week of May, 2016, IBM released, to much fanfare, on the cloud access to a 5 qubit, gate model quantum computer. And with a very nice graphical interface and accompanying simulator to boot, so you can compare the experimental results to the theoretical ones (neglecting noise). They call their service “Quantum Experience” (QE as in Queen Elizabeth, very pro British). You can join QE and use it yourself here The service is free and available to everyone.

I haven’t been blogging too much lately because I’ve very been busy programming my newest project and raising Cain with my silly jokes on Twitter, but it would be a crime if I didn’t write something about this historic for quantum computing release. So here we go.

Much has been written about QE already. Some “experimental” papers have been submitted to arXiv (for example,
https://arxiv.org/abs/1511.00267 ).
Not exactly Fermi caliber experiments, but certainly fun and educational to some. Also, some programmers have written their own simulators and put them on github
(for example, Ganesh, Corbett, Bengualid, and many others)

As my own contribution to all this lively, welcomed activity, I uploaded to Qubiter’s github repo

this script

The script illustrates how to use Qubiter to simulate QE. It outputs

a Picture file and
an English file

for a simple quantum circuit that uses all the gates and only the gates currently realizable by QE. The script also writes on the Python console the probabilities of each of the 5 qubits at the end of the evolution specified by the given initial state vector and quantum circuit.

Of course, Qubiter is capable of simulating much more complicated quantum circuits. This is like a “Hello World” exercise for it. Qubiter is so powerful that it is already capable of simulating the Matrix v0.01. Okay, I’m exaggerating just a little bit. At present, Qubiter can do quantum Fourier transforms, quantum phase estimation, and quantum chemistry (finding ground state energies of simple molecules)

June 8, 2016

Microsoft Quantum Computing Software Patents, A Watch Page

Filed under: Uncategorized — rrtucci @ 6:21 am

This blog post will be dedicated to posting links to Microsoft quantum computing software patents. I will keep adding to it as I become aware of newer patents. My method of finding patents is to use the USPTO search engine for granted patents with the queries:

AN/Microsoft AND IN/Wecker

AN/Microsoft AND IN/Svore

Note that the USPTO also has a search engine for patent applications that are not yet granted. I am not listing those here. You can use that search engine yourself if you also want to see “Previews of the Coming Attractions”

I give patent links to the GooglePatents website (instead of to the USPTO website)

  1. Quantum gate optimizations

  2. Optimizing quantum simulations by intelligent permutation

  3. Language integration via function redirection

  4. Quantum annealing simulator

  5. Fast quantum and classical phase estimation

  6. Method and system that produces non-stabilizer quantum states that are used in various quantum circuits and systems

  7. Method and system for optimal decomposition of single-qubit quantum circuits using standard quantum gates

May 28, 2016

Don’t tell Microsoft. Qubiter, an open source platform, can now do quantum chemistry too

Filed under: Uncategorized — rrtucci @ 8:10 pm

I’ve uploaded to


a small collection of classes called `my-chemistry’ that allow one to construct a gate model quantum circuit for calculating the ground state energy of molecules using Kitaev’s Phase Estimation Algorithm.

Notice that I am releasing my-chemistry under my name only. Although this is an add-on to the artiste-qb.net Qubiter project, the Artiste company is free of any legal liability, as I have not merged it with the main code branch, and the company is not deriving any use of it at this time.

The docstrings of each class describe in detail how it works. All my classes have a main method at the end with examples and tests of the class. In addition, I have written a pdf document describing the more technical details of the quantum circuit involved. The pdf document is part of the my-chemistry distribution.

Here is an excerpt from the Introduction section of that pdf document:

This paper describes the particular circuit used by a Python software package called “my-chemistry”, written by R.R.Tucci, and available at GitHub, Ref.[1]. The software can be used in conjunction with “Qubiter”, another Python software package available at GitHub, Ref.[2].

A quantum circuit that is very similar to the one presented in this paper has previously been implemented FIRST in Ref.[4] and more recently and exhaustively in the closed source software package called Liqui|\rangle produced by Microsoft, with Dave Wecker as main author.

Here is a super brief, by no means exhaustive review of some of the highlights in the history of this quantum computing approach to chemistry.

The person deserving the lion share of the credit for this method is A. Kitaev, who in 1995, Ref.[3], was the first to propose the PEA. Also very deserving are Trotter for his expansion, and Jordan/Wigner for their transformation.

The first paper to present an actual computer program for calculating the ground state energy of an $H_2$ molecule using PEA appears to be Ref.[4], by Whitfield, Biamonte and Aspuru-Guzik.

Researchers working for Microsoft applied the method to more complicated molecules and found some very clever optimization methods, such as using the identity (CNOT)^2 = 1. Here is their epiphany paper Ref.[5], and here is their most recent paper Ref.[6]. The latter is recommended for what appears to be a very fair and exhaustive list of references of this approach.

Finally, one should mention that Microsoft has several patents on this method, so it is possible that Microsoft will claim in the future that the software described in this paper infringes on one of their patents. Going to the USPTO website and using the query IN/wecker AND AN/Microsoft, I located 4 patents Refs.[7][8][9][10] on Liqui|\rangle. There might be more pending.

Patents alluded to

Quantum gate optimizations

Optimizing quantum simulations by intelligent permutation

Language integration via function redirection

Quantum annealing simulator

April 8, 2016

Moral Corruption of Krysta Svore and Her Accomplices

Filed under: Uncategorized — rrtucci @ 3:09 am

Check out the following paper by Krysta Svore from Microsoft and her accomplices:

A Software Methodology for Compiling Quantum Programs, by Thomas Häner(1), Damian S. Steiger(1), Krysta Svore(2), Matthias Troyer(1,2,3)

  1. Theoretische Physik, ETH Zurich, 8093 Zurich, Switzerland
  2. Quantum Architectures and Computation Group, Microsoft Research, Redmond, WA (USA)
  3. Microsoft Research Station Q, Santa Barbara, CA (USA)

excerpt from paper:

Related Work.
One of the earliest proposals for a scalable software methodology for quantum compiling dates back a decade [12] and presents significant steps of any quantum computing design flow. Our work expands upon this work, extending the stack elements by showing how to integrate, e.g., tuned quantum libraries of arithmetic, subroutines, and quantum gates, and providing concrete details of the compilers and optimizers in the stack

[12] Krysta M Svore, Alfred V Aho, Andrew W Cross, Isaac Chuang, and Igor L Markov, “A layered software architecture for quantum computing design tools,” Computer, 74-83 (2006).

Now look at this

Krysta is such an unethical, despicable liar, she should be running for president of the United States or president of FIFA. Her new paper has 33 references but she doesn’t mention my quantum compiler papers and Qubiter software, even though they have the words Quantum Compiler explicitly in the title and they started in 1999, seven years before her clumsy, copy-cat efforts. (Note that her 2006 paper doesn’t mention my 1999 paper and software either. She has been lying for 10 years.)

Don’t trust anything Krysta SNORE tells you. Some call her Quantum Carly Fiorina, some compare her to a female praying mantis or a snake. Microsoft’s quantum software is closed source which is anti-thetical to academic work. Join quantum open source today.


March 31, 2016

MIT Stunned by Scalable Quantum Computer

Filed under: Uncategorized — rrtucci @ 11:16 pm

Okay, I don’t expect any of my readers to believe me, but I have a Martian WiFi wormhole connection which allows me to access the Internet in the future. Today, I came upon this article that will be published exactly 15 years in the future.


MIT Stunned by Scalable Quantum Computer
April 1, 2031. MIT Tech Review

A team of scientists from MIT led by Prof. (also Dean of MIT Physics Dept., and chief editor of Physical Review) Isaac Chuang has just published a paper in Physical Review that describes how they used a 5 qubit quantum computer built of superconductive Niobium rings called SQUIDs to show that 15 =3×5.

Those of us who are old enough to remember may recall that MIT was the first to show in 2001 that 15=3×5 with an NMR quantum computer.

Then, MIT scientists stunned themselves with their brilliance once again when 15 years later, in 2016, they were the first to show 15=3×5 with an ion trap quantum computer.

And now, 15 years later, in 2031, MIT scientists were stunned once again, as if by a lightning out of the blue, when they managed against all odds to show that 15=3×5 with a superconductive quantum computer.

All 3 times that MIT has shown that 15=3×5, they have claimed that their device is scalable. We are beginning to believe them, but then again, in 2031, we are now so old that some days we can’t readily recall the current US president’s name.

Back in 2016, when Prof. Chuang was asked why he wasn’t comparing his ion-trap device to those of David Wineland’s team (at NIST, Colorado), and Chris Monroe’s team (at U. Of Maryland), Prof. Chuang pointed out that those people’s devices were so different to his that he was totally unaware of their existence. According to Prof. Chuang, his device was placed in a lab-room with green colored walls, whereas Wineland and Monroe had used beige colored walls. According to a powerful theorem by Prof. John Preskill of Caltech, the boundary conditions (in this case the color of the lab-room walls) affects so much the evolution of the bulk (in this case the device), that quantum devices placed in lab-rooms with green and beige colored walls behave so differently that they are incomparable. Or so Chuang claims.

Today, April 1, 2031, Prof. Chuang was asked why he isn’t comparing his 5 qubit superconductive device to the 100 qubit superconductive devices built by Google and IBM last year. Once again, Prof. Chuang defers to Preskill’s Theorem which proves those devices are incomparable to his.

Prof. Chuang delivers Commencement speech at MIT

Prof. Chuang delivers Commencement speech at MIT

Coed hen at MIT 2031 graduation ceremonies very impressed by Prof. Chuang's piercing pronouncments

Coed hen at MIT 2031 graduation ceremonies very impressed by Prof. Chuang’s pronouncements

March 29, 2016

Qubiter on the brink of doing Quantum Chemistry

Filed under: Uncategorized — rrtucci @ 6:35 pm

On behalf of the artiste-qb.net company, I am pleased to announce that Qubiter now has a new class called PhaseEstSEO_writer.py that endows it with the superpower of being able to generate and simulate quantum circuits for quantum phase estimation.

The quantum Phase Estimation circuit (PEC) was invented in 1995 by Kitaev. Since then, it has found many applications in quantum computing. Microsoft Liqui|>, the main competitor of Qubiter, uses PEC to find the ground state of molecules.

In fact, Liqui|> can generate many other circuits besides PEC, but most of them are not very commercially viable. For example, Liqui|> can generate quantum error correction circuits, but error correction will most likely be done by the hardware manufacturers, so QC programmers won’t need to implement it via Liqui|> in their circuits. Liqui|> also does Shor’s algo, but I don’t think Shor’s algo will be a big money maker, because it requires thousands of qubits, so it will be one of the last applications to be implemented on a QC. By the time it is implemented, post quantum crypto, which is impervious to it, will have been in general use for many years.

So most of the circuits that Liqui|> can generate & simulate will never be commercially viable, but those for doing quantum chemistry probably will be.

The Liqui|> team claims to have used experimentation with Liqui|> to reduce by a factor of a thousand the size of their QC circuit for finding the ground state of molecules with PEC. They claim that their new, optimized circuit will give an answer in an hour of running on a gate model QC, once those beasts arrive. Such calculations would take billions of years for a classical computer to perform, they claim.

The Liqui|> authors like Krysta Svore seem well aware that Quantum Chemistry is one of the most commercially viable and potentially lucrative applications of Liqui|>. You can almost see the dollar signs in their beady eyes when they speak about quantum chemistry.

But Qubiter is throwing a spanner into their nefarious plans.

Microsoft Liqui|> is closed source and heavily patented. Also, it is written in a very unpopular language F#. Qubiter, on the other hand, is open source and written in the super popular language Python.

And now Qubiter allows everyone, not just Microsoft egg heads, to do QC quantum chemistry too.

March 22, 2016

First version of Qubiter (a quantum computer simulator) is out. It says: “Welcome, my navigator. Where do you want me to take you next?”

Filed under: Uncategorized — rrtucci @ 4:44 pm

artiste-qb.net has just uploaded at GitHub its first version of Qubiter, a quantum computer simulator, under the BSD license and written in Python.

It’s saying to you: “Welcome, Navigator. Where do you want me to take you next?”



Over the last 20 years, dozens of quantum computer simulators (for gate model, aka quantum circuit QC) have been released. Here is a partial list. So what makes this one special?

Let me compare Qubiter with Microsoft’s very famous quantum simulator called Liqui|>.

  • Liqui|> is closed source (and heavily patented), Qubiter is open source under BSD license
  • Liqui|> is written in F#, Qubiter is written in Python. User base of Python is ~ 100 times bigger than that of F#. And believe me, programmers are very savvy consumers of programming languages.
  • Dave Wecker (rhymes with wrecker), chief architect of Liqui|> , has been quoted as saying that he estimates Liqui|> has about 30,000 lines of code. Qubiter currently has less than a 1000, and does all the basics and much more. So tell me, what would you prefer to have to grok, 30,000 or 1,000 lines of code?

I hope you enjoy it. Or as my grandma used to say,

Stai zitto e mangia!!

February 26, 2016

Quantum Fog gets Prefab Nodes (prefab but of high quality, I assure you)

Filed under: Uncategorized — rrtucci @ 7:02 am

Prefabricated or modular homes have a long history in the US and Europe. In the case of Quantum Fog, prefabricated Nodes also have a history. They were available in the Legacy QFog, and now, through the miracle of hard work, are available in the Pythonic QFog as well. I rewrote/translated the old C++ code responsible for the prefab nodes into Python.

So if you look at https://github.com/artiste-qb-net/quantum-fog, you will find a recently added folder entitled “prefabicated_nodes”. Inside that folder, you will find 7 new files, each containing a single class. The files are

  1. BeamSplitter.py
  2. CNot.py
  3. Marginalizer.py
  4. PhaseShifter.py
  5. PolarizationRot.py
  6. Polarizer.py
  7. QubitRot.py

Each of the above files has a long docstring describing its class. In my usual fashion, I also provided a “main” method at the end of the class with examples of how to use the methods of the class.

The motivation behind prefab nodes is simple to explain. A Bayesian Network, whether classical or quantum, assigns a transition matrix to each node. You can enter the components of that transition matrix by hand, but that gets tedious very quickly. In many cases, the matrix is a function of certain parameter and one wants to be able to enter those parameters and have the matrix generated automatically. For instance, for a qubit rotation, the matrix is a 2 by 2 unitary matrix determined by 4 real angles. One wants to be able to enter those 4 angles and have the matrix generated automatically. Similarly, for a CNot, the matrix is a 4 by 4 matrix with 4 entries equal to 1 and all others equal to 0. One wants to be able to enter the value of 2 boolean parameters and have the matrix generated automatically.

I think Donald Trump is a punishment meted out to us by God for the sins of Academics and other greedy, dishonest people. I’m mulling over this theory and may write a novel about it, or at least a comic book. That is, if we are all still alive a year from now.

February 17, 2016

Our baby (Quantum Fog) can now read, write and draw

Filed under: Uncategorized — rrtucci @ 12:06 am

In a special Feb. 2 , 2016, ground hog day blog post, I announced the first large release by our company, artiste-logoartiste-qb.net, of Pythonic open-source Quantum Fog. As you may or may not know, Quantum Fog was originally (almost 20 years ago) a Mac-only application written in C++. The GitHub page for Quantum Fog contains the legacy C++ code of yee ole Quantum Fog, plus the shining new Python code which will attempt to reproduce all the functionality of the old application plus much more. So are we there yet, you ask. Not quite, but making steady progress.

These are some of the things the new QFog can do so far:

  • It can do inference with evidence using 3 methods: Join Tree, MCMC (Monte Carlo) and brute force (enumeration of all Feynman paths).
  • It can do inference by those 3 methods for BOTH, quantum Bayesian networks (QBnets) and classical Bayesian networks (CBnets).
  • It can read and write CBnets and QBnets in two formats .dot and .bif (bif stands for Bayesian Interchange Format).
  • It can draw the CBnet and QBnet graphs using only matplotlib and networkx, included in the usual Python installation. This is fine for most purposes, but if you want a super high quality plot of your graph, you should use the .dot file that Quantum Fog generates and fine-tune that with GraphViz.

QFog integrates CBnets and QBnets seamlessly. You can use all subroutines for either classical or quantum analysis simply by changing a Boolean input parameter called is_quantum


  • .dot and .bif files are both just .txt files. The .dot format is used by a really wonderful, free software called GraphViz. There are several very helpful Bayesian network repositories that store Bnets in the .bif format. The .dot and .bif formats are complementary. The .dot format is good for storing visual layout info, not good for storing the numerical tables associated with each node. The .bif format is good in the opposite way.

  • The “join tree” (or junction tree, or clique tree or belief) propagation method is an exact method (Other methods, like MCMC, are approximate). The Join Tree method caused a mini revolution in the Bayesian networks field starting from 1990 or so. Before then, people had been discouraged by a proof that calculating probabilities from a Bnet by brute force is NP hard. But the Join Tree method takes advantage of the graph structure. If I understand it correctly, its complexity is exp(k) whereas brute force is exp(n), where n is the total number of nodes and k is the number of nodes in the fattest clique (k is called the width of the join tree). The Join Tree algorithm still has exponential complexity, but is much better than the brute force algo. The join tree algo used by the new Qfog is the one described in the following very detailed and clear, cookbook paper:

    Inference in Belief Networks, A Procedural Guide, by C. Huang and A. Darwiche (1996)

I end by waxing poetic in a nerdy way. Here are 3 things that remind me of quantum fog:

Fog Machines, very cool. An essential prop in the shooting of moody films, in rock concerts, in serious Halloween home decorations and in nerd experiments. They work by either (1) pushing a mixture of water and (glycol or glycerin or mineral oil) over a heated surface, or (2) dropping dry ice, i.e., solid CO2, into water heated near boiling point. Some use solid N2 or O2 instead to get a different kind of fog.

Aerogels, very cool too.

They are very good thermal insulators. You can put your hand on one side and a Bunsen Burner flame on the other side of a ½ inch thick layer of aerogel and not feel the heat.

The ones that are almost transparent and ethereal looking are the silica aerogels. They are kind of expensive though, like $50 for a 1 x 1 x 0.5 in. specimen.

Wikipedia quotes:
“Aerogel was first created by Samuel Stephens Kistler in 1931, as a result of a bet with Charles Learned over who could replace the liquid in “jellies” with gas without causing shrinkage.”

“The first aerogels were produced from silica gels. Kistler’s later work involved aerogels based on alumina, chromia and tin dioxide. Carbon aerogels were first developed in the late 1980s.”

And of course, the Golden Gate Bridge shrouded in fog.

February 6, 2016

Quantum Open Source 2016

Filed under: Uncategorized — rrtucci @ 7:31 am


Big Brother is saying: Microsoft’s “Liqui|> is closed source for your own good. Quantum open source is EVIL. Using it will harm you!”

Quantum Carly Fiorina

Quantum Carly Fiorina

Big Brother is saying: Vote for Quantum Carly Fiorina, my handpicked leader

Big Brother is saying: Vote for Quantum Carly Fiorina, my handpicked leader



On 2016, the quantum open source community will finally prevail, and you will see why future quantum computer software won’t be like “1984”

« Previous PageNext Page »

Blog at WordPress.com.

%d bloggers like this: