From cc18af0731fd82cd7d3a45ba4ddcf4edf65890e3 Mon Sep 17 00:00:00 2001 From: Agustin Borgna Date: Sun, 9 Jun 2024 16:03:23 +0100 Subject: [PATCH] fix format --- pybindings/quizx/decompose.py | 4 ++-- pybindings/quizx/graph.py | 2 +- pybindings/quizx/scalar.py | 7 +------ 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pybindings/quizx/decompose.py b/pybindings/quizx/decompose.py index a8ab820..d4642ec 100644 --- a/pybindings/quizx/decompose.py +++ b/pybindings/quizx/decompose.py @@ -35,7 +35,7 @@ def decomp_until_depth(self, depth: int): def use_cats(self, b: bool): self._d.use_cats(b) - + def get_nterms(self): return self._d.get_nterms() @@ -46,6 +46,6 @@ def scalar(self) -> Scalar: @scalar.setter def scalar(self, s: Scalar): self._d.scalar = from_pyzx_scalar(s) - + def is_ground(self, vertex): return False diff --git a/pybindings/quizx/graph.py b/pybindings/quizx/graph.py index 5defba7..253d1f5 100644 --- a/pybindings/quizx/graph.py +++ b/pybindings/quizx/graph.py @@ -327,4 +327,4 @@ def scalar(self, s: Scalar): self._g.scalar = from_pyzx_scalar(s) def is_ground(self, vertex): - return False \ No newline at end of file + return False diff --git a/pybindings/quizx/scalar.py b/pybindings/quizx/scalar.py index 31199f8..e573574 100644 --- a/pybindings/quizx/scalar.py +++ b/pybindings/quizx/scalar.py @@ -2,7 +2,6 @@ from ._quizx import Scalar as QuizxScalar from pyzx.graph.scalar import Scalar as PyzxScalar -import json def from_pyzx_scalar(s: PyzxScalar) -> QuizxScalar: @@ -12,8 +11,4 @@ def from_pyzx_scalar(s: PyzxScalar) -> QuizxScalar: def to_pyzx_scalar(s: QuizxScalar) -> PyzxScalar: """Convert a `pyzx.Scalar` to a `quizx::Scalar`.""" - #d = json.loads(s.to_json()) - #d["power2"] *= 2 - #dStr = json.dumps(d) - #return PyzxScalar().from_json(dStr) - return PyzxScalar().from_json(s.to_json()) \ No newline at end of file + return PyzxScalar().from_json(s.to_json())