I want to create a diagonal matrix whose diagonals are powers of 1/2. I know I could do:
A = Diagonal(1, 1/2, 1/2^2, ..., 1/2^10)
I was wondering if there is a way to do this using a comprehension, something like this:
A = Diagonal((1/2)^x for x=[0:10])