Add missing dict conversion in backconfiguration class#4124
Merged
Conversation
After Qiskit#4016 has merged a missed edge case in the handling of to_dict() and from_dict() for PulseBackendConfiguration was discovered via the aer unit tests. The u_channel_lo attribute is a nested object and needs to call UChannelLO's to_dict() and from_dict() methods in those respective calls. However, this conversion was not being done. This commit corrects the oversight.
There was an issue in the pulse defaults to_dict() method too where the converters attribute was incorrectly attempted to be output as a property in the output dictionary. This was incorrect and it just a helper there constructed based on other input. So outputting it with the dictionary was incorrect. This commit corrects this oversight.
jyu00
reviewed
Apr 13, 2020
Member
|
This still doesn't quite fix the Aer tests. Running tests on this branch there is still one test failure with I'm guessing this is to do with JSON storing complex as a pair vs using complex in python dict? |
Member
Author
|
@chriseclectic yeah, that looks like the pulse system model was assuming |
mtreinish
added a commit
to mtreinish/qiskit-aer
that referenced
this pull request
Apr 14, 2020
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().
mtreinish
added a commit
to mtreinish/qiskit-aer
that referenced
this pull request
Apr 14, 2020
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().
chriseclectic
added a commit
to Qiskit/qiskit-aer
that referenced
this pull request
Apr 14, 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>
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>
faisaldebouni
pushed a commit
to faisaldebouni/qiskit-terra
that referenced
this pull request
Aug 5, 2020
* Add missing dict conversion in backconfiguration class After Qiskit#4016 has merged a missed edge case in the handling of to_dict() and from_dict() for PulseBackendConfiguration was discovered via the aer unit tests. The u_channel_lo attribute is a nested object and needs to call UChannelLO's to_dict() and from_dict() methods in those respective calls. However, this conversion was not being done. This commit corrects the oversight. * Fix pulse defaults to dict There was an issue in the pulse defaults to_dict() method too where the converters attribute was incorrectly attempted to be output as a property in the output dictionary. This was incorrect and it just a helper there constructed based on other input. So outputting it with the dictionary was incorrect. This commit corrects this oversight. * Fix typo and tests * Fix typo in tests * Remove another extra defaults attribute * Update type hint Co-authored-by: Christopher J. Wood <cjwood@us.ibm.com>
ElePT
pushed a commit
to ElePT/qiskit-ibm-provider
that referenced
this pull request
Oct 9, 2023
…#4124) * Add missing dict conversion in backconfiguration class After Qiskit/qiskit#4016 has merged a missed edge case in the handling of to_dict() and from_dict() for PulseBackendConfiguration was discovered via the aer unit tests. The u_channel_lo attribute is a nested object and needs to call UChannelLO's to_dict() and from_dict() methods in those respective calls. However, this conversion was not being done. This commit corrects the oversight. * Fix pulse defaults to dict There was an issue in the pulse defaults to_dict() method too where the converters attribute was incorrectly attempted to be output as a property in the output dictionary. This was incorrect and it just a helper there constructed based on other input. So outputting it with the dictionary was incorrect. This commit corrects this oversight. * Fix typo and tests * Fix typo in tests * Remove another extra defaults attribute * Update type hint Co-authored-by: Christopher J. Wood <cjwood@us.ibm.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
After #4016 has merged a missed edge case in the handling of to_dict()
and from_dict() for PulseBackendConfiguration was discovered via the aer
unit tests. The u_channel_lo attribute is a nested object and needs to
call UChannelLO's to_dict() and from_dict() methods in those respective
calls. However, this conversion was not being done. This commit corrects
the oversight.
Details and comments