Quantum Misc notes, Thurs 20220908
Misc notes that I draw from for lectures.
1 Complexity theory  Hidary chap 4
Problems vs algorithms.
Interesting types of resources: time, space, ...
Worst case time, best case time.
We want to group problems and algorithms into classes in a way that captures their important properties and ignores the others.

competing formal ways to describe algorithms: Turing machine, Church's lambda calculus, ...
different ones had different power (could describe different classes).
the ones listed above seemed to all have the same power.
Universal Turing machine.
ChurchTuring Thesis (CTT): If an algorithm can be performed on any piece of hardware (say, a modern personal computer), then there is an equivalent algorithm for a Universal Turing Machine (UTM) which performs exactly the same algorithm [161, p. 5].
Strong ChurchTuring Thesis (SCTT) Any algorithmic process can be simulated efficiently using a Universal Turing Machine (UTM)
randomness can sometimes lead to a faster algorithm.
Extended ChurchTuring Thesis (ECTT) Any algorithmic process can be simulated efficiently using a Probabilistic Turing Machine (PTM) [161, p. 6].
Quantum Extended ChurchTuring Thesis (QECTT) Any realistic physical computing device can be efficiently simulated by a faulttolerant quantum computer.
2 Hardware implementations
Quantum computation was theoretically started decades before actual quantum computers were designed.
Many competing technologies.
Let the strongest win.
3 New material
Various things designed to solidify your understanding of the fundamentals.
3.1 Math review from Quantum Computing for Computer Scientists

Chapter 2:

Complex vector space, page 34.
ndim vector $\begin{vmatrix} c_0 \\ \cdots \\ c_{n1}\end{vmatrix}$
Add 2 vectors.
Multiply vector by scalar.
etc.

Set of $m\times n$ complex matrices, $\mathbb{C}^{m\times n}$, is also a complex vector space.
Transpose, conjugate, adjoint.
Matrix mult is $\star$ in book.
$\mathbb{C}^{m\times n}$ is a complex algebra.
Set of polynomials in one variable of degree $le n$ is a complex vector space.
State of a quantum system is a complex vector.

You can make new vector spaces from combos of old ones.
Cartesian product or direct sum.
Just an ordered pair.
$(v_1, v_2)$.

Set of basis vectors for the vector space.
Every vector $v$ in the space is a linear combo of the basis vectors.
Represent $v$ as the list of weights.
There are many possible basis sets.
Each different basis set causes a different representation for the vectors.
Convert: change of basis.

Cartography example: NAD27, WGS84.
A bridge between Switzerland and Germany across the Rhine River at Laufenberg had its two ends at different elevations because of a conversion error between two different basis systems.
Hadamard matrix is an example.
Section 2.4 Inner product, etc, p 53

Section 2.7 Tensor product of vector spaces, p 66.
$\mathbb{V} \otimes \mathbb{V'}$.
Let $dim(\mathbb{V})=p$ and $dim(\mathbb{V'})=q$ . Then $dim(\mathbb{V} \otimes \mathbb{V'}) = pq$.
This is how quantum systems combine.
Example 2.7.2 p 70.


From end of section 2.3, p.52 to 2.6.
P 52. Transition matrix to convert a vector representation from the canonical basis this another basis is the Hadamark matrix.
Section 2.4. Add an inner product operator to the complex vector space. Note the conjugates in the rules; you don't see them with a real vector space.
Norm, aka length.
We won't need limits etc.

Section 2.5 Eigenvalues and eigenvectors
Eigenvalues don't depend on the representation. Converting to a new basis set doesn't change them.
Geometrically, in 2D, in you transform a circle centered at origin, eigenvalues are lengths of the axes. Eigenvectors are the axes.
Section 2.6 Hermitian and unitary matrices
P 39. Adjoint: conjugate transpose of matrix.
If you use its eigenvectors as a basis, then the matrix diagonalizes to a list of its eigenvalues.
P 62. Hermitian matrix: it is its adjoint.
Unitary: its inverse is its adjoint.
Geometrically, they are rotations since they preserve distances.
Notation confusion: the books uses capital letters both for matrices and vectors.
P 71, tensor product of matrices.

Chapter 3 through 3.2, p 7488.
p 80, doubly stochastic matrix.
Multiplying it by a vector of probabilities gives a vector of probabilities (i.e., they sum to 1 and $0\le a_i \le 1$ ).
P 88, Chapter 3, section 3.3 Quantum systems,
Real probabilities add.
When probabilities are norms of complex numbers, they might cancel.
p 91, Ex 3.2.2
p 93 double slit experiment
p 97 Section 3.4, Assembling systems
3.2 2 slit experiment compared with real vs complex transitions
4 Misc intro to quantum computing stuff
This is misc stuff that you might find interesting, which I'm drawing from.
4.1 Quantum properties  Phase
You cannot measure the phase of qbit.
You can measure the relative phase of 2 qbits.
Many algorithms encode the answer as a phase shift of a qbit.
Phase kickback means that a gate that runs one way, e.g., the control bit affects an output bit, can be made to run the other way, e.g., the control bit is changed, by making the other bit a Hadamad basis.
4.2 Quantum supremacy
Coined by Preskill in 2012.
Google claimed this in Oct 2019 on a specific (artificial?) problem; see Google section.
IBM disagrees.
4.3 Cloudbased computing
IBM started this.
Alibaba followed.
Then DWave Leap, Rigetti, Amazon AWS Braket and Quantum solutions lab, Microsoft Azure.
IBM's intent is to entangle their computers in different sites; exponentially increasing power.
4.4 Technologies
4.4.1 Transmon qubit
4.4.2 Trapped Ion
Proponents say that it's better than transmon qbits.

"To date, we’ve run singlequbit gates on a 79 ion chain, and complex algorithms on chains of up to 11 ions."
4.4.3 Quantum annealing
This is not comparable to quantum gates and circuits like IBM has.
It minimizes a function by testing many solutions in parallel.
See details in the DWave section.
Qbit count is not comparable to gate models.
4.4.4 Photonics
Operates at room temperature.
See Xanadu below.
4.5 Companies  Primary
These companies have their own hardware.
4.5.1 IBM
4.5.1.1 Summary
They have several quantum computers, up to 53 qbits.
The older ones are freely available on the web; see https://quantumcomputing.ibm.com/
Note that you can put gates between only adjacent qbits.
You submit a batch job and get emailed when it runs.

IBM github site: https://github.com/Qiskit with

a free simulator.
It doesn't match all the physical complexity of the real computer, but it's a good start.
and tutorials and presentations.

and a SW development framework. https://qiskit.org/

You can create a quantum computation program either by
designing a circuit, or
using a programming language.
4.5.1.2 Sites
IBM Introduces First Integrated Quantum Computing System for Commercial Use

Go BehindtheScenes of a Quantum Experiment (2:10) https://quantumexperience.ng.bluemix.net/qx/community/question?questionId=5ae975690f020500399ed39a&channel=videos
or
https://www.youtube.com/watch?v=tfZpJLdkzRU&list=PLOFEBzvsVvpzQnlazij7cL1mjKvJTAwk&index=7

A Qubit in the Making (2:01)
https://www.youtube.com/watch?v=2pB87H3_F_c&list=PLOFEBzvsVvpzQnlazij7cL1mjKvJTAwk&index=10&t=0s
Behold the Mighty Qubit (2:51) https://www.youtube.com/watch?v=_P7K8jUbLU0&list=PLOFEBzvsVvpzQnlazij7cL1mjKvJTAwk&index=10
Classical and Quantum Randomness (3:39) https://www.youtube.com/watch?v=8kyJfAC4VAo&list=PLOFEBzvsVvpzQnlazij7cL1mjKvJTAwk&index=6
Quantum Entanglement (2:21) https://www.youtube.com/watch?v=RmXasxLm43k&list=PLOFEBzvsVvpzQnlazij7cL1mjKvJTAwk&index=5
Benchmarking Quantum Systems (1:58) https://www.youtube.com/watch?v=7L5omzLqU&list=PLOFEBzvsVvpzQnlazij7cL1mjKvJTAwk&index=8
Quantum Pong — Programming on Quantum Computers Season 1 Ep 1 3:54 by Abraham Asfaw.
IBM publishes its quantum roadmap, says it will have a 1,000qubit machine in 2023
https://quantumcomputing.stackexchange.com/questions/tagged/ibmqexperience
https://quantumcomputing.stackexchange.com/questions/tagged/qiskit
4.5.1.3 Applications on the IBM Q
Quantum Algorithms for Applications from qiskit

This is in Huawei HiQ, an opensource software framework for quantum computing.
https://en.wikipedia.org/wiki/Quantum_algorithm_for_linear_systems_of_equations
4.5.1.4 IBM Quantum experience
When you design a circuit here, you don't need to simulate it elsewhere. It shows you the probabilities.
Dual view: you can see and edit both the circuit and the QASM code.
There are some sample programs in https://github.com/Qiskit/openqasm.git
Example circuits in https://quantumcomputing.ibm.com/docs/iqx/examplecircuits .
4.5.2 Intel
Tangle Lake has 49 superconducting qbits.
Produced in Oregon.
Partners with QuTech in Netherlands.
https://www.intel.com/content/www/us/en/research/quantumcomputing.html
4.5.3 Google

Sycamore has 54 (> 53) transmon qbits in 9x6 array, each coupled to 4 neighbors.
Google quantum General web site.
Day 1 opening keynote by Hartmut Neven (Quantum Summer Symposium 2020) 29:58.
QuantumCasts link to some videos, including the following.
Introduction to Quantum Chess (Quantum Summer Symposium 2020) 13:53.
Quantum Money (Quantum Summer Symposium 2020) 15:56. Peter Shor. It's fun to see what Shor is thinking about now.
QSI Seminar: Dr Marissa Giustina, Google Research, Building Google's Quantum Computer, 09/06/2020 55:52.
Programming a quantum computer with Cirq (QuantumCasts) 10:39.
4.5.4 DWave
They make a different type of quantum computer, called a quantum annealer. They have been in the news lately, e.g.,
https://arstechnica.com/science/2020/09/dwavereleasesitsnextgenerationquantumannealingchip/

Quantum Programming 101: Solving a Problem From End to End  DWave Webinar 54:25.
"Want to learn how to program a quantum computer? In this webinar, we explain how to do so by running through a complete, simple example. We explain how to formulate the problem, how to write it, and how to tune it for best results. "
"This webinar is intended for those with little or no experience programming on a DWave quantum computer. After watching, get free time on Leap, the quantum cloud service at https://cloud.dwavesys.com/leap/signup/ "

Slides from Programming Quantum Computers: A Primer with IBM Q and DWave Exercises by Frank Mueller, Patrick Dreher, Greg Byrd held at PPoPP (Feb 2019) ASPLOS'19 (Apr 2019),
Part 3: DWave  Adiabatic Quantum Programming

DWave factoring tutorial and other demos
including Jupyter notebooks (you have to login for them).
4.5.5 IonQ
founders from Maryland/College Park and Duke.
trapped ion
32 qbits.
low error rate
excellent quantum volume
will be available from Microsoft Azure and Amazon AWS Braket.
https://ionq.com/posts/october012020mostpowerfulquantumcomputer
4.5.6 Honeywell
H1: trapped ion.

10 qbits,
full connectivity,
can read isolated qbits in midcomputation,
hires rotations.
JP Morgan experimenting with it.
4.5.6.1 Sites
Zdnet: Honeywell's System Model H1 quantum computer available to enterprises
They partner with Microsoft,, Experience quantum impact with Azure Quantum, Cambridge Quantum Computing, Zapata Computing, etc.
4.5.7 Rigetti
Berkeleybased
founder is exIBM
has lots of tools
available via AWS etc
technical details are sparse
has been absorbing venture capital

"Recently, investors are gambling more on the middleware layer of a quantum computing stack. These are companies like Zapata, QCTRL, Quantum Machines and Aliro, which improve the performance of quantum computers and create an easier user experience"

makes optimistic promises (8/8/18):
https://medium.com/rigetti/therigetti128qubitchipandwhatitmeansforquantumdf757d1b71ea
4.5.8 Xanadu
https://venturebeat.com/2020/09/02/xanaduphotonicsquantumcloudplatform/
Uses photonics.
Operates primarily at room temperature.
Up to 24 qbits, gate depth of 12.
Has free SW tools, some of which can compile to other quantum technologies.
Expected good applications: graphs and networks, machine learning, and quantum chemistry.
They expect to scale up better than competing technologies.
4.5.9 Others
Alibaba
1QBit
CQC
QC Ware
QSimulate
Quantum Circuits
Rahko
Zapata
4.6 Companies  Aggregators
These companies resell others' computers as a cloud service.
4.6.1 Amazon

https://aws.amazon.com/braket/
"Amazon Braket is a fully managed quantum computing service that helps researchers and developers get started with the technology to accelerate research and discovery. Amazon Braket provides a development environment for you to explore and build quantum algorithms, test them on quantum circuit simulators, and run them on different quantum hardware technologies."
"...quantum annealers from DWave, and gatebased computers from Rigetti and IonQ."
4.6.2 Microsoft

They offer a cloud service on 3 platforms: Honeywell, IonQ, QCI.

A lot of stuff, with a low S/N.

Azure Quantum Developer Workshop. 5:05:25.
A little diffuse.
For faster quantum computing, Microsoft builds a better qubit 11/7/2019.
Microsoft Quantum Documentation gateway to a lot of stuff.

Microsoft, e.g. Quantum Computing for Computer Scientists 1:28:22.
This is the same viewpoint as the textbook, but the speaker is different.
This talk discards handwavy popscience metaphors and answers a simple question: from a computer science perspective, how can a quantum computer outperform a classical computer? Attendees will learn the following:
Representing computation with basic linear algebra (matrices and vectors)
The computational workings of qbits, superposition, and quantum logic gates
Solving the Deutsch oracle problem: the simplest problem where a quantum computer outperforms classical methods
Bonus topics: quantum entanglement and teleportation
The talk concludes with a live demonstration of quantum entanglement on a realworld quantum computer, and a demo of the Deutsch oracle problem implemented in Q# with the Microsoft Quantum Development Kit. This talk assumes no prerequisite knowledge, although comfort with basic linear algebra (matrices, vectors, matrix multiplication) will ease understanding.
See more at https://www.microsoft.com/enus/research/video/quantumcomputingcomputerscientists/
4.7 Algorithms
Good ref is Chapter 6, Algorithms of Quantum Computing for Computer Scientists, published in 2000. Algorithms don't change fast. It does omit new things like HHL.
For these examples, the quantum algorithm is quite different from the classical algorithm, and is asymptotically faster.
Current research is deciding what algorithms can be made faster.
p 172: Any function can be made invertible by adding a control bit.

Major categories:
Cryptography
Quantum search
Quantum simulation
Quantum annealing and adiabatic optimization
Nice summary: https://en.wikipedia.org/wiki/Quantum_computing

Algorithm summary:
Some, but not all, are faster.

Boundederror quantum polynomial time (BQP)
"is the class of decision problems solvable by a quantum computer in polynomial time, with an error probability of at most 1/3 for all instances"  https://en.wikipedia.org/wiki/BQP
Includes integer factorization and discrete log.
Relation to NP is unknown (big unsolved problem).

Searching problems:
Find the answer to a puzzle.
Math examples: factor an integer, solve a polynonial equation.
Testing validity of a putative solution is easy.
Finding that putative solution, naively, requires testing all possibilities.
Quantum computation can solve some searching problems faster.
This is probabilistic or noisy; often the found solution is wrong.
So you repeat the computation enough times that the error rate is acceptably low.
Some classical algorithms are similar. There is an excellent probabilistic primality algorithm.
The quantum algorithms are quite complex. (i.e., I'm still learning them.)

Algorithms, another view
Hadamard matrix rotates the pure state to an entangled superposition.
Then we operate in parallel on each state in the superposition.
Finally we separate out the desired answer.

Grover's algorithm:
Given a black box with N inputs and 1 output.
Exactly one input makes the output 1.
Problem: which one?
Classical solution: Try each input, T=N.
Quantum: $T=\sqrt(N)$.
Probabilistic.
Apps: mean, median, reverse a crypto hash, find collisions, generate false blocks.
Can extend to quantum partial search.
Grover's algorithm is optimal.
This suggests that NP is not in BQP .

Shor's algorithm:
Factorize an integer.
in BQP.
almost exponentially faster than best classical algorithm.

Largest examples I can find:
4.8 Algorithm details
4.8.1 Deutsch
We have a black box F(x) > x'.
We're told that F is either balanced or constant.
How to determine which?
We can input any x and see the result.
Classically: eval F(0) and F(1).
That took two evals and some comparisons.
All that matters is the number of evals. We assume that they're slower than everything else.
Quantumly (quantumicly?) we can determine which type F is with only one eval plus some extra matrices.
4.8.2 Deutsch  Jozsa
Now $F: \{0,1\}^n \to \{0,1\}$.
We're told that it's either constant or balanced. It's not neither.
Which is it?
Classically, we need n/2+1 evals of F.
Quantumly, we need only 1.
4.8.3 Simon's periodicity
Blackbox $F: \{0,1\}^n \to \{0,1\}^n$
For some unknown $c$, $F(x\oplus c) = F(x)$.
Determine $c$.
4.8.4 Grover's search
4.8.4.1 Problem
Blackbox $F: \{0,1\}^n \to \{0,1\}$
For only one x, F(x) = 1. Otherwise F(x)=0.
Determine x.
Classically: T(n)=O(n).
Quantumly: $T(n) = O(\sqrt{n})$.
4.8.4.2 Videos
Introduction to Quantum Computing (18)  Grover's Algorithm: Quantum Problem Statement (4:24)
Introduction to Quantum Computing (19)  Grover's Algorithm: Outline (16:09)
Introduction to Quantum Computing (20)  Grover's Algorithm: Subspace (7:42)
Introduction to Quantum Computing (21)  Grover's Algorithm: Geometric Interpretation
Introduction to Quantum Computing (23)  Grover's Algorithm: Implementation (9:33)
Introduction to Quantum Computing (24)  Grover's Algorithm: IBM Quantum Experience (11:39)
4.8.5 DeutschJozsa
This algorithm is deterministic.

https://www.quantiki.org/wiki/deutschjozsaalgorithm
Quick summary; doesn't say why it works.

https://qiskit.org/textbook/chalgorithms/deutschjozsa.html
This is an intro to Qiskit. The terminology is confusing. E.g., Register 1 has q0 q1 q2. Register 2 has q3. The run buttons don't seem to work.

https://en.wikipedia.org/wiki/Deutsch%E2%80%93Jozsa_algorithm
This is a nice detailed description.
4.8.6 Shor's algorithm
4.8.7 HHL algorithm to solve a linear system of equations

Quantum Machine Learning  37  Overview of the HHL Algorithm 5:48.
quick, deep, intro.

Quantum algorithm for solving linear equations 36:31.
quite understandable.
Quantum Algorithms for Systems of Linear Equations (Quantum Summer Symposium 2020) 19:22.

IBM Quantum Algorithms for Applications from qiskit
E.g., Fourier transform and HHL.

This is in Huawei HiQ, an opensource software framework for quantum computing.
https://en.wikipedia.org/wiki/Quantum_algorithm_for_linear_systems_of_equations
4.9 Software
4.9.1 General
A difficulty is to compile to the limited connectivity of the machine
ProjectQ opensource software framework for quantum computing.
Programming Quantum Computers: A Primer with IBM Q and DWave Exercises . Tutorial given at a few conferences.
4.9.2 Middleware
https://www.hpcwire.com/offthewire/quantumcomputingincreleasesversion11ofmukaimiddleware/
https://tbri.com/webinars/middlewarethequantumcomputingdifferentiator/ "An integral piece of quantum computing’s success is the middleware bridging existing code and algorithms to the new logical circuitry being established that sits on top of the quantum circuits. This integration and abstraction will allow the technology to process complex algorithms to provide the outcomes the hardware enables."
4.10 More info
4.10.1 QuTech Academy
excellent videos from this Delft research group.

Per Delsing: Superconducting qubits as artificial atoms 28:59.
He's describing a different computer from IBM's.

The Taming of the Superconducting Qubit: A Tale of Loss 35:47.
Presenter: Conal Murray, Research Staff Member, IBM Research
The potential of quantum computing to enable new ways of solving problems considered intractable on classical computing platforms relies on our understanding of how qubits operate. Qubit scaling follows different metrics than those associated with classical computing, driven by the requirement that the fragile states they possess can be retained for sufficiently long times. After a brief introduction into superconducting transmon qubits, I will discuss how dielectric loss impacts their relaxation times and how we can effectively model such behavior using analytical and computational approaches. The resulting analysis provides guidance into the design aspects associated with such qubits. A secondary issue that follows from manufacturing greater numbers of qubits involves unwanted communication among them. In particular, resonance modes generated in the substrate on which they reside can limit their operating frequencies. It is known that incorporating grounded, throughsilicon vias can increase the corresponding cutoff frequency within the substrate. I will show how we can predict the resulting spectrum by considering the array of vias as an effective photonic crystal to arrive at a fundamental frequency dependent on the particulars of the via geometry.
4.10.2 Misc
Quantum Computing UK nice set of docs and examples.
Ricardo Diaz recommends this book: Something Deeply Hidden: Quantum Worlds and the Emergence of Spacetime .
There are now several business reports on the industry.
4.11 Summary
Quantum computing hasn't solidly proved itself yet. However it's now in the engineering phase  realizing what we basically know how to do.
IMO the physicists have done it again (last time was atomic energy). This will be a fundamental transformation of computing.
Certain searching algorithms will be exponentially faster.
Algorithm design still needs research. Algorithms are quite complex.
Major application areas like drug design.
Several viable technologies competing.
Several HW companies.
Competing toolsets being developed.
Various service platforms to provide simulators and the HW.

Recommendation (remember I'm SW):
Be agnostic wrt platform (we don't know who will win).
Have people use AWS etc to learn and develop apps. No capital investment needed.
Work developing and/or using middleware, which is newer area.

RPIspecific:
Merely playing catchup is a losing game. Need something new.
Assume that IBM etc will make the computers. The big problem with new HW is always how to use it. The ability of customers to use a new tool can determine whether it succeeds.

Include other RPI programs?
Gamify this using Game and Sim?
Work with tetherless world?
I'm still thinking.