Skip to content
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

Hamiltonian simulation for hyperbolic partial differential equations by scalable quantum circuits #581

Open
NadavClassiq opened this issue Nov 5, 2024 · 10 comments
Assignees
Labels
Paper Implementation Project Implement a paper using Classiq quantum intermediate Requires some basic knowledge in quantum computing

Comments

@NadavClassiq
Copy link
Contributor

NadavClassiq commented Nov 5, 2024

Hamiltonian simulation for hyperbolic partial differential equations by scalable quantum circuits

Abstract

Differential equations are fundamental to understanding quantum systems, yet classical methods struggle with the simulation of large quantum systems due to computational inefficiencies. Recent advancements in quantum computing have opened new pathways for solving differential equations with greater efficiency. The paper Hamiltonian Simulation for Hyperbolic Partial Differential Equations by Scalable Quantum Circuits by Yuki Sato et al. proposes a method for solving certain partial differential equations by transforming them into a Schrödinger equation, which can then be solved via Hamiltonian simulation on a quantum computer.

Project Overview

Challenge: Implement the technique outlined in the referenced paper to solve the advection equation with Dirichlet boundary conditions. You will test both a Hamiltonian simulation method of your choice and the circuit implementation proposed in the paper.

Objective

Solve the following advection equation with Dirichlet boundaries:

$$ \frac{d\psi}{dt} = \frac{d\psi}{dx} = 0$ $$ $$ \psi(0, x) = \begin{cases} 1, & \text{if } 1 < x < 2 \\ 0, & \text{otherwise} \end{cases} $$

  1. Implement a parametrized quantum program as a function of time.
  2. Run a single execution of the quantum algorithm using the statevector simulator for $t = 1.0$.
  3. Compare CX-gate counts between the paper’s proposed quantum circuit and a Hamiltonian simulation using Classiq for different time values.

Deliverables

  • Jupyter Notebook containing:
    • A quantum program implemented in Classiq to execute the algorithm.
    • A graphical visualization of the resulting function $\psi(x, t=1.0)$.
    • A quantitative analysis of CX-gate counts for both the quantum circuit from the paper and the Hamiltonian simulation via Classiq, presented in a graphical format.

Follow the Contribution Guidelines in CONTRIBUTING.md. If you need any assistance, feel free to reach out via GitHub or join our Slack Community.

Getting Started

  1. Review Paper: Study the method described in Hamiltonian Simulation for Hyperbolic Partial Differential Equations by Scalable Quantum Circuits by Yuki Sato et al.
  2. Set Up Environment: Create a new Jupyter Notebook and install the Classiq SDK; refer to the setup guide.
  3. Guiding Materials:

Implementation Steps

  1. Algorithm Coding:

    • Implement the algorithm for solving the advection equation with Classiq SDK.
    • Define the Hamiltonian based on the advection equation and parameterize it as a function of time.
    • Document steps in markdown, following the Glued Trees Example.
    • For support, contact us on GitHub or Slack.
  2. Mathematical Explanation:

    • Use markdown and LaTeX to explain theoretical background, key equations, and algorithm insights.
  3. Generate .qmod File:

    • Use write_qmod(model, "filename.qmod") to save your models.
    • Confirm successful notebook execution and .qmod file generation.
  4. Quality Check:

    • Proofread for accuracy and ensure code correctness.
    • Use clear markdown formatting and a professional presentation.
  5. Submit Contribution:

    • Follow Contribution Guidelines.
    • Open a Pull Request in classiq-library/research/differential_equation_simulation.
    • Include a summary of insights and results.

Resources


Note: No strict deadline. Confirm with us if you start this task so we can assign it to you.

Good Luck!

@NadavClassiq NadavClassiq added quantum intermediate Requires some basic knowledge in quantum computing Paper Implementation Project Implement a paper using Classiq labels Nov 5, 2024
@AprilSweettooth
Copy link

Hey, I have successfully implemented the algorithm yesterday, but for some reason I have the error '’module ‘pydantic’ has no attribute ‘model_validator' showing up, without updating or changing any packages. May I ask how to resolve this? Thanks!

@AprilSweettooth
Copy link

I think I have implemented the algo in the paper. Would it be possible to have a check with someone from classiq? Thanks.

@orsa-classiq
Copy link
Collaborator

Hi @AprilSweettooth
It seems that someone just asked that in the community (maybe you? :) ). Here is the link to the answer:
pydantic

Hi. model_validator exists in pydantic since version 2, and since version 0.52 classiq depends on version 2 of pydantic.
From the error it seems like the environment you have classiq installed in also has pydantic 1.
You can try upgrading your classiq SDK by running pip install -U classiq and it should update the pydantic dependency as well.
If you have a different package installed that needs pydantic 1 you should either check if there is a version of that package that supports pydantic 2, or use a virtual environment to separate the package with conflicting dependencies.

@orsa-classiq
Copy link
Collaborator

Let us know if you want to take this issue @AprilSweettooth

@AprilSweettooth
Copy link

Hi @AprilSweettooth It seems that someone just asked that in the community (maybe you? :) ). Here is the link to the answer: pydantic

Hi. model_validator exists in pydantic since version 2, and since version 0.52 classiq depends on version 2 of pydantic.
From the error it seems like the environment you have classiq installed in also has pydantic 1.
You can try upgrading your classiq SDK by running pip install -U classiq and it should update the pydantic dependency as well.
If you have a different package installed that needs pydantic 1 you should either check if there is a version of that package that supports pydantic 2, or use a virtual environment to separate the package with conflicting dependencies.

Yes, this is resolved now, thanks!

@AprilSweettooth
Copy link

Let us know if you want to take this issue @AprilSweettooth

Yes, please.

@NadavClassiq
Copy link
Contributor Author

Hello @AprilSweettooth!
Do you plan to open a PR on this issue?

@AprilSweettooth
Copy link

Hi @NadavClassiq, sorry I haven't found time to write up the explanation yet!

@NadavClassiq
Copy link
Contributor Author

Hi @AprilSweettooth, that is perfectly fine.
I just want to know if I should be assigned to this task and possibly know when to expect a PR, not restrictively.

@AprilSweettooth
Copy link

Hi @NadavClassiq, if that's the case, please feel free to make any necessary adjustments to the assignment, as I don’t want to hold up the progress of the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Paper Implementation Project Implement a paper using Classiq quantum intermediate Requires some basic knowledge in quantum computing
Projects
None yet
Development

No branches or pull requests

3 participants