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

WIP Backend example #372

Merged
merged 10 commits into from
Mar 28, 2018
Merged

WIP Backend example #372

merged 10 commits into from
Mar 28, 2018

Conversation

jaygambetta
Copy link
Member

@jaygambetta jaygambetta commented Mar 27, 2018

WIP Fix the coupling map to be a dictionary just before it goes to the mapper. The code is broken from #363.

Description

Changed the openquantumcompiler to convert to the dictionary to a list just before it is passed to the mapper. In the future the mapper will

Motivation and Context

Because we broke it in last pr

How Has This Been Tested?

running scripts will discuss below twst

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@jaygambetta jaygambetta requested a review from diego-plan9 March 27, 2018 22:25
@jaygambetta
Copy link
Member Author

jaygambetta commented Mar 27, 2018

@diego-plan9 I am worried about a few things before we accept this.

Essentially as we move from the dictionary coupling_map to the list coupling_map we have some issues

coupling_map = [[0,2],[2,1],[2,3]]

  • Mapper (not going to change in 0.5 and it still supports the dictionary)

coupling_map = {0: [2], 2: [1,3]}

So the fix i just did is try to do the convert very close to the mapper -- in the openquantumcompiler
however some users will input both so i need to think about how we want to do that. Need to run home now but i will work on this later. However, this is going to break the tests as the user put in some times the old coupling_map. I am going to do a deprecated warning and an if to check or something.

@jaygambetta
Copy link
Member Author

jaygambetta commented Mar 28, 2018

Its passing the test locally.

To do

  • Add a test to test against this bug in the future
  • Add a python example using the new backends

jaygambetta and others added 5 commits March 28, 2018 06:43
Update the test in order to specify the coupling_maps as lists, due
to recent changes.
Add a `test_compile_coupling_map_as_dict` that still uses the dict
format, for backwards compatibility during the deprecation.
Along with other fixes to docstrings and tests.
Temporarily disable the osx build on Travis, as they are having a
backlog that might take some time to recover:
https://www.traviscistatus.com/incidents/qkqy13yk55q9
@diego-plan9
Copy link
Member

Thanks @jaygambetta for the quick and lean fix, and @ajavadia for picking up the missing coupling map! As discussed, I tweaked the tests and the docstrings, added an individual test to make sure we can still ensure that the functionality is working during the deprecation, and merging!

@diego-plan9 diego-plan9 merged commit 7c5d71e into Qiskit:master Mar 28, 2018
@jaygambetta jaygambetta deleted the backend_example branch March 30, 2018 02:00
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
* Fix for the quantum program with new backends

* Fixing the tests

* Small changes

* Linting

* Update tests using coupling_map as list, add test

Update the test in order to specify the coupling_maps as lists, due
to recent changes.
Add a `test_compile_coupling_map_as_dict` that still uses the dict
format, for backwards compatibility during the deprecation.

* Update coupling_map as list related docstrings

Along with other fixes to docstrings and tests.

* Disable travis osx build temporarily (Qiskit#374)

Temporarily disable the osx build on Travis, as they are having a
backlog that might take some time to recover:
https://www.traviscistatus.com/incidents/qkqy13yk55q9

* adding a missing coupling in test_quantumprogram
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
So Diego can see

Fix for the quantum program with new backends

Fixing the tests

Small changes

Linting

Adding the qp to the compile section for completeness

Doc changes

naming

Small changes

Linting

Small changes

Moving the example

WIP Backend example (Qiskit#372)

* Fix for the quantum program with new backends

* Fixing the tests

* Small changes

* Linting

* Update tests using coupling_map as list, add test

Update the test in order to specify the coupling_maps as lists, due
to recent changes.
Add a `test_compile_coupling_map_as_dict` that still uses the dict
format, for backwards compatibility during the deprecation.

* Update coupling_map as list related docstrings

Along with other fixes to docstrings and tests.

* Disable travis osx build temporarily (Qiskit#374)

Temporarily disable the osx build on Travis, as they are having a
backlog that might take some time to recover:
https://www.traviscistatus.com/incidents/qkqy13yk55q9

* adding a missing coupling in test_quantumprogram
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.

3 participants