This repository was archived by the owner on Jun 9, 2023. It is now read-only.
qiskitexamples: run examples on remote server & also on local simulator #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
qiskitexamples
mostly run the examples on IBM Quantum Experience remote simulator andibmqx2
. With the changes in this PR, we can also run the examples on the local simulator in our computer.Why
As mentioned in issue #8, I am working with the owners of the QISKit SDK Python project to deploy the C++ QASM simulator as a Debian package. Once this is done, I would like to prepare a new PR to make use of this simulator in the Swift framework and then, I will need a way to show it is working as expected. My intention is to modify
qiskitexamples
to let the user decide which local simulator he/she wants to use.How
qiskitexamples
now exposes a new option:--local
If instead of
--token <token>
, you specify--local
; the program will not try to connect to the server, instead it will run the test on your local simulator (backendlocal_qasm_simulator
).Of all the changes the most interesting is the new class I have introduced named
CommandLineOption
. It holds thetoken
(in case there is any) and defines an enumerated typed with the different backends the program uses. At this moment, it might not seem specially useful but, later on, when we can choose between the current local simulator and the C++ QASM simulator, I intend to limit to this class the necessary changes to allow this functionality; the resulting code should be cleaner (or at least, I hope so :) )