-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Luciano Bello
committed
Apr 26, 2020
1 parent
7c5b893
commit 417f3d9
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
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) ├ | ||
└───┘└─────────────┘└───┘└─────────────────┘ |