pcss-qapi 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pcss_qapi-0.1.0/.gitignore +4 -0
- pcss_qapi-0.1.0/.gitlab-ci.yml +51 -0
- pcss_qapi-0.1.0/.pre-commit-config.yaml +16 -0
- pcss_qapi-0.1.0/.python-version +1 -0
- pcss_qapi-0.1.0/.vscode/.gitignore +1 -0
- pcss_qapi-0.1.0/.vscode/settings.json +13 -0
- pcss_qapi-0.1.0/PKG-INFO +21 -0
- pcss_qapi-0.1.0/README.md +7 -0
- pcss_qapi-0.1.0/docs/.gitignore +3 -0
- pcss_qapi-0.1.0/docs/Makefile +20 -0
- pcss_qapi-0.1.0/docs/README.md +31 -0
- pcss_qapi-0.1.0/docs/_static/css/custom.css +31 -0
- pcss_qapi-0.1.0/docs/_static/logo.svg +12 -0
- pcss_qapi-0.1.0/docs/_templates/layour.rst +5 -0
- pcss_qapi-0.1.0/docs/_templates/module.rst +75 -0
- pcss_qapi-0.1.0/docs/_templates/package.rst +115 -0
- pcss_qapi-0.1.0/docs/build.sh +12 -0
- pcss_qapi-0.1.0/docs/conf.py +112 -0
- pcss_qapi-0.1.0/docs/examples.rst +20 -0
- pcss_qapi-0.1.0/docs/index.rst +28 -0
- pcss_qapi-0.1.0/docs/make.bat +35 -0
- pcss_qapi-0.1.0/docs/serve.sh +17 -0
- pcss_qapi-0.1.0/docs/tutorials.rst +13 -0
- pcss_qapi-0.1.0/examples/orca.ipynb +295 -0
- pcss_qapi-0.1.0/pcss_qapi/__init__.py +5 -0
- pcss_qapi-0.1.0/pcss_qapi/auth/__init__.py +4 -0
- pcss_qapi-0.1.0/pcss_qapi/auth/auth_service.py +132 -0
- pcss_qapi-0.1.0/pcss_qapi/auth/connections.py +15 -0
- pcss_qapi-0.1.0/pcss_qapi/auth/oauth_flow.py +203 -0
- pcss_qapi-0.1.0/pcss_qapi/base/__init__.py +0 -0
- pcss_qapi-0.1.0/pcss_qapi/base/connection_base.py +20 -0
- pcss_qapi-0.1.0/pcss_qapi/base/job_base.py +52 -0
- pcss_qapi-0.1.0/pcss_qapi/base/provider_base.py +38 -0
- pcss_qapi-0.1.0/pcss_qapi/orca/__init__.py +15 -0
- pcss_qapi-0.1.0/pcss_qapi/orca/backend.py +198 -0
- pcss_qapi-0.1.0/pcss_qapi/orca/orca_task.py +150 -0
- pcss_qapi-0.1.0/pcss_qapi/orca/provider.py +65 -0
- pcss_qapi-0.1.0/pcss_qapi/orca/ptseries_integration/__init__.py +6 -0
- pcss_qapi-0.1.0/pcss_qapi/orca/ptseries_integration/bbs.py +59 -0
- pcss_qapi-0.1.0/pcss_qapi/orca/ptseries_integration/orca_layer.py +77 -0
- pcss_qapi-0.1.0/pcss_qapi/orca/ptseries_integration/pt_adapter.py +113 -0
- pcss_qapi-0.1.0/pcss_qapi/utils/__init__.py +4 -0
- pcss_qapi-0.1.0/pcss_qapi/utils/exceptions.py +8 -0
- pcss_qapi-0.1.0/pcss_qapi/utils/fs_manager.py +66 -0
- pcss_qapi-0.1.0/pcss_qapi/utils/requests.py +31 -0
- pcss_qapi-0.1.0/pcss_qapi.egg-info/PKG-INFO +21 -0
- pcss_qapi-0.1.0/pcss_qapi.egg-info/SOURCES.txt +64 -0
- pcss_qapi-0.1.0/pcss_qapi.egg-info/dependency_links.txt +1 -0
- pcss_qapi-0.1.0/pcss_qapi.egg-info/requires.txt +8 -0
- pcss_qapi-0.1.0/pcss_qapi.egg-info/top_level.txt +1 -0
- pcss_qapi-0.1.0/pylintrc +7 -0
- pcss_qapi-0.1.0/pyproject.toml +45 -0
- pcss_qapi-0.1.0/set_dev_env.sh +30 -0
- pcss_qapi-0.1.0/setup.cfg +4 -0
- pcss_qapi-0.1.0/tests/__init__.py +0 -0
- pcss_qapi-0.1.0/tests/orca/__init__.py +0 -0
- pcss_qapi-0.1.0/tests/orca/test_imports.py +37 -0
- pcss_qapi-0.1.0/tests/orca/test_integration.py +106 -0
- pcss_qapi-0.1.0/tests/orca/test_task.py +44 -0
- pcss_qapi-0.1.0/tests/test_auth.py +30 -0
- pcss_qapi-0.1.0/tests/utils/__init__.py +0 -0
- pcss_qapi-0.1.0/tests/utils/auth.py +75 -0
- pcss_qapi-0.1.0/tests/utils/conf.py +37 -0
- pcss_qapi-0.1.0/tests/utils/connection.py +14 -0
- pcss_qapi-0.1.0/tests/utils/orca.py +52 -0
- pcss_qapi-0.1.0/uv.lock +2136 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
image: python:3.12-slim
|
|
2
|
+
|
|
3
|
+
stages:
|
|
4
|
+
- testing and code analysis
|
|
5
|
+
- deploy
|
|
6
|
+
# - publish
|
|
7
|
+
|
|
8
|
+
default:
|
|
9
|
+
before_script:
|
|
10
|
+
- python --version ; pip --version
|
|
11
|
+
- apt-get update
|
|
12
|
+
- apt-get upgrade -y
|
|
13
|
+
- apt-get install -y git
|
|
14
|
+
- pip install uv
|
|
15
|
+
- uv venv .venv
|
|
16
|
+
- uv sync
|
|
17
|
+
- source .venv/bin/activate
|
|
18
|
+
|
|
19
|
+
pylint_and_pytest:
|
|
20
|
+
stage: testing and code analysis
|
|
21
|
+
script:
|
|
22
|
+
- pylint pcss_qapi
|
|
23
|
+
- pytest -v tests
|
|
24
|
+
|
|
25
|
+
rules:
|
|
26
|
+
# - if: '$CI_COMMIT_BRANCH == "dev" && $CI_PIPELINE_SOURCE == "push"'
|
|
27
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "dev"'
|
|
28
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event" && $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main"'
|
|
29
|
+
|
|
30
|
+
pages:
|
|
31
|
+
stage: deploy
|
|
32
|
+
script:
|
|
33
|
+
- cd docs
|
|
34
|
+
- mkdir -p tutorials
|
|
35
|
+
- cp ./../examples/*.ipynb ./tutorials
|
|
36
|
+
- sphinx-build -b html . ../public
|
|
37
|
+
- cd ..
|
|
38
|
+
artifacts:
|
|
39
|
+
paths:
|
|
40
|
+
- public
|
|
41
|
+
rules:
|
|
42
|
+
- if: '$CI_COMMIT_BRANCH == "main"'
|
|
43
|
+
|
|
44
|
+
#publish:
|
|
45
|
+
# stage: publish
|
|
46
|
+
# script:
|
|
47
|
+
# - uv pip install build twine
|
|
48
|
+
# - python -m build
|
|
49
|
+
# - twine upload dist/* -u "$PyPI_USERNAME" -p "$PyPI_PASSWORD"
|
|
50
|
+
# rules:
|
|
51
|
+
# - if: '$CI_COMMIT_BRANCH == "main"'
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/hhatto/autopep8
|
|
3
|
+
rev: v2.3.2
|
|
4
|
+
hooks:
|
|
5
|
+
- id: autopep8
|
|
6
|
+
args: ["--max-line-length=140", "--in-place", "--aggressive", "--aggressive"]
|
|
7
|
+
|
|
8
|
+
- repo: local
|
|
9
|
+
hooks:
|
|
10
|
+
- id: pylint
|
|
11
|
+
exclude: ^(tests|docs)/.*$
|
|
12
|
+
name: pylint
|
|
13
|
+
entry: .venv/bin/pylint
|
|
14
|
+
language: system
|
|
15
|
+
types: [python]
|
|
16
|
+
args: ["-rn", "-sn", "--rcfile=pylintrc"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.11
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
launch.json
|
pcss_qapi-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pcss_qapi
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Python client for pcss quantum api
|
|
5
|
+
Requires-Python: >=3.11
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Requires-Dist: numpy==1.26.4
|
|
8
|
+
Requires-Dist: pyjwt>=2.10.1
|
|
9
|
+
Requires-Dist: requests>=2.32.3
|
|
10
|
+
Provides-Extra: orca
|
|
11
|
+
Requires-Dist: torch>=2.7.0; extra == "orca"
|
|
12
|
+
Requires-Dist: torchaudio>=2.7.0; extra == "orca"
|
|
13
|
+
Requires-Dist: torchvision>=0.22.0; extra == "orca"
|
|
14
|
+
|
|
15
|
+
# pcss-python-api
|
|
16
|
+
|
|
17
|
+
Python interface for interacting with the pccs-api for accessing quantum computing resources.
|
|
18
|
+
|
|
19
|
+
Supported computers:
|
|
20
|
+
- ORCA Computing PT-1
|
|
21
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = .
|
|
9
|
+
BUILDDIR = _build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
# Docs
|
|
3
|
+
|
|
4
|
+
## View documentation
|
|
5
|
+
|
|
6
|
+
```sh
|
|
7
|
+
docs/serve.sh
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
will serve the documentation files on [localhost:8080](http://localhost:8080). It will also build the documentation automatically if no html files are found (you will need to manually rebuild on changes).
|
|
11
|
+
|
|
12
|
+
## Build
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
docs/build.sh
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
will build the documentation.
|
|
19
|
+
|
|
20
|
+
## Requirements
|
|
21
|
+
|
|
22
|
+
Requirements needed to build the docs are available in `requirements-dev.txt`, install them with `pip install -r requirements.txt`
|
|
23
|
+
|
|
24
|
+
**PSA**: The `pandoc` library in python is only a wrapper for the program. You need to manually install the program on your computer:
|
|
25
|
+
|
|
26
|
+
- Linux: `sudo apt-get install pandoc`
|
|
27
|
+
- Mac: `brew install pandoc`
|
|
28
|
+
- Windows:
|
|
29
|
+
- `choco install pandoc`
|
|
30
|
+
- `winget install --source winget --exact --id JohnMacFarlane.Pandoc`
|
|
31
|
+
- or use a windows installer (have fun :))
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.bd-page-width {
|
|
2
|
+
max-width: 100% !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
button.sidebar-toggle {
|
|
6
|
+
display: none !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.document {
|
|
10
|
+
width: 100% !important;
|
|
11
|
+
margin: 50px !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.body {
|
|
15
|
+
max-width: 100% !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bd-sidebar-primary {
|
|
19
|
+
overflow-y: hidden !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.navbar-brand img {
|
|
23
|
+
max-height: 300px !important;
|
|
24
|
+
max-width: 300px !important;
|
|
25
|
+
|
|
26
|
+
height: 100%;
|
|
27
|
+
width: 100%;
|
|
28
|
+
|
|
29
|
+
min-height: 100px !important;
|
|
30
|
+
min-width: 100px !important;
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.5 8.5C42.2909 8.5 40.5 10.2909 40.5 12.5V38.5C40.5 40.7091 42.2909 42.5 44.5 42.5H51.5C53.7091 42.5 55.5 40.7091 55.5 38.5V12.5C55.5 10.2909 53.7091 8.5 51.5 8.5H44.5ZM12.5 21.5C10.2909 21.5 8.5 23.2909 8.5 25.5V51.5C8.5 53.7091 10.2909 55.5 12.5 55.5H28.5C30.7091 55.5 32.5 53.7091 32.5 51.5V25.5C32.5 23.2909 30.7091 21.5 28.5 21.5H12.5Z" fill="#1E1E1E"/>
|
|
3
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M44.5 8.5C42.2909 8.5 40.5 10.2909 40.5 12.5V38.5C40.5 40.7091 42.2909 42.5 44.5 42.5H51.5C53.7091 42.5 55.5 40.7091 55.5 38.5V12.5C55.5 10.2909 53.7091 8.5 51.5 8.5H44.5ZM12.5 21.5C10.2909 21.5 8.5 23.2909 8.5 25.5V51.5C8.5 53.7091 10.2909 55.5 12.5 55.5H28.5C30.7091 55.5 32.5 53.7091 32.5 51.5V25.5C32.5 23.2909 30.7091 21.5 28.5 21.5H12.5Z" fill="url(#paint0_linear_340_3781)"/>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="paint0_linear_340_3781" x1="50.9995" y1="14.7146" x2="17.4197" y2="52.9332" gradientUnits="userSpaceOnUse">
|
|
6
|
+
<stop stop-color="#005FFE"/>
|
|
7
|
+
<stop offset="0.28047" stop-color="#0159F5"/>
|
|
8
|
+
<stop offset="0.73457" stop-color="#054BDD"/>
|
|
9
|
+
<stop offset="1" stop-color="#0941CC"/>
|
|
10
|
+
</linearGradient>
|
|
11
|
+
</defs>
|
|
12
|
+
</svg>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{# The :autogenerated: tag is picked up by breadcrumbs.html to suppress "Edit on Github" link #}
|
|
2
|
+
{# This code is from https://github.com/goerz/better-apidoc?tab=readme-ov-file#}
|
|
3
|
+
:autogenerated:
|
|
4
|
+
|
|
5
|
+
{{ fullname }}
|
|
6
|
+
{% for item in range(7 + fullname|length) -%}={%- endfor %}
|
|
7
|
+
|
|
8
|
+
.. currentmodule:: {{ fullname }}
|
|
9
|
+
|
|
10
|
+
.. automodule:: {{ fullname }}
|
|
11
|
+
{% if members -%}
|
|
12
|
+
:members: {{ members|join(", ") }}
|
|
13
|
+
:undoc-members:
|
|
14
|
+
:show-inheritance:
|
|
15
|
+
:member-order: bysource
|
|
16
|
+
|
|
17
|
+
Summary
|
|
18
|
+
-------
|
|
19
|
+
|
|
20
|
+
{%- if exceptions %}
|
|
21
|
+
|
|
22
|
+
Exceptions:
|
|
23
|
+
|
|
24
|
+
.. autosummary::
|
|
25
|
+
:nosignatures:
|
|
26
|
+
{% for item in exceptions %}
|
|
27
|
+
{{ item }}
|
|
28
|
+
{%- endfor %}
|
|
29
|
+
{%- endif %}
|
|
30
|
+
|
|
31
|
+
{%- if classes %}
|
|
32
|
+
|
|
33
|
+
Classes:
|
|
34
|
+
|
|
35
|
+
.. autosummary::
|
|
36
|
+
:nosignatures:
|
|
37
|
+
{% for item in classes %}
|
|
38
|
+
{{ item }}
|
|
39
|
+
{%- endfor %}
|
|
40
|
+
{%- endif %}
|
|
41
|
+
|
|
42
|
+
{%- if functions %}
|
|
43
|
+
|
|
44
|
+
Functions:
|
|
45
|
+
|
|
46
|
+
.. autosummary::
|
|
47
|
+
:nosignatures:
|
|
48
|
+
{% for item in functions %}
|
|
49
|
+
{{ item }}
|
|
50
|
+
{%- endfor %}
|
|
51
|
+
{%- endif %}
|
|
52
|
+
{%- endif %}
|
|
53
|
+
|
|
54
|
+
{% set data = get_members(typ='data', in_list='__all__') %}
|
|
55
|
+
{%- if data %}
|
|
56
|
+
|
|
57
|
+
Data:
|
|
58
|
+
|
|
59
|
+
.. autosummary::
|
|
60
|
+
:nosignatures:
|
|
61
|
+
{% for item in data %}
|
|
62
|
+
{{ item }}
|
|
63
|
+
{%- endfor %}
|
|
64
|
+
{%- endif %}
|
|
65
|
+
|
|
66
|
+
{% set all_refs = get_members(in_list='__all__', include_imported=True, out_format='refs') %}
|
|
67
|
+
{% if all_refs %}
|
|
68
|
+
``__all__``: {{ all_refs|join(", ") }}
|
|
69
|
+
{%- endif %}
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
{% if members %}
|
|
73
|
+
Reference
|
|
74
|
+
---------
|
|
75
|
+
{%- endif %}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
{# The :autogenerated: tag is picked up by breadcrumbs.html to suppress "Edit on Github" link #}
|
|
2
|
+
{# This code is from https://github.com/goerz/better-apidoc?tab=readme-ov-file#}
|
|
3
|
+
:autogenerated:
|
|
4
|
+
|
|
5
|
+
{{ fullname }}
|
|
6
|
+
{% for item in range(8 + fullname|length) -%}={%- endfor %}
|
|
7
|
+
|
|
8
|
+
.. automodule:: {{ fullname }}
|
|
9
|
+
{% if members -%}
|
|
10
|
+
:members:
|
|
11
|
+
:undoc-members:
|
|
12
|
+
:show-inheritance:
|
|
13
|
+
{%- endif %}
|
|
14
|
+
|
|
15
|
+
{% if submodules %}
|
|
16
|
+
Submodules:
|
|
17
|
+
|
|
18
|
+
.. toctree::
|
|
19
|
+
:maxdepth: 1
|
|
20
|
+
{% for item in submodules %}
|
|
21
|
+
{{ fullname }}.{{ item }}
|
|
22
|
+
{%- endfor %}
|
|
23
|
+
{%- endif -%}
|
|
24
|
+
|
|
25
|
+
{% if subpackages %}
|
|
26
|
+
Subpackages:
|
|
27
|
+
|
|
28
|
+
.. toctree::
|
|
29
|
+
:maxdepth: 1
|
|
30
|
+
{% for item in subpackages %}
|
|
31
|
+
{{ fullname }}.{{ item }}
|
|
32
|
+
{%- endfor %}
|
|
33
|
+
{%- endif %}
|
|
34
|
+
|
|
35
|
+
{% set all = get_members(in_list='__all__', include_imported=True) %}
|
|
36
|
+
{% if members or all %}
|
|
37
|
+
Summary
|
|
38
|
+
-------
|
|
39
|
+
|
|
40
|
+
{%- set exceptions = get_members(typ='exception', in_list='__all__', include_imported=True, out_format='table') -%}
|
|
41
|
+
{%- set classes = get_members(typ='class', in_list='__all__', include_imported=True, out_format='table') -%}
|
|
42
|
+
{%- set functions = get_members(typ='function', in_list='__all__', include_imported=True, out_format='table') -%}
|
|
43
|
+
{%- set data = get_members(typ='data', in_list='__all__', include_imported=True, out_format='table') -%}
|
|
44
|
+
{%- set private_exceptions = get_members(typ='exception', in_list='__private__', out_format='table') -%}
|
|
45
|
+
{%- set private_classes = get_members(typ='class', in_list='__private__', out_format='table') -%}
|
|
46
|
+
{%- set private_functions = get_members(typ='function', in_list='__private__', out_format='table') -%}
|
|
47
|
+
|
|
48
|
+
{%- if exceptions %}
|
|
49
|
+
|
|
50
|
+
``__all__`` Exceptions:
|
|
51
|
+
|
|
52
|
+
{% for line in exceptions %}
|
|
53
|
+
{{ line }}
|
|
54
|
+
{%- endfor %}
|
|
55
|
+
{%- endif %}
|
|
56
|
+
{%- if private_exceptions %}
|
|
57
|
+
|
|
58
|
+
Private Exceptions:
|
|
59
|
+
|
|
60
|
+
{% for line in private_exceptions %}
|
|
61
|
+
{{ line }}
|
|
62
|
+
{%- endfor %}
|
|
63
|
+
{%- endif %}
|
|
64
|
+
|
|
65
|
+
{%- if classes %}
|
|
66
|
+
|
|
67
|
+
``__all__`` Classes:
|
|
68
|
+
|
|
69
|
+
{% for line in classes %}
|
|
70
|
+
{{ line }}
|
|
71
|
+
{%- endfor %}
|
|
72
|
+
{%- endif %}
|
|
73
|
+
{%- if private_classes %}
|
|
74
|
+
|
|
75
|
+
Private Classes:
|
|
76
|
+
|
|
77
|
+
{% for line in private_classes %}
|
|
78
|
+
{{ line }}
|
|
79
|
+
{%- endfor %}
|
|
80
|
+
{%- endif %}
|
|
81
|
+
|
|
82
|
+
{%- if functions %}
|
|
83
|
+
|
|
84
|
+
``__all__`` Functions:
|
|
85
|
+
|
|
86
|
+
{% for line in functions %}
|
|
87
|
+
{{ line }}
|
|
88
|
+
{%- endfor %}
|
|
89
|
+
{%- endif %}
|
|
90
|
+
{%- if private_functions %}
|
|
91
|
+
|
|
92
|
+
Private Functions:
|
|
93
|
+
|
|
94
|
+
{% for line in private_functions %}
|
|
95
|
+
{{ line }}
|
|
96
|
+
{%- endfor %}
|
|
97
|
+
{%- endif %}
|
|
98
|
+
|
|
99
|
+
{%- if data %}
|
|
100
|
+
|
|
101
|
+
``__all__`` Data:
|
|
102
|
+
|
|
103
|
+
{% for line in data %}
|
|
104
|
+
{{ line }}
|
|
105
|
+
{%- endfor %}
|
|
106
|
+
{%- endif %}
|
|
107
|
+
|
|
108
|
+
{%- endif %}
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
{% if members %}
|
|
112
|
+
Reference
|
|
113
|
+
---------
|
|
114
|
+
|
|
115
|
+
{%- endif %}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# Configuration file for the Sphinx documentation builder.
|
|
2
|
+
#
|
|
3
|
+
# For the full list of built-in configuration values, see the documentation:
|
|
4
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
import os
|
|
8
|
+
import sys
|
|
9
|
+
import tomllib
|
|
10
|
+
import better_apidoc
|
|
11
|
+
|
|
12
|
+
conf_path = os.path.dirname(os.path.abspath(__file__))
|
|
13
|
+
project_path = os.path.dirname(conf_path)
|
|
14
|
+
lib_path = os.path.join(project_path, 'pcss_qapi')
|
|
15
|
+
sys.path.insert(0, project_path)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def run_apidoc(app):
|
|
19
|
+
"""Generate API documentation"""
|
|
20
|
+
better_apidoc.APP = app
|
|
21
|
+
better_apidoc.main([
|
|
22
|
+
'better-apidoc',
|
|
23
|
+
'-t',
|
|
24
|
+
os.path.join('.', '_templates'),
|
|
25
|
+
'--force',
|
|
26
|
+
'--separate',
|
|
27
|
+
'-o',
|
|
28
|
+
os.path.join('.', 'API'),
|
|
29
|
+
lib_path, # Generate docs only for qailab/
|
|
30
|
+
])
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# -- Project information -----------------------------------------------------
|
|
34
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
|
|
35
|
+
|
|
36
|
+
# Grab info from pyproject.toml
|
|
37
|
+
|
|
38
|
+
with open(os.path.join(project_path, 'pyproject.toml'), 'rb') as f:
|
|
39
|
+
parsed_pyproject = tomllib.load(f)
|
|
40
|
+
|
|
41
|
+
name = parsed_pyproject['project']['name'].replace('_', ' ').title()
|
|
42
|
+
version = parsed_pyproject['project']['version']
|
|
43
|
+
|
|
44
|
+
project = name
|
|
45
|
+
copyright = '2025, psnc-qcg'
|
|
46
|
+
author = 'psnc-qcg'
|
|
47
|
+
release = version
|
|
48
|
+
|
|
49
|
+
# -- General configuration ---------------------------------------------------
|
|
50
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
|
|
51
|
+
|
|
52
|
+
suppress_warnings = [
|
|
53
|
+
'myst.header', # ipynb linter
|
|
54
|
+
'myst.xref_missing',
|
|
55
|
+
'docutils' # rst linter
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
extensions = [
|
|
59
|
+
'sphinx.ext.autodoc',
|
|
60
|
+
'sphinx.ext.napoleon',
|
|
61
|
+
'sphinx.ext.autosummary',
|
|
62
|
+
'sphinx.ext.viewcode',
|
|
63
|
+
'sphinx_copybutton',
|
|
64
|
+
'myst_nb',
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
myst_enable_extensions = [
|
|
68
|
+
"amsmath",
|
|
69
|
+
"colon_fence",
|
|
70
|
+
"deflist",
|
|
71
|
+
"dollarmath",
|
|
72
|
+
"html_image",
|
|
73
|
+
]
|
|
74
|
+
|
|
75
|
+
viewcode_line_numbers = True
|
|
76
|
+
|
|
77
|
+
autodoc_typehints = "both"
|
|
78
|
+
autodoc_typehints_description_target = "documented"
|
|
79
|
+
|
|
80
|
+
autodoc_mock_imports = ['sklearn', 'ptseries']
|
|
81
|
+
|
|
82
|
+
napoleon_numpy_docstring = False
|
|
83
|
+
|
|
84
|
+
nb_execution_mode = "off"
|
|
85
|
+
|
|
86
|
+
templates_path = ['_templates']
|
|
87
|
+
exclude_patterns = [
|
|
88
|
+
'_build',
|
|
89
|
+
'Thumbs.db',
|
|
90
|
+
'.DS_Store',
|
|
91
|
+
'tests/*',
|
|
92
|
+
'*.md',
|
|
93
|
+
'API/modules.rst'
|
|
94
|
+
]
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# -- Options for HTML output -------------------------------------------------
|
|
98
|
+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
|
|
99
|
+
|
|
100
|
+
html_static_path = ['_static']
|
|
101
|
+
html_css_files = ['css/custom.css']
|
|
102
|
+
|
|
103
|
+
html_theme = 'sphinx_book_theme'
|
|
104
|
+
html_logo = '_static/logo.svg'
|
|
105
|
+
html_favicon = "_static/logo.svg"
|
|
106
|
+
|
|
107
|
+
html_show_sourcelink = False # Disable option to show .rst source
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def setup(app):
|
|
111
|
+
app.connect('builder-inited', run_apidoc)
|
|
112
|
+
app.add_css_file('css/custom.css')
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Examples
|
|
2
|
+
========
|
|
3
|
+
|
|
4
|
+
PTLayer inference
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
::
|
|
8
|
+
|
|
9
|
+
import torch
|
|
10
|
+
|
|
11
|
+
from pcss_qapi import AuthorizationService
|
|
12
|
+
from pcss_qapi.orca import OrcaProvider
|
|
13
|
+
|
|
14
|
+
AuthorizationService.login()
|
|
15
|
+
|
|
16
|
+
provider = OrcaProvider()
|
|
17
|
+
|
|
18
|
+
backend = provider.get_backend("ORCA-PT-1-A")
|
|
19
|
+
ptlayer = backend.get_ptlayer(in_features=2)
|
|
20
|
+
output = ptlayer(torch.tensor([[1.0,-1.0]],dtype=torch.float32))
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
PCSS-QAPI Docs
|
|
2
|
+
=====================
|
|
3
|
+
|
|
4
|
+
----------------
|
|
5
|
+
About project
|
|
6
|
+
----------------
|
|
7
|
+
PCSS-QAPI is a allowing you to use pcss quantum computers.
|
|
8
|
+
For now it supports:
|
|
9
|
+
- ORCA Computing PT-1 models
|
|
10
|
+
|
|
11
|
+
----------------
|
|
12
|
+
Getting started
|
|
13
|
+
----------------
|
|
14
|
+
|
|
15
|
+
You can install PCSS-QAPI via pip:
|
|
16
|
+
::
|
|
17
|
+
|
|
18
|
+
pip install TBD
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
Then you can get to know the library by checking out the following sections:
|
|
22
|
+
|
|
23
|
+
.. toctree::
|
|
24
|
+
:maxdepth: 1
|
|
25
|
+
|
|
26
|
+
examples
|
|
27
|
+
tutorials
|
|
28
|
+
API Documentation <API/pcss_qapi>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@ECHO OFF
|
|
2
|
+
|
|
3
|
+
pushd %~dp0
|
|
4
|
+
|
|
5
|
+
REM Command file for Sphinx documentation
|
|
6
|
+
|
|
7
|
+
if "%SPHINXBUILD%" == "" (
|
|
8
|
+
set SPHINXBUILD=sphinx-build
|
|
9
|
+
)
|
|
10
|
+
set SOURCEDIR=.
|
|
11
|
+
set BUILDDIR=_build
|
|
12
|
+
|
|
13
|
+
%SPHINXBUILD% >NUL 2>NUL
|
|
14
|
+
if errorlevel 9009 (
|
|
15
|
+
echo.
|
|
16
|
+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
|
17
|
+
echo.installed, then set the SPHINXBUILD environment variable to point
|
|
18
|
+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
|
19
|
+
echo.may add the Sphinx directory to PATH.
|
|
20
|
+
echo.
|
|
21
|
+
echo.If you don't have Sphinx installed, grab it from
|
|
22
|
+
echo.https://www.sphinx-doc.org/
|
|
23
|
+
exit /b 1
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
if "%1" == "" goto help
|
|
27
|
+
|
|
28
|
+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
29
|
+
goto end
|
|
30
|
+
|
|
31
|
+
:help
|
|
32
|
+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
|
33
|
+
|
|
34
|
+
:end
|
|
35
|
+
popd
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
#Serves the documentation on localhost:8080
|
|
4
|
+
#Builds if necessary
|
|
5
|
+
|
|
6
|
+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
7
|
+
cd $SCRIPT_DIR
|
|
8
|
+
|
|
9
|
+
#Check if the build directory exists
|
|
10
|
+
if [ ! -d "_build" ]; then
|
|
11
|
+
./build.sh
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
cd _build/html
|
|
15
|
+
|
|
16
|
+
echo "Docs available at http://localhost:8080"
|
|
17
|
+
python3 -m http.server -b 127.0.0.1 8080 > /dev/null 2>&1
|