Skip to main content

Unified Python API for multi-backend quantum control on Xilinx RFSoC

Project description

RFSoC-PYNQ-Quantum

Unified Python API for multi-backend quantum control on Xilinx RFSoC.

Implements RFC #57 — a pynq.quantum package that unifies fragmented quantum control ecosystems (QICK, QubiC, custom HLS) under a standard Python API.

Features

  • Multi-backend support — QICK, QubiC, generic HLS, and simulation backends behind one API
  • NumPy simulation — Full state-vector simulator for development and CI (no hardware needed)
  • Standard gate library — X, Y, Z, H, CNOT, CZ, RX, RY, RZ, S, T, SWAP, Toffoli
  • Pulse compiler — Translates gate operations to calibrated pulse instructions
  • Multi-board clustering — Distribute circuits across multiple RFSoC boards
  • Qiskit/Cirq bridges — Run Qiskit or Cirq circuits on RFSoC hardware
  • Pip-installablenumpy is the only hard dependency

Install

# Core (simulation only — no hardware deps)
pip install pynq-quantum

# With specific backends
pip install pynq-quantum[qick]
pip install pynq-quantum[qubic]
pip install pynq-quantum[qiskit]
pip install pynq-quantum[cirq]

# Everything
pip install pynq-quantum[all]

# Development
pip install -e ".[dev]"

Quickstart

from pynq_quantum import QuantumOverlay, QubitController

# Create overlay with simulation backend (default)
overlay = QuantumOverlay(backend='simulation')

# Create controller for 2 qubits
qc = QubitController(overlay, num_qubits=2)

# Build a Bell state
qc.h(0)
qc.cnot(0, 1)
qc.measure([0, 1])

# Run 1000 shots
result = qc.run(shots=1000)
print(result.counts)  # {'00': ~500, '11': ~500}

Using QuantumCircuit Builder

from pynq_quantum import QuantumOverlay, QuantumCircuit

overlay = QuantumOverlay(backend='simulation')

circuit = QuantumCircuit(2)
circuit.h(0)
circuit.cnot(0, 1)
circuit.measure_all()

result = circuit.run(overlay, shots=1000)
print(result.counts)

Qiskit Bridge

from pynq_quantum.bridges.qiskit import RFSoCBackend
from qiskit import QuantumCircuit, transpile

backend = RFSoCBackend()  # Uses simulation by default
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])

job = backend.run(transpile(qc, backend), shots=1000)
result = job.result()
print(result.get_counts())

Architecture

┌────────────────────────────────────────┐
│          User Application              │
├────────────────────────────────────────┤
│  QuantumCircuit  │  QubitController    │
├──────────────────┴─────────────────────┤
│            PulseCompiler               │
├────────────────────────────────────────┤
│          QuantumOverlay                │
├──────┬──────┬──────┬───────────────────┤
│ QICK │QubiC │ HLS  │  Simulation      │
│ Back │ Back │ Back │  Backend          │
│ end  │ end  │ end  │  (NumPy)         │
├──────┴──────┴──────┴───────────────────┤
│      RFSoC Hardware / Simulator        │
└────────────────────────────────────────┘

Supported Boards

Board Backend Status
ZCU111 QICK Supported
ZCU216 QICK Supported
RFSoC 4x2 QICK / QubiC Supported
RFSoC 2x2 QICK / QubiC Supported
Custom HLS Generic Supported
No hardware Simulation Default

Development

git clone https://github.com/The-AI-Cowboys-Projects/RFSoC-PYNQ-Quantum.git
cd RFSoC-PYNQ-Quantum
pip install -e ".[dev]"

# Run tests
pytest tests/ -v --cov=pynq_quantum

# Lint
ruff check src/ tests/
ruff format --check src/ tests/

# Type check
mypy src/

License

BSD-3-Clause — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynq_quantum-0.1.1.tar.gz (50.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynq_quantum-0.1.1-py3-none-any.whl (40.2 kB view details)

Uploaded Python 3

File details

Details for the file pynq_quantum-0.1.1.tar.gz.

File metadata

  • Download URL: pynq_quantum-0.1.1.tar.gz
  • Upload date:
  • Size: 50.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pynq_quantum-0.1.1.tar.gz
Algorithm Hash digest
SHA256 ee1425289fe29d107eb4a32fc58c8d4639f69ffb2e4b2b89af529b95813085da
MD5 f48b2c4070a78bdbab1eb79263bf80bf
BLAKE2b-256 7acdef8bf402db8945426f325069a10fc5b8791c0c73e5eada629f3912eb228f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynq_quantum-0.1.1.tar.gz:

Publisher: ci.yml on The-AI-Cowboys-Projects/RFSoC-PYNQ-Quantum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pynq_quantum-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: pynq_quantum-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 40.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pynq_quantum-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9464e4a4228103b89879391c479f1083eabde7412171d6d0d708cb3553c677e1
MD5 f96ab65ad514c922cd4595241c2ce0c8
BLAKE2b-256 02084c307be0c31f3ebe43623a1a2a8fc15dce74989c87a297c9aad227ec30cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynq_quantum-0.1.1-py3-none-any.whl:

Publisher: ci.yml on The-AI-Cowboys-Projects/RFSoC-PYNQ-Quantum

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page