Assume we have an n qubit system and $K \subset \{1,...,2^n\}, K \neq \emptyset $ I want to describe a circuit that takes the input $|0>....|0>$$|0\rangle....|0\rangle$ to the state $\psi = \frac{1}{\sqrt{|K|}}\sum_{k\in K} \mid k>$$|\psi\rangle = \frac{1}{\sqrt{|K|}}\sum_{k\in K} |k\rangle$
I was thinking of using Grover search to estimate $\psi$$|\psi\rangle$. I believe it will work fine but this does not require us to know all of K$K$ which we do. soSo I assume there is a better way of doing this. I hope to find a generic process that will work for every subset K$K$ without any assumptions.