-
Notifications
You must be signed in to change notification settings - Fork 21
/
pyproject.toml
223 lines (200 loc) · 6.02 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "qadence"
description = "Pasqal interface for circuit-based quantum computing SDKs"
readme = "README.md"
authors = [
{ name = "Aleksander Wennersteen", email = "[email protected]" },
{ name = "Gert-Jan Both", email = "[email protected]" },
{ name = "Niklas Heim", email = "[email protected]" },
{ name = "Mario Dagrada", email = "[email protected]" },
{ name = "Vincent Elfving", email = "[email protected]" },
{ name = "Dominik Seitz", email = "[email protected]" },
{ name = "Roland Guichard", email = "[email protected]" },
{ name = "Joao P. Moutinho", email = "[email protected]" },
{ name = "Vytautas Abramavicius", email = "[email protected]" },
{ name = "Gergana Velikova", email = "[email protected]" },
{ name = "Eduardo Maschio", email = "[email protected]" },
{ name = "Smit Chaudhary", email = "[email protected]" },
{ name = "Ignacio Fernández Graña", email = "[email protected]" },
{ name = "Charles Moussa", email = "[email protected]" },
{ name = "Giorgio Tosti Balducci", email = "[email protected]" },
{ name = "Daniele Cucurachi", email = "[email protected]" },
]
requires-python = ">=3.9"
license = { text = "Apache 2.0" }
version = "1.9.0"
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dependencies = [
"numpy",
"torch",
"openfermion",
"sympy<1.13",
"sympytorch>=0.1.2",
"rich",
"tensorboard>=2.12.0",
"deepdiff",
"jsonschema",
"nevergrad",
"scipy",
"pyqtorch==1.6.0",
"pyyaml",
"matplotlib",
"Arpeggio==2.0.2",
]
[tool.hatch.metadata]
allow-direct-references = true
allow-ambiguous-features = true
[project.optional-dependencies]
pulser = [
"pulser-core==1.1.1",
"pulser-simulation==1.1.1",
"pasqal-cloud==0.12.5",
]
visualization = [
"graphviz",
# FIXME: will be needed once we support latex labels
# "latex2svg @ git+https://github.com/Moonbase59/latex2svg.git#egg=latex2svg",
# "scour",
]
horqrux = [
"horqrux==0.6.2",
"jax",
"flax",
"optax",
"jaxopt",
"einops",
"sympy2jax",
]
protocols = ["qadence-protocols"]
libs = ["qadence-libs"]
dlprof = ["nvidia-pyindex", "nvidia-dlprof[pytorch]"]
mlflow = ["mlflow"]
all = ["pulser", "visualization", "protocols", "libs", "mlflow"]
[tool.hatch.envs.default]
dependencies = [
"flaky",
"hypothesis",
"pytest",
"pytest-cov",
"pytest-mypy",
"pytest-xdist",
"types-PyYAML",
"ipykernel",
"pre-commit",
"black",
"isort",
"ruff",
"pydocstringformatter",
]
features = ["pulser", "visualization", "horqrux", "mlflow"]
[tool.hatch.envs.default.scripts]
test = "pytest -n auto --cov-report lcov --cov-config=pyproject.toml --cov=qadence --cov=tests --ignore=./tests/test_examples.py {args}"
test-examples = "pytest ./tests/test_examples.py {args}"
no-cov = "cov --no-cov {args}"
test-docs = "mkdocs build --clean --strict"
test-all = "pytest -n auto {args} && mkdocs build --clean --strict"
[tool.pytest.ini_options]
markers = ["slow: marks tests as slow (deselect with '-m \"not slow\"')"]
testpaths = ["tests"]
addopts = """-vvv"""
xfail_strict = true
filterwarnings = [
"ignore:Call to deprecated create function FieldDescriptor",
"ignore:Call to deprecated create function Descriptor",
"ignore:Call to deprecated create function EnumDescriptor",
"ignore:Call to deprecated create function EnumValueDescriptor",
"ignore:Call to deprecated create function FileDescriptor",
"ignore:Call to deprecated create function OneofDescriptor",
"ignore:distutils Version classes are deprecated.",
"ignore::DeprecationWarning",
]
[tool.hatch.envs.docs]
dependencies = [
"mkdocs",
"mkdocs_autorefs<1.1.0",
"mkdocs-material",
"mkdocstrings",
"mkdocstrings-python",
"mkdocs-section-index",
"mkdocs-exclude",
"markdown-exec",
"mike",
]
features = ["pulser", "horqrux", "visualization", "mlflow"]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build --clean --strict"
serve = "mkdocs serve --dev-addr localhost:8000"
[[tool.hatch.envs.test.matrix]]
python = ["39", "310"]
[tool.hatch.envs.tests]
features = ["all"]
[tool.hatch.build.targets.sdist]
exclude = [
"/.gitignore",
"/.pre-commit-config.yml",
"/tests",
"/docs",
"/examples",
]
[tool.hatch.build.targets.wheel]
packages = ["qadence"]
[tool.coverage.run]
branch = true
parallel = true
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.ruff]
select = ["E", "F", "I", "Q"]
extend-ignore = ["F841", "F403"]
line-length = 100
[tool.ruff.isort]
required-imports = ["from __future__ import annotations"]
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401", "E402"]
"qadence/operations/primitive.py" = [
"E742",
] # Avoid ambiguous class name warning for identity.
"qadence/backends/horqrux/convert_ops.py" = [
"E741",
] # Avoid ambiguous class name warning for 0.
"examples/*" = ["E402"] # Allow torch seed to be set before qadence imports
[tool.ruff.mccabe]
max-complexity = 15
[tool.ruff.flake8-quotes]
docstring-quotes = "double"
[tool.black]
line-length = 100
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[tool.mypy]
python_version = "3.10"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
no_implicit_optional = false
ignore_missing_imports = true