-
Notifications
You must be signed in to change notification settings - Fork 865
Execution tutorial second part #1013
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
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
updating the branch with new tests
| @@ -0,0 +1,543 @@ | |||
| { | |||
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.
Expected value -> expectation value (the more precise standard terminology)
I think Pauli strings generally refers to a single term in a Pauli operator (where a Hamiltonian is a linear combination of these). We support measuring Hamiltonians generally, not just single terms.
'Classiq Platform' is generally the name of everything, including the SDK. I guess you mean the Classiq IDE web page.
Reply via ReviewNB
| @@ -0,0 +1,543 @@ | |||
| { | |||
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.
Our coding convention everywhere is to put output parameters at the end. At some point we want to support the alternative syntax of return values.
Why do you call 'write_qmod()'? I think you can skip that.
Reply via ReviewNB
| @@ -0,0 +1,543 @@ | |||
| { | |||
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,543 @@ | |||
| { | |||
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.
See the comment about the term "Pauli string" above. Specifically, this Pauli operator is composed of 4 terms ("strings").
Reply via ReviewNB
| @@ -0,0 +1,543 @@ | |||
| { | |||
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 should be recoded to align with the new expression syntax - 0.25*(Pauli.I(0)*Pauli.I(1) + Pauli.X(0)*Pauli.X(1) - Pauli.Y(0)*Pauli.Y(1) + Pauli.Z(0)*Pauli.Z(1))
Reply via ReviewNB
| @@ -0,0 +1,543 @@ | |||
| { | |||
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 #7. with ExecutionSession(qprog) as execution_session:
What is the point in reopening a session with the same qprog immediately after closing the previous?
Reply via ReviewNB
| @@ -0,0 +1,543 @@ | |||
| { | |||
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 #5. print("First sample result:", first_estimate)
IMO making reference to an older object here is confusing, as this should represent code running at a different/time context and only making use of scalar job ids. You can comment that the value here is the same as that previously retuned from the direct estimate() call.
Reply via ReviewNB
| @@ -0,0 +1,543 @@ | |||
| { | |||
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 #5. def main(x: Output[QBit], y: Output[QBit], angles: CArray[CReal, 2]) -> None:
Here too, please put the quantum output parameters at the end.
Reply via ReviewNB
| @@ -0,0 +1,543 @@ | |||
| { | |||
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,543 @@ | |||
| { | |||
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.
Adding the second part of the execution tutorial, focused on parameterized quantum programs and measurement of Pauli Strings.