Skip to content

Conversation

@blakejohnson
Copy link
Contributor

Summary

The verified field on analysis results was being set whenever quality was set. This incorrectly tied together the meaning of these two fields (verified references human review).

χ² was missing a means to forward to the experiment service. I have added this as a property to DbAnalysisResultsV1.

Details and comments

During testing I discovered that I could not call save() on a DbAnalysisResultV1 object that I had loaded from the service. Setting the _created_in_db field was sufficient to fix this.

@CLAassistant
Copy link

CLAassistant commented Jul 21, 2021

CLA assistant check
All committers have signed the CLA.

@blakejohnson
Copy link
Contributor Author

Necessary (but insufficient) to fix #194 (the chisq part).

# Load data from the service
return cls._from_service_data(service.analysis_result(result_id))
instance = cls._from_service_data(service.analysis_result(result_id))
instance._created_in_db = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

The DbExperimentDataV1.load method probably also needs to have this attribute set on the object it returns.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in c6d0a9f.

if "success" not in res:
res["success"] = True
analysis_result = DbAnalysisResultV1(result_data=res, **analysis_result_parameters)
if "chisq" in res:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The existing experiments will need to be updated to use this label, at the moment they all populate "reduced_chisq"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could keep that if you prefer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't have a strong preference, either way is fine with me

@coruscating coruscating added this to the Release 0.1 milestone Jul 21, 2021
@yaelbh
Copy link
Collaborator

yaelbh commented Jul 21, 2021

What you did for chisq is not done for value, yet somehow the value does move forward to the experiment service. Do you know how?

@blakejohnson
Copy link
Contributor Author

@yaelbh if you look at the service endpoint (https://github.ibm.com/IBM-Q-Software/sw-ibmq-results/blob/staging/docs/api-ref.md#post-analysis_results---create-analysis-result) you can see that expects chisq outside of the fit dictionary, whereas value is expected inside it.

@yaelbh yaelbh mentioned this pull request Jul 21, 2021
Copy link
Collaborator

@chriseclectic chriseclectic left a comment

Choose a reason for hiding this comment

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

We still need to decide whether to do chisq or reduced_chisq for experiments, but I think this is good to merge for the verified and load fix.

@chriseclectic chriseclectic merged commit c642e39 into main Jul 21, 2021
@coruscating coruscating deleted the brj-chisq-and-verified branch July 22, 2021 12:52
paco-ri pushed a commit to paco-ri/qiskit-experiments that referenced this pull request Jul 11, 2022
…nt service (qiskit-community#200)

Co-authored-by: Christopher Wood <cjwood@us.ibm.com>
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.

6 participants