Q# Pocket Guide: Instant Help for Q# Developers
- Length: 200 pages
- Edition: 1
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2022-07-19
- ISBN-10: 1098108868
- ISBN-13: 9781098108861
- Sales Rank: #0 (See Top 100 Books)
Q# is a domain-specific language for quantum programming that combines familiar “classical” language constructs with quantum-specific ones. Ideal for any developer familiar with, or willing to learn, the basics of quantum computing, this pocket guide quickly helps you find syntax and usage information for unfamiliar aspects of Q#.
You’ll explore the quantum software development lifecycle, from implementing the program to testing and debugging it to running it on quantum hardware, and you’ll learn to use the tools provided by Microsoft’s Quantum Development Kit for each step of the process.
In this pocket guide, you’ll find:
- Q# language details, including data types, statements, syntax, and expressions
- Guidelines for organizing Q# code and invoking it from different environments
- Information on simulators and tools in the Microsoft Quantum Development Kit
- Advice on testing and debugging tools and techniques for quantum programs
1. Program Structure Your first Q# program Namespaces Operations and functions Type declarations Comments Run your first Q# program! Conclusion 2. Data Types The Q# type system Primitive classical data types Primitive quantum data types Data structures Arrays Tuples User-defined types Operations and functions Conclusion 3. Expressions Equality operators Comparison operators Logical operators Bitwise operators Arithmetic operators Conditional expression Range operator String expressions Array expressions User-defined type expressions Call expressions Adjoint and controlled functors Conclusion 4. Statements Example: calculate Euler’s totient function Working with variables Variable scope Mutable and immutable variables Declaring immutable variables: let statements Declaring mutable variables: mutable statements Reassigning mutable variables: set statements Assigning tuples: tuple deconstruction Conditional execution: if statements Loops Iterate over a sequence: for loops Classical conditional loop: while loops Call an operation or a function: call statements Stop execution: return and fail statements Finish execution: return statements Throw an exception: fail statements Example: prepare a quantum state Allocate qubits: use and borrow statements Quantum conditional loop: repeat-until loops Conjugation: within-apply statements Conclusion 5. Operations and Functions Defining and using operations and functions: the basics Signatures of callables Quantum gates and measurements Defining and using adjoint and controlled specializations of operations Generating operation specializations automatically Using operation specializations Defining operation specializations manually Functional elements of Q# Callable-typed variables Using callables as arguments Partial application Defining and using type-parameterized callables Conclusion 6. Running Q# Programs Quantum applications Quantum software development Quantum simulators Full state simulator Resources estimator Trace simulator Toffoli simulator Noisy simulators Running Q# programs Standalone Q# Q# with a classical host Q# with .NET host Q# with Python host Q# Jupyter Notebooks Conclusion About the Author
Donate to keep this site alive
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: Q# Pocket Guide: Instant Help for Q# Developers
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.