kron(::SparseVector,::SparseVector) returns a dense vector

hello, noobie here

kron (Kronecker product) does not have a method defined for SparseVector (though it does for SparseMatrixCSC), and so it gives a dense result. I’ve written myself a kron method which is mostly just copied from the SparseMatrixCSC implementation to not waste all my memory on zeros. Should I contribute this to somewhere? Would people care? What’s the etiquette?

Sorry for the kinda silly question, I’ve never used git or looked into an open-source project before :grimacing:

Generally, yes! Since the function and the types are defined in Julia Base, that’s what you should normally contribute to. But I think someone beat you to it: kron for sparse vectors by jebej · Pull Request #23229 · JuliaLang/julia · GitHub. Judging by the comments, there seems to be an ambiguity issue though. You could try to find out what’s going on if you want to help out and you’re up for a challenge, but just so you know: it can be a little difficult to identify such ambiguity issues as a beginner.

1 Like