-
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.
[ITensors]
Observers.jl
package extension (#1381)
- Loading branch information
1 parent
95c0a70
commit 4d64299
Showing
5 changed files
with
68 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
name: Run ITensorTDVP tests (Unbuntu) | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: '*' | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.threads }} thread(s) | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
JULIA_NUM_THREADS: ${{ matrix.threads }} | ||
strategy: | ||
matrix: | ||
version: | ||
- '1.6' | ||
- '1' | ||
os: | ||
- ubuntu-latest | ||
threads: | ||
- '2' | ||
arch: | ||
- x64 | ||
exclude: | ||
# MacOS not available on x86 | ||
- {os: 'macOS-latest', arch: 'x86'} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: ${{ matrix.version }} | ||
arch: ${{ matrix.arch }} | ||
- name: Install Julia dependencies and run tests | ||
shell: julia {0} | ||
run: | | ||
using Pkg; | ||
try | ||
Pkg.activate(temp=true); | ||
Pkg.develop(path="./NDTensors"); | ||
Pkg.develop(path="."); | ||
Pkg.add("ITensorTDVP"); | ||
Pkg.test("ITensorTDVP"); | ||
catch err | ||
err isa Pkg.Resolve.ResolverError || rethrow() | ||
# If we can't resolve that means this is incompatible by SemVer and this is fine | ||
# It means we marked this as a breaking change, so we don't need to worry about | ||
# Mistakenly introducing a breaking change, as we have intentionally made one | ||
@info "ITensorTDVP not compatible with this release. Skipping this test." exception=err | ||
exit(0) # Exit immediately, as a success | ||
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,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 |
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