Skip to content

Commit

Permalink
Use random_mps (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman authored May 17, 2024
1 parent bc8fffd commit 1e07b3c
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensorGaussianMPS"
uuid = "2be41995-7c9f-4653-b682-bfa4e7cebb93"
authors = ["Matthew Fishman <[email protected]> and contributors"]
version = "0.1.9"
version = "0.1.10"

[deps]
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ println("\nFree fermion starting energy")
@show inner(ψ0, H, ψ0)

# Random starting state
ψr = randomMPS(s, n -> n Nf ? "1" : "0")
ψr = random_mps(s, n -> n Nf ? "1" : "0")

println("\nRandom state starting energy")
@show inner(ψr, H, ψr)
Expand Down
4 changes: 4 additions & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
ITensorGaussianMPS = "2be41995-7c9f-4653-b682-bfa4e7cebb93"
ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"

[compat]
ITensorMPS = "0.2.2"
ITensors = "0.6.7"
2 changes: 1 addition & 1 deletion examples/hubbard_1d_spin_conservation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ H = MPO(os_interacting, s)
#@show norm(prod(H) - prod(H_noninteracting))

# Random starting state
ψr = randomMPS(s, n -> n Nf ? (isodd(n) ? "" : "") : "0")
ψr = random_mps(s, n -> n Nf ? (isodd(n) ? "" : "") : "0")

println("Random starting state energy")
@show flux(ψr)
Expand Down
2 changes: 1 addition & 1 deletion examples/hubbard_2d_spin_conservation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ end
H = MPO(os, s)

# Random starting state
ψr = randomMPS(s, n -> n Nf ? (isodd(n) ? "" : "") : "0")
ψr = random_mps(s, n -> n Nf ? (isodd(n) ? "" : "") : "0")

println("\nRandom starting state energy")
@show flux(ψr)
Expand Down
2 changes: 1 addition & 1 deletion examples/spinless_fermion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end
H = MPO(os, s)

# Random starting state
ψr = randomMPS(s, n -> n Nf ? "1" : "0")
ψr = random_mps(s, n -> n Nf ? "1" : "0")

println("\nRandom state starting energy")
@show flux(ψr)
Expand Down
4 changes: 4 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
ITensorMPS = "0.2.2"
ITensors = "0.6.7"
4 changes: 2 additions & 2 deletions test/electron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ end
H = MPO(os_interacting, s)

# Random starting state
ψr = randomMPS(s, n -> n Nf ? (isodd(n) ? "" : "") : "0")
ψr = random_mps(s, n -> n Nf ? (isodd(n) ? "" : "") : "0")

@test flux(ψr) == QN(("Nf", Nf, -1), ("Sz", 0))
@test flux(ψ0) == QN(("Nf", Nf, -1), ("Sz", 0))
Expand Down Expand Up @@ -255,7 +255,7 @@ end
H = MPO(os_interacting, s)

# Random starting state
ψr = randomMPS(s, n -> n Nf ? (isodd(n) ? "" : "") : "0")
ψr = random_mps(s, n -> n Nf ? (isodd(n) ? "" : "") : "0")
@show flux(ψr), flux(ψ0)
#@test flux(ψr) == QN(("Nf", Nf, -1), ("Sz", 0))
#@test flux(ψ0) == QN(("Nf", Nf, -1), ("Sz", 0))
Expand Down

2 comments on commit 1e07b3c

@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/107028

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.10 -m "<description of version>" 1e07b3cb267d5dc097a1a92d246bb75a6d06694c
git push origin v0.1.10

Please sign in to comment.