Skip to content

Commit

Permalink
Use random_itensor and random_mps (#6)
Browse files Browse the repository at this point in the history
* Use `random_itensor` and `random_mps`

* Bump to v0.1.11
  • Loading branch information
mtfishman authored May 17, 2024
1 parent d7f7976 commit 5c3603f
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 65 deletions.
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

2 comments on commit 5c3603f

@mtfishman
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/107065

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.11 -m "<description of version>" 5c3603f2300e3d262f15da96c01ee7a73903c324
git push origin v0.1.11

Please sign in to comment.