Quantum Computing with Silq Programming

Book description

Learn the mathematics behind quantum computing and explore the high-level quantum language Silq to take your quantum programming skills to the next level

Key Features

  • Harness the potential of quantum computers more effectively using Silq
  • Learn how to solve core problems that you may face while writing quantum programs
  • Explore useful quantum applications such as cryptography and quantum machine learning

Book Description

Quantum computing is a growing field, with many research projects focusing on programming quantum computers in the most efficient way possible. One of the biggest challenges faced with existing languages is that they work on low-level circuit model details and are not able to represent quantum programs accurately. Developed by researchers at ETH Zurich after analyzing languages including Q# and Qiskit, Silq is a high-level programming language that can be viewed as the C++ of quantum computers! Quantum Computing with Silq Programming helps you explore Silq and its intuitive and simple syntax to enable you to describe complex tasks with less code.

This book will help you get to grips with the constructs of the Silq and show you how to write quantum programs with it. You'll learn how to use Silq to program quantum algorithms to solve existing and complex tasks. Using quantum algorithms, you'll also gain practical experience in useful applications such as quantum error correction, cryptography, and quantum machine learning. Finally, you'll discover how to optimize the programming of quantum computers with the simple Silq.

By the end of this Silq book, you'll have mastered the features of Silq and be able to build efficient quantum applications independently.

What you will learn

  • Identify the challenges that researchers face in quantum programming
  • Understand quantum computing concepts and learn how to make quantum circuits
  • Explore Silq programming constructs and use them to create quantum programs
  • Use Silq to code quantum algorithms such as Grover's and Simon's
  • Discover the practicalities of quantum error correction with Silq
  • Explore useful applications such as quantum machine learning in a practical way

Who this book is for

This Silq quantum computing book is for students, researchers, and scientists looking to learn quantum computing techniques and software development. Quantum computing enthusiasts who want to explore this futuristic technology will also find this book useful. Beginner-level knowledge of any programming language as well as mathematical topics such as linear algebra, probability, complex numbers, and statistics is required.

Table of contents

  1. Quantum Computing with Silq Programming
  2. Contributors
  3. About the authors
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Reviews
  6. Section 1: Essential Background and Introduction to Quantum Computing
  7. Chapter 1: Essential Mathematics and Algorithmic Thinking
    1. Introducing linear algebra for quantum computing
      1. Vectors and vector spaces
      2. Inner products and norms
      3. Matrices and their operations
      4. The eigenvalues and eigenvectors of an operator
      5. Tensor products
    2. Coordinate systems, complex numbers, and probability
      1. Introducing coordinate systems
      2. Complex numbers and the complex plane
      3. Probability
    3. Defining computational thinking
      1. Decomposition
      2. Pattern recognition
      3. Data representation and abstraction
    4. Introducing computer algorithms
      1. Defining an algorithm
      2. The linear search algorithm
    5. The calculation of the time and space complexity of algorithms
      1. Time and space complexity
      2. Notation for time and space complexity
      3. Calculation and analysis of the complexity of algorithms
    6. Summary
    7. Further reading
  8. Chapter 2: Quantum Bits, Quantum Measurements, and Quantum Logic Gates
    1. Introducing single quantum bits – qubits and superposition of qubits
      1. Learning about the Bra-Ket notation for qubits
      2. Superposition of qubits
    2. Illustrating qubits in different bases
      1. Bloch sphere representation of qubits
      2. The Z basis states — |0> and |1>
      3. The X basis states — and
      4. The Y basis states – and
    3. Introducing quantum measurements
      1. Mathematics of projective measurements
    4. Quantum logic gates
      1. Pauli gates
      2. The Hadamard gate – the quantum H gate
      3. The S gate
      4. The S (S dagger) gate
      5. The T gate – gate
      6. The T (T dagger) gate
      7. The gate
      8. The gate
      9. The gate
    5. Summary
    6. Further reading
  9. Chapter 3: Multiple Quantum Bits, Entanglement, and Quantum Circuits
    1. Introducing multiple quantum bits
    2. The wonder of quantum entanglement
      1. Exploring the Bell states system
      2. Verifying entanglement of quantum states
    3. Exploring multi-qubit quantum logic gates
      1. The quantum CX or CNOT gate
      2. The quantum CZ or CPHASE gate
      3. The quantum SWAP gate
      4. The quantum CCX or CCNOT gate – Toffoli gate
      5. The quantum CSWAP gate – Fredkin gate
    4. Quantum teleportation
    5. Quantum superdense coding
    6. Summary
  10. Chapter 4: Physical Realization of a Quantum Computer
    1. Criteria for quantum computation existence
      1. Depicting quantum information
      2. Unitary transformation capability
      3. Reference initial quantum states preparation
      4. Output measurement capability
    2. Superconducting qubit-based quantum computers
      1. Superconducting qubits
      2. NISQ era
    3. Quantum annealing-based quantum computers
    4. Ion-trap quantum computers
    5. Nuclear magnetic resonance
    6. Optical photonics-based quantum computers
    7. Summary
    8. Further reading
  11. Section 2: Challenges in Quantum Programming and Silq Programming
  12. Chapter 5: Challenges in Quantum Computer Programming
    1. A brief history of classical computers
    2. The challenges of today's classical computers
    3. Understanding the assembly language
    4. HLLs for classical computers
    5. Low-level circuit programming of quantum computers
    6. Introducing quantum programming languages
      1. The IBM Qiskit quantum programming language
      2. The Microsoft Q# quantum programming language
      3. The Google Cirq quantum programming language
    7. The challenges of quantum programming
    8. Summary
    9. Further reading
  13. Chapter 6: Silq Programming Basics and Features
    1. Technical requirements
    2. Introducing Silq and its special features
      1. Introducing Silq
    3. Installing Silq
      1. Installing Microsoft Visual Studio Code
      2. Installing the Silq plugin
    4. Introducing Silq data types
    5. Defining variables in Silq
    6. Control flow in Silq
    7. Functions and iterations in Silq
    8. Introducing Silq annotations
      1. Introducing classical type annotations – !
      2. The qfree annotation
      3. The mfree annotation
      4. The const annotation
      5. The lifted annotation
    9. Simple example programs using Silq
    10. Summary
    11. Further reading
  14. Chapter 7: Programming Multiple-Qubit Quantum Circuits with Silq
    1. Technical requirements
    2. Exploring multi-qubit quantum logic gates in Silq
      1. The quantum CX or CNOT gate
      2. The quantum CZ or CPHASE gate
      3. The quantum SWAP gate
      4. The quantum CCX or CCNOT gate – the Toffoli gate
      5. The quantum CSWAP gate – the Fredkin gate
    3. Constructing quantum circuits with quantum logic gates using Silq
      1. Implementing Bell states in Silq
      2. Decomposing the CX gate
      3. Implementing the GHZ state using Silq
      4. Implementing a classical half adder circuit in Silq
    4. Quantum teleportation
    5. Quantum superdense coding
    6. Summary
  15. Section 3: Quantum Algorithms Using Silq Programming
  16. Chapter 8: Quantum Algorithms I – Deutsch-Jozsa and Bernstein-Vazirani
    1. Technical requirements
    2. Introducing quantum parallelism and interference
      1. Quantum parallelism
      2. Quantum interference
    3. Implementing the Deutsch-Jozsa algorithm
      1. Problem statement
      2. Classical solution
      3. Quantum solution
      4. Silq implementation
      5. Designing a more concise version of the algorithm
    4. Implementing the Bernstein-Vazirani algorithm
      1. Problem statement
      2. Classical solution
      3. Quantum solution
      4. Silq implementation
    5. Summary
  17. Chapter 9: Quantum Algorithms II – Grover's Search Algorithm and Simon's Algorithm
    1. Technical requirements
    2. Introducing search algorithms
    3. Getting started with Grover's search algorithm
    4. Grover's search for one solution using Silq programming
    5. Grover's search for multiple solutions using Silq programming
      1. Mathematical treatment of Grover's search for multiple solutions
      2. Silq implementation of Grover's search for multiple solutions
    6. Grover's search for an unknown number of solutions using Silq programming
      1. Silq implementation of Grover's search for an unknown number of solutions
    7. Introducing Simon's algorithm
      1. The Silq implementation of Simon's algorithm
    8. Summary
    9. Further reading
  18. Chapter 10: Quantum Algorithms III – Quantum Fourier Transform and Phase Estimation
    1. Technical requirements
    2. Introducing the classical Discrete Fourier Transform (DFT)
    3. Exploring the QFT
    4. Implementing the QFT using Silq
    5. Getting started with the phase estimation algorithm
    6. Implementing phase estimation using Silq
    7. Summary
    8. Further reading
  19. Section 4: Applications of Quantum Computing
  20. Chapter 11: Quantum Error Correction
    1. Technical requirements
    2. Introducing classical error correction technique
      1. Redundancy and majority vote
      2. Linear codes
    3. Understanding quantum error correction
      1. Working with bit-flip code
      2. Working with phase-flip code
      3. Working with Shor code
    4. Summary
  21. Chapter 12: Quantum Cryptography – Quantum Key Distribution
    1. Technical requirements
    2. Introducing classical cryptography techniques
      1. The basics of cryptography
      2. Overviewing the main types of encryption algorithms
    3. Understanding quantum key distribution
      1. Describing the quantum key distribution protocol
      2. Implementing the quantum key distribution in Silq
    4. Summary
  22. Chapter 13: Quantum Machine Learning
    1. Introducing classical machine learning
      1. Types of learning
      2. The K-means clustering algorithm
      3. Artificial neural networks
      4. Kernel support vector machines (SVMs)
    2. Getting started with quantum machine learning
      1. Encoding classical data into a quantum state
      2. Kernel-based quantum machine learning models
    3. Learning about the quantum K-means algorithm
    4. Exploring variational circuits
      1. Variational quantum classifier (VQC)
      2. Variational quantum eigensolver (VQE)
      3. Quantum approximate optimization algorithm (QAOA)
    5. The latest developments in the field of quantum machine learning and quantum computing
    6. Summary
    7. Further reading
    8. Why subscribe?
  23. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Leave a review - let other readers know what you think

Product information

  • Title: Quantum Computing with Silq Programming
  • Author(s): Srinjoy Ganguly, Thomas Cambier
  • Release date: April 2021
  • Publisher(s): Packt Publishing
  • ISBN: 9781800569669