This repository contains a simple Qiskit program to verify installation and demonstrate the basics of quantum circuits using the AerSimulator.
Qiskit_1-qubit_Verify.ipynbβ Jupyter notebook with code.
- Creates a 1-qubit quantum circuit.
- Applies a Hadamard gate (H) to put the qubit into superposition.
- Measures the qubit into a classical bit.
- Runs the circuit on the AerSimulator for 1024 shots.
- Prints the result counts (expected ~50%
0, ~50%1).
Example output:
Counts: {'0': 503, '1': 521}
To strengthen understanding, try the following:
-
Change number of shots
- Run with
shots=10,1000, and10000. - Compare how close the results are to a 50β50 split.
- Run with
-
Two-qubit superposition
- Apply
Hto both qubits. - Expect outcomes:
00, 01, 10, 11with ~25% each.
- Apply
-
Entangled state (Bell state)
qc.h(0) qc.cx(0, 1) qc.measure_all()
- Expected: only
00and11.
- Expected: only
-
Try an X gate
- Replace
HwithX. - Expected: always
1.
- Replace
-
Three-qubit superposition (challenge)
- Apply
Hto all 3 qubits. - Expect 8 outcomes (
000β111) with ~12.5% each.
- Apply
- Install Qiskit:
pip install qiskit qiskit-aer
- Open the notebook:
jupyter notebook Qiskit_1-gubit_Verify.ipynb
- Run the cells and explore the results!
π¨βπ« This notebook can be used as a classroom demo to introduce:
- Quantum circuits
- Superposition
- Measurement outcomes
- Entanglement basics