Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Bootstrap experimental, toggleable high-performance backend for Quil programs. #1755

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
505b5a8
test: setup benchmarking
MarquessV Mar 15, 2024
f11b491
split pyquil into python package and rust core
MarquessV Mar 24, 2024
b0f2f08
merge benchmarks
MarquessV Mar 24, 2024
80853a6
get benchmark working
MarquessV Mar 24, 2024
77d1157
fix typo in docstring
MarquessV Mar 25, 2024
3e95298
update bench fixture, re-enable pyquil DefCalibration
MarquessV Mar 25, 2024
6bff4f9
fix expression number conversion, reduce boilerplate in calibration
MarquessV Mar 25, 2024
2c8c8ea
remove grpc-web ref
MarquessV Mar 25, 2024
3294a3c
remove unused imports, apply cleanup to declaration
MarquessV Mar 25, 2024
60a97f1
add reversed From<GateModifier> so enums dont drift
MarquessV Mar 25, 2024
e8acd63
cleanup instruction module, add comment explaining deepcopy
MarquessV Mar 25, 2024
22b7324
clarify doc comments
MarquessV Mar 25, 2024
d797814
add __str__, __repr__ to program
MarquessV Mar 25, 2024
9258898
remove unused doc string
MarquessV Mar 25, 2024
be5c1c8
break up setstate method
MarquessV Mar 25, 2024
a3194d6
fix error message
MarquessV Mar 25, 2024
6e5cf18
revert test case changes
MarquessV Mar 25, 2024
0009a5f
Rust backend is toggle-able
MarquessV May 20, 2024
75696ec
move import
MarquessV May 20, 2024
c84cf63
fix docstring
MarquessV May 20, 2024
64f3fd7
restore build backend
MarquessV May 20, 2024
9ac6ad1
remove unneeded module
MarquessV May 20, 2024
f492c36
fix fixed-qubit test
MarquessV May 23, 2024
f05d4f1
Merge branch 'master' into rustiffi
MarquessV May 23, 2024
19ab61f
remove nest_asyncio
MarquessV May 23, 2024
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ coverage.xml
*,cover
.hypothesis/
.pytest_cache/
prof/

# Translations
*.mo
Expand Down Expand Up @@ -189,3 +190,8 @@ fabric.properties


node_modules/


# Added by cargo

/target
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,8 @@ docs/quil/grammars/Quil.g4:
.PHONY: generate-parser
generate-parser: docs/quil/grammars/Quil.g4
cd docs/quil/grammars && antlr -Dlanguage=Python3 -o ../../../pyquil/_parser/gen3 Quil.g4

.PHONY: benchmark
benchmark:
pytest -v test/bench --benchmark-only --profile

132 changes: 119 additions & 13 deletions poetry.lock

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

92 changes: 82 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
[project]
name = "pyquil"
requires-python = ">=3.8"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

[tool.poetry]
name = "pyquil"
version = "4.8.0"
MarquessV marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -12,7 +28,6 @@ classifiers = [
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Operating System :: OS Independent",
]
keywords = ["quantum", "quil", "programming", "hybrid"]
packages = [{ include = "pyquil" }]
Expand All @@ -31,6 +46,8 @@ tenacity = "^8.2.2"
types-python-dateutil = "^2.8.19"
types-retry = "^0.9.9"
packaging = "^23.1"
deprecated = "^1.2.13"
types-deprecated = "^1.2.9.2"

# latex extra
ipython = { version = "^7.21.0", optional = true }
Expand All @@ -44,24 +61,24 @@ pandoc = {version = "2.4b0", optional = true}
matplotlib = {version = "^3.7.1", optional = true}
matplotlib-inline = {version = "^0.1.6", optional = true}
seaborn = {version = "^0.12.2", optional = true}
deprecated = "^1.2.13"
types-deprecated = "^1.2.9.2"

[tool.poetry.dev-dependencies]
black = "^22.8.0"
flake8 = "^3.8.1"
pytest = "^7.4.0"
pytest-cov = "^4.1.0"
mypy = "^1.5.0"
ruff = "^0.3.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Side note, we can replace black and flake8 with ruff, as it contains the functionality of both.

toml = "^0.10.2"
pytest-xdist = "^3.3.1"
pytest-rerunfailures = "^12.0.0"
pytest-timeout = "^1.4.2"
pytest-mock = "^3.11.1"
pytest-benchmark = "^4.0.0"
pytest-profiling = "^1.7.0"
respx = "^0.20"
nest-asyncio = "^1.5.6"
mock = { version = "^4.0", python = "<3.8" }
syrupy = "^3.0.6"
maturin = "^1.5.0"

[tool.poetry.extras]
latex = ["ipython"]
Expand All @@ -71,9 +88,6 @@ docs = ["Sphinx", "sphinx-rtd-theme", "nbsphinx", "recommonmark", "pandoc", "mat
setuptools = {version = "^69.0.2", python = ">=3.12"}
mypy = "^1.8.0"

[tool.ruff]
line-length = 120

[tool.black]
line-length = 120
target-version = ['py38']
Expand All @@ -99,9 +113,67 @@ exclude = '''
)
'''

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
]
# Same as Black.
line-length = 120
indent-width = 4
# Assume Python 3.8
target-version = "py38"

[tool.ruff.lint]
select = ["D", "E4", "E7", "E9", "F", "I", "B", "S", "W"]
ignore = []
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

[tool.pytest.ini_options]
filterwarnings = ["ignore::DeprecationWarning:pyquil.*:", "ignore::DeprecationWarning:test.unit.*:"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["maturin>=1,<2"]
build-backend = "maturin"

[tool.maturin]
module-name = "pyquil._core"
5 changes: 0 additions & 5 deletions pyquil/__init__.py

This file was deleted.

21 changes: 0 additions & 21 deletions pyquil/simulation/__init__.py

This file was deleted.

Loading
Loading