common.title

Docs
Quantum Circuit
TYTAN CLOUD

QUANTUM GAMING


Overview
Terms of service

Privacy policy

Contact
Research

Sign in
Sign up
common.title

Submitting Quantum Jobs via API on the blueqat Cloud: Support for IonQ, IQM, and OQC

Yuichiro Minato

2025/05/27 01:11

Submitting Quantum Jobs via API on the blueqat Cloud: Support for IonQ, IQM, and OQC

Introduction

blueqat provides an environment where users can submit quantum computing jobs to multiple quantum hardware platforms via the cloud. Designed to flexibly support both research and enterprise use cases, the platform currently supports job execution on IonQ, IQM, and OQC systems.

Each backend has a different job submission method:

  • IonQ / IQM: Jobs are submitted via Qiskit
  • OQC: Circuits are submitted using OpenQASM through a dedicated interface over a secure line

Submitting Jobs to IonQ / IQM (via Qiskit)

blueqat supports job submission to IonQ and IQM quantum processors using circuits defined with Qiskit.

🔹 Features

  • Direct submission of Qiskit-defined circuits
  • Execution through blueqat’s cloud API (Qiskit is integrated backend-side)
  • Results are returned in JSON format

🔹 Example (Simplified)

from enum import Enum
import httpx
from qiskit import qpy
import io
from qiskit import QuantumCircuit
from qiskit.result import Result
import json

UA = "blueqat/1.0 (blueqatQuantumTaskAPI; +https://blueqat.com/)"

class Device(str, Enum):
    Harmony = "Harmony"
    Aria_1 = "Aria 1"
    Aria_2 = "Aria 2"
    Forte_1 = "Forte 1"
    Garnet = "Garnet"

class BqQuantumTaskClient:
    api_key: str
    endpoint: str

    def __init__(self, api_key: str, endpoint: str = "https://quantum-task-api.blueqat.com"):
        self.api_key = api_key
        self.endpoint = endpoint

    async def create_quantum_task(self, circuit: QuantumCircuit, device: Device, shots: int) -> Result:
        buffer = io.BytesIO()
        qpy.dump(circuit, buffer)
        buffer.seek(0)
        files = {
            "qpyfile": ("qpy", buffer, "data:application/octet-stream"),
        }
        async with httpx.AsyncClient() as client:
            headers = {
                "user-agent": UA,
                "x-api-key": self.api_key,
                "accept-encoding": "gzip, deflate",
            }
            result = await client.post(
                f"{self.endpoint}/v1/jobs/create",
                files=files,
                data={"shots": shots, "backend": device.value},
                headers=headers,
                timeout=None,
            )

            if result.status_code != 200:
                raise Exception(f"HTTP Error {result.status_code}: {result.text}")
            if not result.content:
                raise Exception("Empty response from server.")
            content_type = result.headers.get("Content-Type", "")
            if "application/json" not in content_type:
                raise Exception(f"Expected JSON response, got: {content_type}\nBody: {result.text}")
            try:
                data = result.json()
            except json.JSONDecodeError as e:
                raise Exception(f"Failed to parse JSON: {e}\nRaw response: {result.text}")
            if "ok" not in data or not data["ok"]:
                raise Exception(data.get("error", "Unknown error occurred"))
            payload = data["payload"]
            return Result.from_dict(payload)

    async def get_quantum_task(self, job_id: str) -> Result:
        async with httpx.AsyncClient() as client:
            result = await client.post(
                f"{self.endpoint}/v1/jobs/get",
                data=json.dumps({"job_id": job_id}),
                headers=self.get_default_headers(),
                timeout=None,
            )
            data = result.json()
            if "ok" not in data or not data["ok"]:
                raise Exception(data["error"])
            payload = data["payload"]
            return Result.from_dict(payload)

    def get_default_headers(self):
        return {
            "user-agent": UA,
            "x-api-key": self.api_key,
            "accept-encoding": "gzip, deflate",
            "content-type": "application/json",
        }
qc = QuantumCircuit(3)
qc.h(0)
for qubit in range(1, 3):
    qc.cx(0, qubit)

api_key = "<Check in your user settings>"
client = BqQuantumTaskClient(api_key=api_key)

task = await client.create_quantum_task(
    circuit=qc, shots=1, device=Device.<DEVICE_NAME>,
)

result = await client.get_quantum_task(job_id=task.job_id)

🔐 Your API key can be found in your user settings.


Submitting Jobs to OQC (OpenQASM + Secure Line)

To submit jobs to Oxford Quantum Circuits (OQC), you must use OpenQASM format and submit circuits via a dedicated secure network interface provided by blueqat.

🔹 Features

  • Uses OpenQASM 2.0
  • Requires secure tunneling for communication
  • Needs a dedicated client tool/environment provided by blueqat
  • Setup and usage are handled on a case-by-case basis — please contact us
OPENQASM 2.0;
include "qelib1.inc";
qreg q[2];
h q[0];
cx q[0], q[1];
measure q[0] -> c[0];
measure q[1] -> c[1];

Availability & Access

Currently, the API is mainly available for contracted enterprise customers, though individual users can also apply for access.


Contact Us

If you're interested in the following, feel free to reach out:

  • Application for use or trial access
  • Access to full API documentation and sample code
  • Setup support for secure OQC integration

📧 contact@blueqat.com
🌐 https://blueqat.com/


Conclusion

The quantum job submission API provided by blueqat enables streamlined, scalable execution of quantum circuits on IonQ and IQM devices via Qiskit, while also supporting secure, specialized workflows for OQC through OpenQASM. This allows developers to focus on algorithms without needing to handle low-level hardware details.

Support for additional hardware and tooling is continually being expanded, enabling blueqat to serve as a robust platform for integrating quantum technology into both research and real-world applications.

© 2025, blueqat Inc. All rights reserved