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

IBM Quantum

Qiskit starter package

SoftwareQuantum SDKLicence: Apache-2.0Version: 2.5.28.2 KB

Official source: Qiskit/qiskit

Download ZIP (free)

A getting-started guide for Qiskit, IBM's open-source quantum SDK, and a tested Bell state example that runs on the local simulator.

What is Qiskit?

Qiskit is the quantum software development kit developed by IBM and the most widely used open-source one in the world. It lets you build quantum circuits in Python, run them on local simulators and send them to IBM Quantum hardware.

When to use it

The example in this package

bell_durumu.py entangles two qubits (Hadamard + CNOT) and measures them 1000 times with StatevectorSampler. You should see only 00 and 11: the two qubits always give the same result.

Next steps

  1. Draw the circuit with qc.draw("mpl") (pip install matplotlib).
  2. Translate the circuit into a real device's gate set with transpile().
  3. Open an IBM Quantum account and run on real hardware with qiskit-ibm-runtime.

Installation and running

pip install qiskit
python bell_durumu.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.

bell_durumu.py

"""Qiskit ile Bell durumu: iki kübitlik devre kur, yerel simülatörde örnekle.

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

from qiskit import QuantumCircuit
from qiskit.primitives import StatevectorSampler

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

print(qc.draw(output="text"))

result = StatevectorSampler(seed=7).run([qc], shots=1000).result()
counts = result[0].data.meas.get_counts()
print("Ölçüm sayıları:", dict(sorted(counts.items())))

# Bell durumunda iki kübit her zaman aynı sonucu verir: yalnızca 00 ve 11.
assert set(counts) <= {"00", "11"}, counts
print("Tamam: yalnızca 00 ve 11 ölçüldü (dolanıklık).")

Related concepts

← All packages

Share: X · LinkedIn