Skip to content
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

Vertex/edge cutting #216

Merged
merged 8 commits into from
Aug 6, 2024
Merged

Vertex/edge cutting #216

merged 8 commits into from
Aug 6, 2024

Conversation

mjsutcliffe99
Copy link
Contributor

Included functions for applying the vertex and edge cutting decompositions

Added a small function to return the averaged position between two points (just basic trig)
Added functions to apply the basic vertex and edge cutting decompositions
@dlyongemallo
Copy link
Contributor

Can you please add tests?

Added tests for vertex and edge cutting on random graphs to verify the scalar results are correct
@mjsutcliffe99
Copy link
Contributor Author

Can you please add tests?

I've just added some tests for both functions to verify the scalar results are correct on randomly generated graphs

@jvdwetering
Copy link
Collaborator

Could you add docstrings to the main functions you added, with perhaps a reference to your papers where you use them.

@jvdwetering
Copy link
Collaborator

pyzx/simulate.py:500: error: invalid syntax [syntax]

@jvdwetering
Copy link
Collaborator

Ah I see what goes wrong. You are using match statements, but these were introduced in Python 3.10. PyZX still supports older versions of Python. I see that in that match statement you are also using hard-coded 1 and 2 for the types of Z and X spiders. You can actually replace this by calling the function utils.toggle_vertex for the same functionality.

Add new 'wishbone' (or 'separator') cutting variant for unfusing a vertex and cutting this new common edge (in the same colour as the original vertex) - this acts to separate a vertex into two, via one cut, with some neighbours on one side and some on another.
@jvdwetering
Copy link
Collaborator

Can this be merged?

@mjsutcliffe99
Copy link
Contributor Author

Can this be merged?

Yes, this should be all good 👍

@jvdwetering jvdwetering merged commit ffff4f8 into zxcalc:master Aug 6, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants