List the known distinct strings in as , where , and use an -qubit index quantum ancilla. Apply Hadamard gates to that register to prepare
First, for each with , apply the available unitary operator that transposes and . The pairs are disjoint because they have distinct index labels. Skip a transposition when the two vectors coincide. This produces
Second, for each , transpose and . These pairs are disjoint because the data strings are distinct. No pair contains the term with , and no later transposition moves an earlier output. The final state is exactly
This clean subset superposition preparation uses at most of the given transpositions and Hadamard gates. Since , is polynomial in ; multiplying this count by the assumed polynomial size of each transposition gives a polynomial-size quantum circuit. The index quantum ancilla returns to zero, so the data register is a pure uniform superposition state, rather than a mixture obtained by discarding its index. The construction uses an available enumeration of the known subset; a membership oracle alone would not justify that enumeration.