Skip to content

Latest commit

 

History

History
130 lines (96 loc) · 3.97 KB

File metadata and controls

130 lines (96 loc) · 3.97 KB

SPDX-License-Identifier: AGPL-3.0-or-later

Commercial license available

© Concepts 1996–2026 Miroslav Šotek. All rights reserved.

© Code 2020–2026 Miroslav Šotek. All rights reserved.

ORCID: 0009-0009-3560-0851

scpn-quantum-control — Installation

Installation

From PyPI

pip install scpn-quantum-control

From source (development)

git clone https://github.com/anulum/scpn-quantum-control.git
cd scpn-quantum-control
pip install -e ".[dev]"

This installs pytest, ruff, and pytest-cov for development.

Optional dependencies

# Visualisation (matplotlib)
pip install -e ".[viz]"

# IBM Quantum hardware execution
# Pulls in qiskit-ibm-runtime (>=0.40, <1.0). The current pinned working
# version on the dev machine is 0.46.x. Note that 0.46+ changed the
# DataBin classical-register name handling — runner.py was updated to
# handle both legacy 'meas' and per-circuit names ('c', 'cr', 'c0').
pip install -e ".[ibm]"

# Rust acceleration (158–5,401× faster Hamiltonian construction;
# 1,665× faster ICI three-level evolution; 44× faster (α,β)-hypergeometric
# envelope; 2–10× across Pauli expectations and OTOC)
pip install scpn-quantum-engine

# Or build from source (requires Rust toolchain):
cd scpn_quantum_engine && maturin develop --release && cd ..

# Unified configuration (pydantic-settings → SCPNConfig)
pip install -e ".[config]"

# Structured logging (structlog → configure_logging + get_logger)
pip install -e ".[logging]"

# Julia acceleration tier (juliacall → accel/julia/order_parameter.jl)
# First call pays a one-off ~20 s JIT boot cost; subsequent calls are
# steady-state. Rust tier is measured faster on every N we have
# benchmarked (see docs/pipeline_performance.md §"Multi-language accel
# chain"), so Julia is a secondary tier — install when you need a
# second independent solver for cross-validation.
pip install -e ".[julia]"

# Cross-validation (QuTiP + Dynamiqs-JAX for XY Hamiltonian diff checks)
pip install -e ".[xvalidate]"

# Application plugin extras for raw-domain adapters
pip install -e ".[app-eeg]"         # EEG/MEG readers and MNE pipelines
pip install -e ".[app-plasma]"      # HDF5/tabular tokamak diagnostics
pip install -e ".[app-power-grid]"  # power-system case readers
pip install -e ".[app-fep]"         # predictive-coding workflow config

# Portable optional surface — excludes CUDA/JAX wheels that need a matching accelerator stack
pip install -e ".[all]"

# Accelerator extras — install only on machines with the matching CUDA stack
pip install -e ".[accelerated]"

Rust Acceleration

The optional scpn-quantum-engine package provides 37 Rust-accelerated functions via PyO3. When installed, all analysis modules transparently use the Rust fast paths. When not installed, everything works via pure Python/NumPy.

Pre-built wheels are available for Linux (x86_64, aarch64), macOS (x86_64, ARM), and Windows (x64). See Rust Engine docs for the full API and benchmark results.

Requirements

  • Python 3.10+
  • Qiskit 2.2+
  • qiskit-aer 0.15+
  • NumPy 1.24+
  • SciPy 1.10+
  • NetworkX 3.0+

pyproject.toml is the canonical dependency source. requirements.txt is kept only as a pip-compatible mirror for users who cannot consume project metadata directly.

Before release, verify that mirror with:

python tools/check_dependency_drift.py

Verify installation

python -c "import scpn_quantum_control; print('OK')"
pytest tests/ -x -q  # full suite should pass

IBM Quantum setup (optional)

Only needed for real hardware execution. See Hardware Guide.

from scpn_quantum_control.hardware import HardwareRunner

# One-time: save your API token
HardwareRunner.save_token("your-ibm-quantum-token")

# Connect to hardware
runner = HardwareRunner()
runner.connect()
print(f"Backend: {runner.backend_name}")

Free tier: 10 minutes QPU time per month on ibm_fez (Heron r2, 156 qubits).