Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d89f614
issue templates
masa10-f Dec 10, 2024
f518604
PR template
masa10-f Dec 10, 2024
00d67e7
changelog
masa10-f Dec 10, 2024
6942c3e
try to add workflow with empty repo
masa10-f Feb 17, 2025
80a1c78
create __init__
masa10-f Feb 17, 2025
685a78f
setup toml file
masa10-f Feb 17, 2025
ccd5e5b
create directories
masa10-f Feb 17, 2025
36daa27
setup requirements
masa10-f Feb 17, 2025
bb5bc79
mypy ymk
masa10-f Feb 17, 2025
b695c37
add pyright workflow
masa10-f Feb 17, 2025
49185ff
add ruff workflow
masa10-f Feb 17, 2025
a27685f
implement common
masa10-f Feb 17, 2025
4987858
add dtype in doc
masa10-f Feb 17, 2025
4a617d4
add unit test
masa10-f Feb 17, 2025
ecd6e1a
fix ruff error
masa10-f Feb 17, 2025
44d17b2
extend numpy version
masa10-f Feb 18, 2025
4cacca5
confiure dependabot
masa10-f Feb 18, 2025
5503caa
add auto-merge workflow
masa10-f Feb 18, 2025
d15ecd8
ignore major version update of numpy
masa10-f Feb 18, 2025
2c68344
merge type checking workflows
masa10-f Feb 18, 2025
b384824
check version of github-actions
masa10-f Feb 18, 2025
eacfc03
add doc
masa10-f Feb 18, 2025
c57c9e0
edit python version
masa10-f Feb 18, 2025
0c7f277
specify package versions
masa10-f Feb 18, 2025
dcb30ba
add empty lines
masa10-f Feb 19, 2025
7a77c59
:wrench: Remove dead rule
EarlMilktea Feb 20, 2025
7926fc1
:recycle: Remove get_ prefix
EarlMilktea Feb 20, 2025
05d48c7
:recycle: Specify dtype
EarlMilktea Feb 20, 2025
504f84b
:heavy_plus_sign: Add typing_extensions
EarlMilktea Feb 20, 2025
d6b3cb1
:recycle: Improve type stability
EarlMilktea Feb 20, 2025
bf0b4e8
:recycle: Add override deco
EarlMilktea Feb 20, 2025
4f6a20e
add sphinx conf
d1ssk Feb 23, 2025
ac76bfe
add sphinx in requirements-dev
masa10-f Feb 24, 2025
43cf20b
remove .DS_store from gitignore
masa10-f Feb 24, 2025
2d8e253
downgrade sphinx version
masa10-f Feb 24, 2025
a0decad
:construction_worker: Add doc CI
EarlMilktea Feb 25, 2025
f931f4c
:wrench: Setup doc config
EarlMilktea Feb 25, 2025
109073b
:construction_worker: Save built docs
EarlMilktea Feb 25, 2025
80c20d3
:memo: Add empty line
EarlMilktea Feb 25, 2025
d18dd49
make autodoc_typehints mode description
masa10-f Feb 25, 2025
f377fd8
update docstring in common
masa10-f Feb 25, 2025
a7ecaeb
update config of sphinx
masa10-f Feb 25, 2025
598cb87
update the doc of common
masa10-f Feb 25, 2025
53bb8d0
try mock import enum
masa10-f Feb 25, 2025
581a126
delete mock import
masa10-f Feb 25, 2025
87d3e88
manually describe enum docs
masa10-f Feb 25, 2025
7d4bbaf
use ` for hyperref
masa10-f Feb 25, 2025
a18f09b
remove duplicated attribute docstring in PlannerMeasBasis
masa10-f Feb 25, 2025
863df81
remove backquote except for graphix-zx classes
masa10-f Feb 25, 2025
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
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Bug report
about: Report a bug
title: "[Bug]: "
labels: bug
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**

- OS: [e.g. Windows11, macOS Sequoia]
- Python version: [e.g. 3.12.1]
- Related module versions if applicable: [e.g. numpy=2.2.0]

**Additional context**
Add any other context about the problem here.
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: new feature
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is.

**Describe the feature you'd like**
A clear and concise description of what you want to happen.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 5
ignore:
- dependency-name: "numpy"
update-types: ["version-update:semver-major"]
- package-ecosystem: "github-actions"
directory: "/.github/workflows"
schedule:
interval: "weekly"
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Before submitting, please check the following:

- Make sure you have tests for the new code and that test passes (run `pytest`)
- If applicable, add a line to the [unreleased] part of CHANGELOG.md, following [keep-a-changelog](https://keepachangelog.com/en/1.0.0/).
- Format added code by `ruff`
- Type checking by `mypy` and `pyright`
- Make sure the checks (github actions) pass.
- Check that the docs compile without errors (run `make html` in `./docs/` - you may need to install dependency for sphinx docs, see `docs/requirements.txt`.)

Then, please fill in below:

**Context (if applicable):**

**Description of the change:**

**Related issue:**
24 changes: 24 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Auto-merge Dependabot PRs

on:
pull_request:
branches:
- main
types:
- opened
- synchronize

jobs:
auto-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
steps:
- name: Approve PR
run: gh pr review --approve "$PR_URL"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable auto-merge
run: gh pr merge --auto --squash "$PR_URL"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31 changes: 31 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: doc

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
check-doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- run: pip install --upgrade pip

- run: pip install -v -e .[dev]

- name: Make docs
run: sphinx-build -W docs/source docs/build

- name: Save docs
uses: actions/upload-artifact@v4
with:
name: html-docs
path: docs/build
34 changes: 34 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: pytest

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
standard:
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-2022", "macos-latest"]
python: ["3.9", "3.10", "3.11", "3.12"]

name: "Python ${{ matrix.python }} / ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- run: |
python -m pip install --upgrade pip
pip install .[dev]
pytest
31 changes: 31 additions & 0 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: ruff

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
ruff_check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: chartboost/ruff-action@v1

ruff_format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: chartboost/ruff-action@v1
with:
args: "format --check"

- uses: chartboost/ruff-action@v1
with:
args: "check --select I"
27 changes: 27 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Type Checking

on:
pull_request:
workflow_dispatch:

permissions:
contents: read

jobs:
typecheck:
runs-on: ubuntu-latest
strategy:
matrix:
tool: [mypy, pyright]

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: 3.9

- run: |
python3 -m pip install -U pip
pip install .[dev]
${{ matrix.tool }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Custom stuff
docs/source/gallery
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# 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
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
1 change: 1 addition & 0 deletions docs/source/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Sphinx documentation package for graphix-zx."""
84 changes: 84 additions & 0 deletions docs/source/common.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
Common
========

:mod:`graphix_zx.common` module
++++++++++++++++++++++++++++++++

.. automodule:: graphix_zx.common

Enums
-----

.. class:: graphix_zx.common.Plane

Measurement planes for MBQC.

We distinguish the axial measurements from the planar measurements.

.. py:attribute:: XY

Arbitrary-angle measurement on the XY plane.

.. py:attribute:: YZ

Arbitrary-angle measurement on the YZ plane.

.. py:attribute:: XZ

Arbitrary-angle measurement on the XZ plane.

.. class:: graphix_zx.common.Axis

Measurement axis for Pauli measurement.

.. py:attribute:: X

Pauli X-axis.

.. py:attribute:: Y

Pauli Y-axis.

.. py:attribute:: Z

Pauli Z-axis.

.. class:: graphix_zx.common.Sign

Measurement sign for Pauli measurement.

.. py:attribute:: PLUS

Positive sign.

.. py:attribute:: MINUS

Negative sign.

Abstract Base Classes
---------------------

.. autoclass:: graphix_zx.common.MeasBasis
:members:
:undoc-members:
:show-inheritance:

Measurement Basis Classes
-------------------------

.. autoclass:: graphix_zx.common.PlannerMeasBasis
:members:
:undoc-members:
:show-inheritance:

.. autoclass:: graphix_zx.common.AxisMeasBasis
:members:
:undoc-members:
:show-inheritance:

Functions
---------

.. autofunction:: graphix_zx.common.default_meas_basis

.. autofunction:: graphix_zx.common.meas_basis
Loading