Skip to main content

System Requirements

ComponentMinimumRecommended
Python3.113.11+
RAM4 GB8 GB+
Storage2 GB10 GB+
OSLinux, macOS, Windows

Install

For development or latest features, install from source:
git clone https://github.com/Dynex-Development/py-sdk.git
cd py-sdk
uv sync --group dev   # or: pip install -e .

With optional dependencies

uv add dynex python-dotenv
uv add dynex pennylane
uv add dynex torch

Core dependencies

The SDK automatically installs:
  • grpcio ≥ 1.60.0 — gRPC communication
  • protobuf ≥ 4.25.0 — protocol buffer serialization
  • dimod ≥ 0.12.0 — quadratic model framework
  • numpy ≥ 1.24.0 — numerical computing
  • pydantic ≥ 2.0.0 — data validation

Configuration

Environment variables

export DYNEX_SDK_KEY="your_sdk_key"
export DYNEX_GRPC_ENDPOINT="quantum-router-engine-grpc.hz.dynex.co:3000"
Create .env in your project root and install python-dotenv:
# .env
DYNEX_SDK_KEY=your_sdk_key
DYNEX_GRPC_ENDPOINT=quantum-router-engine-grpc.hz.dynex.co:3000

# Optional
DYNEX_COMPUTE_BACKEND=cpu
DYNEX_DEFAULT_TIMEOUT=300.0
pip install python-dotenv
The SDK automatically discovers .env files in the current directory and up to 3 parent directories.

Verify installation

import dynex
print(dynex.__version__)

from dynex import DynexConfig, ComputeBackend
import dimod

bqm = dimod.BinaryQuadraticModel({0: 1, 1: -1}, {(0, 1): 0.5}, 0.0, 'BINARY')
config = DynexConfig(compute_backend=ComputeBackend.LOCAL)
model = dynex.BQM(bqm)
sampler = dynex.DynexSampler(model, config=config)
sampleset = sampler.sample(num_reads=10)
print(f"Test passed. Best energy: {sampleset.first.energy}")

Platform notes

No additional setup required. All features work out of the box.

Docker

FROM python:3.11-slim

RUN pip install dynex python-dotenv

ENV DYNEX_SDK_KEY=${DYNEX_SDK_KEY}
ENV DYNEX_GRPC_ENDPOINT=${DYNEX_GRPC_ENDPOINT}

COPY . /app
WORKDIR /app
CMD ["python", "main.py"]
docker build -t my-dynex-app .
docker run -e DYNEX_SDK_KEY=your_key -e DYNEX_GRPC_ENDPOINT=quantum-router-engine-grpc.hz.dynex.co:3000 my-dynex-app

Jupyter notebooks

pip install dynex jupyter   # or: uv add dynex jupyter
jupyter notebook
Add this boilerplate at the top of your notebooks:
import dynex
from dynex import DynexConfig, ComputeBackend, QPUModel
import dimod
import numpy as np

config = DynexConfig(
    compute_backend=ComputeBackend.GPU,
    use_notebook_output=True
)
print(f"Dynex SDK {dynex.__version__} ready")

Troubleshooting

pip install grpcio
Check that you are using the correct Python environment. Try:
pip uninstall dynex && pip install dynex
  • Verify credentials: DYNEX_SDK_KEY and DYNEX_GRPC_ENDPOINT
  • Check that port 443 is not blocked by a firewall
  • Test connectivity: grpcurl quantum-router-engine-grpc.hz.dynex.co:3000 list
QPU backend requires an explicit model. Use:
config = DynexConfig(
    compute_backend=ComputeBackend.QPU,
    qpu_model='apollo_rc1'
)
LOCAL backend requires the dynexcore binary in a testnet/ directory. Download it from the releases page or switch to ComputeBackend.CPU.

Upgrading from legacy SDK

pip uninstall dynex
pip install dynex
Notable changes from legacy SDK:
  • Replace mainnet=True/False with explicit DynexConfig(compute_backend=...)
  • Remove v2=True parameter from sampler calls
  • Communication is now gRPC-based instead of REST