Quantum Bayesian Networks

April 22, 2019

Multi-Threading and Gradients of Cost Functions in Quantum Computing

Filed under: Uncategorized — rrtucci @ 5:15 pm

I am VERY pleased to announce that last night, Easter Sunday, I uploaded a major addition to the Qubiter repo at GitHub. The relevant code files all start with the word “Stairs” and are located in the adv_applications folder of Qubiter.

What does the new code do? I explain this in detail in a paper that I wrote for the occasion. The paper is entitled

Calculation of the Gradient of a Quantum Cost Function using ‘Threading’. Application of these ‘threaded gradients’ to a Quantum Neural Net inspired by Quantum Bayesian Networks


As usual, I included lots of docstrings explaining the code, and a main() method at the end of each class, illustrating its usage and testing it. I will also write some jupyter notebooks with examples of usage in the next week or so.

So what do I mean by threading?(I and most people use the words threading and multi-threading synonymously) I believe I am one of the first persons to use the word threading in connection with quantum computing. What I mean by it is the strategy of partitioning the qubits in a (gate model) quantum computer into small, disjoint sets (“islands”) that are uncorrelated from each other and run concurrently. The qubits within one of these islands are strongly correlated but qubits from different islands are probabilistically independent. This is an ideal scenario for NISQ (Noisy Intermediate Scale Quantum) devices and HQC (Hybrid Quantum Classical) computing being pursued by Rigetti Inc. and others. It is also a good fit for calculating the gradient of quantum cost functions: Each island, after many shots and final measurements, yields a mean value, and a linear combination of the mean values from all the islands equals the gradient. In an artistic, poetical sense, qc threading reminds me of what is commonly called “digital rain”, especially if one draws quantum circuits with time pointing downwards, like Qubiter does.


  1. True to my word, just uploaded to the Qubiter repo a jupyter notebook illustrating this stuff


    Comment by rrtucci — April 24, 2019 @ 3:02 am

  2. Extra, extra, read all about it. My second jupyter notebook explaining this stuff


    Comment by rrtucci — April 26, 2019 @ 3:08 pm

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: