# \[ANN\] TensorKit.jl v0.13

**URL:** https://discourse.julialang.org/t/ann-tensorkit-jl-v0-13/122259
**Category:** Package Announcements
**Tags:** package, announcement, quantum, physics, tensors
**Created:** [November 4, 2024, 9:19pm UTC](https://discourse.julialang.org/t/ann-tensorkit-jl-v0-13/122259 "2024-11-04T21:19:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lkdvos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lkdvos/32/43091_2.png) [@lkdvos](https://discourse.julialang.org/u/lkdvos)
#### Post date: [November 4, 2024, 9:19pm UTC](https://discourse.julialang.org/t/ann-tensorkit-jl-v0-13/122259/1 "2024-11-04T21:19:11Z")

</div>

Hi everyone,

Together with @juthohaegeman, I’m excited to announce the release of TensorKit.jl v0.13﻿, a Julia package designed for large-scale tensor computations with a touch of category theory. This release brings a number of performance enhancements and simplifications to the data structures, particularly for symmetric tensors involving complex fusion trees. We expect a significant reduction in overhead in such cases.

### Breaking Changes:

- **Scalar Type Parameter** : The scalar type (`eltype`) is now an explicit parameter in the AbstractTensorMap type, and appears in the first position. Consequently, you should now use `TensorMap{T}(undef, codomain ← domain)` to create a TensorMap with uninitialized data of scalar type `T`.

- **Updated Tensor Constructors** : The previous form `TensorMap(randn, T, codomain ← domain)` is being replaced by `randn(T, codomain ← domain)`. We now overload `rand`, `randn`, and `randexp` from the Random module, mimicking the constructors for `Array`. You can also pass a custom random number generator as the first argument. Note that `T` (the scalar type) is optional and defaults to `Float64`. The old constructors are still available but in deprecation mode and will be removed in the 1.0 release.

- **TensorMap Structure** : The `TensorMap` data structure has been simplified, with all tensor data now stored in a single `<:DenseVector`. While this does not change the interface, `TensorMap` objects saved with TensorKit.jl v0.12.7 or earlier (e.g., using JLD2.jl) are not compatible with this new version. We provide [a script](https://github.com/Jutho/TensorKit.jl?tab=readme-ov-file#transferring-tensormap-data-from-older-versions-to-v013) to help migrate data for v0.13 compatibility.

### Major Non-Breaking Changes:

- **Support for TensorOperations.jl v5** : TensorKit.jl now supports TensorOperations.jl v5, which introduces new backend and allocator support in the @tensor macro. This includes using Bumper.jl for managing intermediate tensors.

- **Separation of Sector Types** : The `Sector` type hierarchy and its corresponding interface have been moved to [TensorKitSectors.jl](https://github.com/QuantumKitHub/TensorKitSectors.jl). This package is now a direct dependency of TensorKit.jl and is re-exported to ensure backward compatibility while allowing other packages to use it as a lightweight dependency.

- **`fusiontrees` Iterator Update** : The fusiontrees iterator now processes `FusionTree` objects in a different order, improving the performance of certain future operations. It also accepts a `ProductSpace` as input, rather than just a tuple of `Sector` objects, which also affects the ordering of data in `TensorMap` objects.

- **Improved Structural Information Handling** : The structural information for `TensorMap` objects (linked to their `HomSpace`) is now cached globally, eliminating the need for recalculation when creating new `TensorMap` instances. This change reduces overhead, particularly in scenarios where such computations are frequent.

* * *

We hope these updates improve your experience with TensorKit.jl, especially when working with symmetric tensors. As always, we welcome any feedback, issues, comments or feature requests.
