Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
ABorgna committed Jun 9, 2024
1 parent 68caad2 commit cc18af0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pybindings/quizx/decompose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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
2 changes: 1 addition & 1 deletion pybindings/quizx/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,4 +327,4 @@ def scalar(self, s: Scalar):
self._g.scalar = from_pyzx_scalar(s)

def is_ground(self, vertex):
return False
return False
7 changes: 1 addition & 6 deletions pybindings/quizx/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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())
return PyzxScalar().from_json(s.to_json())

0 comments on commit cc18af0

Please sign in to comment.