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

[ITensors] Observers.jl package extension #1381

Merged
merged 20 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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: 2 additions & 0 deletions .github/workflows/comment_trigger_test_itensortdvp.yml
emstoudenmire marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ jobs:
run: |
using Pkg;
Pkg.add("ITensorTDVP");
Pkg.activate(temp=true);
emstoudenmire marked this conversation as resolved.
Show resolved Hide resolved
Pkg.develop("ITensors");
Pkg.test("ITensorTDVP");
- name: Set latest commit status as ${{ job.status }}
uses: myrotvorets/set-commit-status-action@master
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_ndtensors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ jobs:
Pkg.develop(path="./NDTensors");
Pkg.develop(path=".");
Pkg.test("NDTensors");

emstoudenmire marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ Zeros = "bd1ec220-6eb4-527a-9b49-e79c3db6233b"
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"

[weakdeps]
Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0"
VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"

[extensions]
ITensorsObserversExt = "Observers"
ITensorsVectorInterfaceExt = "VectorInterface"

[compat]
Expand Down Expand Up @@ -72,4 +74,5 @@ ZygoteRules = "0.2.2"
julia = "1.6"

[extras]
Observers = "338f10d5-c7f1-4033-a7d1-f9dec39bcaa0"
VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"
11 changes: 11 additions & 0 deletions ext/ITensorsObserversExt/ITensorsObserversExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module ITensorsObserversExt

using Observers: Observers
using Observers.DataFrames: AbstractDataFrame
using ITensors.ITensorMPS: ITensorMPS

function ITensorMPS.update_observer!(observer::AbstractDataFrame; kwargs...)
return Observers.update!(observer; kwargs...)
end

end
2 changes: 1 addition & 1 deletion src/ITensorMPS/alternating_update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function alternating_update(
)
end
current_time += time_step
update!(step_observer!; psi, sweep, outputlevel, current_time)
update_observer!(step_observer!; psi, sweep, outputlevel, current_time)
if outputlevel >= 1
print("After sweep ", sweep, ":")
print(" maxlinkdim=", maxlinkdim(psi))
Expand Down
Loading