Quantum mechanics offers novel algorithms allowing to speed up the solution of specific computational tasks[1, 2]. While applications in quantum cryptography [1, 3] are close to commerical realization [4], the endeavour of building a universal quantum computer with thousands of quantum bits lies in the distant future, if ever realized. In this situation, it is interesting to study and implement special tasks which are less demanding in their requirement with regard to the number of qubits and the complexity of its network. Here, we discuss an algorithm and its application in a mesoscopic setting where a few qubits serve as active or passive detectors. The core algorithmic element is a physical setup with K qubits allowing to count the elements in a stream of particles flowing in a quantum wire. We make use of this setup to process classical and quantum information: we present a divisibility check to experimentally test the size of a finite train of particles in a quantum wire and discuss a scheme allowing to entangle multi-particle wave functions to generate Bell states, Greenberger-Horne-Zeilinger states, or Dicke states in a Mach-Zehnder interferometer. [1] M.A. Nielsen and I.L. Chuang, Quantum Computation and Quantum Information (Cambridge University Press, 6 2000). [2] D. Stucki, N. Gisin, O. Guinnard, G. Ribordy, H. Zbinden, New Journal of Physics textbf{4}, 41.1 (2002); see also www.idquantique.com. [3] R. Cleve, A. Ekert, C. Macchiavello, and M. Mosca, Proc. R. Soc. Lond. A textbf{454}, 339 (1998). [4] E. Andersson and D.K.L. Oi, Phys. Rev. A textbf{77}, 052104 (2008).
L.D. Landau Institute for Theoretical Physics RAS, 117940 Moscow,