Welcome to my series on Q# (Microsoft’s first ever quantum programming language) Quantum Computing. In this series, I plan to walk through Quantum Concepts, Microsoft Quantum Development Kit, Q# and quantum computing. I will try to post at least one article every week so that we can keep pace with the development of Q#.
To begin, lets understand what Quantum Computing is and how is it going to revolutionize the computing forever. There is no easy way to make a software professional understand quantum computing, unless they understand Quantum Mechanics. However, I will try my best to explain. Quantum computing is still in its initial phase and it may take another decade before it becomes mainstream means of computing.
Digital and Quantum
Digital computing works on the principal of bit (a finite state of 1 or 0). We achieve this using a transistor, which can at any point in time can hold either of two states 1 (charged) or 0 (discharged).
In Quantum physics, an atom can be in two states (excited and non-excited) at the same time. Schrodinger’s Cat paradox can explain this. The paradox demands that you put a cat and poison together inside a box and close it. And, when you open it, there are two possible outcomes; either the cat ate the poison and it is dead or it didn’t eat the poison and therefore it is alive.
However, the outcome is not known until the box you open the box. Therefore, the cat is both dead and alive, when the box remains closed. If you haven’t heard about quantum mechanics before, this may sound a little bizarre to you. Albert Einstein too had a tough time with the same and, so you are not alone.
A conventional bit cannot store a state where a data can be both positive and negative until measured. Qubit is the new data type to store such a state.
What makes the Qubit interesting is the feasibility of superposition. Every single superposition of a Qubit value will be a new valid value. Whereas, in a conventional bit, a bit always be either 0 or 1. Theoretically, a single qubit can store an array of values. The below video can give some clarity.
Quantum Entanglement is another phenomenon which will allow the communication between two particles instantaneously regardless of the distance. A real-world implementation of the same will make computation much faster than anything that is available today. We will not discuss about this here. However, you can feed your curiosity by doing a quick Bing.
A “bit” is the foundation of digital programming and Qubit is the foundation of quantum programming. All the conventional high-level languages (like C#, C++, PHP) are based on the digital programming and bound with the physics of bit (0 or 1). Qubit changes the underlying physics of how we store and interpret data. Therefore, it makes more sense to come up with a new programming language rather trying to fit the existing languages.
Q# is the brainchild of Microsoft, designed to reap the benefits of quantum computing. Q# will run on a quantum simulator which runs on a classic computer as there aren’t any practical quantum computers available in the market. However, IBM already has developed a 16bit quantum processor. “IBM Quantum Experience” is the program which allows researchers and programmers to experiment with their technology. A practical quantum computer will need at least a 32-bit processor.
What to expect from this series
I am not an expert in Q# and I am embarking this journey in teaching myself Q# and help fellow enthusiastic programmers in do so. In every part of the series we will first learn about the concept, design, coding and a real-time example.
Setting up the environment
Before you set up the environment, you will need a processor which supports AVX (Advanced Vector extensions) instructions. Intel shipped the support starting Sandy Bridge processors in 2011. You can use a small tool I have created to check if your PC supports AVX.
Microsoft has said that they are working on removing the pre-requisite.
You will also need Visual Studio 2017 (any edition) to develop Q# programs. Download and install the “Microsoft Quantum Developer Kit”. The developer kit includes the extension for syntax highlighting and Quantum Simulator. The simulator will not run in a 32-bit Windows. All the required libraries are available through NuGet packages.
After you have installed the developer kit, you can test the working of the Q# by creating and building an empty project.
Launch the VS and create a new project. Select Q# Application under Visual C#.
Build the project and you will see all the references resolved under “References” of the project.
This concludes the introduction part. Next week we will kick some Q# programming.