Skip to content

Add Continuous-Time Quantum Walk Notebook#1507

Open
king-p3nguin wants to merge 4 commits intoClassiq:mainfrom
king-p3nguin:quantum_walk_fmo
Open

Add Continuous-Time Quantum Walk Notebook#1507
king-p3nguin wants to merge 4 commits intoClassiq:mainfrom
king-p3nguin:quantum_walk_fmo

Conversation

@king-p3nguin
Copy link
Contributor

PR Description

I added a notebook for running a continuous-time quantum walk using FMO Hamiltonian.

The notebook includes:

  • Implementation FMO Hamiltonian in classiq
  • Demonstration of continuous-time quantum walk using FMO Hamiltonian

*This notebook was created during an internship at Classiq Japan

Some notes

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

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

    • And that the file names are clear, descriptive, and match the notebook content.
      • Note that we require the file names of .ipynb and .qmod to be unique across this repository.
    • Plus, please make sure that all required files are included: .qmod, .synthesis_options.json, .metadata.json
    • And that images are embedded inside the notebook, not added as external files
  • If applicable, please include link to the paper on which the notebook is based, in the notebook itself.

  • Please use rebase on your branch (no merge commits)

  • Please link this PR to the relevant issue

  • Please make sure to run pre-commit when commiting changes

    • If you're using git in the terminal, make sure to install pre-commit via running pip install pre-commit followed by pre-commit install
    • Note that Classiq runs automatic code linting. Meaning that one of the tests verifies the output of pre-commit.
    • Also note that pre-commit may minorly alter some files. Make sure to git add the changes done by pre-commit

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions
Copy link

github-actions bot commented Mar 1, 2026

🔥 New notebook just dropped!

@amir-naveh , @TomerGoldfriend — come check out this shiny new addition to our repo.

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

our documentation doesn't parse well the \bra and \ket, so please replace all of the to |...\rangle


Reply via ReviewNB

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

I am missing something in the big picture - what is the purpose of the quantum walk in this case?

And what quantity are we measuring?


Reply via ReviewNB

Copy link
Collaborator

Choose a reason for hiding this comment

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

Note, that the Hamiltonian is quadratic, therefore for an initial fermionic gaussian state such as the vaccum state, or any slater determinate state such as a_m^\dagger....a_1^\dagger|vaccum> the dynamics can be solved in polynomial time in the number of qubits on a classical compute (basically be diagonalizing the single electron Hamiltonian h, where H = sum_{n,m} a_m^\dagger h_{mn}a_n).

see for example https://arxiv.org/abs/2111.08343,

In addition, there are quantum methods to perform efficient and exact propagation of a Gaussian fermionic state, when the dynamics is generated by a quadratic Hamiltonian, so there is no need for Trotterization. See for example: https://arxiv.org/abs/1711.05395

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here, the quantum walk is used to see the exciton population dynamics in the FMO complex. We are measuring the exciton population in each pigment by sampling.

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

what is the result that you measure?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are measuring the exciton population in each pigment by sampling.

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

Line #10.        def main(qnum: Output[QNum]):

I think that you can set time_point as a parameter of main. Then you can synthesize just once, and pass time as a parameter to execution every iteration (see Execution Parameters in the docs)


Reply via ReviewNB

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

Line #12.            suzuki_trotter(

notice that since the number of repetitions stay the same, you loose accuracy with the increase in time.

You can either increase it or explain it in the graph you plot


Reply via ReviewNB

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

Line #43.        print(duration)

write text before each number to explain it or just remove the prints


Reply via ReviewNB

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

why did you choose to plot points only on the peaks? It will be more convincing if you have more points \ points on other trends


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought increasing the number of plots would take too much time, but using ExecutionSession solved the issue. I increased the number of points.

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

is this the J_mn in your equation?


Reply via ReviewNB

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the J_mn is the off-diagonal element in the Hamiltonian.

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

Is H already in qubits or fermionic?

If it is in qubits, so instead of your create_projector function, I think you can use the matrix_to_hamiltonian function.

BTW in this case is the algorithm scalable? because it seems that the input already scales with the exponent of the number of qubits


Reply via ReviewNB

Copy link
Contributor Author

@king-p3nguin king-p3nguin Mar 5, 2026

Choose a reason for hiding this comment

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

I was not able to use matrix_to_hamiltonian function due to the following error:

AssertionError: Matrix dimension is not a power of 2

I believe this code is necessary because the algorithm must work even when the number of pigments is not a power of two.

The Frenkel exciton Hamiltonian restricts the excitation to the single-exciton manifold, so it is not scalable. However, for a better description of energy-transfer dynamics, we need to mix single-exciton states with ground-state or multiexciton states, and in this case, the computational complexity scales exponentially with the number of pigments (J. Chem. TheoryComput. 2022, 18, 1347−1358). I will mention this in the notebook.

@@ -0,0 +1,444 @@
{
Copy link
Collaborator

@orsa-classiq orsa-classiq Mar 3, 2026

Choose a reason for hiding this comment

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

"Since it is difficult to directly execute ..." - I would use another words. Talk about approximating the evolution.


Reply via ReviewNB

@king-p3nguin
Copy link
Contributor Author

@orsa-classiq Thank you for the review. I changed the notebook as requested.

The URL can be accessed without issue, yet it failed the test. Should I delete the problematic URL?

@classiqdor
Copy link
Contributor

classiqdor commented Mar 5, 2026

@orsa-classiq Thank you for the review. I changed the notebook as requested.

The URL can be accessed without issue, yet it failed the test. Should I delete the problematic URL?

If that's the case, and the URL works fine, then add it to .internal/url_allow_list.txt
Thank you!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants