Thanks for the suggestions and timings. I was still curious to find an option with matrix indexing. In matlab I would probably use sub2ind to find the linear indices of the matrix where the values should go. I found a discussion on its Julia equivalent being removed, and suggestion to use CartesianIndices or LinearIndices instead. I don’t fully get how they work, but this seems reasonable:
dummy2 = zeros(ComplexF64,(Nl,qmax,qmax))
for i in 1:Nl
dummy2[CartesianIndex.(i, u, up)] .= values
end