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

Weighted Adder unused ancilla for mct #5320

Closed
ankprd opened this issue Oct 30, 2020 · 0 comments · Fixed by #5332
Closed

Weighted Adder unused ancilla for mct #5320

ankprd opened this issue Oct 30, 2020 · 0 comments · Fixed by #5332
Labels
bug Something isn't working

Comments

@ankprd
Copy link

ankprd commented Oct 30, 2020

Information

  • Qiskit Terra version: 0.23.0
  • Python version: 3
  • Operating system: Ubuntu

What is the current behavior?

WeightedAdder implementation uses mct with default mode 'no-ancilla' but allocates an ancilla qubit for it
(similar to #4786)

Steps to reproduce the problem

What is the expected behavior?

Either use mct(mode = 'v-chain') or not allocating qr_control (and not passing it to mct), l.265 and 284 of https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/circuit/library/arithmetic/weighted_adder.py
(as it is, the resulting circuit has one unused qubit)

Suggested solutions

@ankprd ankprd added the bug Something isn't working label Oct 30, 2020
@mergify mergify bot closed this as completed in #5332 Dec 4, 2020
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

Successfully merging a pull request may close this issue.

1 participant