Skip to content

Function interpolation using Fourier and Chebyshev methods#49

Open
ryboselm wants to merge 27 commits intoJoeyT1994:mainfrom
ryboselm:dev
Open

Function interpolation using Fourier and Chebyshev methods#49
ryboselm wants to merge 27 commits intoJoeyT1994:mainfrom
ryboselm:dev

Conversation

@ryboselm
Copy link
Contributor

@ryboselm ryboselm commented Nov 1, 2024

ITNA Function Interpolation related changes made during the summer.

  • fourier interpolation of 1D and 2D functions and data
  • chebyshev interpolation of 1D and 2D functions and data (clenshaw evaluation-based)
  • example test file

Note: this PR formerly had grid_points and rand_p related changes. These changes are now in PR #50.

ryboselm and others added 18 commits June 3, 2024 21:37
* Add support for rng and eltype in rand_itn

* Bump ITN version

* added error catching for gridpoints and function for random gridpoint sampling

* change to overload Random.rand

* Rename to prevent dimension overload

* Rename calculate_fx(yz) to evaluate

* Rename calculate_x(yz) to calculate_p

* Rename delta_x(yz) to delta_p

* created improved grid_points()

* grid_points can take arbitrary ranges

* Return dimension_indices

* Changed instances of dimension in grid_points() and rand() to use d instead

* updated grid_points() and rand() to incorporate feedback

* grid_points() uses simpler method when span is default

* changed to rand_p() and added enforced points

* fix minor edge case

* Formatting

---------

Co-authored-by: Ryan Levy <rlevy@flatironinstitute.org>
Co-authored-by: Joseph Tindall <51231103+JoeyT1994@users.noreply.github.com>
* Add support for rng and eltype in rand_itn

* Bump ITN version

* Rename to prevent dimension overload

* Rename calculate_fx(yz) to evaluate

* Rename calculate_x(yz) to calculate_p

* Rename delta_x(yz) to delta_p

* Return dimension_indices

* add 1d polynomial interpolation

* added black box function ITNs for fourier/chebyshev

* working chebyshev

* experimenting with function_itn

* add data_itensornetwork()

* started 2D functions, expanded data into QTT

* working 2D function TNs

* 2D data to ITN

* clean up code

* rename examples and add image to ITN example

* function/data itn now takes top coefficients by magnitude by default

* formatting

* add data_itn documentation

* move interpolation functions to new file

* add compat version info

---------

Co-authored-by: Ryan Levy <rlevy@flatironinstitute.org>
Co-authored-by: Joseph Tindall <51231103+JoeyT1994@users.noreply.github.com>
* added clenshaw interpolation

* update how max_coeffs works

* add attribution and rename vars
Copy link
Collaborator

@ryanlevy ryanlevy left a comment

Choose a reason for hiding this comment

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

Thanks Ryan! Some suggestions

  • It seems your grid_points improvements are not included here (and random point stuff?), so your exact_grid=false kwarg will fail. Could we add those?
  • Could you add some tests for these functions?
  • I think all the const_itn need to include the dim they are operating on (we probably should be able to interpolate on dim 1 of a 4 dim object etc)
  • I think we should make fourier_2D_itensornetwork disbatch off of the coeffs, same with chebyshev_2D. We can also set it up such that dims tells us what dim to add everything too (similar to above because s could be bigger than the dimension of the FT)

I'm also not the biggest fan of the data_itensornetwork name function_itensornetwork names personally...

@ryboselm ryboselm requested a review from ryanlevy November 8, 2024 07:55
@JoeyT1994
Copy link
Owner

JoeyT1994 commented Nov 8, 2024

Thanks @ryboselm ! This PR is quite long for me to review all at once. As it introduces multiple separate things to the library I think we should split it up into several different PRs.

Can you create two PRs. One for the grid point changes and one for the interpolation code? That will make it easier to review.

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.

3 participants