Sounds like you just want:
I₃ = Matrix{T}(I, 3N, 3N)
F = [I₃ I₃; I₃ I₃]
or equivalently
F = diagm(0 => ones(T,6N), 3N => ones(T,3N), -3N => ones(T,3N))
or equivalently
F = kron(ones(T,2,2), I(3N))
All of these match the F
constructed by your code above.
1 Like