← Quantum Store · Guides · Lessons · Glossary · Packages · About · Türkçe

QWorld (founded at the University of Latvia, including QTurkey)

QWorld Bronze-Qiskit — introductory course

CourseEducationLicence: Apache-2.0Version: 528207d4.9 KB

Official source: qworld/bronze-qiskit

Download ZIP (free)

A free, Jupyter notebook-based introductory course that goes from linear algebra to Grover's algorithm. The package contains a tested script that checks your Qiskit installation before the course, and a roadmap.

What is Bronze?

Bronze is QWorld's introductory course on quantum computing. It expects only basic Python and secondary-school maths as prior knowledge. The course comes as Jupyter notebooks and covers:

  1. Python and basic linear algebra
  2. Probabilistic systems and classical bits
  3. The qubit, the Hadamard gate and the quantum coin flip
  4. Quantum states, reflections and rotations
  5. Entanglement, superdense coding and teleportation
  6. Grover's search algorithm

The course material is in English. QTurkey, QWorld's group in Turkey, runs Bronze workshops taught in Turkish. See the QTurkey page for current events.

The script in this package

kurulum_kontrol.py runs Bronze's first quantum task, the coin flip:

If the script prints "Tamam" (OK), you can start on the notebooks.

Getting started

git clone https://gitlab.com/qworld/bronze-qiskit.git
cd bronze-qiskit
pip install -r requirements.txt
jupyter lab content.ipynb

content.ipynb is the course's table of contents. If you are joining a workshop, open before-workshop.ipynb first. The Qiskit notebooks are in the quantum-with-qiskit/ folder (from Q20 Hadamard to the Q92 Grover implementation); every exercise also has a solution notebook.

Installation and running

pip install qiskit
python kurulum_kontrol.py

Tested with: qiskit 2.5.2, Python 3.12.

Official source

Links

Package contents

Licence

The example code and the guide in this package were written by the Quantum Store editors and are MIT licensed. The project it uses is subject to its own licence (Apache-2.0).


Quantum Store — https://hakanerdogan.com/en

Example code

The example shipped in the package, run and checked. Comments and printed messages are in Turkish; the code is the same in any language. Everything is in the ZIP.

kurulum_kontrol.py

"""QWorld Bronze-Qiskit öncesi kurulum kontrolü.

Bronze'un ilk kuantum görevi olan "kuantum yazı-tura"yı çalıştırır:
Hadamard kapısı kübiti eşit olasılıklı süperpozisyona sokar; iki Hadamard
ise kübiti başlangıç durumuna geri döndürür.

Çalıştırma:
    pip install qiskit
    python kurulum_kontrol.py
"""

from qiskit import QuantumCircuit
from qiskit.primitives import StatevectorSampler

sampler = StatevectorSampler(seed=1)

tek = QuantumCircuit(1)
tek.h(0)
tek.measure_all()

cift = QuantumCircuit(1)
cift.h(0)
cift.h(0)
cift.measure_all()

r1, r2 = sampler.run([tek, cift], shots=1000).result()
c1 = r1.data.meas.get_counts()
c2 = r2.data.meas.get_counts()
print("Bir Hadamard (yazı-tura):", dict(sorted(c1.items())))
print("İki Hadamard (geri dönüş):", dict(sorted(c2.items())))

assert 400 < c1.get("0", 0) < 600
assert c2 == {"0": 1000}
print("Tamam: Qiskit kurulu, Bronze notebook'larına başlayabilirsin.")

Related concepts

← All packages

Share: X · LinkedIn