Avoid to_dict() when possible in pulse system model#695
Merged
chriseclectic merged 4 commits intoApr 14, 2020
Conversation
As fall out from Qiskit/qiskit#4016 there was a bug in the to_dict() method of the backend configuration that was resulting in UChannelLO objects not getting converted to their dict form in the output of to_dict(). While this is being fixed in Qiskit/qiskit#4124 this commit side steps the issue by adapting the access patterns in the pulse system model to rely on class attribute access and getattr() instead of dict access and get().
8bbb4d5 to
f8fa61f
Compare
chriseclectic
approved these changes
Apr 14, 2020
chriseclectic
approved these changes
Apr 14, 2020
hhorii
pushed a commit
to hhorii/qiskit-aer
that referenced
this pull request
Apr 16, 2020
* Avoid to_dict() when possible in pulse system model As fall out from Qiskit/qiskit#4016 there was a bug in the to_dict() method of the backend configuration that was resulting in UChannelLO objects not getting converted to their dict form in the output of to_dict(). While this is being fixed in Qiskit/qiskit#4124 this commit side steps the issue by adapting the access patterns in the pulse system model to rely on class attribute access and getattr() instead of dict access and get(). Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
chriseclectic
added a commit
to chriseclectic/qiskit-aer
that referenced
this pull request
Apr 20, 2020
* Avoid to_dict() when possible in pulse system model As fall out from Qiskit/qiskit#4016 there was a bug in the to_dict() method of the backend configuration that was resulting in UChannelLO objects not getting converted to their dict form in the output of to_dict(). While this is being fixed in Qiskit/qiskit#4124 this commit side steps the issue by adapting the access patterns in the pulse system model to rely on class attribute access and getattr() instead of dict access and get(). Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
mtreinish
added a commit
to mtreinish/qiskit-aer
that referenced
this pull request
May 10, 2020
In Qiskit#695 we updated the usage of the backend configuration to avoid to_dict() and dict based access. All the access was supposed to be updated to be class attribute based instead. However that PR neglected to update the usage of the calculate_channel_frequencies method. This is causing an error when using the method now. This commit corrects the oversight and adds a unit test covering running that method when building a pulse system model from a backend to avoid this in the future. Fixes Qiskit#741
chriseclectic
pushed a commit
that referenced
this pull request
May 15, 2020
* Update config access in calculate_channel_frequencies In #695 we updated the usage of the backend configuration to avoid to_dict() and dict based access. All the access was supposed to be updated to be class attribute based instead. However that PR neglected to update the usage of the calculate_channel_frequencies method. This is causing an error when using the method now. This commit corrects the oversight and adds a unit test covering running that method when building a pulse system model from a backend to avoid this in the future. Fixes #741 * updated duffing_model_generators.py and corresponding tests to new UchannelLO object (instead of dict) * added test for duffing_model_generators including doing channel frequency calculations in resulting system_model to catch any formatting issues Co-authored-by: Daniel Puzzuoli <dan.puzzuoli@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
As fall out from Qiskit/qiskit#4016 there was a bug in the
to_dict() method of the backend configuration that was resulting in
UChannelLO objects not getting converted to their dict form in the
output of to_dict(). While this is being fixed in
Qiskit/qiskit#4124 this commit side steps the issue by adapting
the access patterns in the pulse system model to rely on class attribute
access and getattr() instead of dict access and get().
Details and comments
This is an alternative to the fix from a combination of #694 and Qiskit/qiskit#4124