Complete step-by-step instructions for using the QPCA SDK to run quantum computations.
401 Unauthorized errors and cannot submit jobs.
python3 --version
Required: Python 3.9 or higher
# 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
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 .
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"
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).
qpca_benchmark_demo.py (test script)benchmark_config.json (configuration file)~/qpca_test/)# 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
{
"job_id": "qpca-3c89e142",
"status_url": "..."
}
Copy the job_id!
qpca-cli status --job-id qpca-3c89e142
Keep checking until status is "COMPLETED":
# Run multiple times
qpca-cli status --job-id qpca-3c89e142
"QUEUED" - Waiting to start"RUNNING" - Executing on quantum hardware"COMPLETED" - Finished successfully ✅"FAILED" - Error occurredqpca-cli results --job-id qpca-3c89e142
# 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
echo $QPCA_API_KEYexport QPCA_API_KEY="your-key"readytogo@quantumpolycontextural.aipython3 -m venv qpca_envsource qpca_env/bin/activatepip install qpca-sdkls path/to/file.pyIf you need help: