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

Update compat and remove redundant fixed #47

Merged
merged 10 commits into from
Oct 18, 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
6 changes: 3 additions & 3 deletions .github/workflows/format_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
name: "Format Check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
- uses: julia-actions/cache@v1
with:
version: 1
Expand All @@ -33,4 +33,4 @@ jobs:
write(stdout, out_diff)
exit(1)
@error ""
end'
end'
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
julia-arch: x86

steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
# with:
# annotate: true
# annotate: true
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,20 @@ version = "0.1.1"
[deps]
Dictionaries = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
GraphRecipes = "bd48cda9-67a9-57be-86fa-5b3c104eda73"
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
ITensorNetworks = "2919e153-833c-4bdc-8836-1ea460a35fc7"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
NamedGraphs = "678767b0-92e7-4007-89e4-4527a8725b19"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SplitApplyCombine = "03a91e81-4c3e-53e1-a0a4-9c0c8f19dd66"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Dictionaries = "0.4.2"
Glob = "1.3.1"
Graphs = "1.8"
ITensorNetworks = "0.11.15"
Graphs = "1.9"
ITensorNetworks = "0.11.21"
ITensors = "0.5, 0.6"
NamedGraphs = "0.6"
Random = "1.8"
Expand Down
2 changes: 1 addition & 1 deletion src/ITensorNumericalAnalysis.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module ITensorNumericalAnalysis

function __init__()
include(joinpath(pkgdir(ITensorNumericalAnalysis), "src", "fixes.jl"))
include(joinpath(@__DIR__, "fixes.jl"))
return nothing
end

Expand Down
4 changes: 2 additions & 2 deletions src/elementary_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function cosh_itensornetwork(
dim::Int=default_dim(),
)
ψ1 = exp_itensornetwork(s; a, k, c=0.5 * c, dim)
ψ2 = exp_itensornetwork(s; a=-a, k=-k, c=0.5 * c, dim)
ψ2 = exp_itensornetwork(s; a=(-a), k=(-k), c=0.5 * c, dim)

return ψ1 + ψ2
end
Expand All @@ -77,7 +77,7 @@ function sinh_itensornetwork(
dim::Int=default_dim(),
)
ψ1 = exp_itensornetwork(s; a, k, c=0.5 * c, dim)
ψ2 = exp_itensornetwork(s; a=-a, k=-k, c=-0.5 * c, dim)
ψ2 = exp_itensornetwork(s; a=(-a), k=(-k), c=-0.5 * c, dim)

return ψ1 + ψ2
end
Expand Down
17 changes: 0 additions & 17 deletions src/fixes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,3 @@ function ITensorMPS.add(tn1::AbstractITensorNetwork, tn2::AbstractITensorNetwork

return tn12
end

function ITensorNetworks.default_message_update(
contract_list::Vector{ITensor}; normalize=true, kwargs...
)
sequence = optimal_contraction_sequence(contract_list)
updated_messages = contract(contract_list; sequence, kwargs...)
message_norm = norm(updated_messages)
if normalize && !iszero(message_norm)
updated_messages /= message_norm
end
return ITensor[updated_messages]
end

function ITensorNetworks.message(bp_cache::BeliefPropagationCache, edge::PartitionEdge)
mts = messages(bp_cache)
return get(() -> default_message(bp_cache, edge), mts, edge)
end
Loading