Skip to content

Implementing derivatives with periodic bc in QTT format. #9

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sakurairihito
Copy link

@sakurairihito sakurairihito commented Jul 24, 2024

Pull request (PR) for the following implementations:

  • First derivative using centered differences with periodic boundary conditions.
  • Second-order derivative using centered differences with periodic boundary conditions.
  • Linear function ( av + b ) on a uniform grid, which is for the test on derivative.

Note that the code does not depend on ITensors.jl. I would appreciate it if you could check it. Any comments and improvements on codes are welcome. If needed, other types of derivatives can be implemented. Thank you.

Reference Papers

  1. Quantized Tensor Networks for Solving the Vlasov-Maxwell Equations:
  2. A Quantum-Inspired Method for Solving the Vlasov-Poisson Equations:

@sakurairihito
Copy link
Author

I found an issue in my source and test code in this pull request, which is related to the mesh size (\Delta = 1 / 2^R), where (R) is the number of bits.

In the current pull requests, the derivative operator incorrectly uses (\Delta). Instead, we should apply (1/\Delta) to the derivative operator.

For instance, the function first_order_central_difference_periodic should be corrected as follows:

function first_order_central_difference_periodic(R::Int64)::Vector{Array{Float64,4}}
    c1 = 1 / 2
    t_left = zeros(1, 2, 2, 3)
    t_left[1, :, :, 1] = I() * 2^R
    t_left[1, :, :, 2] = (S(:plus) + S(:minus)) * 2^R
    t_left[1, :, :, 3] = (S(:plus) + S(:minus)) * 2^R

The function of second_order_derivative and test code should be corrected as the same way.
I would appreciate it if you consider this point.

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.

1 participant