JoeyT1994 / ITensorNumericalAnalysis.jl

MIT License
3 stars 1 forks source link

Calculate point based on vertex pairs #39

Open ryanlevy opened 3 months ago

ryanlevy commented 3 months ago

We should add the following connivence function for calculate_p where instead of specifying indices in an ind_to_ind_value_map we can assume single site ind per vertex and just pass vertices Similar to

function calculate_p(input, s::IndsNetworkMap)
  ndim = dimension(s)
  x = zeros(ndim)
  for (v, value) in input
    ind = only(s[v])
    d = dimension(s, ind)
    x[d] += index_value_to_scalar(s, ind, value - 1)
  end
  return x
end
JoeyT1994 commented 3 months ago

As in input::Vector{Pair{V, Int}} where the pairs are maps from vertices of type V to index_values of type Int?

I'm okay with adding wrappers to calculate_p to do this. We should probably first define input::Vector{Pair{Index, Int}}, and then define the vertex version which checks for a single index per vertex etc