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

Fix multigraph color change #239

Closed
wants to merge 2 commits into from
Closed

Conversation

boldar99
Copy link
Contributor

@boldar99 boldar99 commented Jun 22, 2024

The color_change function had been broken with the Multigraph implementation.

Changes:

  • The implementation of color_change has been modified to call a new function that toggles between Hadamard and Simple edge types.

  • The toggle_edge utility function has been changed not to do anything when the input edge type is neither Hadamard nor Simple.

  • Implement __repr__ for multigraph.Edge for better error messages

Related to zxcalc/zxlive#256

@jvdwetering
Copy link
Collaborator

I'm not sure if we should maybe play it safe, and raise an exception if toggle_edge is called on an edge that we don't expect to be toggleable, instead of just silently doing nothing.

@boldar99
Copy link
Contributor Author

That's a good point! I just pushed a fix.

@RazinShaikh
Copy link
Contributor

I am not sure if toggling the edge type for multigraph should simply flip the number of simple and Hadamard edges. It makes sense for colour change but what if in a different context, switching the edge type of only the chosen edge (not all edges) makes sense?

@boldar99 boldar99 closed this Jun 27, 2024
@RazinShaikh
Copy link
Contributor

superseded by #244

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