Quantum Computing for Software Developers – Part II

Developer Support

App Dev Manager Leonard Woody breaks down the fundamentals of quantum computing from the perspective of a software developer.

Link to Part I – https://devblogs.microsoft.com/premier-developer/quantum-computing-for-software-developers-part-i/

Continuing from Part 1, let’s create a struct that represents the state of a qubit like below:

Using this struct, we can create a class for a Qubit:

Now we can create a Measure method that is a little more rigorous:

Things start to get interesting when we have multiple Qubits. If they are entangled, we have to track all the possibilities in the system of Qubits could have from a measurement. We can represent this like below:

This curious result leads us to a hint of the power of Quantum Computing. For each qubit added to a quantum system, we need to double the amount of bits to store the state. The table below shows how this quickly gets out of control.

Finally, quantum entanglement leads us to the following curious result:

In other words, the results of measurement for a system of qubits is correlated. When we entangle a system of two qubits into a “Bell State”, if you measure 1 on one qubit you will always measure a 1 on the other qubit. The reverse is also true, but you will never get different measurements.

In these two parts of my blog entry, I have demonstrated what Superposition and Entanglement mean from a quantum computing perspective. In Part 3, I’ll get into quantum operations! 😊