Quantum Computing for Software Developers – Part II

Premier Developer


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! 😊


1 comment

Comments are closed. Login to edit/delete your existing comments

  • Avatar
    Beda Bogdan

    Thank you. Very interesting.
    However…more than a year between Part 1 and Part 2? Should I expect another year for Part 3? 😛
    Also, I think the entanglement explanation is too terse..would have loved to see more details about how that actually works, what it may be needed for…maybe an implementation of the Entanglement function (of course there are other resources on the internet and I can have a guess of how that function would work, I am just giving feedback on this article alone)