Skip to content

Conversation

@Alexandre-Classiq
Copy link
Collaborator

Adding the second part of the execution tutorial, focused on parameterized quantum programs and measurement of Pauli Strings.

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@Alexandre-Classiq Alexandre-Classiq marked this pull request as draft May 20, 2025 19:17
@Alexandre-Classiq Alexandre-Classiq marked this pull request as ready for review May 21, 2025 15:52
@@ -0,0 +1,543 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

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 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

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 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

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 code block is adding here. I would drop it.


Reply via ReviewNB

@@ -0,0 +1,543 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

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 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

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 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

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 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

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 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

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 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

Choose a reason for hiding this comment

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

Here too, please switch to the new syntax.


Reply via ReviewNB

@@ -0,0 +1,543 @@
{
Copy link
Member

@matanvax2 matanvax2 Jul 14, 2025

Choose a reason for hiding this comment

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

Why is variational quantum algorithm capitalized? This is just a common noun..


Reply via ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants