Renaming NconBuilder and related
We should consider renaming the methods around NconBuilder.
Current changes proposed: NconBuilder -> ContractionBuilder tn.contract -> tn.contract_edge tn.finalize -> tn.contract
#869
Well, I think it's a good idea. I personally think I would prefer this API in my own work, which is admittedly fairly MPS-centric.
I also like the opportunity it gives to abstract contractions so they can be manipulated and so on independently of the concrete tensors. I wonder if we can invent convenient functions to generate e.g. reflections of contractions:
given
|----
A-B-
|----
return
--|
---B-A
--|
Ok well I can't get the bottom one to come out right but hopefully you get the idea. Not sure if it's feasible.
tn.conj?
I would stick to conj and transpose for that.
Sorry, what I mean is that the function would be transpose, not the output tensor
I don't understand what you mean.
Well that's cause the idea is a bit half-baked:
-eventually we could use Contraction/NconBuilder to create "Contraction" objects which do the specified ncon call -having done that one could also imagine functions acting on the tn.Contraction before it is actually used. For example, reflecting the specified tensor network about an axis, permuting the output, removing one of the tensors or adding a new one.
On Tue, Nov 3, 2020 at 12:27 PM Chase Roberts [email protected] wrote:
I don't understand what you mean.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/google/TensorNetwork/issues/871#issuecomment-721270676, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINHBUIOJUV7PCEMMRSFPTSOA4PRANCNFSM4THWZZ5A .
I really like this idea. We could use NconBuilder as a "shell" tensor network class that Glen was proposing a few months back. The NconBuilder could for example store metadata about contraction orders and the like. In that case it would be useful to be able to replace the current tensors in the builder with new ones. For complicated algorithms, reusing the network structure with different tensors is sometimes useful.
In a way, this would be similar to the early TensorNetwork object we had, but easier to build.
You could not live with your own failed OO design. And where did that bring you? Back to me.
-- The TensorNetwork class
And I like all these ideas. My only request is that the NconBuilder remains functional. (Immutable, functions have no side effects)
absolutely agree
You could not live with your own failed OO design. And where did that bring you? Back to me.
-- The TensorNetwork class
lol