qciconnect 0.3.0__py3-none-any.whl
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.
- commons/hequate_common/README.md +0 -0
- commons/hequate_common/__init__.py +1 -0
- commons/hequate_common/models.py +158 -0
- commons/hequate_common/poetry.lock +7 -0
- commons/hequate_common/pyproject.toml +19 -0
- commons/qciconnect_common/.dockerignore +9 -0
- commons/qciconnect_common/.gitignore +129 -0
- commons/qciconnect_common/README.md +28 -0
- commons/qciconnect_common/__init__.py +1 -0
- commons/qciconnect_common/poetry.lock +888 -0
- commons/qciconnect_common/pyproject.toml +34 -0
- commons/qciconnect_common/qciconnect_conversion/__init__.py +1 -0
- commons/qciconnect_common/qciconnect_conversion/json_conversion.py +225 -0
- commons/qciconnect_common/qciconnect_conversion/tests/test_json_datetime_converter.py +86 -0
- commons/qciconnect_common/qciconnect_conversion/tests/test_json_numpy_converter.py +234 -0
- commons/qciconnect_common/qciconnect_logging/__init__.py +1 -0
- commons/qciconnect_common/qciconnect_logging/configuration.py +112 -0
- commons/qciconnect_common/qciconnect_logging/logger.py +37 -0
- commons/qciconnect_common/qciconnect_models/celery/__init__.py +1 -0
- commons/qciconnect_common/qciconnect_models/celery/result.py +51 -0
- commons/qciconnect_common/qciconnect_models/task_status.py +19 -0
- commons/qciconnect_common/qciconnect_scheduler/__init__.py +1 -0
- commons/qciconnect_common/qciconnect_scheduler/celery_app.py +87 -0
- commons/qciconnect_common/qciconnect_settings/__init__.py +1 -0
- commons/qciconnect_common/qciconnect_settings/environment_config.py +54 -0
- qciconnect/__init__.py +3 -0
- qciconnect/client.py +355 -0
- qciconnect/exceptions.py +8 -0
- qciconnect/mageia.py +85 -0
- qciconnect/methods.py +116 -0
- qciconnect/qpus.py +115 -0
- qciconnect/result_handling.py +162 -0
- qciconnect/token_managers.py +109 -0
- qciconnect/utils.py +9 -0
- qciconnect-0.3.0.dist-info/LICENSE +22 -0
- qciconnect-0.3.0.dist-info/METADATA +33 -0
- qciconnect-0.3.0.dist-info/RECORD +38 -0
- qciconnect-0.3.0.dist-info/WHEEL +4 -0
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Init file for hequate_common module."""
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# generated by fastapi-codegen:
|
|
2
|
+
# filename: ./api-wrapper/openapi.yaml
|
|
3
|
+
# timestamp: 2025-01-08T11:10:30+00:00
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from datetime import datetime
|
|
8
|
+
from enum import Enum
|
|
9
|
+
from typing import Any, Dict, List, Optional, Union
|
|
10
|
+
from uuid import UUID
|
|
11
|
+
|
|
12
|
+
from pydantic import BaseModel, Extra, Field, PositiveFloat, PositiveInt, conint, constr
|
|
13
|
+
|
|
14
|
+
class CompilerStatus(Enum):
|
|
15
|
+
running = 'running'
|
|
16
|
+
offline = 'offline'
|
|
17
|
+
maintenance = 'maintenance'
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class CompilerTable(BaseModel):
|
|
21
|
+
name: str = Field(..., title='Name')
|
|
22
|
+
manufacturer: Optional[str] = Field(..., title='Manufacturer')
|
|
23
|
+
status: CompilerStatus
|
|
24
|
+
description: Optional[constr(min_length=0, max_length=512)] = Field(
|
|
25
|
+
..., title='Description'
|
|
26
|
+
)
|
|
27
|
+
time_limit: PositiveFloat = Field(..., title='Time Limit')
|
|
28
|
+
passes_available: Optional[Dict[str, bool]] = Field(None, title='Passes Available')
|
|
29
|
+
compiler_id: int = Field(..., title='Compiler Id')
|
|
30
|
+
# compiler_alias: str = Field(..., title='Compiler Alias')
|
|
31
|
+
|
|
32
|
+
class CompilerTaskBase(BaseModel):
|
|
33
|
+
compiler_id: Optional[int] = Field(..., title='Compiler Id')
|
|
34
|
+
compilation_pass: str
|
|
35
|
+
options: Optional[Dict[str, Any]] = Field(None, title='Options')
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
class CompilerTaskResult(BaseModel):
|
|
39
|
+
meta_data: Any = Field(..., title='Meta Data')
|
|
40
|
+
status: str = Field(..., title='Status')
|
|
41
|
+
status_message: Optional[str] = Field(..., title='Status Message')
|
|
42
|
+
start_date_time: Optional[str] = Field(..., title='Start Date Time')
|
|
43
|
+
end_date_time: Optional[str] = Field(..., title='End Date Time')
|
|
44
|
+
total_runtime: Optional[float] = Field(..., title='Total Runtime')
|
|
45
|
+
compiled_circuit: Optional[Union[str,List[str]]] = Field(..., title='Compiled Circuit')
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class Primitive(Enum):
|
|
49
|
+
sampling = 'sampling'
|
|
50
|
+
quantum_state = 'quantum_state'
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class QPUOptions(BaseModel):
|
|
54
|
+
class Config:
|
|
55
|
+
extra = Extra.forbid
|
|
56
|
+
|
|
57
|
+
coupling_map: Optional[List[List[conint(ge=0)]]] = Field(None, title='Coupling Map')
|
|
58
|
+
basis_gates: Optional[List[str]] = Field(None, title='Basis Gates')
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class QPUStatus(Enum):
|
|
62
|
+
idle = 'idle'
|
|
63
|
+
running = 'running'
|
|
64
|
+
offline = 'offline'
|
|
65
|
+
maintenance = 'maintenance'
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class QPUTaskBase(BaseModel):
|
|
69
|
+
total_shots: Optional[conint(ge=1, le=1000000)] = Field(1, title='Total Shots')
|
|
70
|
+
qpu_id: int = Field(..., title='Qpu Id')
|
|
71
|
+
primitive: Optional[Primitive] = 'sampling'
|
|
72
|
+
qpu_options: Optional[QPUOptions]
|
|
73
|
+
class Config:
|
|
74
|
+
use_enum_values = True
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class QPUTaskResult(BaseModel):
|
|
78
|
+
meta_data: Any = Field(..., title='Meta Data')
|
|
79
|
+
status: str = Field(..., title='Status')
|
|
80
|
+
status_message: Optional[str] = Field(..., title='Status Message')
|
|
81
|
+
start_date_time: Optional[str] = Field(..., title='Start Date Time')
|
|
82
|
+
end_date_time: Optional[str] = Field(..., title='End Date Time')
|
|
83
|
+
total_runtime: Optional[float] = Field(..., title='Total Runtime')
|
|
84
|
+
data: Optional[str] = Field(..., title='Data')
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class Technology(Enum):
|
|
88
|
+
statevector_simulator = 'statevector_simulator'
|
|
89
|
+
trapped_ions = 'trapped_ions'
|
|
90
|
+
neutral_atoms = 'neutral_atoms'
|
|
91
|
+
vacancy_centers = 'vacancy_centers'
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class ValidationError(BaseModel):
|
|
95
|
+
loc: List[Union[str, int]] = Field(..., title='Location')
|
|
96
|
+
msg: str = Field(..., title='Message')
|
|
97
|
+
type: str = Field(..., title='Error Type')
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class HTTPValidationError(BaseModel):
|
|
101
|
+
detail: Optional[List[ValidationError]] = Field(None, title='Detail')
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class JobInfo(BaseModel):
|
|
105
|
+
circuit: str = Field(..., title='Circuit')
|
|
106
|
+
primitive: Optional[Primitive] = 'sampling'
|
|
107
|
+
name: constr(min_length=1, max_length=64) = Field(..., title='Name')
|
|
108
|
+
comment: Optional[constr(min_length=0, max_length=512)] = Field(
|
|
109
|
+
..., title='Comment'
|
|
110
|
+
)
|
|
111
|
+
job_id: UUID = Field(..., title='Job Id')
|
|
112
|
+
submission_date_time: datetime = Field(..., title='Submission Date Time')
|
|
113
|
+
status: str = Field(..., title='Status')
|
|
114
|
+
status_message: Optional[str] = Field(..., title='Status Message')
|
|
115
|
+
qpu_name: str = Field(..., title='Qpu Name')
|
|
116
|
+
last_compiler_task: Optional[CompilerTaskBase]
|
|
117
|
+
last_qpu_task: Optional[QPUTaskBase]
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class JobResult(BaseModel):
|
|
121
|
+
status: str = Field(..., title='Status')
|
|
122
|
+
status_message: Optional[str] = Field(..., title='Status Message')
|
|
123
|
+
start_date_time: Optional[str] = Field(..., title='Start Date Time')
|
|
124
|
+
end_date_time: Optional[str] = Field(..., title='End Date Time')
|
|
125
|
+
total_runtime: Optional[float] = Field(..., title='Total Runtime')
|
|
126
|
+
last_compiler_result: Optional[CompilerTaskResult]
|
|
127
|
+
last_qpu_result: Optional[QPUTaskResult]
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
class JobSubmission(BaseModel):
|
|
131
|
+
circuit: str = Field(..., title='Circuit')
|
|
132
|
+
primitive: Optional[Primitive] = 'sampling'
|
|
133
|
+
name: constr(min_length=1, max_length=64) = Field(..., title='Name')
|
|
134
|
+
comment: Optional[constr(min_length=0, max_length=512)] = Field(
|
|
135
|
+
..., title='Comment'
|
|
136
|
+
)
|
|
137
|
+
tasks: List[Union[CompilerTaskBase, QPUTaskBase]] = Field(..., title='Tasks')
|
|
138
|
+
class Config:
|
|
139
|
+
use_enum_values = True
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class QPUTable(BaseModel):
|
|
143
|
+
manufacturer: str = Field(..., title='Manufacturer')
|
|
144
|
+
name: str = Field(..., title='Name')
|
|
145
|
+
technology: Technology
|
|
146
|
+
status: QPUStatus
|
|
147
|
+
number_of_qubits_available: PositiveInt = Field(
|
|
148
|
+
..., title='Number Of Qubits Available'
|
|
149
|
+
)
|
|
150
|
+
circuit_depth_limit: conint(ge=0) = Field(..., title='Circuit Depth Limit')
|
|
151
|
+
shot_limit: PositiveInt = Field(..., title='Shot Limit')
|
|
152
|
+
description: Optional[constr(min_length=0, max_length=512)] = Field(
|
|
153
|
+
..., title='Description'
|
|
154
|
+
)
|
|
155
|
+
time_limit: PositiveFloat = Field(..., title='Time Limit')
|
|
156
|
+
measurement_required: Optional[bool] = Field(..., title='Measurement Required')
|
|
157
|
+
qpu_id: int = Field(..., title='Qpu Id')
|
|
158
|
+
qpu_alias: str = Field(..., title='Qpu Alias')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "hequate_common"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
|
|
5
|
+
[tool.poetry]
|
|
6
|
+
name = "hequate_common"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = ""
|
|
9
|
+
authors = ["Hequate Software Team"]
|
|
10
|
+
packages = [
|
|
11
|
+
{include = "hequate_common", from = ".."}
|
|
12
|
+
]
|
|
13
|
+
|
|
14
|
+
[tool.poetry.dependencies]
|
|
15
|
+
python = "3.12.7"
|
|
16
|
+
|
|
17
|
+
[build-system]
|
|
18
|
+
requires = ["poetry-core"]
|
|
19
|
+
build-backend = "poetry.core.masonry.api"
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
53
|
+
|
|
54
|
+
# Translations
|
|
55
|
+
*.mo
|
|
56
|
+
*.pot
|
|
57
|
+
|
|
58
|
+
# Django stuff:
|
|
59
|
+
*.log
|
|
60
|
+
local_settings.py
|
|
61
|
+
db.sqlite3
|
|
62
|
+
db.sqlite3-journal
|
|
63
|
+
|
|
64
|
+
# Flask stuff:
|
|
65
|
+
instance/
|
|
66
|
+
.webassets-cache
|
|
67
|
+
|
|
68
|
+
# Sphinx documentation
|
|
69
|
+
docs/_build/
|
|
70
|
+
|
|
71
|
+
# PyBuilder
|
|
72
|
+
target/
|
|
73
|
+
|
|
74
|
+
# Jupyter Notebook
|
|
75
|
+
.ipynb_checkpoints
|
|
76
|
+
|
|
77
|
+
# IPython
|
|
78
|
+
profile_default/
|
|
79
|
+
ipython_config.py
|
|
80
|
+
|
|
81
|
+
# pyenv
|
|
82
|
+
.python-version
|
|
83
|
+
|
|
84
|
+
# pipenv
|
|
85
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
86
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
87
|
+
# having no cross-platform support, pipenv may install dependencies that don’t work, or not
|
|
88
|
+
# install all needed dependencies.
|
|
89
|
+
#Pipfile.lock
|
|
90
|
+
|
|
91
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
92
|
+
**/__pypackages__/
|
|
93
|
+
|
|
94
|
+
# Celery stuff
|
|
95
|
+
celerybeat-schedule
|
|
96
|
+
celerybeat.pid
|
|
97
|
+
|
|
98
|
+
# SageMath parsed files
|
|
99
|
+
*.sage.py
|
|
100
|
+
|
|
101
|
+
# Environments
|
|
102
|
+
.env
|
|
103
|
+
.venv
|
|
104
|
+
env/
|
|
105
|
+
venv/
|
|
106
|
+
ENV/
|
|
107
|
+
env.bak/
|
|
108
|
+
venv.bak/
|
|
109
|
+
|
|
110
|
+
# Spyder project settings
|
|
111
|
+
.spyderproject
|
|
112
|
+
.spyproject
|
|
113
|
+
|
|
114
|
+
# Rope project settings
|
|
115
|
+
.ropeproject
|
|
116
|
+
|
|
117
|
+
# mkdocs documentation
|
|
118
|
+
/site
|
|
119
|
+
|
|
120
|
+
# mypy
|
|
121
|
+
.mypy_cache/
|
|
122
|
+
.dmypy.json
|
|
123
|
+
dmypy.json
|
|
124
|
+
|
|
125
|
+
# Pyre type checker
|
|
126
|
+
.pyre/
|
|
127
|
+
|
|
128
|
+
# profiling data
|
|
129
|
+
.prof
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# qciconnect_common
|
|
2
|
+
|
|
3
|
+
The qciconnect_common component contains packages or modules that can be shared and reused across all other components. The component is seperated into different sub-components based on their related technical background or functionality. The component can be included in other services by including
|
|
4
|
+
|
|
5
|
+
[tool.poetry.dependencies]
|
|
6
|
+
...
|
|
7
|
+
qciconnect_common = {path = "../commons/qciconnect_common/"}
|
|
8
|
+
...
|
|
9
|
+
|
|
10
|
+
in the respective pyproject.toml file. Don't forget to include the relevant packages also in your Dockerfiles (see Orchestrator Dockerfile).
|
|
11
|
+
|
|
12
|
+
Please be aware that the command `poetry install` is not necessary for this module, as there is no need to set up an independent Python environment and the component isn't designed to operate autonomously. The existing pyproject.toml file merely provides essential information about the module, and its purpose is to facilitate the module's integration into other services.
|
|
13
|
+
|
|
14
|
+
## qciconnect_logging
|
|
15
|
+
|
|
16
|
+
Within this qciconnect_common package, a logger is setup for universal application across all components of the platform. This logger is imbued with an array of formatting options specifically designed to streamline the debugging process. It allows users to seamlessly import and apply it to their individual services or modules, thereby ensuring uniformly formatted and consistent logging information across the complete platform. At this stage, log outputs are solely directed to the console. However, it is our future intention to accumulate these logs, particularly within a production environment setting.
|
|
17
|
+
|
|
18
|
+
## qciconnect_scheduler
|
|
19
|
+
|
|
20
|
+
Contains a celery app factory with default connection strings. To be used by all other services that require a Celery instance.
|
|
21
|
+
|
|
22
|
+
## qciconnect_settings
|
|
23
|
+
|
|
24
|
+
Holds environmental variable settings. Env variables defined in a .env file will automatically populate in a corresponding Python class `EnvironmentSettings`. The `get_settings` method can be used to access the variables in different services.
|
|
25
|
+
|
|
26
|
+
## qciconnect_conversion
|
|
27
|
+
|
|
28
|
+
Provides various helper classes with methods for conversion between data formats, for which no onboard tools exist, e.g., between JSON compatible strings and complex numbers, Numpy arrays, datetime, etc.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Init file for qciconnect_common module."""
|