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

Investigate the best way to validate user-input edge coloring #37

Open
caleb-johnson opened this issue Sep 18, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@caleb-johnson
Copy link
Collaborator

caleb-johnson commented Sep 18, 2024

slice_by_coloring, CollectOpColor, and is_valid_edge_coloring all handle user-input edge coloring directly, but each has a different "perspective" on the coloring.

slice_by_coloring wants to ensure all the edges in the input circuit are correctly covered by the coloring
CollectOpColor is a more naive, generalized tool, so it will simply collect ops on the subset of edges it is given. It doesn't necessarily want to do much checking on the inputs.
is_valid_edge_coloring currently just checks whether the edge coloring on the input graph is valid (i.e. No two incident edges share a color)
Resolution of this issue should include handling the case where a user passes a valid, but incomplete, edge coloring. Currently, this value error passes through silently, causing unintended behavior.

One option is making is_valid_edge_coloring a bit more circuit-centric, in that it would verify that all the qubits in a circuit are covered by the coloring. If we go this route, the function should probably just pass through all circuit instructions and ensure all defined edges in the circuit (i.e. any edge with at least one connecting gate) are included in the coloring.

Another option is to let slice_by_coloring verify that all the input circuit edges are covered by the coloring. slice_by_coloring could continue using is_valid_edge_coloring to ensure the actual coloring is valid.

@caleb-johnson caleb-johnson added the bug Something isn't working label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant