A quantum computing library
Project description
Quanthon
A minimal Python library for quantum computing, for physicists!
Installation
Using PIP:
pip3 install Quanthon
Get Started
Importing the Module
import Quanthon as qt
Initializing a Single Qubit
Initialize a single qubit by creating an instance of the Qubits
class.
qubit = qt.Qubits(1)
Applying Quantum Gates
Quanthon
supports various quantum gates like the Hadamard (H), Pauli-X (X), Pauli-Y (Y), and Pauli-Z (Z) gates.
# Apply a Hadamard gate on the first qubit
qubit.hadamard(0)
# Apply a Pauli-X gate on the first qubit
qubit.X(0)
# Apply a Pauli-Y gate on the first qubit
qubit.Y(0)
# Apply a Pauli-Z gate on the first qubit
qubit.Z(0)
Performing Quantum Measurements
You can perform quantum measurements on your qubit system with a specific number of shots.
result = qubit.measure(n_shots=10)
Working with Multiple Qubits
Use the Qubits
class for all states.
from Quanthon import Qubits
# Initialize a 2-qubit system
two_qubits = Qubits_2()
# Initialize an n-qubit system
n_qubits = Qubits(3)
CNOT and Swap Operations for Multiple Qubits
Quanthon
allows you to perform CNOT and SWAP operations on multi-qubit systems.
# Perform a CNOT operation between the first and second qubit
two_qubits.cnot(0, 1)
two_qubits.swap(0, 1)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Quanthon-0.3.3.tar.gz
(14.9 kB
view hashes)
Built Distributions
Quanthon-0.3.3.0-py3-none-any.whl
(19.4 kB
view hashes)
Quanthon-0.3.3-py3-none-any.whl
(19.3 kB
view hashes)
Close
Hashes for Quanthon-0.3.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a3cdf49ff06f05e212b14e2cd410334bf32a6b6252143c4b5bc85a5aac14e230 |
|
MD5 | 3b09f6c671a75e50dd320e76adfb2bde |
|
BLAKE2b-256 | 20273e8e4823caf26b38f207261de6aff666020cd5d82c4ce1eb1a2194cffd76 |