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

Start reexporting ITensorTDVP and ITensors.ITensorMPS #1

Merged
merged 12 commits into from
May 6, 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
39 changes: 29 additions & 10 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ on:
push:
branches:
- main
tags: '*'
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
Expand All @@ -14,6 +15,10 @@ jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
Expand All @@ -27,7 +32,7 @@ jobs:
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
Expand All @@ -36,25 +41,39 @@ jobs:
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v2
- uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
docs:
name: Documentation
runs-on: ubuntu-latest
permissions:
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
contents: write
statuses: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: julia-actions/cache@v1
- name: Configure doc environment
shell: julia --project=docs --color=yes {0}
run: |
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
- run: |
julia --project=docs -e '
using Documenter: DocMeta, doctest
using ITensorMPS
DocMeta.setdocmeta!(ITensorMPS, :DocTestSetup, :(using ITensorMPS); recursive=true)
doctest(ITensorMPS)'
- name: Run doctests
shell: julia --project=docs --color=yes {0}
run: |
using Documenter: DocMeta, doctest
using ITensorMPS
DocMeta.setdocmeta!(ITensorMPS, :DocTestSetup, :(using ITensorMPS); recursive=true)
doctest(ITensorMPS)
2 changes: 1 addition & 1 deletion .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CompatHelper
on:
schedule:
- cron: '00 00 * * *'
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ on:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: "3"
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/register.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
jobs:
register:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: julia-actions/RegisterAction@latest
with:
Expand Down
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ version = "0.1.0"
[deps]
ITensorTDVP = "25707e16-a4db-4a07-99d9-4d67b7af0342"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
ITensorTDVP = "0.3.0"
ITensorTDVP = "0.3"
ITensors = "0.5.2"
Reexport = "1"
julia = "1.6"

[extras]
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
# ITensorMPS.jl

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://itensor.github.io/ITensorMPS.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://itensor.github.io/ITensorMPS.jl/dev/)
[![Build Status](https://github.com/ITensor/ITensorMPS.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/ITensor/ITensorMPS.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![Coverage](https://codecov.io/gh/ITensor/ITensorMPS.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/ITensor/ITensorMPS.jl)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)

MPS and MPO methods based on ITensor (ITensors.jl).

This package supercedes the MPS codes previously located in the ITensors.jl and ITensorTDVP.jl packages, including applications like DMRG, TDVP, applying MPO to MPS, applying gates, etc.
Expand Down
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
16 changes: 16 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using ITensorMPS
using Documenter

DocMeta.setdocmeta!(ITensorMPS, :DocTestSetup, :(using ITensorMPS); recursive=true)

makedocs(;
modules=[ITensorMPS],
authors="ITensor developers",
sitename="ITensorMPS.jl",
format=Documenter.HTML(;
canonical="https://ITensor.github.io/ITensorMPS.jl", edit_link="main", assets=String[]
),
pages=["Home" => "index.md"],
)

deploydocs(; repo="github.com/ITensor/ITensorMPS.jl", devbranch="main")
14 changes: 14 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
```@meta
CurrentModule = ITensorMPS
```

# ITensorMPS

Documentation for [ITensorMPS](https://github.com/ITensor/ITensorMPS.jl).

```@index
```

```@autodocs
Modules = [ITensorMPS]
```
170 changes: 167 additions & 3 deletions src/ITensorMPS.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,169 @@
module ITensorMPS

# Write your package code here.

using Reexport: @reexport
@reexport using ITensorTDVP: TimeDependentSum, dmrg_x, linsolve, tdvp, to_vec
using ITensorTDVP: ITensorTDVP
const alternating_update_dmrg = ITensorTDVP.dmrg
@reexport using ITensors.ITensorMPS:
@OpName_str,
@SiteType_str,
@StateName_str,
@TagType_str,
@ValName_str,
@preserve_ortho,
@visualize,
@visualize!,
@visualize_noeval,
@visualize_noeval!,
@visualize_sequence,
@visualize_sequence_noeval,
AbstractMPS,
AbstractObserver,
Apply,
AutoMPO,
DMRGMeasurement,
DMRGObserver,
Lattice,
LatticeBond,
MPO,
MPS,
NoObserver,
Op,
OpName,
OpSum,
Ops,
Prod,
ProjMPO,
ProjMPOSum,
ProjMPO_MPS,
Scaled,
SiteType,
Spectrum,
StateName,
Sum,
Sweeps,
TagType, # deprecate
Trotter,
ValName,
add,
add!,
apply,
applyMPO,
applympo,
argsdict,
checkdone!, # remove export
coefficient,
common_siteind,
common_siteinds,
convert_leaf_eltype, # remove export
correlation_matrix,
cutoff,
cutoff!, # deprecate
disk,
dmrg,
dot, # remove export
eigs, # deprecate
energies, # deprecate
entropy, # deprecate
errorMPOprod, # deprecate
error_contract,
error_mpoprod, # deprecate
error_mul, # deprecate
expect,
findfirstsiteind, # deprecate
findfirstsiteinds, # deprecate
findsite, # deprecate
findsites, # deprecate
firstsiteind, # deprecate
firstsiteinds, # deprecate
get_cutoffs, # deprecate
get_maxdims, # deprecate
get_mindims, # deprecate
get_noises, # deprecate
has_fermion_string, # remove export
hassameinds,
inner,
isortho,
linkdim,
linkdims,
linkind,
linkindex,
linkinds,
logdot,
loginner,
lognorm,
lproj,
maxdim,
maxdim!,
maxlinkdim,
measure!,
measurements,
mindim,
mindim!,
movesite,
movesites,
mul, # deprecate
multMPO,
multmpo,
noise,
noise!,
noiseterm,
nsite,
nsweep,
op,
ops,
orthoCenter,
ortho_lims,
orthocenter,
orthogonalize,
orthogonalize!,
outer,
position!,
product,
primelinks!,
productMPS,
projector,
promote_itensor_eltype,
randomITensor,
randomMPO,
randomMPS,
replace_siteinds,
replace_siteinds!,
replacebond,
replacebond!,
replaceprime,
replacesites!,
reset_ortho_lims!,
rproj,
sample,
sample!,
set_leftlim!,
set_ortho_lims!,
set_rightlim!,
setcutoff!,
setmaxdim!,
setmindim!,
setnoise!,
simlinks!,
siteind,
siteindex,
siteinds,
splitblocks,
square_lattice,
state,
sum,
swapbondsites,
sweepnext,
tensors,
toMPO,
totalqn,
tr,
triangular_lattice,
truncate,
truncate!,
truncerror,
truncerrors,
unique_siteind,
unique_siteinds,
val,
end
5 changes: 5 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2"
ITensorTDVP = "25707e16-a4db-4a07-99d9-4d67b7af0342"
ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
26 changes: 22 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
using ITensorMPS
using Test

@eval module $(gensym())
using ITensorMPS: ITensorMPS
using ITensorTDVP: ITensorTDVP
using ITensors: ITensors
include("utils/TestITensorMPSExportedNames.jl")
using Test: @test, @testset
@testset "ITensorMPS.jl" begin
# Write your tests here.
@testset "exports" begin
@test issetequal(
names(ITensorMPS),
[
[:ITensorMPS]
# ITensorTDVP reexports
[:TimeDependentSum, :dmrg_x, :linsolve, :tdvp, :to_vec]
# ITensors and ITensors.ITensorMPS reexports
TestITensorMPSExportedNames.ITENSORMPS_EXPORTED_NAMES
],
)
end
@testset "aliases" begin
@test ITensorMPS.alternating_update_dmrg === ITensorTDVP.dmrg
end
end
end
Loading
Loading