Although it took me four long days to complete the fourth chapter of the Introduction to Classical and Quantum Computing - Thomas Wong book, I’ve finally done it. The relative length, dense topics, and some personal obligations were the main cause of delay, but it was a worthwhile journey.

# Lessons learned

We started off by learning about Entanglion game, whose mechanics were inspired by the rules of quantum mechanics. We then learned about tensor products and how they can be used to represent multiple qubits. We also learned about different conventions, Little endian and Big endian, to represent a binary string as a decimal. We saw why it is difficult for classical computers to simulate a quantum computer and the evidence (no proof as of yet) to support this. We learned about the Kronecker product and how measuring multiple qubits simultaneously and measuring single qubits one after another gives the same results.

We then delved into the realm of quantum Entanglement. We were first introduced to the product states, i.e. those states that can be factored into individual qubit states, and then we learned about the entangled states, i.e. those states that cannot be factored. This entanglement property is one of the key contributors to the power of quantum computing over the classical one, and results in some ingenious algorithms.

After that, we learned about quantum gates, how single qubit quantum gates can be applied to multiple qubits by using the tensor product, and also how two-qubit quantum gates act on multiple qubits. We then learned about the Toffoli Gate because of which we know that quantum computers can efficiently do everything a classical computer can efficiently do (because Toffoli gate is universal for classical computing). We then learned about the No-Cloning Theorem which states that quantum information cannot generally be cloned.

We then learned how to create a Quantum Adder using the quantum gates that we’ve learned about previously. We took inspiration from the Classical Ripple-Carry Adder, which we learned about in Chapter 1, and replaced the classical gates with their quantum counterparts and implemented a Quantum Ripple-Carry Adder. It can be used to act on superpositions. One important thing to remember is that even though it can act on superpositions at the same time, we cannot measure the results of all the calculations. We would only be able to get a single result/measurement because of the collapsing property of qubits, so we can’t think of quantum computers as big parallel computers.

Following that, we learned about universal quantum gates and gate sets. We first learned about some components/properties that a universal gate set should have, i.e. superposition, entanglement, complex amplitudes, not from Clifford group. We’re not sure if these are all of the requirements for a gate set to be universal. We then learned about the SOLOVAY-KITAEV THEOREM which says that with any universal gate set, we can approximate a quantum gate to some precision.

Finally, we learned about Quantum Error Correction. There are two types of errors that can be encountered, bit-flip error and phase-flip error. We can used bit-flip code, which encodes each logical qubit using three-physical qubits. We can then use the parity of the bit-string to determine if an error has occurred without actually measuring the value (and collapsing) and we can then use an $X$ Gate to correct the error. For the phase-flip code, we employ the same strategy, encoding each logical qubit using three physical qubits, and using the parity to determine the presence of some error, and then use the $Z$ gate to correct it. The Shor Code combines both of these encodings into a single encoding, where each logical qubit is represented by nine physical qubits. It can detect and correct both bit-flip and phase-flip errors.

# Moving forward

Yesterday, respected Thomas Wong tweeted about my challenge:

Now I’m more inclined and motivated to finish this journey and produce better notes/content (No pressure 🙄). Furthermore, sharing PDF notes isn’t the best option, as I’ve known from the start, but now I’m noticing its limitations more and more. I’m using Obsidian to take my notes and most of the notes have links to other notes or I’ll note certain details about a specific topic separately and just link to it in the main note. So most of the detailed notes aren’t visible on the PDF I share and only a link to that note is present (which is of no use). I’ll try to get a draft version of my notes website up ASAP, so you guys can have a more interactive way to view the notes. You’ll be able to follow the links and dive deeper into the topics that you want to explore further.

I’m also thinking about creating Sketchnotes for this. I have no previous experience with these types of notes, and I know I’ll be really bad at it, but you’ve got to start somewhere, right? That will be a great way to visualize what I’m learning, reinforce it, and share as a small cohesive package. Let’s see how it goes.

If you have any suggestions or questions, feel free to comment below. Talk to you next time, InshaAllah.

# PDF Notes

My notes on the fourth Chapter of the Thomas Wong’s Introduction to Classical and Quantum Computing book.