Skip to content

Quickstart

Get started with QPyth in just a few minutes. This guide will walk you through the basics of using QPyth for quantum computing simulations.

Installation

First, install QPyth:

pip install QPyth

CLI Mode

The easiest way to get started is through the interactive CLI:

qpy

You'll see a menu with various quantum computing options:

=== QPyth App ===
1) Sacred-geometry QRNG sequence
2) Circuit explorer (Bell pair)
3) Circuit explorer (Hadamard sweep)
4) TMT Sierpinski fractal (21-qubit)
5) Bloch State Vector Projection (ASCII)
6) Non-local Teleportation Bridge
7) Molecular Ground-State (VQE Sim)
8) Toggle Quantum Decoherence [OFF]
9) Quantum Error Correction
q) Quit

Example: Bloch Sphere Visualization

Select option 5 to visualize quantum states on the Bloch sphere:

Select option: 5

You'll be prompted for theta (θ) and phi (φ) angles. Try these values:

Theta (θ) [0.0-3.14159]: 1.047
Phi (φ) [0.0-6.28318]: 1.571

This will display the quantum state projection with measurement probabilities.

Example: Bell Pair Entanglement

Select option 2 to create a Bell pair:

Select option: 2

This creates the maximally entangled state |Φ⁺⟩ = (|00⟩ + |11⟩)/√2 and shows the measurement results.

Python API

You can also use QPyth directly in Python scripts:

Bloch Sphere Visualization

from quantumpytho.modules.bloch_ascii import run_bloch_ascii

# Display statevector at θ=π/3, φ=π/2
run_bloch_ascii(theta=1.047, phi=1.571)

Quantum Random Number Generation

from quantumpytho.modules.qrng_sacred import qrng_phi_sequence

# Generate 16 random numbers scaled by golden ratio
sequence = qrng_phi_sequence(num_qubits=8, length=16)
print(sequence)

Bell Pair Circuit

from quantumpytho.modules.circuit_explorer import bell_pair

# Create and run a Bell pair circuit
result = bell_pair(shots=1024)
print(f"Counts: {result['counts']}")

VQE Simulation

from quantumpytho.modules.vqe_h2_cli import run_vqe_h2_cli

# Run VQE for H2 molecule
run_vqe_h2_cli()

Web UI

For a graphical interface, start the web UI:

# Terminal 1: Start backend
python server.py

# Terminal 2: Start frontend
cd web
npm install
npm run dev

Then open http://localhost:3000 in your browser.

Noisy Simulation

QPyth includes realistic noise models from IBM Quantum calibration data:

from quantumpytho.modules.hardware_ibm import NoisySimulatorEngine

# Create noisy simulator with IBM calibration profile
engine = NoisySimulatorEngine(noise_profile="ibm_brisbane")

# Run circuit with noise
result = engine.run(circuit, shots=1024)

Next Steps

  • CLI Usage - Learn more about the command-line interface
  • Web UI - Explore the web interface
  • VQE - Deep dive into Variational Quantum Eigensolver
  • Noisy Simulation - Learn about realistic noise modeling
  • API Reference - Complete API documentation