Setup Guide

EpochCore Setup Guide

Three integration paths to production quantum computing. Choose your approach and be running circuits in under 5 minutes.

Python SDK Salesforce REST API
Standalone Python SDK
Install the EpochCore Python SDK, configure your API key, and execute your first quantum circuit. Supports Python 3.10+ on Linux, macOS, and Windows.
Prerequisites
  • Python 3.10 or later
  • pip 23.0+ (or conda)
  • EpochCore API key (get one at epochcoreqcs.com/install)
  • Internet connection for API access
1

Install the SDK

Install the EpochCore SDK and its dependencies via pip.

Terminal Copy
pip install epochcore
Note

For GPU-accelerated QEC decoding (NVIDIA QLDPC, Tensor Network), install with CUDA support: pip install epochcore[cuda]

2

Configure Authentication

Set your API key as an environment variable or pass it directly to the client.

Terminal Copy
# Option A: Environment variable (recommended)
export EPOCHCORE_API_KEY="ec_live_your_api_key_here"

# Option B: Configuration file
mkdir -p ~/.epochcore
echo '{"api_key": "ec_live_your_api_key_here"}' > ~/.epochcore/config.json
3

Run Your First Circuit

Create a simple Bell state circuit and execute it on live IBM Heron R3 hardware.

Python Copy
from epochcore import EpochCore
from qiskit import QuantumCircuit

# Initialize client (reads EPOCHCORE_API_KEY from env)
ec = EpochCore()

# Create a Bell state circuit
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])

# Execute on live hardware
# Fidelity-first routing selects the optimal backend
result = ec.run(
    circuit=qc,
    shots=4096,
    qec="auto"          # Automatic QEC + decoder selection
)

# Print results
print(f"Backend:  {result.backend}")
print(f"Fidelity: {result.fidelity:.4f}")
print(f"Counts:   {result.counts}")
print(f"Time:     {result.execution_time_ms:.1f}ms")
Expected Output Copy
Backend:  ibm_fez
Fidelity: 0.9994
Counts:   {'00': 2041, '11': 2055}
Time:     847.3ms
4

Run a QAOA Optimization

Execute a pre-built QAOA algorithm for portfolio optimization.

Python Copy
from epochcore.algorithms import QAOA
from epochcore import EpochCore
import numpy as np

ec = EpochCore()

# Define optimization problem
# Maximize returns subject to risk constraints
returns = np.array([0.12, 0.08, 0.15, 0.10, 0.06])
cov_matrix = np.random.rand(5, 5)

# Run QAOA
qaoa = QAOA(
    problem_type="portfolio",
    p_layers=5,
    shots=8192
)

result = qaoa.optimize(
    client=ec,
    returns=returns,
    covariance=cov_matrix,
    risk_tolerance=0.3
)

print(f"Optimal allocation: {result.allocation}")
print(f"Expected return:    {result.expected_return:.4f}")
print(f"Fidelity:           {result.fidelity:.4f}")
Salesforce Integration
Connect EpochCore to your Salesforce org via Named Credential and execute quantum algorithms from Apex, Flows, or the API.
Prerequisites
  • Salesforce Enterprise Edition or higher
  • System Administrator profile or Named Credential permissions
  • EpochCore API key
  • EpochCore Salesforce managed package (available on AppExchange)
1

Create Named Credential

Navigate to Setup → Named Credentials and create a new credential for the EpochCore API.

Named Credential Configuration Copy
Label:          EpochCore Quantum API
Name:           EpochCore_Quantum_API
URL:            https://api.epochcoreqcs.com/v1
Auth Protocol:  Custom Header
Header Name:    Authorization
Header Value:   Bearer ec_live_your_api_key_here
2

Install Managed Package

Install the EpochCore Apex SDK from the Salesforce AppExchange. This provides the EpochCore namespace with pre-built Apex classes.

Package Contents

The managed package includes: EpochCoreClient, QuantumCircuit, QAOAOptimizer, VQESolver, and GroverSearch Apex classes, plus pre-built Lightning Web Components for result visualization.

3

Execute from Apex

Use the Apex SDK to submit quantum circuits from triggers, batch jobs, or REST endpoints.

Apex Copy
// Initialize client with Named Credential
EpochCore.Client client = new EpochCore.Client(
    'callout:EpochCore_Quantum_API'
);

// Create a Bell state circuit
EpochCore.Circuit qc = new EpochCore.Circuit(2, 2);
qc.h(0);
qc.cx(0, 1);
qc.measure(new List<Integer>{0, 1}, new List<Integer>{0, 1});

// Execute asynchronously
EpochCore.Result result = client.run(qc, 4096);

// Access results
System.debug('Backend: ' + result.backend);
System.debug('Counts: ' + result.counts);
System.debug('Fidelity: ' + result.fidelity);
4

QAOA from Salesforce

Run portfolio optimization directly from your CRM.

Apex Copy
// QAOA portfolio optimization from Account records
EpochCore.Client client = new EpochCore.Client(
    'callout:EpochCore_Quantum_API'
);

EpochCore.QAOAOptimizer qaoa = new EpochCore.QAOAOptimizer();
qaoa.setProblemType('portfolio');
qaoa.setLayers(5);
qaoa.setShots(8192);

// Pull portfolio data from custom objects
List<Portfolio_Asset__c> assets = [
    SELECT Return_Rate__c, Risk_Factor__c
    FROM Portfolio_Asset__c
    WHERE Active__c = true
];

qaoa.loadAssets(assets);
EpochCore.OptimizationResult result = qaoa.optimize(client);

System.debug('Allocation: ' + result.allocation);
REST API
Direct HTTP integration for any language or platform. Submit circuits via JSON, receive results via webhook or polling.
Prerequisites
  • EpochCore API key
  • HTTP client (curl, Postman, any language with HTTP support)
  • Base URL: https://api.epochcoreqcs.com/v1
1

Verify Authentication

Test your API key with the health endpoint.

curl Copy
curl -s https://api.epochcoreqcs.com/v1/health \
  -H "Authorization: Bearer ec_live_your_api_key_here" | jq
Response Copy
{
  "status": "healthy",
  "backends": 6,
  "total_qubits": 913,
  "queue_depth": 0,
  "api_version": "v1.4.2"
}
2

Submit a Circuit

POST an OpenQASM 3.0 circuit to the execution endpoint.

curl Copy
curl -X POST https://api.epochcoreqcs.com/v1/circuits/execute \
  -H "Authorization: Bearer ec_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "qasm": "OPENQASM 3.0; include \"stdgates.inc\"; qubit[2] q; bit[2] c; h q[0]; cx q[0], q[1]; c = measure q;",
    "shots": 4096,
    "qec": "auto",
    "backend": "auto"
  }'
Response Copy
{
  "job_id": "ec_job_7f3a2b1c8d9e",
  "status": "completed",
  "backend": "ibm_fez",
  "qec_decoder": "steane",
  "results": {
    "counts": {"00": 2041, "11": 2055},
    "fidelity": 0.9994,
    "execution_time_ms": 847,
    "shots": 4096
  }
}
3

List Available Backends

Query the current status and calibration data of all backends.

curl Copy
curl -s https://api.epochcoreqcs.com/v1/backends \
  -H "Authorization: Bearer ec_live_your_api_key_here" | jq '.[0]'
Response (first backend) Copy
{
  "name": "ibm_fez",
  "qubits": 156,
  "processor": "Heron R3",
  "topology": "heavy-hex",
  "status": "online",
  "queue_depth": 0,
  "median_2q_error": 0.0019,
  "median_t1_us": 312,
  "last_calibrated": "2026-03-03T08:00:00Z"
}
4

Async Execution with Webhook

For long-running circuits, use async mode with a webhook callback.

curl Copy
curl -X POST https://api.epochcoreqcs.com/v1/circuits/execute \
  -H "Authorization: Bearer ec_live_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "qasm": "...",
    "shots": 8192,
    "async": true,
    "webhook_url": "https://your-app.com/webhooks/epochcore"
  }'
Common Issues
Authentication error: 401 Unauthorized
Verify your API key is valid and has not expired. Check the Authorization header format: Bearer ec_live_.... For the Python SDK, ensure the EPOCHCORE_API_KEY environment variable is set correctly.
Circuit exceeds maximum depth
The maximum circuit depth is 5,000 gates. If your circuit exceeds this, consider using the transpile=true option to let EpochCore optimize the circuit, or break it into smaller sub-circuits using mid-circuit measurement.
Import error: ModuleNotFoundError: No module named 'epochcore'
Ensure you installed the package in the correct Python environment. Run pip show epochcore to verify the installation. For conda environments, activate the environment first: conda activate your_env.
QEC decoder not available: NVIDIA QLDPC requires CUDA
The NVIDIA QLDPC and Tensor Network decoders require GPU hardware. Install with CUDA support: pip install epochcore[cuda]. If you do not have a GPU, use qec="steane" for CPU-only decoding, or set qec="auto" and the platform will select server-side decoding.
Salesforce callout error: Unauthorized endpoint
Add https://api.epochcoreqcs.com to Remote Site Settings in Salesforce Setup. Verify the Named Credential URL does not have a trailing slash. Ensure the running user's profile has the "EpochCore API Access" permission set.
Results show lower fidelity than expected
Check backend calibration status via GET /v1/backends. If a backend's median_2q_error is elevated, set backend="auto" to let the routing engine select the best-calibrated backend. For maximum fidelity, explicitly set qec="tensor_network".