Skip to content

Commit 6dcbce9

Browse files
authored
Merge pull request #23 from ionq/add-copyright-headers-and-getting-help
Add copyright headers to generated code and Getting Help to README
2 parents 2fe1b81 + ae88c49 commit 6dcbce9

149 files changed

Lines changed: 445 additions & 143 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,12 @@ git tag v0.1.0
406406
git push origin v0.1.0
407407
```
408408

409+
## Getting help
410+
411+
- **Bug reports and feature requests** - [GitHub Issues](https://github.com/ionq/ionq-core-python/issues)
412+
- **Account, billing, or QPU questions** - [IonQ Support](https://ionq.com/contact)
413+
- **API documentation** - [docs.ionq.com](https://docs.ionq.com/)
414+
409415
## License
410416

411417
Apache-2.0. See [LICENSE](LICENSE) for details.

custom-templates/package_init.py.jinja

Lines changed: 1 addition & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,5 @@
11
{% from "helpers.jinja" import safe_docstring %}
2-
# Copyright 2026 IonQ, Inc.
3-
# SPDX-License-Identifier: Apache-2.0
4-
5-
"""A Python client library for the [IonQ Cloud Platform API](https://docs.ionq.com/).
6-
7-
Provides full access to IonQ's quantum computing services with typed models for all
8-
request and response objects. Supports both synchronous and asynchronous usage.
9-
10-
## Quick start
11-
12-
```python
13-
from ionq_core import IonQClient
14-
from ionq_core.api.backends import get_backends
15-
16-
# Authenticate with the IONQ_API_KEY environment variable
17-
client = IonQClient()
18-
19-
# List available quantum backends
20-
for backend in get_backends.sync(client=client):
21-
print(f"{backend.backend}: {backend.status}")
22-
```
23-
24-
## Authentication
25-
26-
Get an API key from the [IonQ Cloud Console](https://cloud.ionq.com), then
27-
either set the ``IONQ_API_KEY`` environment variable or pass it directly:
28-
29-
```python
30-
client = IonQClient() # reads IONQ_API_KEY
31-
client = IonQClient(api_key="your-key") # explicit key
32-
```
33-
34-
## Submitting a job
35-
36-
```python
37-
from ionq_core.api.default import create_job
38-
from ionq_core.models.circuit_job_creation_payload import CircuitJobCreationPayload
39-
40-
job = create_job.sync(
41-
client=client,
42-
body=CircuitJobCreationPayload.from_dict({
43-
"type": "ionq.circuit.v1",
44-
"backend": "simulator",
45-
"shots": 1000,
46-
"input": {
47-
"gateset": "qis",
48-
"circuit": [
49-
{"gate": "h", "targets": [0]},
50-
{"gate": "cnot", "targets": [0], "controls": [1]},
51-
],
52-
},
53-
}),
54-
)
55-
```
56-
57-
## Key features
58-
59-
- **Sync and async** - every endpoint has ``.sync()`` and ``.asyncio()`` variants.
60-
- **Automatic retries** - transient errors (429, 5xx) are retried with exponential
61-
backoff. See `IonQClient` for configuration.
62-
- **Typed exceptions** - HTTP errors are raised as `AuthenticationError`,
63-
`RateLimitError`, `ServerError`, etc. See `_exceptions` for the full hierarchy.
64-
- **Pagination helpers** - `iter_jobs` and `aiter_jobs` follow cursors automatically.
65-
- **Job polling** - `wait_for_job` and `async_wait_for_job` poll until completion.
66-
- **Session management** - `SessionManager` wraps the session lifecycle as a
67-
context manager.
68-
- **Native gate matrices** - `gpi_matrix`, `gpi2_matrix`, `ms_matrix`, and
69-
`zz_matrix` return pure-Python unitary matrices for simulation and verification.
70-
- **Extensibility** - `ClientExtension` lets downstream SDKs inject hooks, headers,
71-
custom transports, and error mappers without modifying this library.
72-
"""
73-
2+
{{ safe_docstring(package_description) }}
743
from ._exceptions import (
754
APIConnectionError,
765
APIError,

ionq_core/__init__.py

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,7 @@
11
# Copyright 2026 IonQ, Inc.
22
# SPDX-License-Identifier: Apache-2.0
33

4-
"""A Python client library for the [IonQ Cloud Platform API](https://docs.ionq.com/).
5-
6-
Provides full access to IonQ's quantum computing services with typed models for all
7-
request and response objects. Supports both synchronous and asynchronous usage.
8-
9-
## Quick start
10-
11-
```python
12-
from ionq_core import IonQClient
13-
from ionq_core.api.backends import get_backends
14-
15-
# Authenticate with the IONQ_API_KEY environment variable
16-
client = IonQClient()
17-
18-
# List available quantum backends
19-
for backend in get_backends.sync(client=client):
20-
print(f"{backend.backend}: {backend.status}")
21-
```
22-
23-
## Authentication
24-
25-
Get an API key from the [IonQ Cloud Console](https://cloud.ionq.com), then
26-
either set the ``IONQ_API_KEY`` environment variable or pass it directly:
27-
28-
```python
29-
client = IonQClient() # reads IONQ_API_KEY
30-
client = IonQClient(api_key="your-key") # explicit key
31-
```
32-
33-
## Submitting a job
34-
35-
```python
36-
from ionq_core.api.default import create_job
37-
from ionq_core.models.circuit_job_creation_payload import CircuitJobCreationPayload
38-
39-
job = create_job.sync(
40-
client=client,
41-
body=CircuitJobCreationPayload.from_dict(
42-
{
43-
"type": "ionq.circuit.v1",
44-
"backend": "simulator",
45-
"shots": 1000,
46-
"input": {
47-
"gateset": "qis",
48-
"circuit": [
49-
{"gate": "h", "targets": [0]},
50-
{"gate": "cnot", "targets": [0], "controls": [1]},
51-
],
52-
},
53-
}
54-
),
55-
)
56-
```
57-
58-
## Key features
59-
60-
- **Sync and async** - every endpoint has ``.sync()`` and ``.asyncio()`` variants.
61-
- **Automatic retries** - transient errors (429, 5xx) are retried with exponential
62-
backoff. See `IonQClient` for configuration.
63-
- **Typed exceptions** - HTTP errors are raised as `AuthenticationError`,
64-
`RateLimitError`, `ServerError`, etc. See `_exceptions` for the full hierarchy.
65-
- **Pagination helpers** - `iter_jobs` and `aiter_jobs` follow cursors automatically.
66-
- **Job polling** - `wait_for_job` and `async_wait_for_job` poll until completion.
67-
- **Session management** - `SessionManager` wraps the session lifecycle as a
68-
context manager.
69-
- **Native gate matrices** - `gpi_matrix`, `gpi2_matrix`, `ms_matrix`, and
70-
`zz_matrix` return pure-Python unitary matrices for simulation and verification.
71-
- **Extensibility** - `ClientExtension` lets downstream SDKs inject hooks, headers,
72-
custom transports, and error mappers without modifying this library.
73-
"""
4+
"""A client library for accessing IonQ Cloud Platform API"""
745

756
from ._exceptions import (
767
APIConnectionError,

ionq_core/api/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright 2026 IonQ, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
""" Contains methods for accessing the API """

ionq_core/api/backends/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright 2026 IonQ, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
""" Contains endpoint functions for accessing the API """

ionq_core/api/backends/get_backend.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright 2026 IonQ, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
from http import HTTPStatus
25
from typing import Any, cast
36
from urllib.parse import quote

ionq_core/api/backends/get_backends.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright 2026 IonQ, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
from http import HTTPStatus
25
from typing import Any, cast
36
from urllib.parse import quote
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright 2026 IonQ, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
""" Contains endpoint functions for accessing the API """

ionq_core/api/characterizations/get_characterization.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright 2026 IonQ, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
from http import HTTPStatus
25
from typing import Any, cast
36
from urllib.parse import quote

ionq_core/api/characterizations/get_characterizations_for_backend.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright 2026 IonQ, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
14
from http import HTTPStatus
25
from typing import Any, cast
36
from urllib.parse import quote

0 commit comments

Comments
 (0)