Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ repos:
hooks:
- id: gitleaks

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.18
- repo: local
hooks:
- id: ruff-check
args: [--fix]
name: ruff check
entry: uv run ruff check --force-exclude --fix
language: system
types_or: [python, pyi, jupyter]
require_serial: true
- id: ruff-format
name: ruff format
entry: uv run ruff format --force-exclude
language: system
types_or: [python, pyi, jupyter]
require_serial: true
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ from ionq_core import IonQClient
from ionq_core.api.default import create_job, get_job, get_variant_probabilities, get_jobs
from ionq_core.models.circuit_job_creation_payload import CircuitJobCreationPayload

client = IonQClient() # reads IONQ_API_KEY
get_job.sync(uuid, client=client) # one path param
client = IonQClient() # reads IONQ_API_KEY
get_job.sync(uuid, client=client) # one path param
get_variant_probabilities.sync(uuid, variant_id, client=client) # multiple path params
get_jobs.sync(client=client, status="completed", limit=10) # query only
create_job.sync(client=client, body=payload) # body only
get_jobs.sync(client=client, status="completed", limit=10) # query only
create_job.sync(client=client, body=payload) # body only
```

Use `next_=` (trailing underscore) for the cursor pagination kwarg — Python keyword collision. The `iter_jobs` / `aiter_jobs` / `iter_session_jobs` / `aiter_session_jobs` helpers handle paging for you.
Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,21 @@ from ionq_core.models.circuit_job_creation_payload import CircuitJobCreationPayl

client = IonQClient() # reads IONQ_API_KEY from the environment

body = CircuitJobCreationPayload.from_dict({
"type": "ionq.circuit.v1",
"backend": "simulator",
"shots": 100,
"input": {
"gateset": "qis",
"qubits": 2,
"circuit": [
{"gate": "h", "target": 0},
{"gate": "cnot", "control": 0, "target": 1},
],
},
})
body = CircuitJobCreationPayload.from_dict(
{
"type": "ionq.circuit.v1",
"backend": "simulator",
"shots": 100,
"input": {
"gateset": "qis",
"qubits": 2,
"circuit": [
{"gate": "h", "target": 0},
{"gate": "cnot", "control": 0, "target": 1},
],
},
}
)

job = create_job.sync(client=client, body=body)
completed = wait_for_job(client, job.id)
Expand All @@ -71,6 +73,7 @@ This package follows [SemVer 2.0](https://semver.org/spec/v2.0.0.html), independ

```python
import ionq_core

print(ionq_core.__version__)
```

Expand Down
Loading