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

Issues with get_subgraph method of CouplingGraph #290

Open
alonkukl opened this issue Oct 8, 2024 · 0 comments
Open

Issues with get_subgraph method of CouplingGraph #290

alonkukl opened this issue Oct 8, 2024 · 0 comments

Comments

@alonkukl
Copy link
Contributor

alonkukl commented Oct 8, 2024

I see a few issues with the method get_subgraph of CouplingGraph.

Consider the following code, where we create a 5-qubit all-to-all, and then ask for a specific subgraph :

cg = CouplingGraph.all_to_all(5)
sub_g = cg.get_subgraph((1,3,4))

The issues I see are:

  1. The default behavior of the function is to rename the qubits from 0 to j (where j Is the size of the subgraph). This is not documented and is not the default behavior I would expect.
  2. When trying to provide the function with a renaming dict, the code crashes:

cg.get_subgraph((1,3,4), {i:i for i in range(5)})

The crash:
ValueError: Edges between invalid qudits or num_qudits too small.

  1. The class also has a method named 'get_induced_subgraph', that doesn't change the name of the qubits, but returns a list rather than a CouplingGraph. The issues here is why is there a code duplication? Why is the default different?
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

No branches or pull requests

1 participant