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

W node #77

Merged
merged 37 commits into from
Aug 21, 2023
Merged

W node #77

merged 37 commits into from
Aug 21, 2023

Conversation

RazinShaikh
Copy link
Collaborator

No description provided.

zxlive/commands.py Outdated Show resolved Hide resolved
@jvdwetering
Copy link
Collaborator

I don't really see where you are changing the VertexType and EdgeType classes to allow for W-like things. Is this a change you are making in a local copy of pyzx?

@RazinShaikh
Copy link
Collaborator Author

@RazinShaikh RazinShaikh marked this pull request as ready for review August 13, 2023 23:47
zxlive/edit_panel.py Outdated Show resolved Hide resolved
zxlive/edit_panel.py Outdated Show resolved Hide resolved
zxlive/vitem.py Outdated Show resolved Hide resolved
zxlive/edit_panel.py Outdated Show resolved Hide resolved
@RazinShaikh
Copy link
Collaborator Author

@mark-koch Thanks a lot for your comments. I have gone through each of them and incorporated your suggestions. Let me know if it looks good to you.

@jvdwetering
Copy link
Collaborator

So just checking that this is desired behaviour:
I made the following diagram
image
And then when I 'fuse W nodes' I get the following:
image
Is that correct? I would have expected no self-loop. Is this because a W must have an output? If so, did I make something that is not well-typed?

@jvdwetering
Copy link
Collaborator

Also, when you add new W-spiders, depending on where you click the orientation of the W-spider changes, sometimes in weird ways:
image

@jvdwetering
Copy link
Collaborator

I don't understand the bug I outlined above, I tried with two different configurations:
image
And the left one rewrites correctly with fuse W nodes, but the right one doesn't:
image

@RazinShaikh
Copy link
Collaborator Author

Hi John, that is indeed not the right behaviour. For instance, if you drag the nodes, they will fuse correctly. I will check later today and see what's going wrong when you press the fuse button.

@RazinShaikh
Copy link
Collaborator Author

@jvdwetering the fusion bug should be fixed by this PR zxcalc/pyzx#129 in PyZX.

@RazinShaikh
Copy link
Collaborator Author

Also, when you add new W-spiders, depending on where you click the orientation of the W-spider changes, sometimes in weird ways:
image

Fixed in 306754b. The fix for this is to call set_vitem_rotation() when a graph is updated. It should always have the correct orientation now.

@RazinShaikh
Copy link
Collaborator Author

@mark-koch @jvdwetering are you guys happy for this to be merged?

@jvdwetering
Copy link
Collaborator

It looks like you got a new conflict because Boldi fixed some mypy bugs, but once that's fixed I think this can be merged in.

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