diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 65e338d..0000000 --- a/.dockerignore +++ /dev/null @@ -1,7 +0,0 @@ -__pycache__ -*.pyc -*.pyo -*.pyd -*.egg-info -dist -build diff --git a/.github/workflows/pre-commit-au.yml b/.github/workflows/pre-commit-au.yml new file mode 100644 index 0000000..f7a86fc --- /dev/null +++ b/.github/workflows/pre-commit-au.yml @@ -0,0 +1,21 @@ +name: Pre-commit auto-update + +on: + # every day at midnight + schedule: + - cron: "0 0 * * *" + # on demand + workflow_dispatch: + +jobs: + upgrade: + uses: browniebroke/github-actions/.github/workflows/pre-commit-autoupdate.yml@v1 + secrets: + gh_pat: ${{ secrets.GITHUB_TOKEN }} + with: + # Inputs listed with their default (all optional) + config_path: ".pre-commit-config.yaml" # path is relative to repository root + python_version: "3.11" + branch_name: "update/pre-commit-hooks" + pull_request_title: "chore(deps): upgrade pre-commit dependencies" + commit_message: "chore(deps): upgrade pre-commit dependencies" diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 7c97d6f..cd44dc1 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -32,3 +32,14 @@ jobs: - name: Run tests run: | python -m pytest + - name: Sphinx documentation build + run: | + make docs + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v3 + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.python-version == '3.11' }} + with: + publish_branch: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/build/html/ + force_orphan: true diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..9cdb788 --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,35 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: +# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + deploy: + + runs-on: ubuntu-latest + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build + - name: Build package + run: python -m build + - name: Publish package + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 29224f1..af7b2a8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,34 +13,34 @@ repos: - id: debug-statements - repo: https://github.com/crate-ci/typos - rev: v1.16.21 + rev: v1.16.23 hooks: - id: typos - repo: https://github.com/keewis/blackdoc - rev: v0.3.8 + rev: v0.3.9 hooks: - id: blackdoc additional_dependencies: - black==23.10.1 - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.1.4 + rev: v0.1.5 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: 'v1.6.1' + rev: 'v1.7.0' hooks: - id: mypy pass_filenames: false args: [--package=pytket.phir, --package=tests] additional_dependencies: [ + phir, pytest, - pytket==1.21.0, pytket-quantinuum==0.25.0, + pytket==1.21.0, types-setuptools, - "phir", ] diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..82557a8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,17 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.0] - 2023-11-17 + +First release. + +[0.1.0]: https://github.com/CQCL/pytket-phir/commits/v0.1.0 +[unreleased]: https://github.com/CQCL/pytket-phir/compare/v0.1.0...HEAD + + diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 29fe139..0000000 --- a/Dockerfile +++ /dev/null @@ -1,13 +0,0 @@ -FROM python:3.10-slim - -# Set the working directory to /pytket-phir -WORKDIR /pytket-phir - -# Copy the pyproject.toml and requirements.txt files to the container -COPY . . - -# Install the dependencies -RUN pip install --no-cache-dir -r requirements.txt - -# Start the web server -CMD ["python", "-m", "pytket.phir.main"] diff --git a/MANIFEST.in b/MANIFEST.in index 32ebcd1..567cd32 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,10 +1,11 @@ -include *.toml +include *.md include *.txt include Makefile include mypy.ini recursive-include docs *.rst recursive-include docs Makefile recursive-include tests *.qasm -exclude Dockerfile -exclude .docker* -exclude .pre-commit* + +exclude .pre-commit-config.yaml +exclude mypy.ini +exclude ruff.toml diff --git a/Makefile b/Makefile index e166518..19129b6 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,10 @@ -.PHONY: tests lint clean build install dev docs +.PHONY: install dev tests lint docs clean build + +install: + pip install . + +dev: + pip install -e . tests: pytest -s -x -vv tests/test*.py @@ -6,18 +12,12 @@ tests: lint: pre-commit run --all-files +docs: + # sphinx-apidoc --implicit-namespaces -f -o docs/source/ pytket + sphinx-build -M html docs/source/ docs/build/ + clean: rm -rf *.egg-info dist build docs/build build: clean - python -m build --sdist -n - -install: - pip install . - -dev: - pip install -e . - -docs: - # sphinx-apidoc -f -o docs/source/ pytket - sphinx-build -M html docs/source/ docs/build/ + python -m build --sdist --wheel -n diff --git a/README.md b/README.md index b1d4ace..229110d 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,48 @@ # pytket-phir +[![PyPI version](https://badge.fury.io/py/pytket-phir.svg)](https://badge.fury.io/py/pytket-phir) +[![Python versions](https://img.shields.io/badge/python-3.10%20%7C%203.11-blue.svg)](https://img.shields.io/badge/python-3.10%2C%203.11-blue.svg) + PHIR stands for _[PECOS](https://github.com/PECOS-packages/PECOS) High-level Intermediate Representation_. See [PHIR specification](https://github.com/CQCL/phir/blob/main/spec.md) for more. +`pytket-phir` is a circuit analyzer and translator from [pytket](https://tket.quantinuum.com/api-docs/index.html) to PHIR. + +Also included is the CLI tool `phirc` that takes QASM programs as input and emulates them using PECOS. + +## Prerequisites + +Python >=3.10 + ## Installation -To install the project, clone the repository and run: +Just issue `pip install pytket-phir` to obtain the latest stable release. + +## phirc CLI + +The package includes a tool for emulating QASM files from the command line using PECOS. + +PECOS needs to be installed using `pip install .[phirc]` for the CLI to work. + +```sh +❯ phirc -h +usage: phirc [-h] [-m {H1-1,H1-2}] [-v] qasm_files [qasm_files ...] + +Emulates QASM program execution via PECOS + +positional arguments: + qasm_files One or more QASM files to emulate + +options: + -h, --help show this help message and exit + -m {H1-1,H1-2}, --machine {H1-1,H1-2} + machine name, H1-1 by default + -v, --version show program's version number and exit +``` + +## Development + +Clone the repository and run: ```sh python -m venv .venv @@ -15,7 +52,7 @@ pip install -r requirements.txt pre-commit install ``` -Then install the project using: +Then, install the project using: ```sh pip install -e . @@ -25,4 +62,4 @@ See `Makefile` for other useful commands. ## Testing -Just issue `pytest` from the root directory. +Issue `pytest` from the root directory. diff --git a/docs/source/conf.py b/docs/source/conf.py index 706657f..1b46ca5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: @@ -7,16 +15,17 @@ # add these directories to sys.path here. import pathlib import sys +from importlib.metadata import version as get_version -sys.path.insert(0, pathlib.Path("../../pytket").resolve().as_posix()) +sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix()) # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = "pytket.phir" -project_copyright = "2023, Quantinuum" -author = "Quantinuum" -release = "0.0.1" +project = "pytket-phir" +project_copyright = "2023, Quantinuum LLC" +author = "Quantinuum LLC" +release: str = ".".join(get_version("pytket-phir").split(".")[:2]) # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -24,7 +33,6 @@ extensions = [ "sphinx.ext.doctest", "sphinx.ext.autodoc", - "sphinx.ext.autosummary", "sphinx.ext.napoleon", ] @@ -34,4 +42,4 @@ # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = "sphinx_rtd_theme" +html_theme = "pydata_sphinx_theme" diff --git a/docs/source/index.rst b/docs/source/index.rst index cc722e8..83a2215 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -12,6 +12,21 @@ PHIR stands for `PECOS `__ specification `__ for more. +``pytket-phir`` is a circuit analyzer and translator from +`pytket `__ to PHIR. + +Also included is the CLI tool ``phirc`` that takes QASM programs as +input and emulates them using PECOS. + +Installation +------------ + +To install pytket-phir, simply run: + +.. code-block:: bash + + pip install pytket-phir + Indices and tables ================== diff --git a/docs/source/modules.rst b/docs/source/modules.rst index e1f1009..d8f9683 100644 --- a/docs/source/modules.rst +++ b/docs/source/modules.rst @@ -1,7 +1,7 @@ -pytket -====== +pytket.phir +=========== .. toctree:: :maxdepth: 4 - phir + pytket.phir diff --git a/docs/source/phir.rst b/docs/source/phir.rst deleted file mode 100644 index 197cefd..0000000 --- a/docs/source/phir.rst +++ /dev/null @@ -1,21 +0,0 @@ -phir package -============ - -Subpackages ------------ - -.. toctree:: - :maxdepth: 4 - - phir.sharding - -Submodules ----------- - -phir.main module ----------------- - -.. automodule:: phir.main - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/phir.sharding.rst b/docs/source/phir.sharding.rst deleted file mode 100644 index 9b65767..0000000 --- a/docs/source/phir.sharding.rst +++ /dev/null @@ -1,21 +0,0 @@ -phir.sharding package -===================== - -Submodules ----------- - -phir.sharding.shard module --------------------------- - -.. automodule:: phir.sharding.shard - :members: - :undoc-members: - :show-inheritance: - -phir.sharding.sharder module ----------------------------- - -.. automodule:: phir.sharding.sharder - :members: - :undoc-members: - :show-inheritance: diff --git a/docs/source/pytket.phir.rebasing.rst b/docs/source/pytket.phir.rebasing.rst new file mode 100644 index 0000000..cbb8e61 --- /dev/null +++ b/docs/source/pytket.phir.rebasing.rst @@ -0,0 +1,21 @@ +pytket.phir.rebasing package +============================ + +Submodules +---------- + +pytket.phir.rebasing.rebaser module +----------------------------------- + +.. automodule:: pytket.phir.rebasing.rebaser + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pytket.phir.rebasing + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pytket.phir.rst b/docs/source/pytket.phir.rst new file mode 100644 index 0000000..71b9436 --- /dev/null +++ b/docs/source/pytket.phir.rst @@ -0,0 +1,86 @@ +pytket.phir package +=================== + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + pytket.phir.rebasing + pytket.phir.sharding + +Submodules +---------- + +pytket.phir.api module +---------------------- + +.. automodule:: pytket.phir.api + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.cli module +---------------------- + +.. automodule:: pytket.phir.cli + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.machine module +-------------------------- + +.. automodule:: pytket.phir.machine + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.phirgen module +-------------------------- + +.. automodule:: pytket.phir.phirgen + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.place\_and\_route module +------------------------------------ + +.. automodule:: pytket.phir.place_and_route + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.placement module +---------------------------- + +.. automodule:: pytket.phir.placement + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.qtm\_machine module +------------------------------- + +.. automodule:: pytket.phir.qtm_machine + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.routing module +-------------------------- + +.. automodule:: pytket.phir.routing + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pytket.phir + :members: + :undoc-members: + :show-inheritance: diff --git a/docs/source/pytket.phir.sharding.rst b/docs/source/pytket.phir.sharding.rst new file mode 100644 index 0000000..7762799 --- /dev/null +++ b/docs/source/pytket.phir.sharding.rst @@ -0,0 +1,37 @@ +pytket.phir.sharding package +============================ + +Submodules +---------- + +pytket.phir.sharding.shard module +--------------------------------- + +.. automodule:: pytket.phir.sharding.shard + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.sharding.sharder module +----------------------------------- + +.. automodule:: pytket.phir.sharding.sharder + :members: + :undoc-members: + :show-inheritance: + +pytket.phir.sharding.shards2ops module +-------------------------------------- + +.. automodule:: pytket.phir.sharding.shards2ops + :members: + :undoc-members: + :show-inheritance: + +Module contents +--------------- + +.. automodule:: pytket.phir.sharding + :members: + :undoc-members: + :show-inheritance: diff --git a/pyproject.toml b/pyproject.toml index 450aaef..361c79c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ license = {file = "LICENSE"} authors = [{name = "Quantinuum"}] classifiers = [ + "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: BSD License", @@ -21,19 +22,20 @@ classifiers = [ "Topic :: Software Development :: Libraries :: Python Modules", "Typing :: Typed", ] - dynamic = ["version"] dependencies = ["phir>=0.1.6", "pytket"] [project.optional-dependencies] +docs = ["sphinx", "pydata_sphinx_theme"] +phirc = ["quantum-pecos@git+https://github.com/PECOS-packages/PECOS.git@e2e-testing"] tests = ["pytest"] -docs = ["sphinx", "sphinx-rtd-theme"] - [project.scripts] phirc = "pytket.phir.cli:main" [project.urls] +Changelog = "https://github.com/CQCL/pytket-phir/blob/main/CHANGELOG.md" +Documentation = "https://cqcl.github.io/pytket-phir/" Repository = "https://github.com/CQCL/pytket-phir.git" [tool.setuptools.packages.find] diff --git a/pytket/phir/api.py b/pytket/phir/api.py index 079c627..7a7570c 100644 --- a/pytket/phir/api.py +++ b/pytket/phir/api.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + import logging from typing import TYPE_CHECKING @@ -30,7 +38,7 @@ def pytket_to_phir( :param qtm_machine: (Optional) Quantinuum machine architecture to rebase against Returns: - ------- + -------- PHIR JSON as a str """ logger.info("Starting phir conversion process for circuit %s", circuit) diff --git a/pytket/phir/cli.py b/pytket/phir/cli.py index 672501b..18aa22e 100644 --- a/pytket/phir/cli.py +++ b/pytket/phir/cli.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + # mypy: disable-error-code="misc" from argparse import ArgumentParser @@ -21,10 +29,10 @@ def main() -> None: """pytket-phir compiler CLI.""" parser = ArgumentParser( prog="phirc", - description="Simulates QASM file via PECOS", + description="Emulates QASM program execution via PECOS", ) parser.add_argument( - "qasm_files", nargs="+", default=None, help="One or more QASM files to simulate" + "qasm_files", nargs="+", default=None, help="One or more QASM files to emulate" ) parser.add_argument( "-m", diff --git a/pytket/phir/machine.py b/pytket/phir/machine.py index 4096971..3421a6a 100644 --- a/pytket/phir/machine.py +++ b/pytket/phir/machine.py @@ -1,3 +1,12 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + + class Machine: """A machine info class for testing.""" diff --git a/pytket/phir/phirgen.py b/pytket/phir/phirgen.py index 4ac492b..36206de 100644 --- a/pytket/phir/phirgen.py +++ b/pytket/phir/phirgen.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + import json import logging from collections.abc import Sequence diff --git a/pytket/phir/place_and_route.py b/pytket/phir/place_and_route.py index aeaf0e3..42bee34 100644 --- a/pytket/phir/place_and_route.py +++ b/pytket/phir/place_and_route.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + from .machine import Machine from .placement import optimized_place from .routing import transport_cost diff --git a/pytket/phir/placement.py b/pytket/phir/placement.py index 722f488..c51ce9a 100644 --- a/pytket/phir/placement.py +++ b/pytket/phir/placement.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + import bisect import math diff --git a/pytket/phir/qtm_machine.py b/pytket/phir/qtm_machine.py index 1f80013..7981581 100644 --- a/pytket/phir/qtm_machine.py +++ b/pytket/phir/qtm_machine.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + from enum import Enum from .machine import Machine diff --git a/pytket/phir/rebasing/rebaser.py b/pytket/phir/rebasing/rebaser.py index cfc2585..0793b37 100644 --- a/pytket/phir/rebasing/rebaser.py +++ b/pytket/phir/rebasing/rebaser.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + from pytket.circuit import Circuit from pytket.extensions.quantinuum.backends.api_wrappers import QuantinuumAPIOffline from pytket.extensions.quantinuum.backends.quantinuum import ( diff --git a/pytket/phir/routing.py b/pytket/phir/routing.py index 53bcb1c..02cc443 100644 --- a/pytket/phir/routing.py +++ b/pytket/phir/routing.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + from __future__ import annotations diff --git a/pytket/phir/sharding/shard.py b/pytket/phir/sharding/shard.py index 685aaa3..da4b1be 100644 --- a/pytket/phir/sharding/shard.py +++ b/pytket/phir/sharding/shard.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + import io from dataclasses import dataclass, field from itertools import count diff --git a/pytket/phir/sharding/sharder.py b/pytket/phir/sharding/sharder.py index a208c84..4a47d1d 100644 --- a/pytket/phir/sharding/sharder.py +++ b/pytket/phir/sharding/sharder.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + import logging from typing import cast diff --git a/pytket/phir/sharding/shards2ops.py b/pytket/phir/sharding/shards2ops.py index 81068d2..aac7148 100644 --- a/pytket/phir/sharding/shards2ops.py +++ b/pytket/phir/sharding/shards2ops.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + from typing import TypeAlias from .shard import Shard, ShardLayer diff --git a/requirements.txt b/requirements.txt index 8e514db..e8aad5f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,8 +2,11 @@ build==1.0.3 mypy==1.7.0 phir==0.1.6 pre-commit==3.5.0 +pydata_sphinx_theme==0.14.3 pytest==7.4.3 pytket-quantinuum==0.25.0 pytket==1.21.0 ruff==0.1.5 +setuptools_scm==8.0.4 +sphinx==7.2.6 wheel==0.41.3 diff --git a/ruff.toml b/ruff.toml index e208b3a..018f34f 100644 --- a/ruff.toml +++ b/ruff.toml @@ -2,7 +2,6 @@ target-version = "py310" line-length = 88 - preview = true select = [ @@ -17,6 +16,7 @@ select = [ "C4", # flake8-comprehensions # "C90", # mccabe "COM", # flake8-commas + "CPY", # flake8-copyright "D", # pydocstyle "EM", # flake8-errmsg "ERA", # eradicate @@ -71,7 +71,7 @@ ignore = [ ] [per-file-ignores] -"__init__.py" = ["F401", "D104"] # module imported but unused; Missing docstring in public package +"__init__.py" = ["F401", "D104", "CPY001"] # module imported but unused; Missing docstring in public package "docs/*" = [ "INP001", # File * is part of an implicit namespace package. Add an `__init__.py`. ] @@ -89,5 +89,8 @@ convention = "google" [pylint] max-args = 6 +[flake8-copyright] +author = "Quantinuum LLC" + [format] preview = true diff --git a/tests/e2e_test.py b/tests/e2e_test.py index 3409d78..0193d92 100644 --- a/tests/e2e_test.py +++ b/tests/e2e_test.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + from phir.model import PHIRModel from rich import print diff --git a/tests/sample_data.py b/tests/sample_data.py index c11fc88..f8bd0f1 100644 --- a/tests/sample_data.py +++ b/tests/sample_data.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + from enum import Enum, auto from pathlib import Path diff --git a/tests/test_api.py b/tests/test_api.py index 28b7fa8..c46a4ba 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + import logging import pytest diff --git a/tests/test_placement.py b/tests/test_placement.py index 220020b..ae2e7e5 100644 --- a/tests/test_placement.py +++ b/tests/test_placement.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + # Tests for qubit routing import pytest diff --git a/tests/test_rebaser.py b/tests/test_rebaser.py index ceeca49..8daab41 100644 --- a/tests/test_rebaser.py +++ b/tests/test_rebaser.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + import logging from pytket.circuit import Circuit, OpType diff --git a/tests/test_sharder.py b/tests/test_sharder.py index 7c7c55d..f0628a6 100644 --- a/tests/test_sharder.py +++ b/tests/test_sharder.py @@ -1,3 +1,11 @@ +############################################################################## +# +# Copyright (c) 2023 Quantinuum LLC All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. +# +############################################################################## + from typing import cast from pytket.circuit import Conditional, Op, OpType