forked from Qiskit/qiskit
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DAGCircuit output option to OneQubitEulerDecomposer
This commit adds a new option to the euler one qubit decomposer class, use_dag, which when set to True will return a DAGCircuit object for the decomposed matrix instead of a QuantumCircuit object. This is useful for transpiler passes that call the decomposer so that they don't have to convert from a circuit to a dag. The passes that use the decomposer are also updated to use this new option. This was originally attempted before in Qiskit#5926 but was abandoned because at the time there was no real performance improvement from doing this. However, since then this class has changed quite a bit, and after Qiskit#9185 the overhead of conversion between QuantumCircuit and DAGCircuit is a more critical component of the runtime performance of the 1 qubit optimization pass. By operating natively in DAGCircuit from the decomposer we're able to remove this overhead and directly substitute the output of the decomposer in the pass.
- Loading branch information
Showing
5 changed files
with
143 additions
and
116 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
Oops, something went wrong.