Giter Site home page Giter Site logo

vf2_partial_layout's Introduction

VF2 Partial Layout Plugin

This repo contains an experimental transpiler pass VF2PartialLayout which is for performing the layout stage of compilation (ie initial qubit selection). This pass leverages the vf2 implementation in rustworkx to find a layout using subgraph isomorphsim of a partial interaction graph and the coupling map. Unlike VF2Layout (and VF2PostLayout) it gives up on finding a perfect layout for the full interaction graph and instead builds partial interaction graphs over the circuit and tries to find the most complete interaction graph that has a matching subgraph. The best performing qubits are then matched for this subgraph (per the normal vf2 layout algorithm) and that is used as the core of the initial layout.

Installing

Right now the package is not published on pypi but you can install it with pip still by running:

pip install git+https://github.com/mtreinish/vf2_partial_layout

Usage

Once you have it installed you can use the VF2PartialLayout method by specifying layout_method="vf2_partial" when calling transpile. For example:

from qiskit.circuit.library import QFT
from qiskit import transpile
from qiskit.providers.fake_provider import FakeAuckland
qc = QFT(4)
qc.measure_all()

tqc = transpile(qc, FakeAuckland(), layout_method='vf2_partial')

Note this pass is still experimental and also known to be quite memory hungry in its current form. The eventual goal is to have this pass as part of qiskit-terra after we prove it's effectiveness and decrease the memory overhead.

vf2_partial_layout's People

Contributors

mtreinish avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.