Grover state preparation algorithm