Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. import tensornetwork as tn
  2. import numpy as np
  3.  
  4. net = tn.TensorNetwork()
  5. a = net.add_node(np.eye(2))
  6. b = net.add_node(np.eye(2))
  7. a[0] ^ b[0] # Same as net.connect(a[0], b[0])
  8. result = a @ b # Same as net.contract_between(a, b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement