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

Add DAGCircuit output option to OneQubitEulerDecomposer #9188

Merged
merged 3 commits into from
Dec 2, 2022

Commits on Dec 2, 2022

  1. 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.
    mtreinish committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    f8029e8 View commit details
    Browse the repository at this point in the history
  2. Use a dataclass for internal gate list and phase tracking

    This commit updates the internal psx circuit generator function to pass
    a dataclass with a field for the gates and phase instead of using 2
    lists. This provides a cleaner interface for using a mutable reference
    between the different functions used to add gates to the circuit.
    mtreinish committed Dec 2, 2022
    Configuration menu
    Copy the full SHA
    c66dd09 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    17bfe87 View commit details
    Browse the repository at this point in the history