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 DenseLayout trial to SabreLayout #12453

Merged
merged 1 commit into from
May 22, 2024
Merged

Commits on May 22, 2024

  1. Add DenseLayout trial to SabreLayout

    Building on the work done in Qiskit#10829, Qiskit#10721, and Qiskit#12104 this commit adds
    a new trial to all runs of `SabreLayout` that runs the dense layout
    pass. In general the sabre layout algorithm starts from a random layout
    and then runs a routing algorithm to permute that layout virtually where
    swaps would be inserted to select a layout that would result in fewer
    swaps. As was discussed in Qiskit#10721 and Qiskit#10829 that random starting point
    is often not ideal especially for larger targets where the distance
    between qubits can be quite far. Especially when the circuit qubit count
    is low relative to the target's qubit count this can result it poor
    layouts as the distance between the qubits is too large. In qiskit we
    have an existing pass, `DenseLayout`, which tries to find the most
    densely connected n qubit subgraph of a connectivity graph. This
    algorithm necessarily will select a starting layout where the qubits are
    near each other and for those large backends where the random starting
    layout doesn't work well this can improve the output quality.
    
    As the overhead of `DenseLayout` is quite low and the core algorithm is
    written in rust already this commit adds a default trial that uses
    DenseLayout as a starting point on top of the random trials (and any
    input starting points). For example if the user specifies to run
    SabreLayout with 20 layout trials this will run 20 random trials and
    one trial with `DenseLayout` as the starting point. This is all done
    directly in the sabre layout rust code for efficiency. The other
    difference between the standalone `DenseLayout` pass is that in the
    standalone pass a sparse matrix is built and a reverse Cuthill-McKee
    permutation is run on the densest subgraph qubits to pick the final
    layout. This permutation is skipped because in the case of Sabre's
    use of dense layout we're relying on the sabre algorithm to perform
    the permutation.
    
    Depends on: Qiskit#12104
    mtreinish committed May 22, 2024
    Configuration menu
    Copy the full SHA
    921a53c View commit details
    Browse the repository at this point in the history