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.