TensorNetwork icon indicating copy to clipboard operation
TensorNetwork copied to clipboard

Make Node a subclass of Tensor?

Open repst opened this issue 5 years ago • 5 comments

Having not followed the recent PRs, our group became aware of the new Tensor class with the release of 0.4.2. We found that tensornetwork.ncon, tensornetwork.conj and tensornetwork.node now take Tensor objects and throw errors when passed Node objects. If Node inherited from Tensor they could share such functionality. I think of a node as a tensor with extra ability to connect to other nodes.

What do you think of this solution rather than wrapping Node around Tensor as discussed in #848?

repst avatar Oct 26 '20 21:10 repst

Hi Ryan, great suggestion! I think that would make sense. @Thenerdstation @alewis, what are your thoughts?

mganahl avatar Oct 27 '20 07:10 mganahl

It seems fine to me. I don't know how Node works well enough to decide how hard it would be.

On Tue, Oct 27, 2020 at 3:15 AM Martin Ganahl [email protected] wrote:

Hi Ryan, great suggestion! I think that would make sense. @Thenerdstation https://github.com/Thenerdstation @alewis https://github.com/alewis, what are your thoughts?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/TensorNetwork/issues/858#issuecomment-717040016, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINHBUYOISOGBOZQJ3NYODSMZXRXANCNFSM4S77AMAA .

alewis avatar Oct 27 '20 12:10 alewis

Hey @repst to give you some perspective: we added Tensor specifically for use in traditional tensor network calculations where the Node API becomes cumbersome to use. We are currently working to move the DMRG implementation towards a consistent use of Tensor.

mganahl avatar Oct 27 '20 15:10 mganahl

Nevertheless, it would be a nice simplification to the interface if all the tn. functions worked on Node

On Tue, Oct 27, 2020 at 11:02 AM Martin Ganahl [email protected] wrote:

Hey @repst https://github.com/repst to give you some perspective: we added Tensor specifically for use in traditional tensor network calculations where the Node API becomes cumbersome to use. We are currently working to move the DMRG implementation towards a consistent use of Tensor.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/TensorNetwork/issues/858#issuecomment-717305882, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINHBRAG56SVAWNEQTTVKDSM3OIRANCNFSM4S77AMAA .

alewis avatar Oct 27 '20 15:10 alewis

Yeah, as long as all of the nodes created by these methods always return with dangling legs, i think that would be fine.

chaserileyroberts avatar Oct 28 '20 18:10 chaserileyroberts