-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Brought use_cats and get_nterms into the scope of the python bindings #42
Conversation
Resolved some discrepancies that arise among the scalars when applying simplification functions to a graph
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Make sure to run a formatter on the code, and follow the other linter recommendations.
See: https://github.com/Quantomatic/quizx/blob/master/CONTRIBUTING.md#-coding-style
pybindings/quizx/scalar.py
Outdated
#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()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a leftover from debugging?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially, yes. The scalar doesn't seem to be accurate (largely, it seems, because not all of the scalar information gets encoded via json) - but this is an issue I'm yet to resolve (but will likely make a separate pull request for in due course). These remarked lines of code were just part of my trying to fix that.
Trying to include use_cats here seemed to cause formatting issues which would not resolve, but it doesn't seem necessary to include it here anyway
I added a couple fixes to pass the checks ran by |
Brought use_cats and get_nterms into the scope of the python bindings (such that these can now be changed/read within Python when using the bindings).
Moreover, the Python bindings for simplifying graphs did not work, but a couple of trivial changes seem to fix it.