Oh boy - have to bring GoPi5Go-Dave into the Quantum Computing Craze

Watched 60 minutes segment on the Quantum computing craziness last night, and don’t want GoPi5Go-Dave to miss out being the first GoPiGo3 with a Quantum Computer (…simulator).

IBM publishes a quantum computing simulator in various forms, Dockered or “venv’d”. Each present difficulties when faced with giving the quantum computer (simulator) access to the GoPiGo3 hardware.

As a start I’m trying the “build it yourself” Docker/32-bit-Buster/ibmosquito-qiskit/Jupyter approach without GoPiGo3 API which has been building for almost 45 minutes and still going strong claiming 51% done.

Have to see if it even runs on Dave’s 64-bit PiOS Bookworm, before trying the really complicated process to add the GoPiGo3 API and permissions to access to the GoPiGo3 hardware.

OOPS - build died after 44 minutes. Have to try the venv approach.

The example programs are only 7 lines of imports and 3 lines of code.

Of course everyone’s comments “I don’t know what to do with a quantum computer now that I have one” is a bit foreboding.

Found a great repo (4 years old) - “quantum-simulator-benchmark” that builds a docker container with four different quantum processor simulators (qisket-toaster, qisket-aer, quil QVM, cirq) and runs a benchmark against each one for 1 to 27 qubits.

It was written for Intel hosts, but I was able to change the build for 64-bit Raspberry Pi and all was looking good till it announced “not enough disk space”. I may need to add a 128GB USB disk and super-cool Dave down to near absolute zero to achieve “coherence”.

I deleted all the docker temporary build files to recover an additional 5GB on Dave’s card - we’ll see if I can just squeek this thing in for a test.

Looks like I should strip it down to just the cirq simulator and use less than 10 qubits. I really hate using Google software - come back a day later and nothing will work.

I managed to find a very easy to install, very sophisticated Quantum Simulator, and run Dave’s “First Qisket Circuits” without having to sign up for IBM, or Google access to a cloud Quantum processor.

I haven’t the slightest idea what Dave computed, but it runs without errors and spits out true non-deterministic (quantum) results:

(qvmvenv) pi@GoPi5Go:~/GoPi5Go/systests/qvm/qvmvenv/examples $ ./first_qisket_circuit.py
Simulating Two 2-qubit circuits
expectation values : psi1 = [ 1.53564065 -1.10584991], psi2 = 0.17500806267478156
time: 2.51 ms
Simulating 128 shots of a 2-qubit circuit
counts for Bell circuit : {'00': 66, '11': 62}
time: 1.03 ms
Simulating a 2-qubit circuit
counts for parameterized circuit : {'01': 399, '11': 394, '10': 94, '00': 137}
time: 1.49 ms

Quantum Simulator: Qiskit-Aer

“Bell State Measurement: Bell state measurement (BSM) is a quantum-mechanical measurement that determines which of the four Bell states two qubits are in. Bell states are quantum states of two qubits that are examples of quantum entanglement. When one qubit is measured, the other qubit is forced to take on a specific value as the entangled state collapses” - Yeah - that clears up a lot!

GoPi5Go-Dave has joined the Quantum Computing Revolution!

(but I will never be able to grok quantum computing: “we recommend familiarity with basic linear algebra, complex numbers, and elementary mathematical notions including sets and functions.”)

It’s like buying an Abrams tank. Now that you have it, what do you do with it?

Though I have to admit it’s a great experimental success - possibly way ahead of its time.

Isn’t that 9th grade Algebra?

I would have loved to have one of these things when I was taking Calculus - it would be great for functions surrounding a discontinuity and/or approaching (±)infinity.

Hmm. . . It could be useful around “event horizons” too, where things go all pear-shaped in uniquely new and interesting ways.

“ mathematical discipline that deals with vectors and matrices and, more generally, with vector spaces and linear transformations . Unlike other parts of mathematics that are frequently invigorated by new ideas and unsolved problems, linear algebra is very well understood”

Not by me, not my 9th grade. College course I struggled to get a B in, and don’t have a sense what a dot product vs a cross product vs an inversion vs a rotation or any of the Greek alphabet mean on the page,when combined with the other course I struggled with - statistics II Applied Statistics.

Put imaginary numbers in those matrices and my imagination cannot function with irrational numbers or thinking.

Pushed it to Git, and “boast that I did it”…
And be honest when anyone asks “what can Dave do with it?” Diddly squat, but he does it real fast (near absolute zero).

And remind myself to type

P.s. At one time I wrote an entire sailing club membership maintenance system in APL. Remembering matrices and special characters reminds me how irrational that was.

You wrote " an entire sailing club membership maintenance system" in APL?!! And you’re complaining about having trouble with Dave chasing after a few measly bosons?

APL and its gibberish language constructs makes Chinese look like a Dick and Jane first grade primer! Case in point: The strange symbols across the bottom of a check drawn on a US bank are actually APL programming constructs saying “read this” and “print that”, etc.

I have to go out and buy more bandages for the scrapes on my chin, dragging my jaw off the floor!

P.S.
How about a brief lexicon of the strange terms you’ve been throwing around fast and loose.

Found the latest version of Qiskit Quantum Processing SDK which includes an improved simulator (55% faster at whatever you want to do with your Quantum Processor…)

(qiskit1) pi@GoPi5Go:~/GoPi5Go/systests/qvm/qiskit1 $ pip show qiskit
Name: qiskit
Version: 1.1.1
Summary: An open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
Home-page:
Author:
Author-email: Qiskit Development Team <qiskit@us.ibm.com>
License: Apache 2.0
Location: /home/pi/GoPi5Go/systests/qvm/qiskit1/lib/python3.11/site-packages
Requires: dill, numpy, python-dateutil, rustworkx, scipy, stevedore, symengine, sympy, typing-extensions

3qubitGHZ.py

(qiskit1) pi@GoPi5Go:~/GoPi5Go/systests/qvm/qiskit1/examples $ ./3qubitGHZ.py
> Quasi probability distribution: [{0: np.float64(0.528), 7: np.float64(0.472)}]
Execution Time: 1.70 ms
> Expectation values: [4.]
Execution Time: 0.69 ms

v1.1.1 appears to be roughly 55% faster than v0.14 (They claim 1000% faster)