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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ body = CircuitJobCreationPayload.from_dict({
"shots": 100,
"input": {
"gateset": "qis",
"qubits": 2,
"circuit": [
{"gate": "h", "targets": [0]},
{"gate": "h", "target": 0},
{"gate": "cnot", "control": 0, "target": 1},
],
},
Expand Down
18 changes: 8 additions & 10 deletions ionq_core/models/qis_circuit_input.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions openapi-overlay.yaml
Comment thread
splch marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
overlay: 1.0.0
info:
title: ionq-core-python local OpenAPI fixes
version: 0.1.0
description: |
Patches applied to openapi.json before client generation. The upstream
spec marks QisCircuitInput.qubits as optional and floating-point, but
the simulator preflight rejects payloads without it (surfacing as
UnexpectedCompilationError) and qubit counts are non-negative integers.

actions:
- target: $.components.schemas.QisCircuitInput.required
remove: true
- target: $.components.schemas.QisCircuitInput
update:
required:
- circuit
- gateset
- qubits
- target: $.components.schemas.QisCircuitInput.properties.qubits
update:
type: integer
format: int32
3 changes: 2 additions & 1 deletion tests/integration/test_simulator_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@
"shots": 100,
"input": {
"gateset": "qis",
"qubits": 2,
"circuit": [
{"gate": "h", "targets": [0]},
{"gate": "h", "target": 0},
{"gate": "cnot", "control": 0, "target": 1},
],
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_sync(self, httpx_mock, auth_client):
"type": "ionq.circuit.v1",
"backend": "simulator",
"shots": 100,
"input": {"gateset": "qis", "circuit": [{"gate": "h", "targets": [0]}]},
"input": {"gateset": "qis", "qubits": 1, "circuit": [{"gate": "h", "target": 0}]},
}
)
result = create_job.sync(client=auth_client, body=body)
Expand Down
Loading