Quantum Bayesian Networks

December 16, 2017

In Love With Jupyter Widgets

Filed under: Uncategorized — rrtucci @ 11:56 pm

Many old fashioned computer programs that allow a lot of pointing and clicking, what I like to call “GUI-rich” software (GUI=Graphical User Interface), provide you with only a limited “scripting and documenting” ability, i.e., ability to save and restore your work history (including the buttons you clicked and in what order, the plots you generated, your comments, etc.). Before the advent of Jupyter widgets, Jupyter notebooks got an A++ grade in scripting ability, but an F in GUI. Old fashioned, GUI-rich software got the opposite grades. So it might have been hard back then to decide which of these two paths, GUI-rich or Jupyter, to choose. But this is no longer a hard choice. With Jupyter widgets, Jupyter notebooks get an A++ in both categories.

In my opinion, scripting ability is very desirable when doing work related to statistics, Bayesian networks, Big Data, AI, numerical research, etc. A GUI is desirable too, especially if you want normal people, i.e. non-geeks, ever to use your software! So I am glad to announce that Quantum Fog now has some Jupyter notebooks with widgets.

In the following folder, you will find notebooks for doing inference with the (classical, not quantum) WetGrass and Asia networks. This is a link to GitHub, so of course the GUI is displayed but doesn’t work properly there. It only works properly if you are running the notebook in a Python environment.


August 15, 2017

Resistance is Futile: Jupyter Borg Threatens to Assimilate Quantum Computing Universe

Filed under: Uncategorized — rrtucci @ 5:00 pm

A week ago, IBM announced at its Quantum Experience usegroup that it had uploaded to github a large collection of jupyter notebooks exhibiting the use of their gate model quantum computer (previously 5 qubits, currently 16 qubits). I consider this an excellent addition to the quantum open source and free jupyter notebook universe and ecosystem. I’ve advocated for quantum open source and jupyter notebooks many times before in this blog, so it’s a pleasure for me to echo their announcement.

Pow! Right in the kisser of Microsoft’s Liqui|> software. Liqui|> is closed source software.

Google has announced that it will deliver by year’s end a 49 qubit gate model qc with accompanying open source software and cloud service. The jupyter ball is now in your court, Google.

Artiste-qb.net, the company that I work for, already provides a large and ever growing library of jupyter notebooks for both of its quantum open source offerings, Qubiter and Quantum Fog.

Rigetti’s PyQuil and ProjectQ are two other gate model qc simulators analogous to IBM quantum experience. So far these two have very few jupyter notebooks. Wimps! Laggards! Let them eat cake!


Borg Cake


Jupyter Cake

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.

October 1, 2018

谢谢 (Xièxiè, Thank you), CAS and Tsinghua Univ.

Filed under: Uncategorized — rrtucci @ 2:50 am

This week was very important for our company artiste-qb-net. Our cofounder Dr. Tao Yin had the honor of giving a short presentation at a workshop entitled: “Quantum Software: from theory to realization” in Beijing. The workshop was organized by the “Institute of Software: Chinese Academy of Sciences (CAS)“. Our most sincere thanks to the organizers of the workshop for allowing us to speak at the last minute.

Here is a conference agenda:

Here is a photo of Tao giving his presentation:

and here are links to his presentation


While in Beijing, Tao also had the opportunity to visit and do some networking with qc and Bayesian Networks researchers and programmers at Tsinghua Univ (TU), which is considered one of the best technical universities in China, sort of the MIT of China. TU has a student enrollment 3 times as big (11,000 vs, 36,000) as that of MIT, which reminds me that the population of China is about 4 times that of the USA.

TU is a prominent player in China’s $100 billion push to become a quantum computing giant. In 2015, Turing award winner Andrew Yao moved from Princeton Univ. to TU, to head several Chinese academic institutes, some of which are devoted to quantum information and quantum computing. Recently, TU opened a joint quantum institute at the Univ. of Michigan, and second one at the Univ. of Waterloo and the Waterloo-IQC (Institute for quantum computing)

August 14, 2018

What programming languages are available for quantum computers? What is the best quantum language?

Filed under: Uncategorized — rrtucci @ 1:07 am

Answering this question is Easy Peasy.

Qubiter is the Greatest. It floats like a butterfly and stings like a bee. If Qubiter were a heavy weight fighter, it would be called Muhammad Ali.

Qubiter is insanely great software.

Many supposedly exhaustive lists of quantum languages do NOT list Qubiter; this probably indicates that the list’s authors are DISHONEST people who want to suppress knowledge of the existence of Qubiter because they have an affiliation or conflict of interest with the authors of a competing quantum language. Alas, hype and outright dishonesty in quantum computing is not uncommon in both Academia and Industry. In reality, Qubiter (open source under BSD license) is an excellent alternative to the following popular quantum languages:

  • Google Cirq
  • IBM qasm/qiskit
  • Microsoft Q# (its former version was called Liqui|>)
  • Rigetti PyQuil
  • Project Q
  • Quipper

Caveat Emptor: Here are some features of Qubiter that the other quantum languages may not have:

  • Automatically creates 2 files for the quantum circuit, a Qubiter qasm file and an ASCII picture file. This makes debugging easier (can also draw fancy LaTex picture of circuit but that is slower so only optional) The ascii file and qasm file correspond line by line, so line 5 in each gives 2 representations, ascii and qasm, of the same gate. For example, consider Teleportation. Here is
    Qubiter’s ASCII Picture file for that:


    and here is the corresponding qasm (English) file:



  • Only uses quantum bits instead of quantum and classical registers. Classical registers are an unnecessary and bothersome complication. For example, If you continue developing the classical register operations of PyQuil, you will eventually end up reinventing Python inside PyQuil, which is itself inside Python. That would be the logical conclusion of PyQuil’s classical registers, wouldn’t it?
  • Translates Qubiter qasm to IBM qasm, Google’s Cirq and Rigetti’s PyQuil.
  • Only Qubiter has PRINT statement in its qasm that prints to screen the state vector at the position of the PRINT statement in the qasm
  • Expands arbitrary one qubit gates with any number of controls to a sequence of cnots and single qubit rotations
  • Includes quantum CSD compiler. This compiler can expand an arbitrary n qubit unitary matrix into a sequence of CNOTs and single qubit rotations. The compiler also expands quantum multiplexors and diagonal unitary matrices which are very useful in dealing with Quantum Neural Networks.
  • Is written in Python (Q# is written in Q# and Quipper in Haskell)
  • Gates controlled by classical qubits are handled much more clearly
  • Has nice library of Jupyter notebooks, not as large as IBM qiskit’s, but other languages besides IBM qiskit have almost no Jupyter notebooks
  • 100% object oriented, like JAVA and C++. Other quantum languages written in Python are partly object oriented and partly procedural, which is not as well organized as 100% object oriented.
  • Not made by an international monopoly trying to control the quantum computing field
  • (this is only important to Canadians) Made in Canada, eh. Oh Canada!

August 8, 2018

I am being bullied and harassed at Quantum Computing Stack Exchange (branch of StackOverflow)

Filed under: Uncategorized — rrtucci @ 1:52 am

Today almost all of my replies at Quantum Computing Stack Exchange (a branch of StackOverflow) were edited or deleted in a very disdainful way, by a bully called Heather. I politely objected to the moderators by email and received the following reply


According to them, I don’t answer the questions and instead use my replies to advertise my products and my website. This is total BS, I always do the utmost to answer the questions in a polite way, and I’ve never mentioned my website. I do give links to some of my jupyter notebooks iff they directly address the issue being asked. Sometimes I also give a link to the Qubiter repo (Qubiter is open source under the BSD license, so it is hardly “a product”), but the Qiskit, pyQuil and Cirq people link to their repo too. If not they should. It’s pretty ridiculous and inconsiderate to the readers to talk about a software program without giving the URL of its github repo.

The bullies also claim that I don’t mention that I’m the author of the software that I link to. Bizarre claim. If I were plagiarizing someone else’s code, that would be a crime. But since when does one have to explicitly state before every line of code that one cites at Quantum Stack Exchange

# I wrote the following line of code all by myself. My mama did not help me.

Other people from IBM, Rigetti and Google frequently answer questions about their software products at Quantum Stack Exchange and are never taken to task for not mentioning their affiliation or conflict of interest. The double standards of these bullies is hilarious in a Sarah Huckabee Sanders, Fox News kind of way.

After receiving the above unacceptable reply from the moderators, I sent the following email to Tim Post, “Director of Community Strategy, Stack Overflow.” Quite frankly, I expect Tim Post will ignore my email, or else will side with the rapists and blame me, the victim, for dressing provocatively. Typical response by authority figures to harassment claims, you know.

​Dear Sir,

I am rrtucci (Robert Tucci) I would like to point out that I am being bullied and harassed at quantum stack overflow. A person called Heather ( a high school student) has just edited ALL my posts in a very disdainful way that implies I am doing something dishonest by explaining my open source software Qubiter. I don’t see why that is dishonest, the IBM, Google and Rigetti people do it all the time and she doesn’t object to that. Who better than the author of a software to explain it? I have worked in quantum computing for more that 15 yrs and have a PhD in physics. I assure you that everything I say in my comments is true.

This is an example of her bullying. My blog post has received a -2 rating and has been edited by her in a disdainful bullying manner whereas the other dishonest posts that omit mentioning my software have received a rating of 26 points

I very much expect that because of this blog post, I will soon be banned from Quantum Stack Exchange and all my posts there will be deleted. Even if they don’t do that, they have succeeded in intimidating me so that I can’t post replies there anymore. Before the above webpage disappears, or is censored, I saved a copy of it. Here it is


The disingenuousness of the replies, other than mine, in that webpage, is obvious and palpable. None of them mentions Qubiter, an excellent, free, open source under BSD license, and very up-to-date alternative. Instead of mentioning Qubiter, they pad the list with dozens of very old, outdated, softwares. Despite their disingenousness, Heather objects only to my reply. Heather doesn’t claim that something that I say in my reply is false, because my reply is 100% true. Instead, she is outraged that I didn’t explicitly state that I wrote Qubiter (she forcibly inserted the sentence “(Disclaimer: I wrote the code for Qubiter.)” implying that I was doing something very dishonest by not mentioning this) but she doesn’t mind that nobody else mentions their affiliations or conflicts of interest. #MeToo

Update: new blog post

July 24, 2018

Are You a Young Male Interested in Quantum Computing? We Recommend a Date with ROSA (Write Once, Simulate Anywhere)

Filed under: Uncategorized — rrtucci @ 12:44 am

Five days ago (7/19), Google released it’s long awaited language for quantum computers, called Cirq. Cirq is available at Github as open source under the Apache license. I expect that Google’s 72 qubit quantum computer and accompanying cloud service, also long awaited, will be unveiled soon too.

(Yes, I am referring to the same company that on (7/18), one day before Cirq was released , was fined $5B by the European Union because it favors Google’s search engine in Android devices, and it also is gradually making closed source and proprietary all the new R&D for the key apps in the Android ecosystem, and it also ruthlessly excommunicates anyone who tries to fork the Android repo to produce a serious competitor to Android. It also excommunicates any company that uses any Android fork in any of its products. Google, please say it ain’t so!… and say you won’t try to destroy Qubiter—my qc language and simulator, a microscopic competitor to Cirq.)

Qubiter is available at Github as open source under the BSD license.

So as not to be destroyed by the bad hombres at Google, a mere five days after the release of Cirq, I have given to Qubiter amazing new superpowers. Qubiter now has the ability to translate Qubiter qasm to Google Cirq, IBM qasm and Rigetti Pyquil. I equate these superpowers to the ability to go out on dates with an Italian bombshell actress called ROSA. ROSA is an acronym for

    Write Once, Simulate Anywhere (ROSA)

Let me explain further. In the Qubiter language, you can use as an operation: any one qubit rotation or a swap of two qubits, with any number of controls attached to them. Qubiter has tools (this Jupyter notebook shows how to use those tools) which allow you to expand such multiply controlled operations into simpler “qasm” that contains only single qubit rotations and cnots. If you want to run that Qubiter qasm on IBM’s, Rigetti’s, or Google’s hardware, Qubiter can also translate its qasm to IBM qasm, Rigetti PyQuil and Google Cirq. The notebook below shows how to do this translation


So, the previous notebook in effect shows you how to go on a date with beautiful Miss ROSA. Hurry up and call her before she is all booked up. Signorina ROSA also enjoys befriending other females interested in quantum computing.



May 24, 2018

Quantum Computing and a new book, “The Book of Why”, by Judea Pearl and Dana Mackenzie

Filed under: Uncategorized — rrtucci @ 5:23 am

“Leaping the Chasm” (1886) by Ashley Bennett, son of photographer Henry Hamilton Bennett, jumping to “Stand Rock”. See http://www.wisconsinhistory.org

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:

  1. Introduction to Judea Pearl’s Do-Calculus, by Robert R. Tucci (Submitted on 26 Apr 2013)
  2. 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.

April 6, 2018

PyMC and Edward/TensorFlow Merging?

Filed under: Uncategorized — rrtucci @ 9:09 pm

News bulletin: Edward is now officially a part of TensorFlow and PyMC is probably going to merge with Edward.

The python software library Edward enhances TensorFlow so that it can harness both Artificial Neural Nets and Bayesian Networks. The main architect of Edward, Dustin Tran, wrote its initial versions as part of his PhD Thesis at Columbia Univ. (Columbia is the home of the illustrious Andrew Gelman, one of the fathers of hierarchical models, which are a special case of Bayesian networks). Dustin now works at Google as part of a team merging Edward with TensorFlow.

One of the near term goals of artiste-qb.net is to produce a quantum generalization of Edward. This would not run on a quantum computer but would simulate on a distributed classical computer possible experiments that could in the future be conducted on a qc.

I highly recommend the following two Discourses for Edward and PyMC:

It looks like the python software libs PyMC3 and Edward may soon merge:


This is very good news, in my opinion, because I am in love with both programs. It’s interesting to note that the current Numpy is also the result of the fortuitous marriage of two separate complementary software libs.

One can now call PyMC3 and Edward from Quantum Fog, although not very smoothly yet. See here.

February 9, 2018

Today Enrolled our Baby (Quantum Fog) in gambling school taught by famous Monte Carlo gamblers (PyMC3, Edward, Zhusuan)

Filed under: Uncategorized — rrtucci @ 4:57 am

In the beginning, there was Matlab, which grew out of the Fortran lib Lapack (Linear Algebra Package, still one of the main software libs used to benchmark supercomputers). Matlab’s tensor stuff was copied and improved by the Python borgs to produce numpy, which handles tensors really nicely but doesn’t do it in a distributed “parallel” fashion. Then, starting about 10 years ago, some guys from the University of Montréal had the brilliant idea of writing the Theano Python Library (Theano was a Greek mathematician thought to have been the wife of Pythagoras). Theano replaces most numpy functions with Theano functions that are namesakes of the numpy ones and do the same thing in a distributed fashion. Then Google came out with the TensorFlow Python Lib, which copied Theano and improved on it. TensorFlow can do most numpy operations using multiple CPUs, GPUs and TPUs. But TensorFlow and Theano are much more than tools for doing tensor operations in a distributed fashion. They also do differentiation in a distributed fashion (such differentiation is often used to train neural nets). They are also designed to help you do fast prototyping and distributed running of artificial neural nets. In the last year, some new Python libraries built on top of TensorFlow and Theano have appeared that allow you to do fast prototyping and distributed running of Bayesian networks. B nets are dear and near to my heart and I consider them even more powerful than artificial neural networks. And I’m far from being alone in my love of b nets. Judea Pearl won the prestigious Turing prize for his pioneering work on them. Those new Python libs that I alluded to are PyMC3 (built on top of Theano), Edward (on top of TensorFlow) and Zhusuan (on top of TensorFlow). Added later: Forgot to mention that Facebook & Uber have their own Theano equivalent called PyTorch and also an Edward equivalent called Pyro. But I haven’t used them yet.

The main architect of Edward is Dustin Tran, who wrote Edward as part of his PhD thesis at Columbia Univ. Dustin now works at Google, and the TensorFlow team is working with Dustin to integrate Edward with TensorFlow.

Zhusuan is the art of using an abacus. The word means literally “bead counting” in Chinese. The Zhusuan lib is a fine open-source (under MIT license) product of the Tsinghua University in Beijing, China. It demonstrates that China is already very advanced in AI.

According to Google Trends, “TensorFlow” is at least 10 times more popular than “quantum computing” as a search term, even though TensorFlow has many competitors that started before it did and it was open sourced for the first time only 2 years ago.



One of the aims of artiste-qb.net is to participate in the revolution of extending Edward & Tensorflow so that it can do both classical and quantum Bayesian Networks. Today we took a small, initial step in that direction. We added a folder


which contains a file called ModelMaker.py and two jupyter notebooks. Both notebooks do MCMC for the classical Bayesian network WetGrass. One notebook does this by invoking the external software PyMC (a.k.a. PyMC2, the precursor of PyMC3), whereas the other does it via PyMC3. Both notebooks start by loading a .bif file for the WetGrass bnet. From that alone, they construct an X native model and analyze that model using X, where X = PyMC2, PyMC3. In the near future, we will also add a notebook that does the same thing for X=Edward, Zhusuan.
Addendum(Feb.16, 2018): Added support for Edward

climbing-mt-qc(Image by Henning Dekant)

January 1, 2018

New tools for dealing with limited couplings of a quantum computer chip

Filed under: Uncategorized — rrtucci @ 11:37 pm

The main purpose of this blog post is to announce that Qubiter now has two simple, but hopefully useful, new classes that facilitate writing qc programs for the new crop of qc’s with 20-50 qubits but such that those qubits are not fully connected (coupled):

  1. Class ForbiddenCNotExpander reads an English file and writes a new English file. Any CNot in the old file that is not physically allowed by a pre-specified qc chip is replaced in the new file by an expansion (sequence) of allowed CNots.

  2. Class ChipCouplingsFitter reads an English file and writes a new English file. The new file permutes the qubits of the old file so that the old CNots are mapped into new ones that are allowed for a pre-specified qc chip. Of course, this is not always possible, so the class only promises to find such a mapping and to tell you what it is if it finds one.

I hope these 2 new classes will make it easier for Qubiter users to interact with real qc hardware of any brand.

We are striving to make Qubiter interact with as many qc hardware brands as possible. So far, we have targeted the IBM chips with a class called Qubiter_to_IBMqasm2 that translates a Qubiter English file (i.e., Qubiter’s version of qasm) to IBM qasm2. As soon as Google comes out with its 49 qubit qc and accompanying cloud service, which Martinis has promised for Jan 2018, we will target Google devices too, by writing a translator from Qubiter English files to Google’s version of qasm. This IBM or Google qasm can be sent by a Jupyter notebook via the internet to the IBM or Google quantum computers sitting in the cloud, which will then run the program and send back the results to the original Jupyter notebook.

We are trying to design Qubiter so that it facilitates communication not only between a user and multiple hardware devices, but also among multiple users. Indeed, Qubiter already makes it easy for users of different qc devices, for example Alice who uses an IBM chip and Bob who uses a Google chip, to be on friendly terms with each other, maybe even go out on a date. Qubiter facilitates such dalliances because it saves quantum circuits as simple yet clear text files. This makes it as easy as pie to modify those text files, save them to improve them at a later date, and share them with other qc engineers. I you want to collect quantum circuits like you would collect baseball cards, comic books, stamps, butterflies or whatever, Qubiter’s English and Picture files found in Qubiter’s io_folder are a great way of doing it.

October 18, 2017

One small step for Qubiter, one giant step for Alibaba

Filed under: Uncategorized — rrtucci @ 10:06 pm

In a previous blog post, I used the example of teleportation of a 1 qubit state to compare 3 popular quantum computer simulators: (1) artiste-qb.net’s Qubiter (of which I am the main author), (2) IBM’s Quantum Experience and (3) Microsoft’s Liqui|> sequel. I gave many reasons why I think Qubiter is much better than the other 2 (clearer, simpler, more logical design, more commands, open source under BSD license, Python, many Jupyter notebooks, includes translators from Qubiter’s qasm to IBM’s qasm and soon to Google’s qasm, …)

Today, I am proud to announce that Qubiter now has 2 of its Jupyter notebooks in both English and Chinese (translator: Dr. Tao Yin, CTO of artiste-qb.net, living in Shenzhen, China)

Alibaba must have heard about our Chinese notebooks and decided to match our move and better it by a smidgen. On Oct 10, 2017, they announced to the press that they are planning to spend $15B over the next 3 years on moonshot projects like AI and quantum computing. At the same time, they unveiled at a conference a quantum computing cloud service.

October 3, 2017

A Microsoft Quantum Computing language by any other name would smell as badly

Filed under: Uncategorized — rrtucci @ 3:31 am

On September 25-29, 2017, Microsoft held its IGNITE conference at Orlando, FL. Arstechnica reported about IGNITE here. They usually publish quantum computing articles that are more balanced and well informed than the average sci-tech popular journal. This time though, I think Arstechnica dropped the ball badly. This article sounds to me like a glorified infomercial for MS. However, I did learn a few curious facts from it.

The article reports that MS intends to release by the end of this year a “quantum programming language—as yet unnamed” for programming quantum computers. The language will be distributed with Visual Studio and available on Azure, the MS cloud service. Let me henceforth call it language Q?#. The article gives the following snapshot of a quantum teleportation circuit written in this marvelous new language. A Rube Goldberg machine language if I ever saw one. Also, sounds like this ugly baby is going to be CLOSED SOURCE, just like LiquiD. (Click image to enlarge)

Mysteriously, no mention is made of Liqui|>, MS’s previous “quantum programming language”. Since Q?# comes a short time after Liqui|> and Dave Wecker is the main author of both, it is safe to assume that Q?# is just a new wrapper with Liqui|> under the hood. (Some have gone so far as to suggest that the new language should be called LiquidShit#).

But friends, Romans, countrymen, lend me your ears. I have come here to bury Q?#, not to praise it. Next, I will show the code for the same quantum Teleportation 3 qubit circuit, but written instead in IBM’s qasm language and in Qubiter’s language.

IBM’s github repository called qiskit-tutorial has a Jupyter notebook for this same teleportation circuit. Here is a snapshot taken from the notebook showing IBM qasm for the teleportation circuit.

The Qubiter repo at github also has a Jupyter notebook for the same teleportation circuit. Here is a snapshot taken from the notebook showing Qubiter’s English and Picture files for the teleportation circuit.

And now, let me indicate a few reasons why I think Qubiter (which I wrote) is nicer than the other two.

  • Qubiter allows one to write controlled gates with any number of controls, and the controls can be of two types T or F. (T controls are usually represented in latex pictures of quantum circuits by a solid dot, F controls by a hollow dot). Qubiter also has subroutines that allow one to expand each gate with multiple controls into a sequence of gates with only one or zero controls, because those simpler gates are the only type of gates that most hardware devices can perform physically. IBM’s qasm so far only allows one or two controls of type T only. They have CNOT and CCNOT and that’s it.
  • Qubiter automatically generates an ASCII picture of the circuit at the same time that it generates its English qasm-like file. IBM’s q-software and LiquiD do not write a picture of the circuit automatically. If they draw a circuit, it requires a separate run to generate it and the picture is in Latex. Also, their circuit pictures have time running from left to right instead of downwards. Qubiter’s English and Picture files, on the other hand, have the highly desirable properties–especially desirable for long circuits–that (1) time runs downward in both English and Picture files, and (2) line number n in the English file corresponds to line number n in the Picture file.
  • IBM qasm and LiquiD distinguish between quantum and classical registers. Qubiter only has quantum registers. Classical registers are an unnecessary, ugly complication because the information stored in them can be stored in the memory of your pc.

Two other languages, Rigetti’s PyQuil and ProjectQ, are similar to IBM qasm and suffer from some of the same architectural design flaws mentioned above.

UPDATE: Microsoft released their Rube Goldberg “quantum language” with much fanfare on Dec. 11, 2017. They called it, after so much suspense, simply Q#. MS is not known for their creativity in naming things.

April 29, 2017

Miss Quantum Computing, may I introduce to you Miss Bayesian Hierarchical Models and Miss MCMC?

Filed under: Uncategorized — rrtucci @ 5:49 pm

Warning: Intense talk about computer software ahead. If you are a theoretical computer scientist, you better stop reading this now. Your weak constitution probably can’t take it.

When you enter the nerd paradise and secret garden that is Bayesforge.com (a free service on the Amazon cloud), you will see one folder named “Classical” and another named “Quantum”. Here is a screenshot of this taken from Henning Dekant’s excellent post in Linkedin

The “Quantum” folder contains some major open source quantum computing programs: Quantum Fog, Qubiter, IBM-QisKit (aka kiss-kit), QuTip, DWave, ProjectQ, Rigetti

The “Classical” folder contains some major Bayesian analysis open source programs: Marco Scutari’s bnlearn (R), Kevin Murphy’s BNT (Octave/matlab), OpenPNL (C++/matlab), PyMC, PyStan.

The idea is to promote cross fertilization between “Quantum” and “Classical” Bayesian statisticians.

Today I want to talk mostly about PyMC and PyStan. PyMC and PyStan deal with “Hierarchical Models” (Hmods). The other programs in the “Classical” folder deal with “Bayesian Networks”(Bnets).

Bnets and Hmods are almost the same thing. The community of people working on Bnets has Judea Pearl as one of its distinguished leaders. The community of people working on Hmods has Andrew Gelman as one of its distinguished leaders. You might know Gelman (Prof. at Columbia U.) from his great blog “Statistical Modeling, Causal Inference, and Social Science” or from one of his many books

Both PyStan and PyMC do MCMC (Markov Chain Monte Carlo) for Hmods. They are sort of competitors but also complementary.

PyStan (its GitHub repo here) is a Python wrapper of a computer program written in C++ called Stan. According to Wikipedia, “Stan is named in honour of Stanislaw Ulam, pioneer of the Monte Carlo method.” Prof. Gelman is one of the fathers of Stan (I mean the program, of course).

PyMC comes in 2 incompatible versions: 2.X and 3.X. Version 3 is more advanced and intends to replace Ver 2. PyMC2’s best sampler is a Metropolis-Hastings (MH) sampler. PyMC3 contains an MH sampler, but it also contains the “No U turns” or “NUTS” sampler that is supposed to be much faster than MH for large networks. Currently, Bayesforge contains only PyMC2, but the next version will contain both PyMC2 and PyMC3. As an added bonus, PyMC3 comes with Theano, one of the leading deep neural networks frameworks.

Check out this really cool course:

Sta-663 “Statistical Programming” , available at GitHub, taught at Duke U. by Prof. Chi Wei Cliburn Chan.

This wonderful course has some nice jupyter notebooks illustrating the use of PyMC2, PyMC3 and PyStan. Plus it contains discussions of many other statistical programmimg topics. I love it. It has a similar philosophy to BayesForge, namely to do statistical programming with jupyter notebooks because they are great for communicating your ideas to others and allow you to combine seamlessly various languages like Python, R, Octave, etc

April 8, 2017

Welcome to BayesForge, a free service on the Amazon cloud

Filed under: Uncategorized — rrtucci @ 7:08 am

Our company artiste-qb.net is proud to announce BayesForge.com (BF), our new service on AWS (Amazon Web Services). BayesForge is not yet open for business but will open in a week or less. The purpose of this blog post is to give an overview and teaser of what is coming.

Henning Dekant will give a tour of BF to those who attend the meeting on April 21 of the Toronto Quantum Computing Meetup.

Why AWS?

The Amazon cloud is one of the largest and Amazon offers an incredible deal to all its customers. Anybody with a credit card can get an AWS Free Tier account. An AWS Free Tier account gives you one full year of free cloud use (there are some upper bounds on usage but very generous ones). Furthermore, you can open a separate AWS Free Tier account in the name of your spouse and each of your children. Amazon doesn’t seem to care!! Only Jeff Bezos could be so crazy generous. Once you have an AWS Free Tier account, you can use it to play with BayesForge for a whole year, free of charge. You don’t have to be a student to do this.

What can you do with BayesForge?

BF allows you to write Jupyter notebooks on your web browser in a wide variety of languages and run/store those notebooks on the cloud. (Besides the web browser, no additional software needs to be installed on your computer). We have installed Jupyter kernels for Python-3, Python-2, R, Octave (clone of matlab) and bash. This means you can write/run a notebook in which you use one of those languages exclusively. We have also installed Rmagic and Octavemagic which allows you to write a notebook in Python but dip temporarily into R or Octave.

What software packages does BayesForge include?

BF comes with 2 folders called “Classical” and “Quantum”. The “Quantum” folder contains a large selection of open source quantum computing software, including our own Quantum Fog and Qubiter, and also open source qc software from DWave, IBM, Rigetti, etc. The “Classical” folder contains a large selection of open source software for doing classical bayesian statistical analysis.

This is the logo of BayesForge (graphics by our inhouse artiste and Gimp wizard, Henning Dekant. BayesForge name suggested by Gavin Dekant)

“True gold is not afraid of fire.”
(Chinese Proverb)

“Incus robust malleum non timet”
“A strong anvil need not fear the hammer.”
(Latin Proverb)

Next Page »

Create a free website or blog at WordPress.com.

%d bloggers like this: