• Stars
    star
    413
  • Rank 101,091 (Top 3 %)
  • Language
    Julia
  • License
    Other
  • Created about 10 years ago
  • Updated 3 days ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Julia package for tensor contractions and related operations

TensorOperations.jl

Fast tensor operations using a convenient Einstein index notation.

Documentation Build Status
CI CI (Julia nightly)
Digital Object Identifier Downloads
DOI TensorOperations Downloads

What's new in v3

  • Switched to CUDA.jl instead of CuArrays.jl, which effectively restricts support to Julia 1.4 and higher.

  • The default cache size for intermediate results is now the minimum of either 4GB or one quarter of your total memory (obtained via Sys.total_memory()). Furthermore, the structure (i.e. size) and eltype of the temporaries is now also used as lookup key in the LRU cache, such that you can run the same code on different objects with different sizes or element types, without constantly having to reallocate the temporaries. Finally, the task rather than threadid is used to make the cache compatible with concurrency at any level.

    As a consequence, different objects for the same temporary location can now be cached, such that the cache can grow out of size quickly. Once the cache is not able to hold all the temporary objects needed for your simulation, it might actually deteriorate perfomance, and you might be better off disabling the cache alltogether with TensorOperations.disable_cache().

WARNING: TensorOperations 3.0 contains breaking changes if you did implement support for custom array / tensor types by overloading checked_similar_from_indices etc.

Code example

TensorOperations.jl is mostly used through the @tensor macro which allows one to express a given operation in terms of index notation format, a.k.a. Einstein notation (using Einstein's summation convention).

using TensorOperations
α=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 begin
    D[a,b,c] = A[a,e,f,c,f,g]*B[g,b,e] + α*C[c,a,b]
    E[a,b,c] := A[a,e,f,c,f,g]*B[g,b,e] + α*C[c,a,b]
end

In the second to last line, the result of the operation will be stored in the preallocated array D, whereas the last line uses a different assignment operator := in order to define and allocate a new array E of the correct size. The contents of D and E will be equal.

For more information, please see the documentation.

More Repositories

1

KrylovKit.jl

Krylov methods for linear problems, eigenvalues, singular values and matrix functions
Julia
255
star
2

TensorKit.jl

A Julia package for large-scale tensor computations, with a hint of category theory
Julia
189
star
3

Strided.jl

A Julia package for strided array views and efficient manipulations thereof
Julia
142
star
4

OptimKit.jl

OptimKit: A blissfully ignorant Julia package for gradient optimization
Julia
54
star
5

WignerSymbols.jl

A Julia package for computing Wigner symbols and related quantities
Julia
45
star
6

TNSchool2018

European Tensor Network - School 2018
Julia
38
star
7

TupleTools.jl

Type stable methods for small tuples
Julia
34
star
8

SparseArrayKit.jl

Sparse multidimensional arrays using a DOK format, with support for TensorOperations.jl
Julia
28
star
9

CMPSKit.jl

Continuous Matrix Product States in Julia
Julia
27
star
10

VectorInterface.jl

A Julia interface for working with vector like objects
Julia
26
star
11

TensorToolbox.jl

Julia package for working with tensors, i.e. multilinear maps between vector spaces
Julia
15
star
12

TensorKitManifolds.jl

Useful tools for working with isometric or unitary tensors
Julia
15
star
13

ManyBodyKit.jl

Initial attempts at a package for defining many body systems in both quantum and statistical physics
Julia
13
star
14

CuTensorOperations.jl

TensorOperations and cuTENSOR combined
Julia
12
star
15

RationalRoots.jl

A Julia type for representing square roots of rational numbers
Julia
11
star
16

cMPS-notebook

Notebook for illustrating the use of CMPSKit.jl and to reproduce the results from arXiv:2006.01801.
Jupyter Notebook
11
star
17

TestExtras.jl

Some useful additions to the Julia Test Standard Library
Julia
7
star
18

StridedViews.jl

A Julia package to represent strided views over a parent DenseArray
Julia
4
star
19

VectorFunctionSpacesSummary

Summary page for the course on "Vector and Function Spaces"
4
star
20

Presentations

HTML
3
star
21

ExtendedIntegers.jl

Julia
2
star
22

TensorOperationsCore.jl

Core functionality and interface for TensorOperations.jl
Julia
1
star