Skip to main content

SDK to interact with PLANQK quantum backends.

Project description

PLANQK Quantum SDK

PyPI version

The PLANQK Quantum SDK is for developing quantum circuits using Qiskit to be run on quantum devices provided by the PLANQK Platform. This library is an extension for Qiskit. This means that you are able to seamlessly integrate and reuse your existing Qiskit code, leveraging the power and familiarity of a framework you are already accustomed to.

Getting Started

Check out the following guides on how to get started with PLANQK:

Installation

The package is released on PyPI and can be installed via pip:

pip install --upgrade planqk-quantum

To install a pre-release version, use the following command:

pip install --pre --upgrade planqk-quantum

Usage

Working with Qiskit Backends

You can execute a Qiskit circuit on a selected backend, retrieve its job object, and its results:

from planqk.quantum.sdk import PlanqkQuantumProvider
from qiskit import QuantumCircuit, transpile

# Initialize the provider
provider = PlanqkQuantumProvider()

# Select a backend, full list of backends can be found at https://platform.planqk.de/quantum-backends
backend = provider.get_backend("azure.ionq.simulator")

# Create a Qiskit circuit
circuit = QuantumCircuit(3, 3)
circuit.h(0)
circuit.cx(0, 1)
circuit.cx(1, 2)
circuit.measure(range(3), range(3))

# Transpile the circuit for the selected backend
circuit = transpile(circuit, backend)

# Execute the circuit on the selected backend
job = backend.run(circuit, shots=100)

# Monitor job status and get results
print(f"Status: {job.status()}")
print(f"Result: {job.result()}")

Working with Braket Devices

You can execute a Braket circuit on a selected device, retrieve its task object, and its results:

from braket.circuits import Circuit
from planqk.quantum.sdk import PlanqkBraketProvider

# Select the IonQ Forte device
device = PlanqkBraketProvider().get_device("aws.ionq.forte")

# Create a Braket circuit
circuit = Circuit().h(0).cnot(0, 1).cnot(1, 2)

# Execute the circuit with 100 shots
task = device.run(circuit, 100)

# Monitor task status and get results
print(f"Status: {task.state()}")
print(f"Result: {task.result()}")

Development

To create a new virtual environment, for example, run:

uv venv
uv sync

Then, to activate the environment:

source .venv/bin/activate

Update dependencies and lock files:

uv sync -U

Project details


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-3.1.1.tar.gz (128.0 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-3.1.1-py3-none-any.whl (165.4 kB view details)

Uploaded Python 3

File details

Details for the file planqk_quantum-3.1.1.tar.gz.

File metadata

  • Download URL: planqk_quantum-3.1.1.tar.gz
  • Upload date:
  • Size: 128.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for planqk_quantum-3.1.1.tar.gz
Algorithm Hash digest
SHA256 028d9d254ae87bfa5804c3cc26d1ec41176fbab08bed2bbbf2c0c825f708bb0d
MD5 bc475b326fd4f759d425623539e7d7a9
BLAKE2b-256 8b8d24bf2bfe5a4698ea1fbef528bd97b8ed38b2d9c5250707f5b86b35b5e591

See more details on using hashes here.

File details

Details for the file planqk_quantum-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: planqk_quantum-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 165.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.12

File hashes

Hashes for planqk_quantum-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c61dfdc1f67b0b1480fd6265f1fa2d128b052d443173c2deff434ce17c4b2eb9
MD5 f7d0cefca36e06a6eb38fbca0726cdd7
BLAKE2b-256 88470e317d47b6d6076e1dd2729deaf1edb914ec44a8d4239fce3cd6e106f29a

See more details on using hashes here.

Supported by

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