-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ITensorsNamedDimsArraysExt] Convert symmetric tensors (#1578)
* [ITensorsNamedDimsArraysExt] Convert symmetric tensors * [NDTensors] Bump to v0.3.63 * [ITensors] Bump to v0.7.5
- Loading branch information
Showing
12 changed files
with
107 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "NDTensors" | ||
uuid = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" | ||
authors = ["Matthew Fishman <[email protected]>"] | ||
version = "0.3.62" | ||
version = "0.3.63" | ||
|
||
[deps] | ||
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "ITensors" | ||
uuid = "9136182c-28ba-11e9-034c-db9fb085ebd5" | ||
authors = ["Matthew Fishman <[email protected]>", "Miles Stoudenmire <[email protected]>"] | ||
version = "0.7.4" | ||
version = "0.7.5" | ||
|
||
[deps] | ||
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[deps] | ||
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" | ||
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" | ||
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" | ||
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@eval module $(gensym()) | ||
using BlockArrays: blocklengths | ||
using ITensors: ITensor, Index, QN, dag, inds, plev, random_itensor | ||
using ITensors.ITensorsNamedDimsArraysExt: to_nameddimsarray | ||
using NDTensors: tensor | ||
using NDTensors.BlockSparseArrays: BlockSparseArray, block_nstored | ||
using NDTensors.GradedAxes: isdual | ||
using NDTensors.LabelledNumbers: label | ||
using NDTensors.NamedDimsArrays: NamedDimsArray, unname | ||
using Test: @test, @testset | ||
@testset "to_nameddimsarray" begin | ||
i = Index([QN(0) => 2, QN(1) => 3]) | ||
a = random_itensor(i', dag(i)) | ||
b = to_nameddimsarray(a) | ||
@test b isa ITensor | ||
@test plev(inds(b)[1]) == 1 | ||
@test plev(inds(b)[2]) == 0 | ||
@test inds(b)[1] == i' | ||
@test inds(b)[2] == dag(i) | ||
nb = tensor(b) | ||
@test nb isa NamedDimsArray{Float64} | ||
bb = unname(nb) | ||
@test bb isa BlockSparseArray{Float64} | ||
@test !isdual(axes(bb, 1)) | ||
@test isdual(axes(bb, 2)) | ||
@test blocklengths(axes(bb, 1)) == [2, 3] | ||
@test blocklengths(axes(bb, 2)) == [2, 3] | ||
@test label.(blocklengths(axes(bb, 1))) == [QN(0), QN(1)] | ||
@test label.(blocklengths(axes(bb, 2))) == [QN(0), QN(-1)] | ||
@test block_nstored(bb) == 2 | ||
@test b' * b ≈ to_nameddimsarray(a' * a) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
@eval module $(gensym()) | ||
using ITensors: ITensors | ||
using Suppressor: @suppress | ||
using Test: @testset | ||
|
||
@testset "examples" begin | ||
include("../examples/example_readme.jl") | ||
@suppress include( | ||
joinpath( | ||
pkgdir(ITensors), | ||
"src", | ||
"lib", | ||
"ITensorsNamedDimsArraysExt", | ||
"examples", | ||
"example_readme.jl", | ||
), | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
[deps] | ||
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5" | ||
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf" | ||
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@eval module $(gensym()) | ||
using ITensors: ITensors | ||
include( | ||
joinpath( | ||
pkgdir(ITensors), "src", "lib", "ITensorsNamedDimsArraysExt", "test", "runtests.jl" | ||
), | ||
) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cf050da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register subdir=NDTensors
cf050da
There was a problem hiding this comment.
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/119293
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.
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:
cf050da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
cf050da
There was a problem hiding this comment.
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/119298
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.
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:
Also, note the warning: Version 0.7.5 skips over 0.7.4
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.
cf050da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
cf050da
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request updated: JuliaRegistries/General/119298
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.
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: