-
Notifications
You must be signed in to change notification settings - Fork 160
[WIP] Generate json files for tests (which used pickled data) #398
Conversation
It will be better to merge this only after #407 is merged. |
@ShellyGarion if you do that can we integrate this PR with those so we can test them. Currently several tests are disabled for RB (#402) so we can't evaluate that those PRs are working correctly. |
test/rb/generate_data.py
Outdated
coherent_results.append(qiskit.execute(current_circ, backend=backend, | ||
basis_gates=basis_gates, | ||
shots=shots, | ||
noise_model=noise_model, |
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.
should it be coherent_noise_model?
test/rb/generate_data.py
Outdated
|
||
The simulation results file will contain a list of Result objects in a dictionary format. | ||
The fitter data file will contain dictionary with the following keys: | ||
- 'cnotdihedral_Z_ydata', value is stored in the form of list of dictionaries with keys of: |
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.
cnot_dihedral does not belong here...
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.
maybe you mean 'original_ydata' ?
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.
- Is the code in the
generate_data.py
files a duplicate of code that lies somewhere else? If yes then the duplication should be removed. If no then how did you decide how to write it? - I recommend to split to three PRs, for measurement calibration, quantum volume, and RB. It's ok to have the same change in
utils.py
in all three PRs. This way only the RB pull request will depend on another non-merged RB pull request.
|
Generally, you can also follow this example: |
Summary
changed the pickle files used in the fitter tests into json files.
in addition, reordered the comparing of the real results and the expected results into one function.
Details and comments
I also checked the sizes of the json files compared to the pickle files, and found that -
the run times of the tests are almost the same with pickle files and json files (when running them on my laptop) - with the json files the average was a little faster (in the scale of only 1/100 sec)