-
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
ProcessTomography analysis gives UnboundLocalError: local variable 'num_cond' referenced before assignment #1182
Comments
Ok specifying the provider fixes the issue. The error message should be made more helpful though. from qiskit_experiments.framework.experiment_data import ExperimentData
service = ExperimentData.get_service_from_backend(backend)
data = ExperimentData.load("4f939335-6fe0-4711-b47e-e7c6a14afb0c", service, provider=provider)
experiment = ProcessTomography(target_circuit)
data = experiment.analysis.run(data)
data.block_for_results() |
the data is retrieved using Edit: |
…bject (#1313) ### Summary Added a warning for the user if the `ExperimentData` data is empty before running an analysis and if the data couldn't be retrieved. ### Details and comments Some details that should be in this section include: - The user will get an un-inductive error regarding the analysis while the reason it was raised is because the analysis doesn't have data to analyze from the experiment. We can see an example in #1182 . - A solution that was suggested was to raise an error that says the user is trying to run analysis on empty `ExperimentData` object but the team didn't want to constraint the user to run analysis only if the experiment has data so we decided that raising a warning is enough. Changes: - [x] Added warning before analysis if `ExperimentData.data()` is empty. ### PR checklist (delete when all criteria are met) - [x] I have read the contributing guide `CONTRIBUTING.md`. - [x] I have added a release note file using `reno` if this change needs to be documented in the release notes. --------- Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>
…bject (qiskit-community#1313) ### Summary Added a warning for the user if the `ExperimentData` data is empty before running an analysis and if the data couldn't be retrieved. ### Details and comments Some details that should be in this section include: - The user will get an un-inductive error regarding the analysis while the reason it was raised is because the analysis doesn't have data to analyze from the experiment. We can see an example in qiskit-community#1182 . - A solution that was suggested was to raise an error that says the user is trying to run analysis on empty `ExperimentData` object but the team didn't want to constraint the user to run analysis only if the experiment has data so we decided that raising a warning is enough. Changes: - [x] Added warning before analysis if `ExperimentData.data()` is empty. ### PR checklist (delete when all criteria are met) - [x] I have read the contributing guide `CONTRIBUTING.md`. - [x] I have added a release note file using `reno` if this change needs to be documented in the release notes. --------- Co-authored-by: Yael Ben-Haim <yaelbh@il.ibm.com>
Informations
What is the current behavior?
Steps to reproduce the problem
What is the expected behavior?
Should work.
Suggested solutions
Weird thing I noticed is that if I add the following line, which should be unnecessary, then there is no error, but also no analysis results are produced (
data.analysis_results()
is an empty list)The text was updated successfully, but these errors were encountered: