Q Sharp


Q# is a domain-specific programming language used for expressing quantum algorithms. It was initially released to the public by Microsoft as part of the Quantum Development Kit.

History

During a Microsoft Ignite Keynote on, Microsoft announced that they were going to release a new programming language geared specifically towards quantum computers. On, Microsoft released Q# as a part of the Quantum Development Kit.

Usage

Q# is available as a separately downloaded extension for Visual Studio, but it can also be run as an independent tool from the Command line and/or Visual Studio Code. The Quantum Development Kit ships with a quantum simulator which is capable of running Q#.
In order to invoke the quantum simulator, another.NET programming language, usually C#, is used, which provides the input data for the simulator and reads the output data from the simulator.

Features

A primary feature of Q# is the ability to create and use qubits for algorithms. As a consequence, some of the most prominent features of Q# are the ability to entangle and introduce superpositioning to qubits via Controlled NOT gates and Hadamard gates, respectively, as well as Toffoli Gates, Pauli X, Y, Z Gate, and many more which are used for a variety of operations; see the list at the article on quantum logic gates.
The hardware stack that will eventually come together with Q# is expected to implement Qubits as topological qubits. The quantum simulator that is shipped with the Quantum Development Kit today is capable of processing up to 32 qubits on a user machine and up to 40 qubits on Azure.

Documentation and Resources

Currently, the resources available for Q# are scarce, but the official documentation is published: . is also a large collection of sample programs implementing a variety of Quantum algorithms and their tests.
Microsoft has also hosted a Quantum Coding contest on Codeforces here: https://web.archive.org/web/20181119064628/https://codeforces.com/msqs2018, and also provided related material to help answer the questions in the blog posts, plus the detailed solutions in the tutorials.
Microsoft hosts a set of learning exercises to help learn Q# on github: https://github.com/Microsoft/QuantumKatas with links to resources, and answers to the problems.

Syntax

Q# is syntactically related to both C# and F# yet also has some significant differences.

Similarities with C#