Skip to content

Commit ba4e27b

Browse files
committed
expand README and add release notes
1 parent 23128ae commit ba4e27b

File tree

1 file changed

+130
-3
lines changed

1 file changed

+130
-3
lines changed

README.md

Lines changed: 130 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,137 @@ A Julia package for large-scale tensor computations, with a hint of category the
4242
[aqua-img]: https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg
4343
[aqua-url]: https://github.com/JuliaTesting/Aqua.jl
4444

45-
Install via the package manager.
45+
## Release notes for v0.13
46+
47+
TensorKit v0.13 brings a number of performance improvements, but also comes with a number of
48+
breaking changes:
49+
50+
1. The scalar type (the `eltype` of the tensor data) is now an explicit parameter of the
51+
the `TensorMap` type, and appears in the first position. As a consequence, `TensorMap{T}(undef, codomain ← domain)` can and should now be used to create a `TensorMap` with uninitialised data with scalar type `T`.
52+
53+
2. The constructors for creating tensors with randomly initialised data, of the form
54+
`TensorMap(randn, T, codomain ← domain)`, are being replaced with
55+
`randn(T, codomain ← domain)`. Hence, we overload the methods `rand` and `randn` from
56+
Base (actually, Random, and also `Random.randexp`) and mimick the `Array` constructors,
57+
relying on the fact that we use spaces instead of integers to characterise the tensor
58+
structure. As with integer-based `rand` and `randn`, a custom random number generator
59+
from the `Random` module can be passed as the first argument, and the scalar type `T` is
60+
optional, defaulting to `Float64`. The old constructors
61+
`TensorMap(randn, T, codomain ← domain)` still exist in deprecation mode, and will be
62+
removed in the 1.0 release.
63+
64+
3. The `TensorMap` data structure has been changed (simplified), so that all tensor data now
65+
resides in a single array of type `<:DenseVector`. While this should not does not lead to
66+
breaking changes in the interface, it does mean that `TensorMap` objects from
67+
TensorKit.jl v0.12.7 or earlier that were saved to disk using e.g. JLD2.jl, cannot simply
68+
be read back in using the new version of TensorKit.jl. We provide a script below export
69+
data in a format that can be read back in by TensorKit.jl v0.13.
70+
71+
Major non-breaking changes include:
72+
73+
* Support for [TensorOperations.jl v5](https://github.com/Jutho/TensorOperations.jl), and
74+
with this the new backend and allocator support within the `@tensor` macro.
75+
* The part of TensorKit.jl that defines `Sector` type hierarchy and its corresponding
76+
interface, as well as the implementation of all of the standard symmetries, has been
77+
moved to a separate package called [TensorKitSectors.jl](https://github.com/QuantumKitHub/TensorKitSectors.jl),
78+
so that it can also be used by other packages and is a more lightweight dependency.
79+
TensorKitSectors.jl a direct dependency and is automatically installed when installing
80+
TensorKit.jl. Furthermore, its public interface is re-exported by TensorKit.jl, so that
81+
this should not have any observable consequences.
82+
* The `fusiontrees` iterator now iterates over `FusionTree` objects in a different order,
83+
which will facilitate speeding up certain operations in the future. Furthermore, it now
84+
also accepts a `ProductSpace` object as first input, instead of simply a tuple of `Sector`
85+
objects. This also affects the data ordering in the `TensorMap` objects.
86+
* The structural information associated with a `TensorMap` object (or rather with the
87+
`HomSpace` instance that represents the space to which the tensor belongs) is no longer
88+
stored within the tensor, but is cached in a global (or task local) dictionary. As a
89+
result, this information does not need to be recomputed when new `TensorMap` objects are
90+
created, thus eliminating some overhead that can be significant in certain applications.
91+
92+
### Transferring `TensorMap` data from older versions to v0.13:
93+
94+
To export `TensorMap` data from TensorKit.jl v0.12.7 or earlier, you should first export the
95+
data there in a format that is explicit about how tensor data is associated with the
96+
structural part of the tensor, i.e. the splitting and fusion tree pairs. Therefore, on the
97+
older version of TensorKit.jl, use the following code to save teh data
98+
99+
```julia
100+
using JLD2
101+
filename = "choose_some_filename.jld2"
102+
t_dict = Dict(:space => space(t), :data => Dict((f₁, f₂) => t[f₁, f₂] for (f₁, f₂) in fusiontrees(t)))
103+
jldsave(filename; t_dict)
104+
```
105+
106+
If you have already upgraded to TensorKit.jl v0.13, you can still install the old version in
107+
a separate environment, for example a temporary environment. To do this, run
108+
109+
```julia
110+
]activate --temp
111+
]add TensorKit@0.12.7
112+
```
113+
114+
or
115+
116+
```julia
117+
import Pkg
118+
Pkg.activate(; temp = true)
119+
120+
```
121+
122+
Then, in the environment where you have TensorKit.jl v0.13 installed, you can read in the
123+
data and reconstruct the tensor as follows:
124+
125+
```julia
126+
using JLD2
127+
filename = "choose_some_filename.jld2"
128+
t_dict = jldload(filename)
129+
T = eltype(valtype(t_dict[:data]))
130+
t = TensorMap{T}(undef, t_dict[:space])
131+
for ((f₁, f₂), val) in t_dict[:data]
132+
t[f₁, f₂] .= val
133+
end
134+
```
135+
136+
## Overview
137+
138+
TensorKit.jl is a package that provides a types and methods to represent and manipulate
139+
tensors with symmetries. The emphasis is on the structure and functionality needed to build
140+
tensor network algorithms for the simulation of quantum many-body systems. Such tensors are
141+
typically invariant under a symmetry group which acts via specific representions on each of
142+
the indices of the tensor. TensorKit.jl provides the functionality for constructing such
143+
tensors and performing typical operations such as tensor contractions and decompositions,
144+
thereby preserving the symmetries and exploiting them for optimal performance.
145+
146+
While most common symmetries are already shipped with TensorKit.jl, there exist several extensions: [SUNRepresentations.jl](https://github.com/maartenvd/SUNRepresentations.jl) provides support for SU(N), while [CategoryData.jl](https://github.com/lkdvos/CategoryData.jl) incorporates a large collection of *small* fusion categories.
147+
Additionally, for libraries that implement tensor network algorithms on top of TensorKit.jl, check out [MPSKit.jl](https://github.com/maartenvd/MPSKit.jl), [MERAKit.jl](https://github.com/mhauru/MERAKit.jl) and [PEPSKit.jl](https://github.com/quantumghent/PEPSKit.jl).
46148

47149
Check out the [tutorial](https://jutho.github.io/TensorKit.jl/stable/man/tutorial/) and the full [documentation](https://jutho.github.io/TensorKit.jl/stable).
48150

151+
## Installation
152+
`TensorKit.jl` can be installed with the Julia package manager.
153+
From the Julia REPL, type `]` to enter the Pkg REPL mode and run:
154+
```
155+
pkg> add TensorKit
156+
```
49157

50-
While most common symmetries are already shipped with TensorKit.jl, there exist several extensions: [SUNRepresentations.jl](https://github.com/maartenvd/SUNRepresentations.jl) provides support for SU(N), while [CategoryData.jl](https://github.com/lkdvos/CategoryData.jl) incorporates a large collection of *small* fusion categories.
51-
Additionally, for libraries that implement tensor network algorithms on top of TensorKit.jl, check out [MPSKit.jl](https://github.com/maartenvd/MPSKit.jl), [MERAKit.jl](https://github.com/mhauru/MERAKit.jl) and [PEPSKit.jl](https://github.com/quantumghent/PEPSKit.jl).
158+
Or, equivalently, via the `Pkg` API:
159+
```julia
160+
julia> import Pkg; Pkg.add("TensorKit.jl")
161+
```
162+
163+
## Documentation
164+
165+
- [**STABLE**][docs-stable-url] - **documentation of the most recently tagged version.**
166+
- [**DEVEL**][docs-dev-url] - *documentation of the in-development version.*
167+
168+
## Project Status
169+
170+
The package is tested against Julia versions `1.8`, `1.10` and the latest `1.x` release, as
171+
well as against teh nightly builds of the Julia `master` branch on Linux, macOS, and Windows
172+
platforms with a 64-bit architecture.
173+
174+
## Questions and Contributions
175+
176+
Contributions are very welcome, as are feature requests and suggestions. Please open an [issue][issues-url] if you encounter any problems.
177+
178+
[issues-url]: https://github.com/Jutho/TensorKit.jl/issues

0 commit comments

Comments
 (0)