Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
a48d19e
copy euler of mf branch
masa10-f Mar 10, 2025
207e47a
edit TODOs
masa10-f Mar 10, 2025
9e8127f
add matrix utility method
masa10-f Mar 10, 2025
1e5bae9
add test for euler
masa10-f Mar 10, 2025
3d66021
add type-arg in NDArray
masa10-f Mar 10, 2025
1e1d818
add type-arg in matrix
masa10-f Mar 10, 2025
3c5477c
update test_euler
masa10-f Mar 10, 2025
904216a
write doc about euler
masa10-f Mar 10, 2025
d3621d2
update docstring of euler
masa10-f Mar 10, 2025
76da55e
create document of matrix.py
masa10-f Mar 10, 2025
e8279fe
update docstring of matrix
masa10-f Mar 10, 2025
3ba4c8b
fix func name
masa10-f Mar 10, 2025
5f6a021
update docstring
masa10-f Mar 10, 2025
687a94d
fix ruff error
masa10-f Mar 10, 2025
41272dd
Merge branch 'master' into euler
masa10-f Mar 14, 2025
0c4dda9
fix docstring
masa10-f Mar 16, 2025
eb63098
:construction_worker: Add pre-commit for basic text checks
EarlMilktea Mar 17, 2025
fbcbc18
:rotating_light: Format text files
EarlMilktea Mar 17, 2025
ea23f23
add intersphinx map
masa10-f Mar 24, 2025
767ff94
enable intersphinx for built-in and numpy func
masa10-f Mar 24, 2025
0b428d7
enable intersphinx in matrix.py
masa10-f Mar 24, 2025
4c0b02a
add shape check
masa10-f Mar 24, 2025
203141b
use generic type
masa10-f Mar 24, 2025
0b2649e
stabilize type
masa10-f Mar 24, 2025
9784fad
fix type error
masa10-f Mar 24, 2025
157f3d3
use list[Plane]
masa10-f Mar 24, 2025
cbb7241
enable PLC2701 in tests
masa10-f Mar 24, 2025
b6dc384
make two funcs public
masa10-f Mar 24, 2025
090829f
update test and doc
masa10-f Mar 24, 2025
0fec537
Merge remote-tracking branch 'origin/euler-ss' into euler
masa10-f Mar 24, 2025
9f66199
version switch for type error
masa10-f Mar 24, 2025
ee09954
fix typo in docstring
masa10-f Mar 26, 2025
93f06a2
:memo: Strip class specifiers
EarlMilktea Apr 1, 2025
8bab9e9
:memo: Add auto links
EarlMilktea Apr 1, 2025
58125b9
:heavy_plus_sign: Add mathjax plugin
EarlMilktea Apr 1, 2025
81d6789
:construction: Use :math:
EarlMilktea Apr 1, 2025
2031d16
:construction: Improve type stability
EarlMilktea Apr 1, 2025
192c0c3
Merge branch 'master' into euler
masa10-f Apr 1, 2025
5043ba8
replace with list(Plane)
masa10-f Apr 1, 2025
47977b1
fix calculation
masa10-f Apr 1, 2025
67e078b
use math rendering
masa10-f Apr 1, 2025
4dc5544
:safety_vest: Check element size
EarlMilktea Apr 3, 2025
38fa38d
:recycle: Improve type stability
EarlMilktea Apr 3, 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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ A clear and concise description of what you expected to happen.
- Related module versions if applicable: [e.g. numpy=2.2.0]

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ A clear and concise description of what the problem is.
A clear and concise description of what you want to happen.

**Additional context**
Add any other context or screenshots about the feature request here.
Add any other context or screenshots about the feature request here.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ Then, please fill in below:

**Description of the change:**

**Related issue:**
**Related issue:**
12 changes: 12 additions & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,15 @@ jobs:
with:
name: html-docs
path: docs/build

lint-text:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

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

- name: Run language-agnostic linters
uses: pre-commit/action@v3.0.1
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
12 changes: 6 additions & 6 deletions docs/source/common.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,27 @@ Enums
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
Expand All @@ -52,7 +52,7 @@ Enums
Positive sign.

.. py:attribute:: MINUS

Negative sign.

Abstract Base Classes
Expand Down
6 changes: 6 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"sphinx.ext.autosectionlabel",
"sphinx.ext.mathjax",
"sphinx.ext.napoleon",
"sphinx_gallery.gen_gallery",
]
Expand All @@ -43,6 +44,11 @@
html_title = " "
# html_static_path = ["_static"]

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"numpy": ("https://numpy.org/doc/stable/", None),
}

html_context = {
"mode": "production",
}
Expand Down
35 changes: 35 additions & 0 deletions docs/source/euler.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Euler
=====

:mod:`graphix_zx.euler` module
++++++++++++++++++++++++++++++

.. automodule:: graphix_zx.euler

Local Operators
---------------

.. autoclass:: graphix_zx.euler.LocalUnitary
:members:
:show-inheritance:

.. autoclass:: graphix_zx.euler.LocalClifford
:members:
:show-inheritance:

Functions
---------

.. autofunction:: graphix_zx.euler.euler_decomposition

.. autofunction:: graphix_zx.euler.bloch_sphere_coordinates

.. autofunction:: graphix_zx.euler.is_close_angle

.. autofunction:: graphix_zx.euler.is_clifford_angle

.. autofunction:: graphix_zx.euler.meas_basis_info

.. autofunction:: graphix_zx.euler.update_lc_lc

.. autofunction:: graphix_zx.euler.update_lc_basis
12 changes: 12 additions & 0 deletions docs/source/matrix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Matrix
======

:mod:`graphix_zx.matrix` module
+++++++++++++++++++++++++++++++

.. automodule:: graphix_zx.matrix

Functions
---------

.. autofunction:: graphix_zx.matrix.is_unitary
4 changes: 3 additions & 1 deletion docs/source/references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ Module reference
.. toctree::
:maxdepth: 2

common
common
euler
matrix
2 changes: 1 addition & 1 deletion examples/readme.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Graphix-zx examples
====================

Here are a few examples.
Here are a few examples.
18 changes: 9 additions & 9 deletions graphix_zx/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ def angle(self) -> float:

Returns
-------
float
`float`
measurement angle
"""
return self.__angle

@typing_extensions.override
def vector(self) -> NDArray[np.complex128]:
"""Return the measurement basis vector.
r"""Return the measurement basis vector.

Returns
-------
NDArray[np.complex128]
`numpy.typing.NDArray`\[`numpy.complex128`\]
measurement basis vector
"""
return meas_basis(self.plane, self.angle)
Expand Down Expand Up @@ -193,7 +193,7 @@ def angle(self) -> float:

Returns
-------
float
`float`
measurement angle

Raises
Expand All @@ -212,11 +212,11 @@ def angle(self) -> float:

@typing_extensions.override
def vector(self) -> NDArray[np.complex128]:
"""Return the measurement basis vector.
r"""Return the measurement basis vector.

Returns
-------
NDArray[np.complex128]
`numpy.typing.NDArray`\[`numpy.complex128`\]
measurement basis vector
"""
return meas_basis(self.plane, self.angle)
Expand All @@ -236,18 +236,18 @@ def default_meas_basis() -> PlannerMeasBasis:


def meas_basis(plane: Plane, angle: float) -> NDArray[np.complex128]:
"""Return the measurement basis vector corresponding to the plane and angle.
r"""Return the measurement basis vector corresponding to the plane and angle.

Parameters
----------
plane : `Plane`
measurement plane
angle : float
angle : `float`
measurement angle

Returns
-------
NDArray[np.complex128]
`numpy.typing.NDArray`\[`numpy.complex128`\]
measurement basis vector

Raises
Expand Down
Loading