Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: MethodError: no method matching Strided.UnsafeStridedView(::Hermitian{Float64,Array{Float64,2}}) #102

Open
schneiderfelipe opened this issue Jan 17, 2021 · 0 comments

Comments

@schneiderfelipe
Copy link

I'm having trouble using Hermitian or Symmetric matrices (defined in the LinearAlgebra package). Here is an MWE:

using LinearAlgebra
using TensorOperations

function g(F)
    return @tensor F[i, j] * F[i, j]
end

A = rand(7, 7)

g(A)
# => works great

H = Hermitian(A)
g(H)
# => ERROR: MethodError: no method matching Strided.UnsafeStridedView(::Hermitian{Float64,Array{Float64,2}})

A similar error (ERROR: MethodError: no method matching Strided.UnsafeStridedView(::Symmetric{Float64,Array{Float64,2}})) is thrown for Symmetric matrices.

Of course, it works with H.data, which points to the original matrix, but then we are not using any symmetry:

g(H.data)
# => works fine, but that's not the same thing

Hermitian/Symmetric are simple wrappers, basically, and there are some challenges concerning supporting them:

pointer(H)
# => ERROR: conversion to pointer not defined for Hermitian{Float64,Array{Float64,2}}

strides(H)
# => ERROR: MethodError: no method matching strides(::Hermitian{Float64,Array{Float64,2}})

How could Hermitian/Symmetric be supported?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant