This repository contains a simple Python script that uses the Qiskit library to create a quantum circuit. The circuit prepares a single qubit in a superposition state, measures it, and then prints the counts of the measurement results.
The quantum circuit is executed on Qiskit's Quantum Assembly Language (QASM) simulator. The measurement is repeated 1000 times to highlight the probabilistic nature of quantum mechanics. The counts of the measurement results (i.e., how many times the qubit was found in state 0 and how many times it was found in state 1) are printed to the console.
- Python 3.6 or later.
- Qiskit. You can install it using pip:
pip install qiskit
.
- Run the script with Python:
python_quantum_circuit.py
.
VellVoid
For more information, follow me on Twitter: @VellVoid
🐍📚 Python Code Snippet Thread 📚🐍
— Vell (@VellVoid) June 23, 2023
Learn Python with these powerful snippets! Each one highlights a unique concept. Let's explore! #Python #CodeSnippet #Education pic.twitter.com/buxhQjpMep
This project is licensed under the MIT License - see the LICENSE file for details.