Skip to content
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
34 changes: 33 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ concurrency:
# needed to allow julia-actions/cache to delete old caches that it has created
permissions:
actions: write
contents: read
contents: write
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand Down Expand Up @@ -44,6 +44,16 @@ jobs:
Pkg.Registry.add(
RegistrySpec(url = "https://github.com/tensor4all/T4ARegistry.git")
)'
- name: Develop extracted dependencies (temporary)
run: |
julia --project=@. -e '
using Pkg
Pkg.Registry.add()
Pkg.add([
PackageSpec(url = "https://github.com/tensor4all/T4AMatrixCI.jl.git", rev = "main"),
PackageSpec(url = "https://github.com/tensor4all/T4ATensorTrain.jl.git", rev = "fix/t4aitensorcompat-uuid"),
])
Pkg.instantiate()'
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
Expand All @@ -65,7 +75,29 @@ jobs:
Pkg.Registry.add(
RegistrySpec(url = "https://github.com/tensor4all/T4ARegistry.git")
)'
- name: Develop extracted dependencies (temporary)
run: |
julia --project=@. -e '
using Pkg
Pkg.Registry.add()
Pkg.add([
PackageSpec(url = "https://github.com/tensor4all/T4AMatrixCI.jl.git", rev = "main"),
PackageSpec(url = "https://github.com/tensor4all/T4ATensorTrain.jl.git", rev = "fix/t4aitensorcompat-uuid"),
])
Pkg.instantiate()'
- uses: julia-actions/julia-buildpkg@v1
- name: Instantiate docs environment (pin extracted dependencies)
run: |
julia --project=docs/ -e '
using Pkg
# Ensure default registries are available
Pkg.Registry.add()
# Pin extracted packages by URL to avoid relying on registry metadata during docs builds
Pkg.add([
PackageSpec(url = "https://github.com/tensor4all/T4AMatrixCI.jl.git", rev = "main"),
PackageSpec(url = "https://github.com/tensor4all/T4ATensorTrain.jl.git", rev = "fix/t4aitensorcompat-uuid"),
])
Pkg.instantiate()'
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
*.jl.mem
/Manifest.toml
/docs/build/

# Local logs and build artifacts (do not commit)
*.log
/docs/Manifest.toml
/docs/*.log
/docs_build.log
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ EllipsisNotation = "da5c29d0-fa7d-589e-88eb-ea29b0a81949"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
T4AMatrixCI = "c72b89c1-c391-41a7-b711-dfcca653bb47"
T4ATensorTrain = "ec6ec972-96ae-4a21-b859-3911b77e305f"

[weakdeps]
ITensorMPS = "0d1a4710-d33b-49a5-8f18-73bdf49b47e2"
Expand All @@ -26,6 +28,8 @@ Optim = "1"
QuadGK = "2.9"
Random = "1.9.0"
T4AITensorCompat = "0.8"
T4AMatrixCI = "0.1"
T4ATensorTrain = "0.1"
julia = "1.10"

[extras]
Expand Down
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ ITensors = "9136182c-28ba-11e9-034c-db9fb085ebd5"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
T4AITensorCompat = "864b39ca-388c-4f43-a593-a1076cf4b253"
T4AMatrixCI = "c72b89c1-c391-41a7-b711-dfcca653bb47"
T4ATensorCI = "14428447-6903-48c7-83df-f2cb08af9918"
T4ATensorTrain = "ec6ec972-96ae-4a21-b859-3911b77e305f"
13 changes: 13 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
using Pkg

Pkg.activate(@__DIR__)
Pkg.develop(PackageSpec(path=joinpath(@__DIR__, "..")))
for pkgdir in ("T4AMatrixCI.jl", "T4ATensorTrain.jl")
local_path = joinpath(@__DIR__, "..", "..", pkgdir)
if isdir(local_path)
Pkg.develop(PackageSpec(path=local_path))
end
end
Pkg.resolve()
Pkg.instantiate()

using T4ATensorCI
using ITensors
using ITensorMPS
Expand Down
2 changes: 1 addition & 1 deletion docs/src/implementation.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ This function adds one pivot at bond $\ell$ (in the code, we use `p` instead of

To add a pivot, we have to add a row and a column to $T_\ell, P_\ell$ and $T_{\ell + 1}$. Afterwards, we update neighbouring $\Pi$ tensors $\Pi_{\ell-1}$ and $\Pi_{\ell+1}$ for efficiency.

- Construct an $MCI$ ([`MatrixCI`](@ref)) object with row indices $I$, column indices $J$, columns $C$ and rows $R$, where:
- Construct an $MCI$ (`T4AMatrixCI.MatrixCI`) object with row indices $I$, column indices $J$, columns $C$ and rows $R$, where:
- Row indices $MCI.I \leftarrow \Pi I_\ell [I_{\ell+1}]$
- Column indices $MCI.J \leftarrow \Pi J_{\ell+1} [J_\ell]$
- Column vectors $MCI.C \leftarrow \text{reshape}(T_\ell; D_{\ell-1}\times d_\ell, D_{\ell})$
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ println("Sum of original function: $sumorig")
sumtt = sum(tci)
println("Sum of tensor train: $sumtt")
```
For further information, see [`sum`](@ref).
For further information, see `sum`.

This factorized sum can be used for efficient evaluation of high-dimensional integrals. This is implemented with Gauss-Kronrod quadrature rules in [`integrate`](@ref). For example, the integral
```math
Expand Down
6 changes: 5 additions & 1 deletion ext/TCIITensorConversion/TCIITensorConversion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module TCIITensorConversion

import T4ATensorCI as TCI
import T4ATensorCI: evaluate
import T4ATensorTrain

using ITensors
import ITensorMPS
Expand All @@ -10,7 +11,10 @@ import ITensorMPS: MPS, MPO
export MPS, MPO
export evaluate

include("ttmpsconversion.jl")
# Conversions between `T4ATensorTrain.TensorTrain` (re-exported by T4ATensorCI)
# and ITensorMPS types are provided by `T4ATensorTrain`'s extension
# `TTITensorConversion`. Do not re-define them here to avoid method overwriting
# during precompilation.
include("mpsutil.jl")

end
4 changes: 2 additions & 2 deletions ext/TCIITensorConversion/mpsutil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Evaluates an MPS or MPO for a given set of index values.

- `indexspec` is a list of tuples, where each tuple contains an `ITensorMPS.Index` object specifying an index, and an `Int` corresponding to the value of the specified index.

If many evaluations are necessary, it may be advantageous to convert your MPS to a [`T4ATensorCI.TTCache`](@ref) object first.
If many evaluations are necessary, it may be advantageous to convert your MPS to a `T4ATensorCI.TTCache` object first.
"""
function evaluate(
mps::Union{ITensorMPS.MPS,ITensorMPS.MPO},
Expand Down Expand Up @@ -39,7 +39,7 @@ Evaluates an MPS or MPO for a given set of index values.
- `indices` is a list of `ITensors.Index` objects that specifies the order in which indices are given.
- `indexvalues` is a list of integer values in the same order as `indices`.

If many evaluations are necessary, it may be advantageous to convert your MPS to a [`T4ATensorCI.TTCache`](@ref) object first.
If many evaluations are necessary, it may be advantageous to convert your MPS to a `T4ATensorCI.TTCache` object first.
"""
function evaluate(
mps::Union{ITensorMPS.MPS,ITensorMPS.MPO},
Expand Down
138 changes: 0 additions & 138 deletions ext/TCIITensorConversion/ttmpsconversion.jl

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
module TCIT4AITensorCompatConversion

import T4ATensorCI as TCI
import T4ATensorTrain

using ITensors
using T4AITensorCompat

include("t4aitensorcompat_conversion.jl")
# Conversions between `T4ATensorTrain.TensorTrain` (re-exported by T4ATensorCI)
# and `T4AITensorCompat.TensorTrain` are provided by `T4ATensorTrain`'s extension
# `TTT4AITensorCompatConversion`. Do not re-define them here.

end

Loading
Loading