https://github.com/quantumkithub/tensoroperationstblis.jl
Julia wrapper for TBLIS with TensorOperations.jl
https://github.com/quantumkithub/tensoroperationstblis.jl
tensor tensor-contraction tensor-operations tensor-trace
Last synced: 6 months ago
JSON representation
Julia wrapper for TBLIS with TensorOperations.jl
- Host: GitHub
- URL: https://github.com/quantumkithub/tensoroperationstblis.jl
- Owner: QuantumKitHub
- License: mit
- Created: 2023-04-29T14:22:10.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-08-12T08:20:20.000Z (9 months ago)
- Last Synced: 2025-10-21T12:51:42.892Z (6 months ago)
- Topics: tensor, tensor-contraction, tensor-operations, tensor-trace
- Language: Julia
- Homepage:
- Size: 34.2 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Citation: CITATION.cff
Awesome Lists containing this project
README
# TensorOperationsTBLIS.jl
Julia wrapper for [TBLIS](https://github.com/devinamatthews/tblis) with [TensorOperations.jl](https://github.com/Jutho/TensorOperations.jl).
[![CI][ci-img]][ci-url] [![CI (Julia nightly)][ci-julia-nightly-img]][ci-julia-nightly-url] [![][codecov-img]][codecov-url]
[ci-img]: https://github.com/QuantumKitHub/TensorOperationsTBLIS.jl/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/QuantumKitHub/TensorOperationsTBLIS.jl/actions/workflows/ci.yml
[ci-julia-nightly-img]: https://github.com/QuantumKitHub/TensorOperationsTBLIS.jl/actions/workflows/ci-julia-nightly.yml/badge.svg
[ci-julia-nightly-url]: https://github.com/QuantumKitHub/TensorOperationsTBLIS.jl/actions/workflows/ci-julia-nightly.yml
[codecov-img]: https://codecov.io/gh/QuantumKitHub/TensorOperationsTBLIS.jl/graph/badge.svg?token=wTWrpf2Pzh
[codecov-url]: https://codecov.io/gh/QuantumKitHub/TensorOperationsTBLIS.jl
Currently provides implementations of `tensorcontract!`, `tensoradd!` and `tensortrace!` for array types compatible with Strided.jl, i.e. `StridedView{<:BlasFloat}`.
These can be accessed through the backend system of TensorOperations, i.e.
```julia
using TensorOperations
using TensorOperationsTBLIS
tblisbackend = TBLIS()
α = randn()
A = randn(5, 5, 5, 5, 5, 5)
B = randn(5, 5, 5)
C = randn(5, 5, 5)
D = zeros(5, 5, 5)
@tensor backend = tblisbackend begin
D2[a, b, c] = A[a, e, f, c, f, g] * B[g, b, e] + α * C[c, a, b]
E2[a, b, c] := A[a, e, f, c, f, g] * B[g, b, e] + α * C[c, a, b]
end
```
Additionally, the number of threads used by TBLIS can be set by:
```julia
TensorOperationsTBLIS.set_num_threads(4)
@show TensorOperationsTBLIS.get_num_threads()
```
## Notes
- This implementation of TBLIS for TensorOperations.jl is only supported from v5 of
TensorOperations.jl onwards. For v4, an earlier version of this package exists.
For older versions, you could look for
[BliContractor.jl](https://github.com/xrq-phys/BliContractor.jl) or
[TBLIS.jl](https://github.com/FermiQC/TBLIS.jl).