forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfix-decompose-hls-5019793177136024.yaml
42 lines (34 loc) · 1.67 KB
/
fix-decompose-hls-5019793177136024.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
---
features_circuits:
- |
Added a new argument ``"apply_synthesis"`` to :class:`.Decompose`, which allows
the transpiler pass to apply high-level synthesis to decompose objects that are only
defined by a synthesis routine. For example::
from qiskit import QuantumCircuit
from qiskit.quantum_info import Clifford
from qiskit.transpiler.passes import Decompose
cliff = Clifford(HGate())
circuit = QuantumCircuit(1)
circuit.append(cliff, [0])
# Clifford has no .definition, it is only defined by synthesis
nothing_happened = Decompose()(circuit)
# this internally runs the HighLevelSynthesis pass to decompose the Clifford
decomposed = Decompose(apply_synthesis=True)(circuit)
fixes:
- |
Fixed a bug in :meth:`.QuantumCircuit.decompose` where objects that could be synthesized
with :class:`.HighLevelSynthesis` were first synthesized and then decomposed immediately
(i.e., they were decomposed twice instead of once). This affected, e.g., :class:`.MCXGate`
or :class:`.Clifford`, among others.
- |
Fixed a bug in :meth:`.QuantumCircuit.decompose`, where high-level objects without a definition
were not decomposed if they were explicitly set via the ``"gates_to_decompose"`` argument.
For example, previously the following did not perform a decomposition but now works as
expected::
from qiskit import QuantumCircuit
from qiskit.quantum_info import Clifford
from qiskit.transpiler.passes import Decompose
cliff = Clifford(HGate())
circuit = QuantumCircuit(1)
circuit.append(cliff, [0])
decomposed = Decompose(gates_to_decompose=["clifford"])(circuit)