-
Notifications
You must be signed in to change notification settings - Fork 127
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 option to control figure generation in composite experiments #1240
Add option to control figure generation in composite experiments #1240
Conversation
@@ -338,7 +337,7 @@ def _evaluate_quality( | |||
Returns: | |||
String that represents fit result quality. Usually "good" or "bad". | |||
""" | |||
if fit_data.reduced_chisq < 3.0: | |||
if 0 < fit_data.reduced_chisq < 3.0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanation. This change itself makes sense to me. (I'm not sure we can really determine if a fit is good or bad based on a single value, though, but I know it's another issue.)
b8defd2
to
b3997cf
Compare
…qiskit-experiments into selective-figure-generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @coruscating. I think generate_figures
is a useful option for CompositeAnalysis
.
I have two high level questions.
- Should we expose
generate_figures
option in Experiment classes? - Do we have any means to generate some figures (without rerunning analyses) after running analyses with
generate_figures=="never"
?
(1) I think an Experiment class should not depend on an Analysis class as possible (an Analysis class may depend on Experiment classes). Basically, I don't want the changes in Analysis class affect Experiment classes. In this case, asking users to set generate_figures
via analysis option makes sense to me. What do you think?
(2) I guess no but I know adding such a feature is beyond the scope of this PR. I hope the on-going refactoring on AnalysisResult
makes the future addition of the feature much easier.
@itoko Thanks for your review! (1) I was thinking it would be convenient for users to specify (2) Good question. There's no easy way to do that now since you have to give the plotter the series data manually. I'll write an issue to track this feature. |
@coruscating thank you for the quick responses. Regarding (1), your suggestion (move |
…qiskit-experiments into selective-figure-generation
@itoko I've updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
…kit-community#1240) ### Summary Closes qiskit-community#1239. An init parameter has been added to composite analysis, `generate_figures`, to control figure generation. By default, ``generate_figures`` is ``always``, meaning figures will always be generated. If ``generate_figures`` is set to ``selective``, then only figures for analysis results of bad quality will be generated. If ``generate_figures`` is set to ``never``, then figures will never be generated. This behavior can still be overridden for individual analyses by setting the analysis option ``plot``, which is now unset by default instead of `True`. ### Details and comments - I didn't end up implementing the proposal discussed in the issue where all figures would still be generated in `selective` mode if there are 10 or fewer figures. If this is preferable, we can add the behavior, but it seems a bit messy to keep a counter of all component experiments and how many figures each generates. - Added how to access child analysis classes in the Getting Started tutorial. ### Timing benchmark I ran a parallel T1 experiment over 127 qubits then timed only the analysis. - ``always``: ~120 seconds - ``selective``: ~100 seconds (generated 60/127 figures) - ``never``: ~15 seconds
Summary
Closes #1239. An init parameter has been added to composite analysis,
generate_figures
, to control figure generation. By default,generate_figures
isalways
, meaning figures will always be generated. Ifgenerate_figures
is set toselective
, then only figures for analysis results of bad quality will be generated. Ifgenerate_figures
is set tonever
, then figures will never be generated. This behavior can still be overridden for individual analyses by setting the analysis optionplot
, which is now unset by default instead ofTrue
.Details and comments
selective
mode if there are 10 or fewer figures. If this is preferable, we can add the behavior, but it seems a bit messy to keep a counter of all component experiments and how many figures each generates.Timing benchmark
I ran a parallel T1 experiment over 127 qubits then timed only the analysis.
always
: ~120 secondsselective
: ~100 seconds (generated 60/127 figures)never
: ~15 seconds