Skip to content

Instantly share code, notes, and snippets.

@chaserileyroberts
Last active October 2, 2019 23:25
Show Gist options
  • Save chaserileyroberts/b425bf684ef91fc651cb45a04d84b7aa to your computer and use it in GitHub Desktop.
Save chaserileyroberts/b425bf684ef91fc651cb45a04d84b7aa to your computer and use it in GitHub Desktop.
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment