-
Notifications
You must be signed in to change notification settings - Fork 874
Adding execution tutorial #998
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
base: main
Are you sure you want to change the base?
Adding execution tutorial #998
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
@Alexandre-Classiq I think the tutorial should introduce execution_session
and not execute
If we do want to show both - so execute is only relevant for simple use cases where es supports much more complex operation that we can teach.
The goal is that users will use es. in general
@@ -0,0 +1,432 @@ | |||
{ |
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.
@@ -0,0 +1,432 @@ | |||
{ |
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.
Line #6. )
This is a question of taste, but to me these long lines are hard to read. I think the following yields a more convenient printout -
for state, count in results.counts.items(): print(f"state={state}, count={count}") for pc in results.parsed_counts: print(pc)
I would actually consider leaving out the counts (the bit strings are hard to interpret), and only keeping parsed_counts. Instead, I would add -
print(results.dataframe)
Reply via ReviewNB
@@ -0,0 +1,432 @@ | |||
{ |
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.
IMO the term "classical hardware" to refer to simulators is confusing (it's software simulating the behavior of quantum hardware)
I don't think 'Backend Preferences' should be capitalized - it's a generic noun..
I think a much better (and shorter way) to determine the execution preference is just passing it as a parameter to ExecutionSession
constructor (as opposed to set_quantum_program_execution_preferences
).
Reply via ReviewNB
@@ -0,0 +1,432 @@ | |||
{ |
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.
Line #11. set_quantum_program_execution_preferences(qprog, execution_preferences)
Again, I think this API should not be used. And surely the output here is a huge pile of junk..
Reply via ReviewNB
@@ -0,0 +1,432 @@ | |||
{ |
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.
Line #9. )
IMO these massive printouts are cluttering the notebook and making it harder to grasp. I think much shorter and more structured printouts would be better.
Reply via ReviewNB
@@ -0,0 +1,432 @@ | |||
{ |
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.
I'm not sure this description is very clear. You wait while your job is pending also when you use the regular sample
method. It's only when you don't want your Python script to be blocked while waiting, or maybe when you want to store the job ID on some secondary storage to be able to retrieve it in at a different time, with a different process/machine that you must use the submit_sample
variant.
Reply via ReviewNB
@@ -0,0 +1,432 @@ | |||
{ |
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.
This is the first part of the execution tutorial.