forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transpiling with basis_gates=None disables unrolling (Qiskit#4263)
* allow basis_gates=None * some docstring and organization * lint * reno
- Loading branch information
Luciano Bello
authored
Apr 27, 2020
1 parent
e1c1af5
commit 7f785dd
Showing
4 changed files
with
55 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
releasenotes/notes/transpiling_basis_none-b2f1abdb3c080eca.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
fixes: | ||
- | | ||
Bug #3017 is fixed. The function ``qiskit.compiler.transpile()`` honors the parameter ``basis_gates=None`` | ||
to allow any gate in the final tranpiled circuit, including gates added by the transpilation process. | ||
This might also have some unintended consequences during optimization. For example, | ||
:class:`qiskit.transpiler.passes.Optimize1qGates` only optimizes the chains of u1, u2, and u3 gates: | ||
.. code-block:: python | ||
from qiskit import * | ||
q = QuantumRegister(1, name='q') | ||
circuit = QuantumCircuit(q) | ||
circuit.h(q[0]) | ||
circuit.u1(0.1, q[0]) | ||
circuit.u2(0.1, 0.2, q[0]) | ||
circuit.h(q[0]) | ||
circuit.u3(0.1, 0.2, 0.3, q[0]) | ||
result = transpile(circuit, basis_gates=None, optimization_level=3) | ||
result.draw() | ||
.. parsed-literal:: | ||
┌───┐┌─────────────┐┌───┐┌─────────────────┐ | ||
q_0: ┤ H ├┤ U2(0.1,0.3) ├┤ H ├┤ U3(0.1,0.2,0.3) ├ | ||
└───┘└─────────────┘└───┘└─────────────────┘ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters