Skip to main content

Qiskit 2.0 adapter for GuoJi Quantum Cloud Platform

Project description

GJQ-Client

gjq-client is the Python SDK for the GuoJi Quantum Cloud Platform, providing Qiskit 2.0 integration with real quantum hardware.

Project Structure

src/gjq_client/
├── __init__.py                # Public API exports
├── _version.py                # Version info
├── gjq_runtime/               # Runtime service module
│   ├── gjq_runtime_service.py # Service entry (auth, backend discovery)
│   ├── sampler.py             # Sampler primitive
│   ├── estimator.py           # Estimator primitive
│   └── runtime_job.py         # Job status tracking
├── client/                    # Auth & communication module
│   ├── client_parameters.py   # JWT lifecycle management
│   ├── auth.py                # Auth header injection
│   ├── session.py             # HTTP retry session
│   ├── runtime.py             # REST API client
│   └── rest/                  # REST adapter layer
├── backend/                   # Backend models
│   ├── gjq_backend.py         # GJQBackend (BackendV2)
│   ├── backend_configuration.py
│   └── backend_properties.py
└── utils/                     # Utilities
    ├── exceptions.py          # Exception classes
    ├── backend_converter.py   # Configuration → Target
    ├── backend_decoder.py     # Server data decoder
    └── generate_preset_pass_manager.py

📦 Installation

Requirements: Python >= 3.10, Qiskit >= 2.0.0

# Install from TestPyPI
pip install -i https://test.pypi.org/simple/ gjq-client

# Install from source
pip install .

🚀 Quick Start

from qiskit import QuantumCircuit
from gjq_client import GJQRuntimeService, Sampler, generate_preset_pass_manager

# 1. Authenticate and initialize RuntimeService
#    (API key required on first use, cached automatically afterwards.
#     Obtain your key from tiangongqs.com/cloud)
service = GJQRuntimeService(api_key="YOUR_API_KEY")

# 2. Select a quantum backend
backend = service.backend("target_quantum_machine")
# Or pick the least busy backend:
# backend = service.least_busy()

# 3. Build a quantum circuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

# 4. Transpile the circuit for the target backend
pm = generate_preset_pass_manager(backend=backend, optimization_level=2)
transpiled_qc = pm.run(qc)

# 5. Submit the job and retrieve results
sampler = Sampler(backend=backend)
job = sampler.run(transpiled_qc, shots=1024)

result = job.result()
print("Measurement results:", result.get("counts"))

📄 License

Apache License 2.0

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

gjq_client-0.1.0-py3-none-any.whl (70.1 kB view details)

Uploaded Python 3

File details

Details for the file gjq_client-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gjq_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 70.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for gjq_client-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1289ce560006f39f7a00b30ad71d8e4dca67be1a6ae63bdef8bcd7f6f4251eab
MD5 c743111acbb7d72fb0b6c240b494a33b
BLAKE2b-256 ec2d84081a775e968c6b10d31dfeab61896a0b34ce19c6abeebcde5807e289f5

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