Skip to content

Instantly share code, notes, and snippets.

@chaserileyroberts
Last active October 2, 2019 23:25
Show Gist options
  • Save chaserileyroberts/0d3e69ab93661a08ca99cd8e8381f918 to your computer and use it in GitHub Desktop.
Save chaserileyroberts/0d3e69ab93661a08ca99cd8e8381f918 to your computer and use it in GitHub Desktop.
import tensornetwork as tn
import numpy as np
a = tn.Node(np.eye(2))
b = tn.Node(np.eye(2))
a[0] ^ b[0] # Same as tn.connect(a[0], b[0])
result = a @ b # Same as tn.contract_between(a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment