Skip to content
This repository was archived by the owner on Jun 12, 2023. It is now read-only.

Generate json files for QV tests #445

Merged

Conversation

dekool
Copy link
Contributor

@dekool dekool commented Jun 28, 2020

Summary

Added code to generate json files used in the quantum volume tests

Details and comments

Split from #398 in order to separate data generation of different functionalities

yaelbh
yaelbh previously approved these changes Jun 28, 2020

def qv_circuit_execution(qubit_lists: list, ntrials: int, shots: int):
"""
create quantum volume circuits, simulates the ideal state and run a noisy simulation
Copy link
Contributor

Choose a reason for hiding this comment

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

simulate, not simulates


def generate_qv_fitter_data(ideal_results_file_path: str, exp_results_file_path: str):
"""
run the quantum volume circuits and saves the results
Copy link
Contributor

Choose a reason for hiding this comment

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

save, not saves

ShellyGarion
ShellyGarion previously approved these changes Jun 29, 2020
@ShellyGarion
Copy link
Contributor

The code looks good!
When you generate the json files - do you get the same files in:
https://github.com/Qiskit/qiskit-ignis/tree/master/test/quantum_volume

@ShellyGarion
Copy link
Contributor

There is a build failure in one of the tests - it's not related to this PR.

yaelbh
yaelbh previously approved these changes Jun 30, 2020
@dekool
Copy link
Contributor Author

dekool commented Jun 30, 2020

when I generate the json files I do not get exactly the same files as in
https://github.com/Qiskit/qiskit-ignis/tree/master/test/quantum_volume
because these files are with the content of the pickle files. I can delete them and replace with the files from the generation code (I checked and the tests work fine with the new json files, and they look very similar, but with different results)

@ShellyGarion
Copy link
Contributor

Are the results close to the original json files?

@yaelbh
Copy link
Contributor

yaelbh commented Jun 30, 2020

Thanks @dekelmeirom !

ShellyGarion
ShellyGarion previously approved these changes Jun 30, 2020
@dekool
Copy link
Contributor Author

dekool commented Jun 30, 2020

Are the results close to the original json files?

in the quantum volume circuits creation, there is a random permutation of the gates which don't have an option to have a constant seed, so each run the results are a bit different (but their structure is the same as the results in https://github.com/Qiskit/qiskit-ignis/tree/master/test/quantum_volume)

@chriseclectic
Copy link
Collaborator

chriseclectic commented Jul 1, 2020

We should refactor the quantum volume circuit generation to use the qiskit.circuit.library.QuantumVolume, rather than the custom circuit generation function in Ignis. The circuit library QV function allows setting a seed.

@ShellyGarion
Copy link
Contributor

We should refactor the quantum volume circuit generation to use the qiskit.circuit.library.QuantumVolume, rather than the custom circuit generation function in Ignis. The circuit library QV function allows setting a seed.

Should this be a part of this PR? or is this PR depend on a refactor of the QV code in ignis?

@chriseclectic
Copy link
Collaborator

I think we should do that as a separate PR

@ShellyGarion
Copy link
Contributor

There is an open issue about this: #395

@chriseclectic
Copy link
Collaborator

@dekool I can't merge or update this Pr as its out-of-date with the base branch, and you fix rebase/merge from master to fix this?

@dekelmeirom dekelmeirom dismissed stale reviews from ShellyGarion and yaelbh via ba2cb52 July 12, 2020 07:05
@dekelmeirom dekelmeirom force-pushed the qv-test-data-generation branch from 07f0f18 to ba2cb52 Compare July 12, 2020 07:05
@chriseclectic chriseclectic merged commit 15b7177 into qiskit-community:master Jul 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants