-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concretize Ansatz
type with "lattice"/connectivity information and refactor subtypes on top of it
#204
base: master
Are you sure you want to change the base?
Conversation
678c3af
to
9b22b13
Compare
@jofrevalles The code is basically finished and the tests have been refactored. I need to add some more tests, but the current tests are failing on comparing 2 I thought this comparison should already be working (we have a |
It seems to be working for me: julia> using Tenet
julia> rand_array = rand(2,2,2)
2×2×2 Array{Float64, 3}:
[:, :, 1] =
0.305335 0.447022
0.0377352 0.553704
[:, :, 2] =
0.0825549 0.671104
0.22955 0.801683
julia> A = Tensor(rand_array, (:i, :j, :k))
2×2×2 Tensor{Float64, 3, Array{Float64, 3}}:
[:, :, 1] =
0.305335 0.447022
0.0377352 0.553704
[:, :, 2] =
0.0825549 0.671104
0.22955 0.801683
julia> B = Tensor(permutedims(rand_array, (1, 3, 2)), (:i, :k, :j))
2×2×2 Tensor{Float64, 3, Array{Float64, 3}}:
[:, :, 1] =
0.305335 0.0825549
0.0377352 0.22955
[:, :, 2] =
0.447022 0.671104
0.553704 0.801683
julia> A == B
true |
@jofrevalles Seems like the problem is (again) related to the way indices are replaced when doing |
In my opinion, it would be much better to revert the code to what we had previously (so indices are not repeated, and just have an |
I wouldn't change the indices for plotting because it will lie to the users. |
I mean, you can take any |
…PS`, `MPO`, `PEPS`
Inspired by ITensorNetworks.jl (but not equal), I experimented with using a graph for representing the connectivity between different sites.
In "ITensorNetworks.jl", they use the graph for representing the structure of the TensorNetwork and the connectivity graph of the different sites, which is useful when dealing with lattices or hamiltonians. Unlike them, the hypergraph structure is already implicit in
TensorNetwork
, but it doesn't comfortably accommodate for fixed structured Tensor Networks like MPS, PEPS, TTN, ...By adding a graph field in
Ansatz
that accounts for the connectivity pattern between sites, a lot of the software design problems can be mitigated.I've also refactored
Chain
intoMPS
andMPO
andGrid
intoPEPS
and(actually, I've never seen a PEPO in real life).PEPO
@jofrevalles @starsfordummies you might want to reconsider refactoring your PR on top of this.