Skip to main content

Lightweight Python client for QIntent, the native intent language powered by QDSV.

Project description

qdsv-qintent

Lightweight Python client for QIntent, the native intent language powered by QDSV.

QIntent lets you write declarative computational intent over state spaces, rows, predicates, ranking, and sampling without installing the QDSV runtime locally.

pip install qdsv-qintent

Developer Preview: the package is a client SDK. It does not include QDSV Runtime, CAP, QuEST, Aer, IBM adapters, lowering, noise mitigation internals, or crypto internals.

Quick Start

from qintent import QIntentClient

client = QIntentClient(api_url="https://api.qdsv.cloud/api")

rows = [
    {"candidate_index": 0, "score": 720, "risk_ok": True},
    {"candidate_index": 1, "score": 910, "risk_ok": True},
    {"candidate_index": 2, "score": 840, "risk_ok": False},
]

result = client.run(
    'find_rows("candidate_index").where("score", ">=", 850).rank_by("score").top_k(5)',
    rows=rows,
)

print(result["status"])
print(result["result"]["selected_rows"])

Python-like QIntent

source = """
x = domain(0, 15)
score = clip(round(max(x["score"], 0)), 0, 1000)
find(x).where(all([700 <= score <= 950, x not in [0, 1]])).rank_by(score).top_k(3)
"""

compiled = client.compile(source)
print(compiled["compiled_summary"])

Supported preview patterns include:

  • find_rows(...).where(...)
  • find_rows(...).where_between(...)
  • find_rows(...).where_all(...)
  • find_rows(...).where_any(...)
  • find_rows(...).rank_by(...).top_k(...)
  • domain(...), range(...), find(...).where(...)
  • field(variable, column) and row["column"]
  • not, in, not in, chained comparisons
  • all([...]), any([...])
  • abs(...), round(...), min(...), max(...), clip(...)

Methods

client.spec()
client.examples()
client.validate(source, rows=None, backend="logical")
client.compile(source, rows=None, backend="logical")
client.run(source, rows=None, backend="logical")

CLI

qintent spec --api-url https://api.qdsv.cloud/api
qintent examples --api-url https://api.qdsv.cloud/api
qintent compile 'x = domain(0, 15); find(x).where(x in [3, 6, 9])'
qintent run 'find_rows("candidate_index").where("score", ">=", 850)' --rows candidates.csv

Environment variables:

QINTENT_API_URL=https://api.qdsv.cloud/api
QINTENT_API_KEY=...
QDSV_LICENSE_KEY=...

Public Preview Limits

The public preview intentionally exposes a stable subset. Advanced QDSV families such as crypto, sensing, AI semantic operations, hardware routing, and mitigation internals may compile or run only through Qruba full platform endpoints depending on your license.

Write QIntent locally. Execute on QDSV.

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

qdsv_qintent-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

qdsv_qintent-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file qdsv_qintent-0.1.0.tar.gz.

File metadata

  • Download URL: qdsv_qintent-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for qdsv_qintent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9bd451da3d7b7688810348eb90dd4b931eac2eab4a66033fa76d00473878e9d0
MD5 9ea907b632f31743e4c389555305fcac
BLAKE2b-256 4bea41a9757ca5b49668c277928b35c4ced2dffa43a0506a531604660c89915d

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for qdsv_qintent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1112e5562d99beee3219a92a961b905e7d3a98eb97a9c79dc1656aa995590421
MD5 3ea88fc0692302dccc51f2209d2b06f3
BLAKE2b-256 8705ff13761ffa030b5eceae7bcb1b4a7825ef38167d6a5d597844d72c4cd379

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