Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

⚠️ DEPRECATED ⚠️

This package has been deprecated and is no longer maintained.

Please migrate to the new package:

Install the new package:

pip install qhub-api

PLANQK Quantum Client

The PLANQK Quantum Client is a Python SDK for accessing quantum computing backends through the PLANQK platform. It provides a low-level interface for direct interaction with quantum hardware and simulators, offering fine-grained control over job submission, backend management, and result retrieval.

A more detailed documentation of the client can be found here.

Installation

The package is published on PyPI and can be installed via pip (Python 3.11 or higher is required):

pip install --upgrade planqk-quantum-client

Quick Start

Basic Setup

To get started with the PLANQK Quantum Client, you'll need a valid access token from the PLANQK platform. You can obtain this from the PLANQK dashboard.

from planqk.quantum.client import PlanqkQuantumClient

# Initialize the client
client = PlanqkQuantumClient(
    access_token="your_access_token_here"
)

Exploring Backends

# List all available backends
backends = client.backends.get_backends()
for backend in backends:
    print(f"{backend.id} - {backend.name}")

# Get detailed backend information
backend_info = client.backends.get_backend("aws.ionq.aria")
print(f"Backend: {backend_info.name}")
print(f"Qubits: {backend_info.configuration.qubit_count}")
print(f"Technology: {backend_info.technology}")
...

# Check backend status and availability
status = client.backends.get_backend_status("azure.ionq.simulator")
print(f"Status: {status.status}")

Submitting a Quantum Job

This example demonstrates how to submit a quantum circuit using the IonQ native gate format. The circuit applies a Hadamard gate to the first qubit (creating a superposition) and an X gate to the second qubit (flipping it to |1⟩), resulting in the state |+1⟩.

from planqk.quantum.client.sdk import AzureIonqJobInput

# Define a quantum circuit using IonQ format
ionq_input = AzureIonqJobInput(
    gateset="qis",
    qubits=2,
    circuits=[
        {"type": "h", "targets": [0]},
        {"type": "x", "targets": [1], "controls": [0]},
    ]
)

# Submit job to a simulator
job = client.jobs.create_job(
    backend_id="azure.ionq.simulator",
    name="My Quantum Job",
    shots=100,
    input=ionq_input,
    input_params={},
    input_format="IONQ_CIRCUIT_V1"
)

print(f"Job submitted with ID: {job.id}")
print(f"Initial status: {job.status}")

# Wait for completion and get results
job_id = job.id
final_job = client.jobs.get_job(job_id)

if final_job.status == 'COMPLETED':
    results = client.jobs.get_job_result(job_id)
    print(f"Histogram: {results['histogram']}")
    # Expected output: {"00": ~50, "11": ~50} due to H gate on qubit 0 and X gate on qubit 1


elif final_job.status == 'FAILED':
    error = client.jobs.get_job_result(job_id)
    print(f"Job failed: {error}")

Different backends require specific input formats (in the example AzureIonqJobInput). Therefore, the SDK provides backend-specific classes (see documentation for details).

The type of the job result is a dictionary whose structure depends on the backend being used.

Important: The client does not perform transpilation. Input must match the target backend's capabilities and connectivity, including gates, qubits, and other backend-specific requirements.

Metadata

Release files for planqk-quantum-client 1.1.2

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

Source distribution (sdist)

Source distribution for planqk-quantum-client 1.1.2
File Size Uploaded
planqk_quantum_client-1.1.2.tar.gz 50.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for planqk-quantum-client 1.1.2
File Interpreter ABI Platform
planqk_quantum_client-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 129.7 kB

Release files / planqk_quantum_client-1.1.2.tar.gz

Download URL planqk_quantum_client-1.1.2.tar.gz
Size 50.4 kB
Tags Source
SHA-256 checksum
How to use checksums
eab19335a0c27d6d11cda919e2a0165668bf17104dcf88e48332fc5abfdb96ca
BLAKE2b-256 checksum
How to use checksums
f58cf2e5b42cc1687d0053b73c58fa16b67317f7ef3033d43b4ec67a1cc75b43
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / planqk_quantum_client-1.1.2-py3-none-any.whl

Download URL planqk_quantum_client-1.1.2-py3-none-any.whl
Size 79.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9964ebaa1adcdc067b67e70c1082a04342da6514e00631446a1019e75625b33e
BLAKE2b-256 checksum
How to use checksums
926a17a74a7c34e086faea2f16ca22ecb6477e027f9075ca119968641770bdee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.16 {"installer":{"name":"uv","version":"0.9.16","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":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

1.1.2 This release

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