Tags

,

Quantum.jpg

Back in December 2017, Microsoft announced a Quantum Development kit which uses Q # (Q Sharp) as its language. It is designed to be used with Visual Studio 2017.  Recently I decided to install the development kit and have a go at the usual “Hello World” example.

The development kit is explained as being capable of developing Quantum code using a Quantum Simulator on your device.

“The development kit contains the tools you’ll need to build your own quantum computing programs and experiments. Assuming some experience with Microsoft Visual Studio or Visual Studio Code, beginners can write their first quantum program, and experienced researchers can quickly and efficiently develop new quantum algorithms”

Source: Microsoft

Overall I found the tutorial well laid out, with lots of good explanations and shows how some functions are equivalent to others in C, C#, Java. If you are used to C#, then Q# will be immediately familiar as it uses semicolons and braces to indicate program structure.

With this demonstration the “Hello World” is in the form of qubit, so the output on the screen is in Zero and One. the example also takes you through changing the program to create Superposition and Entanglement.

We’ll start with the simplest program possible and build it up to demonstrate quantum superposition and quantum entanglement. We will start with a qubit in a basis state |0⟩
, perform some operations on it and then measure the result.

Output:

Init:Zero 0s=1000 1s=0
Init:One 0s=0 1s=1000

Creating Superposition

Output:

Init:Zero 0s=484 1s=516
Init:One 0s=522 1s=478

Creating Entanglement

Output:

Init:Zero 0s=499 1s=501 agree=1000
Init:One 0s=490 1s=510 agree=1000

Source: Q# Worked Example

Q#

A good introduction and first steps into programming Quantum Computing.

Resources