Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 7 additions & 1 deletion graphix/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
"""Optimize and simulate measurement-based quantum computation."""
"""
Optimize and simulate measurement-based quantum computation.

This module provides tools and functionalities for optimizing and simulating measurement-based quantum computation (MBQC).

Measurement-based quantum computation is a model of quantum computation that uses entangled states and measurements to perform computations. This module implements various algorithms and techniques for effectively optimizing and simulating these quantum processes.
"""

from __future__ import annotations

Expand Down
53 changes: 50 additions & 3 deletions graphix/_db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
"""Database module for Graphix."""
"""
Database module for Graphix.

This module provides functionality to interact with the Graphix database,
enabling operations such as data retrieval, insertion, updating, and deletion
of records within the Graphix application.
"""

from __future__ import annotations

Expand Down Expand Up @@ -126,14 +132,55 @@


class _CM(NamedTuple):
"""Pauli string and sign."""
"""
Pauli string and sign.

Attributes
----------
pauli_string : str
A string representing the Pauli operation, such as 'X', 'Y', 'Z', or 'I'.
sign : int
The sign associated with the Pauli string, typically +1 or -1.

Methods
-------
__init__(pauli_string: str, sign: int)
Initializes the Pauli string and its sign.

__repr__()
Returns a string representation of the Pauli string with its sign.

__eq__(other)
Checks if two _CM instances are equal based on their Pauli strings and signs.
"""

pstr: IXYZ
sign: Sign


class _CMTuple(NamedTuple):
"""Container for three Pauli strings along X, Y and Z axes."""
"""
Container for three Pauli strings along the X, Y, and Z axes.

Attributes
----------
x : str
The Pauli string along the X axis.
y : str
The Pauli string along the Y axis.
z : str
The Pauli string along the Z axis.

Examples
--------
>>> pauli_tuple = _CMTuple('X', 'Y', 'Z')
>>> pauli_tuple.x
'X'
>>> pauli_tuple.y
'Y'
>>> pauli_tuple.z
'Z'
"""

x: _CM
y: _CM
Expand Down
Loading
Loading