Skip to content

Installation

QPyth can be installed via pip from PyPI. The package supports Python 3.10+ and provides optional extras for different use cases.

Requirements

  • Python 3.10 or higher
  • pip (Python package manager)

Basic Installation

Install the core QPyth package with minimal dependencies:

pip install QPyth

This includes: - Qiskit (quantum computing framework) - Qiskit-Aer (quantum simulator) - NumPy (numerical computing) - Pandas (data manipulation)

Optional Extras

Physical VQE Support

For molecular VQE simulations with physical energies:

pip install QPyth[physical]

Additional dependencies: - qiskit-algorithms (quantum algorithms) - qiskit-nature (quantum chemistry) - pyscf (molecular calculations)

IBM Quantum Hardware Support

For running circuits on real IBM Quantum hardware:

pip install QPyth[hardware]

Additional dependencies: - qiskit-ibm-runtime (IBM Quantum runtime)

You'll also need to set your IBM Quantum token:

export QISKIT_IBM_TOKEN="your-ibm-quantum-token"

Web UI Support

For the FastAPI + React web interface:

pip install QPyth[web]

Additional dependencies: - FastAPI (web framework) - Uvicorn (ASGI server) - SlowAPI (rate limiting)

Development Mode

For contributing to QPyth:

git clone https://github.com/quantumdynamics927-dotcom/QPyth.git
cd QPyth
pip install -e .[dev,physical,web,hardware]

This installs all extras plus development tools: - pytest (testing framework) - pytest-cov (coverage reporting) - pytest-mock (mocking utilities) - ruff (linter and formatter) - pre-commit (git hooks)

Verify Installation

After installation, verify that QPyth is working:

# Check version
python -c "import quantumpytho; print(quantumpytho.__version__)"

# Run CLI
qpy

# Run a simple test
python -c "from quantumpytho.modules.bloch_ascii import run_bloch_ascii; run_bloch_ascii(theta=1.047, phi=1.571)"

Troubleshooting

Import Errors

If you encounter import errors, try reinstalling:

pip uninstall QPyth
pip install QPyth

Missing Dependencies

For specific features, ensure you installed the appropriate extras:

# For VQE
pip install QPyth[physical]

# For hardware
pip install QPyth[hardware]

# For web UI
pip install QPyth[web]

Platform-Specific Issues

Windows

On Windows, you may need to install Microsoft Visual C++ Redistributable for some dependencies.

macOS

On macOS, you may need to install Xcode command line tools:

xcode-select --install

Linux

On Linux, you may need to install system dependencies:

# Ubuntu/Debian
sudo apt-get update
sudo apt-get install python3-dev build-essential

# Fedora/RHEL
sudo dnf install python3-devel gcc

Next Steps