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

[BUG] ADAPT ansatz not removing superfluous qubits #186

Closed
KrzysztofB-1qbit opened this issue Aug 8, 2022 · 2 comments
Closed

[BUG] ADAPT ansatz not removing superfluous qubits #186

KrzysztofB-1qbit opened this issue Aug 8, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@KrzysztofB-1qbit
Copy link
Contributor

Issue: Bug Report

Expected Behavior
When generating an ADAPT ansatz with scbk, there should be 2 qubits removed

Current Behavior
ADAPT returns a circuit with superfluous quits which are not actually used for anything. These can be removed using the trim_qubits method of the Circuit class.

Steps to Reproduce (minimal example)
The ansatz in the project Neon should be a 2 qubit circuit, but it clearly indicates a width of 4 qubits, even though there are only gates on the first 2.

Environment
MacOS 11.6.1

@ValentinS4t1qbit
Copy link
Collaborator

Thank you for reporting this ! I think you raise an important point we may not have looked into: meta VQEs or complex algorithms in general may not have a constant number of qubits. Maybe it can grow, maybe it can go down as well. When going to a different step or concatenating circuits, maybe we should try trimming once in a while and updating qubit number if relevant to ensure we keep resources low during runtime.

I think it's probably a small surgery we can do inside the code of ADAPT itself, unless we foresee VQE itself may have fancy ansatze whose number of qubits-in-use may change because... stuff.

@alexfleury-sb
Copy link
Collaborator

Closed with #214.

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

4 participants