Tutorial Webpage for

Lecture Quantum Computing

Loading...

Tutorial Webpage for Lecture
Quantum Computing

Home

Welcome to the tutorial page of the Quantum Computing lecture held by Sven Groppe at the University of Lübeck

All tutorials contain the exercise descriptions, all necessary data and example solutions, such that the students have the possibility to compare their solutions.

Tutorials

The following tutorials are available:

Contact

Please use the following email address for any comments and questions:

Introduction

This is the start page for the introduction exercises with the Silq programming language.

General Hints

The lecture slides are a good starting point to solve the following exercises. Additional information from the internet can you find on the website https://silq.ethz.ch/!

Please choose your silq introduction tutorial from the tabs below:

Introduction Exercises

The following exercieses cover some of the basics of Silq.

Exercise 1: Declaration of values

Create a qubit, a classical bit, an unsigned integer, and a list of qubits. Return them as a tuple in the given order.

Exercise: Start
Solution: Output In Editor Page

Exercise 2: First gates

This exercise should introduce the use of some basic gates. The identity HXH = Z is one of the most used identities. You should implement the method indetityHXH, which gets one qubit as an argument. Duplicate this qubit and then apply the gates H, X, and H to one qubit and Z to the other. Return them as a tuple. You will see that the values are the same. You can play with the input qubit in the main method.

Exercise: Start
Solution: Output In Editor Page

Exercise 3: Annotations

One of the unique features of Silq is the use of annotations to avoid errors and allow safe uncomputation. You will find here some code that has some missing and maybe some wrong-placed annotations. Try to fix it.

Exercise: Start
Solution: Output In Editor Page

Amplitude Encoding Exercises

The following exercieses are about creating different superpositions.

Exercise 1: Equal Superposition

Given a quantum register as an unsigned integer. Set this in a superposition such that all possible outcomes have equal probability. Try to do this for variable input sizes.

Exercise: Start
Solution: Output In Editor Page

Exercise 2: Bell states

The bell states are four different states of two qubits. They are the maximum entangled states. So you have four methods, each of which should create one bell state.

Exercise: Start
Solution: Output In Editor Page

Exercise 3: Pick out of three

We want an equal probability of choosing out of three options. So create a method that produces the state 1/sqrt(3)*(|00>+|01>+|10>).

Exercise: Start
Solution: Output In Editor Page

Algorithms

This is the start page for the exercises covering algorithms in the Silq programming language.

General Hints

The lecture slides are a good starting point to solve the following exercises. Additional information from the internet can you find on the website https://silq.ethz.ch/!

Please choose your silq introduction tutorial from the tabs below:

Oracles Exercises

Oracles are an essential concept in Quantum Computation. They are used in algorithms and to prove things about Quantum complexity classes. You should now implement a few of them.

Exercise 1: Alternating bits

You get an n-dimensional vector of bits. Your oracle should decide if the bit values alternate. Output true if you detect this pattern. Otherwise false.

Exercise: Start
Solution: Output In Editor Page

Exercise 2: Number of threes

You get an n-dimensional vector of bits. Your oracle should decide if the number of bits equal to one is divisible by three.

Exercise: Start
Solution: Output In Editor Page

Exercise 3: Is the String periodic

You get an n-dimensional vector of bits. Your oracle should decide if the string has a period. A period p is that for all bits in X: x[i] = x[i+p], where p is in [1..n-1]. You should not output the period. Just detect if there is a period.

Exercise: Start
Solution: Output In Editor Page

Algorithms Exercises

Your challenge is to implement the given algorithms.

Exercise 1: Deutsch-Jozsa algorithm

The Deutsch-Jozsa Algorithm was the first discovered algorithm where a quantum computer performs better than a classical computer. Implement the Deutsch-Jozsa Algorithm, which gets a function f and returns 0 if f is balanced and one if f is constant.

Exercise: Start
Solution: Output In Editor Page

Exercise 2: Quantum teleportation

Quantum teleportation sounds a bit magic but is possible with a relatively simple protocol. You should implement the algorithm which performs this protocol. For more information on this protocol, consider the link above.

Exercise: Start
Solution: Output In Editor Page

Advanced

We will now tackle some of the advanced topics like cryptography, and machine learning/optimization on Quantum computer

General Hints

The lecture slides are a good starting point to solve the following exercises. Additional information from the internet can you find on the website https://silq.ethz.ch/!

Please choose your silq introduction tutorial from the tabs below:

Cryptography Exercises

In this section we will cover error correction and Shor's algorithm.

Exercise 1: Error correction

Error correction is an essential part of communication. You will get an easy example: a qubit is encoded in a three-qubit state and sent to another person. During this process, one of the qubits could get flipped. Try to detect if there was a qubit flip and correct it if necessary.

Exercise: Start
Solution: Output In Editor Page

Exercise 2: QFT

The quantum Fourier Transformation is the essential underlying algorithm that speeds up Shor's algorithm such that we can break cryptosystems like RSA with a reasonable amount of qubits and time. Despite this importance, you can implement this algorithm in 10-20 lines of code. Try to do this.

Exercise: Start
Solution: Output In Editor Page

Exercise 3: Shor's algorithm

In the exercise before, you implemented the quantum Fourier Transformation, which is the heart of Shor's algorithm. Unfortunately, implementing the complete algorithm would take too long. But you will find here one possible implementation. Feel free to try it out and play with it.

Exercise: Start
Solution: Output In Editor Page

Machine learning Exercises

Coming soon...

Exercise 1: Coming soon

...

Exercise: Start
Solution: Output In Editor Page