Learning Quantum Programming as a Huge Idiot


I’ve been spending some time recently thinking about what I want to focus on in my career as an very average software developer.

I do not want to just be a code monkey that can be replaced by AI in about 3 months’ time. Nor do I want to be an architect that just talks about code and has no real involvement in the process.

My current skillset, such as it is, consists of C#, .NET, Python, SQL, and JavaScript.

These are all very mainstream, boring, uninspiring technologies that get the job done. I could even pretend that I am full stack1, though I do not believe there is such a thing. Recruiters and companies love that sort of label however, which is a shame.

I’ve also managed to acquire some knowledge around approaches to software, and have even used a few patterns in my job. These were not always appreciated. I don’t know whether you’ve heard but most software developers aren’t actually very good. Many just know some basic syntax of a language, and have used it to bolt things together without any wider understanding. I should know, I have worked with many2.

What’s this got to do with Quantum Programming?


I need to focus on something familiar yet different. Another language isn’t going to cut it3. It needs to be complicated enough to ward off the riffraff, and also serve a unique purpose. I don’t want to learn yet another JavaScript framework or library.

Quantum Programming seemed like a good idea. It fits the requirements. It sounds impressive. It may even be relevant in the future. It also combines my interest in physics and computing. I also think it solves a problem that is standing in the way of more technological advancement in the world.

There is one problem though: I am a massive fucking idiot.

Seriously, I can’t learn anything. No information stays in my head for long enough to take root.

I started reading about Qiskit and watching some videos by Olivia Lanes4 and she mentioned that before viewers continue watching they should know that they aren’t going to go over the basics, as it is assumed they would already know this stuff. She recommended another video series.

Naturally, being a dumbass, I would need to know these basics, so I switched over to the basics course titled “Single Systems | Understanding Quantum Information & Computation: Lesson 1”.

Within 20 minutes of watching my intellect was stretched and I could almost feel IQ points burning away5 as I was presented with matrix vector multiplication. I have never studied maths at school to any real level. I was 16 the last time I had to learn any maths as part of a curriculum. I did not understand the equations for finding areas under curves, or why I would want to do that, or need to do that. I struggled with simultaneous equations, and was, again, never sure of why I needed to know this stuff.

The problem is, as I learned many years too late, it doesn’t have to require a practical purpose for your every day life in order to be worthwhile. Learning for the sake of learning is valuable in itself. I was entirely disengaged from school for most of my teenage years6 before eventually dropping out at 16, to no great concern from anybody, and never picked up maths again.

Going from Sohcahtoa to Dirac notation is a big leap.

I am able to understand this, I think:

There are four functions f1, f2, f3, f4, and they take one input a. There are only two possible inputs, 0 and 1.

f1(0) = 0
f1(1) = 0

Ok, so the function f1 always returns 0. It is the “constant zero function”7 as it constantly returns zero.

f2(0) = 0
f2(1) = 1

f2 is the “identity function” as it returns whatever its input is8.

f3(0) = 1
f3(1) = 0

f3 is the “Not function”9 as it flips the input as the output.

f4(0) = 1
f4(1) = 1

f4 is the “constant 1 function” for obvious reasons.

These are the only four functions from the binary alphabet to itself. Makes sense as there are only two values in binary, 0 and 1.

Now some matrices are introduced that correlate to the functions …

… and I don’t get it.

f1(0) = 0 apparently corresponds to the M1(0,0) entry (the top-left) and equals 1.

What? Why is it 1 when f1(0) is 0?

Then the video goes on to say that the M1(1,0) entry (the bottom-left) is equal to 0.

Right .. sure? I can see that from the matrix but I have no idea where you came up with those numbers, or how it relates to the functions that were described earlier?



Ok so spent some time trying to work this out for myself. I think I gave myself mild brain damage in the process10.

  • M1 is a 2x2 matrix that does stuff to the inputs
  • The inputs are vectors
  • These vectors are describing the probability of the qubit being 0 or 1, using some kind of maths that I haven’t learned yet
  • f1(0) = 0 corresponds to the value at location (0,0) in the M1 matrix (M1_00), which is 1
  • This value 1 means there is a 100% probability of this output. What is the output of M1_00? 0!
  • If the input to the constant zero function M1 is 0 then the probability that the output will be 0 is 1 (i.e. 100% probability)
  • M1_00 = 1 means: input 0 -> output 0 with 100% probability
  • M1_01 = 1 means: input 1 -> output 0 with 100% probability
  • M1_10 = 0 means: input 0 -> not output 1 with 100% probability
  • M1_11 = 0 means: input 1 -> not output 1 with 100% probability

So these matrix entries are all referring to the probability that given a particular input we get a particular output. Because this example is about binary states, 0 or 1, there is always either a 0% or 100% probability of these states. the M1 matrix is the constant-zero function, so the output is always 011.

With a single qubit, each input is either 0 or 1. With two inputs there are four ways the output can be mapped (these four functions from earlier, Constant-Zero, Identity, NOT, Constant-One).

Too bad qubits can also exist in superpositions. Using quantum gates means that way more complex stuff can be done than just the normal boring classical functions.


Aaaaannd that’s enough Quantum Programming for today 💀

I didn’t even get onto the programming part of this as I was too busy struggling with basic matrix multiplication, and not understanding what the matrix was telling me.

Perhaps I had better start again at Sohcahtoa after all.

« Back to Posts

23rd September 2024


  1. Like everyone else ↩︎

  2. Sometimes I fear I am the person I complain about ↩︎

  3. But I do want to check out Rust ↩︎

  4. I think it was the “Your Guide to 100+ Qubits: Quantum Computing in Practice” course on YouTube ↩︎

  5. I cannot afford to lose any as it is - in fact I likely need to acquire a good 20 or 30 ↩︎

  6. 20 years later I was diagnosed with ADHD - so that’s a probable factor ↩︎

  7. Right. But whyyyy. Is that a thing across all of “functions”? Is there a “constant zero function” in “maths”? ↩︎

  8. And what is the point of that? ↩︎

  9. Heyyooo I know this one! What I now don’t get is how does a “Not” function work when there are three or more possible inputs? ↩︎

  10. Or maybe it was already there right ahaha ↩︎

  11. It might not even be worth thinking about this stupid matrix at all, and just bear in mind that the output is always going to be 0 regardless ↩︎

Serigan's Blog