Official Python SDK for Ravan Quantum-ML Surrogate Engine
Project description
Ravan SDK
High-level Python client for the Ravan Quantum-ML system. Works with a running API server or directly with local models (auto fallback).
Install
From repo root:
pip install -e ravan_sdk
Usage
from ravan_sdk import Ravan
# auto: prefer HTTP at http://localhost:8000; fallback to local
client = Ravan(mode="auto")
# Predict: [apply_hadamard, apply_cnot, shots_norm]
res = client.predict([1, 1, 0.5])
print(res)
# Inverse design (optimize to target entropy/fidelity)
opt = client.inverse.run(target_entropy=0.95, target_fidelity=0.95)
print(opt)
Modes
- auto: Prefer HTTP; fallback to local
- http: Force HTTP; raises if server is unavailable
- local: Force local models (ONNX > PyTorch)
HTTP Auth
Pass api_key to include Authorization: Bearer <key> header.
client = Ravan(mode="http", api_key="YOUR_TOKEN")
Simulators
When available, you can call simulators either via HTTP or locally:
qc = client.simulate_quantum_circuit({
"n_qubits": 2, "shots": 2048, "apply_hadamard": 1, "apply_cnot": 1
})
sch = client.simulate_schrodinger({
"V0": 5.0, "barrier_width": 1.0, "k0": 10.0, "sigma": 1.0,
"x0": -8.0, "L": 50.0, "Nx": 1024, "dt": 0.005, "n_steps": 1000
})
ho = client.simulate_harmonic_oscillator({
"oscillator_length": 1.0, "basis_size": 30, "initial_n": 0
})
Benchmarks
results = client.benchmark.run()
print(results)
Ravan SDK
High-level Python client for the Ravan Quantum-ML system. Works with a running API server or directly with local models (auto fallback).
Install
From repo root:
pip install -e .
Usage
from ravan_sdk import Ravan
# auto: prefer HTTP at http://localhost:8000; fallback to local
client = Ravan(mode="auto")
# Predict: [apply_hadamard, apply_cnot, shots_norm]
res = client.predict([1, 1, 0.5])
print(res)
# Inverse design (optimize to target entropy/fidelity)
opt = client.inverse.run(target_entropy=0.95, target_fidelity=0.95)
print(opt)
Modes
- auto: Prefer HTTP; fallback to local
- http: Force HTTP; raises if server is unavailable
- local: Force local models (ONNX > PyTorch)
HTTP Auth
Pass api_key to include Authorization: Bearer <key> header.
client = Ravan(mode="http", api_key="YOUR_TOKEN")
Simulators
When available, you can call simulators either via HTTP or locally:
qc = client.simulate_quantum_circuit({
"n_qubits": 2, "shots": 2048, "apply_hadamard": 1, "apply_cnot": 1
})
sch = client.simulate_schrodinger({
"V0": 5.0, "barrier_width": 1.0, "k0": 10.0, "sigma": 1.0,
"x0": -8.0, "L": 50.0, "Nx": 1024, "dt": 0.005, "n_steps": 1000
})
ho = client.simulate_harmonic_oscillator({
"oscillator_length": 1.0, "basis_size": 30, "initial_n": 0
})
Benchmarks
results = client.benchmark.run()
print(results)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ravan_sdk-0.1.0.tar.gz.
File metadata
- Download URL: ravan_sdk-0.1.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5608ba5975d5d986a1744cde1c9b707bcd9a247b22b4ccc408dc108a59b4d699
|
|
| MD5 |
5dc1b0c0ee16570d31262ac83c3f7577
|
|
| BLAKE2b-256 |
6c0b4c8e877eb08483abc6b5050a763cd0b1c81b46bc7587fee65fd20e33a050
|
File details
Details for the file ravan_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ravan_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
970511771bf36c9c6aa37f3bb2819816b585048cb6dabc2e5da03f0f79427aac
|
|
| MD5 |
34620d507dd02eacb71b5154bdd6b46d
|
|
| BLAKE2b-256 |
06a340de519beeb59e768e5182477fc9bfb68f0f8d4c45065d15380c754ee09e
|