# Threshold quantum gate

I would like to know if it is possible to construct a set of quantum gates to do the following:

• Start with a set of N qubits representing a number expressed in binary notation.
• The values in the various qubits are entangled in unknown ways with each other, and have unknown ratios of likelihood of being 1 or 0.
• calculate a new qubit whose probability of being 1 is the probability that the number represented by the N qubits exceeds $$\delta$$, where $$\delta$$ is an externally provided (classical) parameter.

The objective is to create a quantum algorithm for general purpose optimization.

• I tkink the output qbit must necessarily be entangled with the N qbits. The subtractor->adder sounds like a good approach. But it wouldn't act on two sers of qbits; it would act on one set of qbits and a classical set representing $\delta$. – S. McGrew Mar 18 at 15:41