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

Don't remove unused qubits in default compilation pass #116

Open
cqc-alec opened this issue Mar 24, 2023 · 3 comments
Open

Don't remove unused qubits in default compilation pass #116

cqc-alec opened this issue Mar 24, 2023 · 3 comments
Assignees

Comments

@cqc-alec
Copy link
Collaborator

This causes sometimes-surprising differences with other backends. To get around the problem of QASM insisting on contiguous zero-indexed registers, can we omit this step and relabel the qubits including the blank ones?

@sjdilkes
Copy link
Contributor

sjdilkes commented Mar 24, 2023

This solution would mean we're rejecting valid Circuits that only need to call remove_blank_wires. The inconsistency Dan found is due to the stored Architecture referring to Node as "fcNode", while the current Quantinuum compilation both relabels them to "q", and doesn't update the Compilation maps to reflect this. Updating the connectivity graph generating Architecture classes to allow custom Node labelling CQCL/tket#796 and moving the relabelling pass into the c++ to allow the maps to be updated CQCL/tket#799 was my planned solution.

*The analogy I've been working with for removing wires is as with Routing for other algorithms, where we remove empty wires and add ancillas to find a good solution.

I think this works around Dan's problems sufficiently - but can update it to just not remove empty wires if that is preferred* though I don't think this is a better solution.

@cqc-alec
Copy link
Collaborator Author

cqc-alec commented Mar 27, 2023

I thought the issue was that Dan wants to run the default compilation pass on circuits that contain blank wires and for the result to still contain blank wires. However I'm not sure that's a reasonable request. Maybe having remove_blank_wires as an option defaulting to True would also work.

@daniel-mills-cqc
Copy link

Just to give my view as a user, there are a couple of themes which guide my requests:

  • As someone who builds software on top of pytket, I prefer the backends to behave as similarly as possible. We have hacked around it a few times but only after time spent debugging to find the differences, and it would be neater not to.
  • When designing experiments I prefer to see errors and warnings, rather than have pytket default to 'correcting' my 'mistakes'. This might be a benchmarking edge-case, but there are a lot of us doing benchmarking.

I think maybe these both apply here? Many thanks for looking into this!

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

4 participants