Closed JoeyT1994 closed 2 weeks ago
@ryanlevy I added support for complex delta functions by changing the delta_p
constructor to not assume that there is only one index per vertex. With that generalization everything seems to work and I added tests
@ryanlevy any further comments or ready to merge?
This PR adds the ability to use complex arguments within the library by introducing the
ComplexIndexMap
type.The
ComplexIndexMap
works by containing an additional dictionary, in comparison to theRealIndexMap
, which keeps track of whether an index is imaginary of real. Theindex_to_scalar
function is then overloaded and will return an imaginary vs real number depending on the nature of the index.All elementary functions now can be constructed as complex versions and this will be automatic based on whether
s::IndsNetworkMap
wraps aComplexIndexMap
or aRealIndexMap
. Extensive testing is added andexamples/construct_multidimensional_function.jl
has been modified to do complex version of the functions.Operators (such as differentiation, boundary operators etc) are not tested within this framework and currently assume the underlying
IndexMap
is real (maybe we should add a check for this).Complex numbers can be accessed by calling
complex_continuous_siteinds(g, args...; kwargs...)
which will build anIndsNetworkMap
wrapping aComplexIndexMap
. One should pass the argumentscomplex_continuous_siteinds(g, real_dimension_vertices::Vector{Vector{V}}, imag_dimension_vertices::Vector{Vector{V}})
to specify on which vertices of the graphg
the real indices should be placed and on which vertices the imaginary indices should be placed. These nested vectors should ordered by dimension and then digit as usual.There is complete flexibility here over the placement and multiple indices and can be placed on the same vertex, a lot of the special tensor constructors in
utils.jl
andpolynomial_utils.jl
have been modified to allow for multiple site indices.The library has been updated to the latest version of ITensorNetworks with this PR.
This PR supercedes #32 which I will close.
@ryanlevy @ryboselm @emstoudenmire