JoeyT1994 / ITensorNumericalAnalysis.jl

MIT License
3 stars 0 forks source link

Operators #13

Closed JoeyT1994 closed 3 months ago

JoeyT1994 commented 4 months ago

This code adds operators into the mix, specifically the ability to build derivative operators by constructing stencils which are operators that perform the mapping: f(x,y,z, ...) -> a*f(x+h, y, z, ...) + b*f(x, y, z, ...) + c*f(x-h, y, z, ...) where a,b,c are arbitrary scalars and h = 1/(2^L) with L the number of bits in the dimension where the derivative is being taken. The derivative can be taken in any dimension you wish.

Currently this operator is only supported on trees but a simple modification can be done to make it work on any graph (by taking a spanning tree of that graph).

Tests are included. Slight refactor of the TensorNetworkFunctionals.jl file to streamline the module interface.

emstoudenmire commented 4 months ago

The stencil idea is really nice. Are yall planning to lift the limitation on only passing three numbers?

JoeyT1994 commented 4 months ago

The stencil idea is really nice. Are yall planning to lift the limitation on only passing three numbers?

I think so! It seems straightforward enough to do shift by any multiple of (1/2^{L}) so that would allow us to create stencils for even higher order derivatives.

JoeyT1994 commented 3 months ago

@ryanlevy Sure let me add some comments because those functions are ambiguous (and probably need better naming)