Closed JoeyT1994 closed 3 months ago
One minor stylistic thing I noticed in a lot of the code here is that many types are constrained to be 64 bit. I.e. Int64
, Float64
. I doubt this will change performance but it could hinder the code from being more generic (e.g. what if we wanted to use Float32
mode to run some of it on GPUs later?). So I would recommend using either no type constraints in many places, or just using Integer
, Number
, etc. say when constraining function arguments.
@emstoudenmire good point, there is no real need for that restriction within the code.
I will lessen those constraints in the code for function arguments.
This PR changes
BitMap
(which originally kept a dictionary mapping vertices to adigit
and adimension
) to anIndexMap
which maps indices (of the formITensor.Index
) to adigit
anddimension
).This more directly reflects the fact that the physical indices encode the
digits
and not the vertices, meaning you could have multipledigits
on a given vertex of anITensorNetworkFunction
.A new type is introduced
IndsNetworkMap
which wraps anIndexMap
and anIndsNetwork
.ITensorNetworkFunction
then wrapsIndsNetworkMap
and anITensorNetwork
.Sweeping changes throughout in order to reflect this.