# Is there a quantum gate that can do this?

Is there a quantum gate that can do the following?

Given a first set of N qbits, mutually entangled in such a way that each state in the superposition meets a given condition, generate a second set of N qbits entangled in such a way that NO superimposed state in the second set of qbits meets that condition, and ALL states that do not meet that condition ARE included in the superimposed states in the second set of qbits.

It seems that a combination of quantum NOT gates might do the trick, but I can't quite wrap my head around it. My apologies if the terminology is wrong: this is not my field.

• Can you please provide more details and examples? What kind of conditions? For example, can the parity of the bitstrings in the superposition be regarded as a condition? If yes then $\frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$ is a superposition of states with even parity (even number of $1$s), but if we will apply $X$ gate to the second qubit we will obtain $\frac{1}{\sqrt{2}}(|01\rangle + |10\rangle)$ that has bitstrings in the superposition state with odd parity. Sep 24, 2020 at 15:56
• I expect that there will be about 40 qbits. The condition will typically be a test of whether or not the value of a given function of the 40 qbits is greater or less than a threshold value. Sep 24, 2020 at 17:22
• Whether or not you can do that might come down to the specific condition you want to know about, so it is important to formulate it precisely, e.g. as a mathematical statement. Sep 25, 2020 at 7:16
• Do you mean --- given a state $\lvert \psi \rangle = \sum_{x \in S} \alpha_x \lvert x \rangle$ (where you might possibly want $\alpha_x \ne 0$ for all $x \in S$, and indeed possibly $\alpha_x = \alpha_y$ for all $x,y \in S$), where $S$ is the set of $n$-bit strings which satisfy some property --- to generate a second state $\lvert \phi \rangle = \sum_{x \in S'} \beta_x \lvert x \rangle$, such that $\beta_x \ne 0$ for all $x \in S'$, and where $S'$ is the complementary set to $S$? Sep 25, 2020 at 12:41
• Can you put that in layman's language? @DaftWullie, the specific condition will typically be based on a polynomial function of numerical values represented by subsets of the qbits; with the condition itself being that the value of the function exceeds (1) or falls below (0) a separately specified threshold value. I hope to be able to recover the superposition corresponding to (1), even when the condition returns a (0). I suspect a simple bit-flip applied to all the qbits in the case of (0) being returned will work, but can't prove it. Sep 25, 2020 at 14:39