Skip to main content

XQ Cloud

xq-cloud is a Python client for submitting quantum computing jobs to XQ Cloud and retrieving their results. It integrates with Qiskit and supports pulse programs on compatible backends.

Installation

Requires Python 3.10 or later.

pip install xq-cloud

Connect and choose a backend

You need XQ Cloud access credentials and permission to use a backend. Set the environment variables XQ_CLOUD_CLIENT_ID and XQ_CLOUD_CLIENT_SECRET to the Client ID and Client Secret provided with your account, then connect:

import os

from xq_cloud import XQCloudProvider

provider = XQCloudProvider(
    cloudflare_client_id=os.environ["XQ_CLOUD_CLIENT_ID"],
    cloudflare_client_secret=os.environ["XQ_CLOUD_CLIENT_SECRET"],
)

for backend in provider.backends():
    print(backend.name)

Submit a job and get results

Replace YOUR_BACKEND_NAME with a name returned above. This example prepares a single-qubit circuit, compiles it for the selected backend, and submits it for population readout. Readout is handled by the backend; omit measurement instructions from the circuit.

from qiskit import QuantumCircuit

from xq_cloud.transpiler import transpile

backend = provider.backends(name="YOUR_BACKEND_NAME")[0]

circuit = QuantumCircuit(1)
circuit.h(0)
compiled_circuit = transpile(circuit, target=backend.target)

job = backend.run(
    compiled_circuit,
    shots=1000,
    name="first-experiment",
    metadata={"description": "Single-qubit superposition"},
)
job.submit()
print("Job ID:", job.job_id())  # Save this ID to retrieve results later.

result = job.result(timeout_seconds=300)
print(result.results[0].data.expectation_values)

backend.run(...) prepares the job; job.submit() sends it to the queue. job.result(...) waits for completion and returns a Qiskit Result. The optional name and JSON-object metadata are stored with the job. Names can be reused; every submission receives its own unique job ID.

Retrieve results later

After connecting again, use a saved job ID to wait for its result payload:

job_id = "YOUR_SAVED_JOB_ID"
results = provider.client.wait_for_result(job_id, timeout_seconds=300)
print(results)

To check once without waiting, use provider.client.get_result(job_id) and inspect its status, result, and error fields. A waiting timeout raises TimeoutError and leaves the job running or queued; you can request its results again later. API errors and failed jobs raise XQCloudApiError when waiting.

You can also find your jobs by name:

for saved_job in provider.client.get_jobs(name="first-experiment"):
    print(saved_job.job_id, saved_job.status, saved_job.metadata)

Name matching is exact. Add backend=... or status=... to narrow the list.

Metadata

Release files for xq-cloud 0.10.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xq-cloud 0.10.0
File Size Uploaded
xq_cloud-0.10.0.tar.gz 25.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xq-cloud 0.10.0
File Interpreter ABI Platform
xq_cloud-0.10.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.5 kB

Release files / xq_cloud-0.10.0.tar.gz

Download URL xq_cloud-0.10.0.tar.gz
Size 25.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2557d495bb8b99fa0c21fc5d105966261741f56b8119d9b7ed4624dd3ac4df14
BLAKE2b-256 checksum
How to use checksums
92a35c3edbbaa7333a976c06aa0fc4cac86fe18899e134bda0f8a1663c429599
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / xq_cloud-0.10.0-py3-none-any.whl

Download URL xq_cloud-0.10.0-py3-none-any.whl
Size 33.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
12293f4a57854cc7c04e490208c8d43fddb51d2b638013b2fa490dcc1c119dad
BLAKE2b-256 checksum
How to use checksums
71fb8f0fe8af987a728683e397ac5dcbcf2de62bfb5b9bdf629aaa3df7d47b7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.10.0 This release

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page