Welcome to the Q# User Guide!

In the different topics of this guide, we detail the core concepts of the Q# language and all the information you need to write quantum programs.

Ways to run a Q# program : describes how a Q# program is run, and provides an overview of the various ways you can call the program: from the command line, in Q# Jupyter Notebooks, or from a classical host program written in Python or a .NET language.

Type Expressions : Details how to specify, reference, combine, and operate on values of each type in Q#.

Types in Q# : Lays out the Q# type model and describes the syntax for specifying and working with types.

Q# File Structure: Describes the structure and syntax of a *.qs Q# file.

Operations and Functions: Details the two callable types of the Q# language: operations, which include action on qubit registers, and functions, which strictly work with classical information. Here you see how to define and call them, including the adjoint and controlled versions of quantum operations.

Variables: Describes the role of variables within Q# programs and how to leverage them effectively. For example, you can find information about binding scopes, as well as the difference between immutable and mutable variables and how to assign or re-assign them.

Working with qubits: Describes the features of Q# used to address individual qubits and systems of qubits, specifically, allocating them, performing operations on them, and measuring them.

Control Flow: Details the programming control flow patterns available in Q#, which includes many standard techniques (such as conditional processing, for loops, while loops) as well as the quantum-specific Repeat-Until-Success pattern.