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()

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")

For a local Docker/private demo API:

client = QIntentClient.local()

CLI

qintent spec
qintent examples
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.2.tar.gz (6.3 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.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: qdsv_qintent-0.1.2.tar.gz
  • Upload date:
  • Size: 6.3 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.2.tar.gz
Algorithm Hash digest
SHA256 d9f5a382200dca8ab85e32c9dd9d60b22fe5ad3bdfeb3ce06ae827201713ecfa
MD5 8d1d8afe053fe2a5fd6c4bb5808c7ae0
BLAKE2b-256 9afe6c7933fb98ec310d2ae8e9da835ea2e0d89b7b8ffc5a73752ef0cb0db5fd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: qdsv_qintent-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2fc83c63dbb2b909af8d1ec485c779481c543016a3dc28a06ee9d17e30813c1b
MD5 511c2072a1504ddfe472a2fd7611cc46
BLAKE2b-256 f09d47fd1759c462862f950e99f952740f63f79a863ee9b25b7feae672316fcc

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