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

extra CNOT inserted in Patel-Hayes-Markov algorithm #2718

Closed
ajavadia opened this issue Jul 1, 2019 · 0 comments · Fixed by #5044
Closed

extra CNOT inserted in Patel-Hayes-Markov algorithm #2718

ajavadia opened this issue Jul 1, 2019 · 0 comments · Fixed by #5044
Labels
bug Something isn't working priority: medium

Comments

@ajavadia
Copy link
Member

ajavadia commented Jul 1, 2019

#2457 added the graysynth and patel-hayes-markov synthesis algorithms.

However the doubly-controlled Z rotation synthesis from Figure 3 of the associated paper seems not to be synthesized accurately.

A 6-cnot construction should be found according to the paper:
image

but currently qiskit finds a 7-cnot construction:
image

Code for the above:

from qiskit.transpiler.synthesis import graysynth
cnots = [[1, 0, 1, 0, 1, 1, 0],
         [0, 1, 0, 1, 1, 1, 0],
         [0, 0, 1, 1, 1, 0, 1]]
angles = [1/8, 1/8, 3/8, 3/8, 1/8, 3/8, 1/8]
c_gray = graysynth(cnots, angles, 3)
c_gray.draw(output='mpl')
@1ucian0 1ucian0 added the bug Something isn't working label Dec 19, 2019
meamy added a commit to meamy/qiskit-terra that referenced this issue Sep 8, 2020
@mergify mergify bot closed this as completed in #5044 Sep 11, 2020
mergify bot pushed a commit that referenced this issue Sep 11, 2020
* Fix for issue #2718

* Do inversion in graysynth rather than PMH

* Fixed tests

* Update qiskit/transpiler/synthesis/graysynth.py

* Changing some comments

* New test + out of bounds bug fix

* Typo

* linting

Co-authored-by: Luciano Bello <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants