Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use random_itensor and random_mps #6

Merged
merged 2 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensorVisualizationBase"
uuid = "cd2553d2-8bef-4d93-8a38-c62f17d5ad23"
authors = ["Matthew Fishman <[email protected]> and contributors"]
version = "0.1.10"
version = "0.1.11"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ j = Index(10, "j")
k = Index(40, "k")
l = Index(40, "l")
m = Index(40, "m")
A = randomITensor(i, j, k)
B = randomITensor(i, j, l, m)
C = randomITensor(k, l)
A = random_itensor(i, j, k)
B = random_itensor(i, j, l, m)
C = random_itensor(k, l)
ABC = @visualize A * B * C
```
This will execute the contraction and output
Expand Down
12 changes: 12 additions & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[deps]
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2"
ITensorVisualizationBase = "cd2553d2-8bef-4d93-8a38-c62f17d5ad23"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
LayeredLayouts = "f4a74d36-062a-4d48-97cd-1356bad1de4e"
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"

[compat]
ITensorMPS = "0.2.2"
ITensors = "0.6.8"
10 changes: 5 additions & 5 deletions examples/ex_dmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ x = Index([QN("Sz", 0) => 2]; tags="X")
y = Index([QN("Sz", 0) => 2]; tags="Y")

n = 2
ψn1n2 = randomITensor(l⃗[n - 1], s⃗[n], s⃗[n + 1], l⃗[n + 1], dag(x), dag(y))
hn1 = randomITensor(dag(h⃗[n - 1]), s⃗[n]', dag(s⃗[n]), h⃗[n], x, y)
hn2 = randomITensor(dag(h⃗[n]), s⃗[n + 1]', dag(s⃗[n + 1]), h⃗[n + 1])
ELn0 = randomITensor(l⃗[n - 1]', h⃗[n - 1], dag(l⃗[n - 1]))
ERn2 = randomITensor(l⃗[n + 1]', dag(h⃗[n + 1]), dag(l⃗[n + 1]))
ψn1n2 = random_itensor(l⃗[n - 1], s⃗[n], s⃗[n + 1], l⃗[n + 1], dag(x), dag(y))
hn1 = random_itensor(dag(h⃗[n - 1]), s⃗[n]', dag(s⃗[n]), h⃗[n], x, y)
hn2 = random_itensor(dag(h⃗[n]), s⃗[n + 1]', dag(s⃗[n + 1]), h⃗[n + 1])
ELn0 = random_itensor(l⃗[n - 1]', h⃗[n - 1], dag(l⃗[n - 1]))
ERn2 = random_itensor(l⃗[n + 1]', dag(h⃗[n + 1]), dag(l⃗[n + 1]))

edge_labels = (; plevs=true)

Expand Down
2 changes: 1 addition & 1 deletion examples/ex_qn_mps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using ITensorMPS
using ITensorVisualizationBase

s = siteinds("S=1/2", 5; conserve_qns=true)
ψ = randomMPS(s, n -> isodd(n) ? "" : ""; linkdims=2)
ψ = random_mps(s, n -> isodd(n) ? "" : ""; linkdims=2)
orthogonalize!(ψ, 2)
ψdag = prime(linkinds, dag(ψ))
tn =..., ψdag...]
Expand Down
27 changes: 0 additions & 27 deletions examples/notest_ex_2d_circuit.jl

This file was deleted.

23 changes: 0 additions & 23 deletions examples/notest_ex_qft_circuit.jl

This file was deleted.

5 changes: 5 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2"
ITensorVisualizationBase = "cd2553d2-8bef-4d93-8a38-c62f17d5ad23"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
LayeredLayouts = "f4a74d36-062a-4d48-97cd-1356bad1de4e"
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
ITensorMPS = "0.2.2"
ITensors = "0.6.8"
10 changes: 5 additions & 5 deletions test/test_basics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ using Test
y = Index([QN("Sz", 0) => 2]; tags="Y")

n = 2
ψn1n2 = randomITensor(l⃗[n - 1], s⃗[n], s⃗[n + 1], l⃗[n + 1], dag(x), dag(y))
hn1 = randomITensor(dag(h⃗[n - 1]), s⃗[n]', dag(s⃗[n]), h⃗[n], x, y)
hn2 = randomITensor(dag(h⃗[n]), s⃗[n + 1]', dag(s⃗[n + 1]), h⃗[n + 1])
ELn0 = randomITensor(l⃗[n - 1]', h⃗[n - 1], dag(l⃗[n - 1]))
ERn2 = randomITensor(l⃗[n + 1]', dag(h⃗[n + 1]), dag(l⃗[n + 1]))
ψn1n2 = random_itensor(l⃗[n - 1], s⃗[n], s⃗[n + 1], l⃗[n + 1], dag(x), dag(y))
hn1 = random_itensor(dag(h⃗[n - 1]), s⃗[n]', dag(s⃗[n]), h⃗[n], x, y)
hn2 = random_itensor(dag(h⃗[n]), s⃗[n + 1]', dag(s⃗[n + 1]), h⃗[n + 1])
ELn0 = random_itensor(l⃗[n - 1]', h⃗[n - 1], dag(l⃗[n - 1]))
ERn2 = random_itensor(l⃗[n + 1]', dag(h⃗[n + 1]), dag(l⃗[n + 1]))

tn = [ELn0, ψn1n2, hn1, hn2, ERn2]

Expand Down
Loading