Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add OpenGraph class for graphical compilation This is based on the Open Graph definition from the "Picturing Quantum Software" textbook. Comes with methods to convert to and from pyzx diagrams. Provides properties inputs(), outputs(), and measurements() that are compatible with the rest of graphix. * Add OpenGraph to docs * Add Open Graph tests * Implement suggested changes on PR * Add PyZX requirement into dev requirements * Use enum for measurement planes * Skip tests if pyzx isn't installed * Add conversion between patterns and Open graphs * Extract PyZX code into separate file This is because we want to treat PyZX as an optional dependency. Since OpenGraph is meant to be a standardised interface for many projects to use, it shouldn't include any optional dependencies * Update graphix/open_graph.py Co-authored-by: Shinichi Sunami <[email protected]> * Improve docstrings on pattern methods * Rename open_graph.py to opengraph.py * Change docs for measurement angle It was always between [0, 2). The docstring was wrong. * Improve Measurement class's comparisons Removed is_z_measurement() method since there is no need for it here. Since we compare floats in the equality operation, we have converted it into an `isclose` method so we can include the relative and absolute error tolerances. * Simplify graph equality operation * Simplify internal datastructure for OpenGraph * Improve code quality * Use Mapping for the iterface for extensibility * Add warning for PyZX version Co-authored-by: Shinichi Sunami <[email protected]> * Remove classmethod for OpenGraph * Add comments for clarity Co-authored-by: Shinichi Sunami <[email protected]> * Fix lints * Implement changes for random circuit testing Co-authored-by: Shinichi Sunami <[email protected]> * Implement changes for random circuit testing Co-authored-by: Shinichi Sunami <[email protected]> * Implement changes for random circuit testing Co-authored-by: Shinichi Sunami <[email protected]> * Implement changes for random circuit testing Co-authored-by: Shinichi Sunami <[email protected]> * Implement changes for random circuit testing Co-authored-by: Shinichi Sunami <[email protected]> * Implement changes for random circuit testing Co-authored-by: Shinichi Sunami <[email protected]> * Implement changes for random circuit testing Co-authored-by: Shinichi Sunami <[email protected]> * No need to reset the random seed * Fix formatting * Remove qasm files * Add type annotations Co-authored-by: S.S. <[email protected]> * Add type annotations * Highlight that inputs/outputs are ordered * Simplify * Add type annotations * Avoid consuming the iterator * Switch from NamedTuple to dataclass for validation Authored by thierry-martinez * Check open graphs are close, not equal --------- Co-authored-by: Shinichi Sunami <[email protected]> Co-authored-by: S.S. <[email protected]>
- Loading branch information