Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quantum-kittens
GitHub Repository: quantum-kittens/platypus
Path: blob/main/notebooks/summer-school/2021/lab1.ipynb
3855 views
Kernel: Python 3

Lab 1: Quantum Computing Operations and Algorithms

In this lab, you will learn how to construct quantum states and circuits, and run a simple quantum algorithm.

Quantum States and Circuits:

  • Graded Exercise 1-1: Bit Flip

  • Graded Exercise 1-2: Plus State

  • Graded Exercise 1-3: Minus State

  • Graded Exercise 1-4: Cmplex State

  • Graded Exercise 1-5: Bell State

  • Graded Exercise 1-6: GHZ-like State

The Deutsch-Jozsa Algorithm:

  • Graded Exercise 1-7: Classical Deutsch-Jozsa

  • Graded Exercise 1-8: Quantum Deutsch-Jozsa

Lab Tips / Hints

  • For all the exercises with gates just add the gate(s) and only gates.

  • For Ex6, look at the example with GHZ state and how it will look if you add X gate.

  • For the Ex7, the balanced aspect is related to fact that half of the output are '0' and the other one is ‘1'. So in the worst case you have to test half of possibilities plus 1.

  • For the Ex8, think of the algorithm by parts. A good help is the Qiskit textbook chapter on D-J algorithm.

  • To test your gate, please go to IBM Composer here. As per the docs, "IBM Quantum Composer is a graphical quantum programming tool that lets you drag and drop operations to build quantum circuits and run them on real quantum hardware or simulators."

  • For Ex7, the formula is mentioned in the lecture 2.1 notes, under the Deutsch-Jozsa Algorithm>Classical Solution

  • For an alternate solution to Ex6, one can use “Y” gate it performs a bit flip and phase flip on the second qubit for e.g, 000+111|000\rangle + |111\rangle changes to 010101|010\rangle - |101\rangle

FAQ

Is it needed to watch the two firsts lectures to complete the lab? It’s recommended but not mandatory.

Suggested resources