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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

planqk_quantum_client-1.1.2.tar.gz (50.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

planqk_quantum_client-1.1.2-py3-none-any.whl (79.3 kB view details)

Uploaded Python 3

File details

Details for the file planqk_quantum_client-1.1.2.tar.gz.

File metadata

  • Download URL: planqk_quantum_client-1.1.2.tar.gz
  • Upload date:
  • Size: 50.4 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for planqk_quantum_client-1.1.2.tar.gz
Algorithm Hash digest
SHA256 eab19335a0c27d6d11cda919e2a0165668bf17104dcf88e48332fc5abfdb96ca
MD5 0cb32b6bd90b2ec7f29005a505b4d0c6
BLAKE2b-256 f58cf2e5b42cc1687d0053b73c58fa16b67317f7ef3033d43b4ec67a1cc75b43

See more details on using hashes here.

File details

Details for the file planqk_quantum_client-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: planqk_quantum_client-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 79.3 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for planqk_quantum_client-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9964ebaa1adcdc067b67e70c1082a04342da6514e00631446a1019e75625b33e
MD5 e8dd82d7333a592f10e7e55612727dc3
BLAKE2b-256 926a17a74a7c34e086faea2f16ca22ecb6477e027f9075ca119968641770bdee

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.2 This release

2 files

1.1.1

2 files

1.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page