← Back to Downloads

QPCA SDK Usage Guide

Complete step-by-step instructions for using the QPCA SDK to run quantum computations.

⚠️ Important: You MUST get an API key first before using the SDK. Without an API key, the SDK will not work.

1 Get API Key (REQUIRED FIRST STEP)

Email Request:

Wait for Response:

Without API Key: You will get 401 Unauthorized errors and cannot submit jobs.

2 Install Python (If Needed)

Check if Python is Installed:

python3 --version

Required: Python 3.9 or higher

If Not Installed:

3 Install QPCA SDK

Option A: Install from PyPI (Recommended)

# Create virtual environment (recommended)
python3 -m venv qpca_env

# Activate virtual environment
source qpca_env/bin/activate  # macOS/Linux
# OR
qpca_env\Scripts\activate  # Windows

# Install SDK
pip install qpca-sdk
Note: On macOS, use a virtual environment to avoid "externally-managed-environment" errors.

Option B: Install from Source

If SDK is not on PyPI yet, download the package from the website and install:

# Download SDK package from downloads page
# Extract it, then:

cd path/to/qpca-sdk
python3 -m venv qpca_env
source qpca_env/bin/activate
pip install .

4 Set API Key

Set as Environment Variable:

macOS/Linux:

export QPCA_API_KEY="your-api-key-from-email"

Windows (Command Prompt):

set QPCA_API_KEY=your-api-key-from-email

Windows (PowerShell):

$env:QPCA_API_KEY="your-api-key-from-email"

Verify API Key is Set:

echo $QPCA_API_KEY  # macOS/Linux
echo %QPCA_API_KEY%  # Windows CMD
echo $env:QPCA_API_KEY  # Windows PowerShell

Should show your API key (not empty).

5 Download Test Files

Get Files from Website:

  1. Visit: Downloads Page
  2. Download:
    • qpca_benchmark_demo.py (test script)
    • benchmark_config.json (configuration file)
  3. Save them in a folder (e.g., ~/qpca_test/)

6 Submit Test Job

Run the Test Script:

# Make sure virtual environment is activated
source qpca_env/bin/activate  # macOS/Linux
qpca_env\Scripts\activate  # Windows

# Submit job
qpca-cli submit \
  --script path/to/qpca_benchmark_demo.py \
  --config path/to/benchmark_config.json
✅ Expected Output:
{
  "job_id": "qpca-3c89e142",
  "status_url": "..."
}

Copy the job_id!

7 Check Job Status

Monitor Job Progress:

qpca-cli status --job-id qpca-3c89e142

Keep checking until status is "COMPLETED":

# Run multiple times
qpca-cli status --job-id qpca-3c89e142

Possible Statuses:

8 Get Results

Once Status is "COMPLETED":

qpca-cli results --job-id qpca-3c89e142

You'll Get:

Quick Reference

Complete Workflow:

# 1. Activate environment
source qpca_env/bin/activate

# 2. Set API key
export QPCA_API_KEY="your-key"

# 3. Submit job
qpca-cli submit --script script.py --config config.json

# 4. Check status
qpca-cli status --job-id JOB_ID

# 5. Get results
qpca-cli results --job-id JOB_ID

Troubleshooting

Error: 401 Unauthorized

Error: externally-managed-environment (macOS)

Error: File Not Found

Support

If you need help: