Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tensornetwork as tn
- import numpy as np
- net = tn.TensorNetwork()
- a = net.add_node(np.eye(2))
- b = net.add_node(np.eye(2))
- a[0] ^ b[0] # Same as net.connect(a[0], b[0])
- result = a @ b # Same as net.contract_between(a, b)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement