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

MCXVChain with dirty ancilla is not optimal. #9740

Closed
adjs opened this issue Mar 6, 2023 · 1 comment
Closed

MCXVChain with dirty ancilla is not optimal. #9740

adjs opened this issue Mar 6, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@adjs
Copy link
Contributor

adjs commented Mar 6, 2023

Environment

  • Qiskit Terra version: 0.23.2
  • Python version: 3.8.10
  • Operating system: Ubuntu 20.04.5 LTS

What is happening?

The number of cx operations in the MCXVChain gate with dirty_ancilla=True and k controls is higher than 8k -6 [Lemma 7, https://arxiv.org/pdf/1501.06911.pdf].

How can we reproduce the issue?

from qiskit import transpile
from qiskit.circuit.library.standard_gates import MCXVChain

k = 10
qc = MCXVChain(k, True).definition
tqc = transpile(qc, basis_gates=['u', 'cx'])
print(tqc.count_ops()['cx'])

prints 98 instead of 10*8-6=74.

What should happen?

MCXVChain with dirty_ancilla=True and k controls should use 8k-6 cx gates.

Any suggestions?

No response

@ShellyGarion
Copy link
Member

closed by #9687

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

2 participants