You asked:

how much magnesium is there in 1kg of pasta

Sorry, I don't yet have an answer to that question.