Skip to content
Open
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
__pycache__/
*.DS_Store
.venv
*.egg-info/
*/_version.py
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ reportUnknownVariableType = "information"
reportInvalidTypeVarUse = "error"

[tool.uv.sources]
graphix = { git = "https://github.com/TeamGraphix/graphix.git" }
graphix = { git = "https://github.com/matulni/graphix.git", rev = "rename_methods" }
17 changes: 7 additions & 10 deletions tests/test_graphix_pyzx.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@

import numpy as np
import pytest
from numpy.random import PCG64, Generator

import pyzx as zx
from graphix.fundamentals import ANGLE_PI
from graphix.random_objects import rand_circuit
from graphix.transpiler import Circuit

import pyzx as zx
from pyzx.generate import cliffordT as clifford_t

from graphix_pyzx import from_pyzx_graph, to_pyzx_graph

from numpy.random import PCG64, Generator
from pyzx.generate import cliffordT as clifford_t

if TYPE_CHECKING:
from graphix import Pattern, Statevec
from pyzx.graph.base import BaseGraph

from graphix import Pattern, Statevector


def test_graph_equality(fx_rng: Generator) -> None:
# No default value for `byteorder` in Python 3.10
Expand Down Expand Up @@ -65,14 +62,14 @@ def test_random_clifford_t() -> None:
assert_reconstructed_pyzx_graph_equal(g)


def simulate_pattern(pattern: Pattern, rng: Generator) -> Statevec:
def simulate_pattern(pattern: Pattern, rng: Generator) -> Statevector:
pattern.remove_pauli_measurements()
pattern.minimize_space()
return pattern.simulate_pattern(rng=rng)


def check_round_trip(pattern: Pattern, rng: Generator, full_reduce: bool) -> bool:
opengraph = pattern.extract_opengraph()
opengraph = pattern.to_opengraph()
zx_graph = to_pyzx_graph(opengraph.to_bloch())
if full_reduce:
zx_graph.normalize()
Expand Down
Loading
Loading