Skip to content

Conversation

@TomerGoldfriend
Copy link
Member

PR Description

This PR improves the Hamiltonian simulation based on block encoding example: align with new features, use optimized select operation for the Qubitization and QSVT approaches, and include a GQSP example.

Some notes

  • Please make sure that the notebook runs successfully with the latest Classiq version.

  • [ x] Please make sure that you placed the files in an appropriate folder

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

I would flip the 1st and 2nd paragraphs (first motivation, then how people solve it)

"and applications, such as Continouos Quantum Walk. " - not sure if that is actually an application or a primitive. but you can mention GS preparaiton of gibbs sampling.

Promise - I think it is not relevant


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

"This will be acheived by implementing a block-encoding for the polynomial approximation of the function" - you don't block encode the function - you block encode the function of the hamiltonian

last sentence is missing a '.'


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

the words 'more important' are a bit weird here


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

I am not sure - is it right to say 'block encoded state'?


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

Line #1.    DATA_SIZE = HAMILTONIAN.num_qubits

you already defined this one above.

Also, be consistent with either capital or lower case


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

can you use the previously defined BlockEncodedState?


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

maybe mention that the need for negative_power is because the expansion in exp(i*theta) include negative powers as well


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

Line #7.    print(

maybe define some utility function vector_overlap because you do this calculation 3 times?


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

Line #36.        U(0, 0, np.pi / 2, -np.pi / 2, state.block.block_lcu)

use phase instead of this U

consider using within_apply for the H


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

the cx-counts is a bit misleading, maybe add some effective_counts that is the product with the scaling factor. Also the scaling factor is chosen a bit arbitrarily, I would choose it close to 1 so it won't affect the result.

Additionaly, add the approximation ratio or something like that, it also has impact on the comparison


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

yeilds -> yields


Reply via ReviewNB

@@ -5,34 +5,83 @@
"id": "0",
Copy link
Collaborator

@orsa-classiq orsa-classiq Oct 20, 2025

Choose a reason for hiding this comment

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

unfinished sentence


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