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

Transpiling with basis_gates=None disables unrolling #4263

Merged
merged 5 commits into from
Apr 27, 2020

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Apr 25, 2020

Fixes #3017

When basis_gates=None during transpilation, the unroller just accepts everything (does nothing on the input).

It has some (undesired) effect in optimization:

from qiskit import *

q = QuantumRegister(2, name='q')
circuit = QuantumCircuit(q)
circuit.h(q[0])
circuit.u1(0.1, q[0])
circuit.u2(0.1, 0.2, q[0])
circuit.u3(0.1, 0.2, 0.3, q[0])
circuit.cz(q[0], q[1])
result = transpile(circuit, basis_gates=None, optimization_level=3)

print(result)
     ┌───┐┌───────────────────────────┐
q_0: ┤ H ├┤ U3(1.6629,0.6018,0.33905) ├─■─
     └───┘└───────────────────────────┘ │
q_1: ───────────────────────────────────■─

@1ucian0 1ucian0 marked this pull request as ready for review April 26, 2020 13:01
ajavadia
ajavadia previously approved these changes Apr 26, 2020
@ajavadia
Copy link
Member

can you add a bugfix release note?

@ajavadia ajavadia added the Changelog: Bugfix Include in the "Fixed" section of the changelog label Apr 26, 2020
@1ucian0
Copy link
Member Author

1ucian0 commented Apr 26, 2020

can you add a bugfix release note?

done

@mergify mergify bot merged commit 283dde1 into Qiskit:master Apr 27, 2020
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* allow basis_gates=None

* some docstring and organization

* lint

* reno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

transpile unrolls even when basis_gates=None
2 participants