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 methods to retrieve info from channels config in backends #4097

Merged
merged 40 commits into from
Apr 15, 2020

Conversation

SooluThomas
Copy link
Member

@SooluThomas SooluThomas commented Apr 7, 2020

Summary

This PR fixes #3311 and adds methods

  • get_channel_qubits(channel) to get a list of all qubits operated by the given channel.
  • get_qubit_channels(qubit) to get a list of channels operating on the given qubit.

Details and comments

ControlChannels(qubit) is now generated by using the data in channels in the backend configuration (added this to fake pulse backends in PR #4085).
The backend configuration channels is a dictionary containing information of each channel -- their purpose, type, and qubits operated on.

TODO

  • reno

qiskit/providers/models/backendconfiguration.py Outdated Show resolved Hide resolved
qiskit/providers/models/backendconfiguration.py Outdated Show resolved Hide resolved
qiskit/providers/models/backendconfiguration.py Outdated Show resolved Hide resolved
qiskit/providers/models/backendconfiguration.py Outdated Show resolved Hide resolved
@SooluThomas SooluThomas marked this pull request as ready for review April 8, 2020 20:01
@lcapelluto lcapelluto self-assigned this Apr 9, 2020
@SooluThomas SooluThomas changed the title Add methods to retrieve info from channels config in backends [WIP] Add methods to retrieve info from channels config in backends Apr 9, 2020
@lcapelluto lcapelluto changed the title [WIP] Add methods to retrieve info from channels config in backends Add methods to retrieve info from channels config in backends Apr 14, 2020
lcapelluto
lcapelluto previously approved these changes Apr 14, 2020
Copy link
Contributor

@taalexander taalexander left a comment

Choose a reason for hiding this comment

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

I'm sorry, @lcapelluto convinced me that channels dict shouldn't be public. It looks good otherwise!

taalexander
taalexander previously approved these changes Apr 15, 2020
@SooluThomas
Copy link
Member Author

SooluThomas commented Apr 15, 2020

Adding a minor change in tests. Reverting this based on an offline conversation with @lcapelluto

lcapelluto
lcapelluto previously approved these changes Apr 15, 2020
@kdk kdk merged commit de04fcf into Qiskit:master Apr 15, 2020
@lcapelluto lcapelluto added the Changelog: New Feature Include in the "Added" section of the changelog label Apr 30, 2020
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
…#4097)

* Add get_channel_qubits method to get info from channels config

* Add tests

* Update docstrings

* Remove unwanted imports

* Review suggestions

* Fix get_qubit_channels

* Deprecation warning to use control(qubits: List) instead of control(channel: int)

* typos

* update the control based on the new backend schema

* typos

* More logic fixes

* lint

* lint

* add older code

* More logic fixes

* lint

* Update docstrings and typehints

* Unused imports

* Release notes

* Review suggestions

* Bug fix for get_qubit_channels(0)

Updated tests too

* Review Suggestions

* lint

* Change error message of _get_channel_prefix_index

* Added raise error for backends without 'channel' information

* Update docstrings for raise errors

* Fix error messages and docstrings

* make self.channels private

* Remove collections.Counter

* Revert "Remove collections.Counter"

This reverts commit d602738.

* change list() -> set()
@1ucian0 1ucian0 added the mod: pulse Related to the Pulse module label Jan 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog mod: pulse Related to the Pulse module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accurate Control Channels
5 participants