TensorOperations.jl
TensorOperations.jl copied to clipboard
Julia package for tensor contractions and related operations
Is it possible to support views into arrays? It seems the api might be too specific. e.g. a Matrix works as expected: ```julia A = [1 2 3; 4 5...
As a disclaimer, there might be a simple way to achieve this, I am not an expert in tensor contractions or `TensorOperations.jl`, but I could not find a solution easily....
``` julia> a = ones(2,2) 2×2 Matrix{Float64}: 1.0 1.0 1.0 1.0 julia> @tensor A[i,j] := a[i,1]*a[j,1] 2×2 Matrix{Float64}: 2.0 2.0 2.0 2.0 ``` This is hugely surprising to me. I...
Is it possible to assign a constant using the @tensor macro? Example: ``` C=zeros(3,3,3) @tensor begin C[i,i,i] = 6 end ```
optimaltree can fail for empty contractions, but can be made to work with these small changes
Hi @Jutho, hope you're well! I was just wondering if you have considered splitting out the CUDA implementation into a separate package. CUDA is quite a heavy dependency that is...
I'm having trouble using `Hermitian` or `Symmetric` matrices ([defined in the LinearAlgebra package](https://docs.julialang.org/en/v1/stdlib/LinearAlgebra/#Special-matrices)). Here is an MWE: ```julia using LinearAlgebra using TensorOperations function g(F) return @tensor F[i, j] * F[i,...
Hi there, It seems that tensorcontract, with its current definition, is type unstable: ``` julia> @code_warntype tensorcontract(A, a_idx, B, b_idx) Variables #self#::Core.Compiler.Const(TensorOperations.tensorcontract, false) A::Array{Int64,2} IA::Tuple{Int64,Int64} B::Array{Int64,2} IB::Tuple{Int64,Int64} Body::Array 1 ─...
Update: `TensorOperations` does not have big advantage over `NumPy` for large tensors. In `NumPy`, we have a handy feature in `np.tensordot`, as illustrated below: ``` import numpy as np ts1...
First of all, awesome package! I want to use TensorOperations in https://github.com/simeonschaub/CoolTensors.jl, but I think to get it to return the correct output type, I need to implement a specialized...