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

Layout object #1313

Merged
merged 28 commits into from
Nov 23, 2018
Merged

Layout object #1313

merged 28 commits into from
Nov 23, 2018

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Nov 21, 2018

Summary

This PR introduces the notion of a Layout object, a two-ways dictionary that represents a layout.

Layout is the relation between logical (qu)bits and physical wires.

  • Logical (qu)bits are tuples (eg, ('qr',2).
  • Physical wires are numbers.

Details and comments

It's possible to construct a Layout from a dict, a list (see #735), and by the add() method.

Other methods and use examples available in test/python/test_layout.py.

qiskit/mapper/_layout.py Outdated Show resolved Hide resolved
qiskit/mapper/_layout.py Outdated Show resolved Hide resolved
qiskit/mapper/_layout.py Outdated Show resolved Hide resolved
qiskit/mapper/_layout.py Outdated Show resolved Hide resolved
qiskit/mapper/_layout.py Outdated Show resolved Hide resolved
Copy link
Member

@ajavadia ajavadia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. left some comments.

qiskit/mapper/_layout.py Outdated Show resolved Hide resolved
@ajavadia
Copy link
Member

Lastly: can you remove "fixes #735", until we actually fix that by modifying the compile() and transpile() signatures? This lays the groundwork for that, but doesn't quite do it.

@1ucian0 1ucian0 mentioned this pull request Nov 21, 2018
@1ucian0 1ucian0 added this to the 0.7 milestone Nov 23, 2018
@1ucian0 1ucian0 merged commit 0d5c193 into Qiskit:master Nov 23, 2018
@1ucian0 1ucian0 deleted the layout_object branch December 19, 2018 19:30
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants