The Deutsch-Jozsa algorithm distinguishes constant functions from balanced
functions with a single evaluation. In the first part of this work, we present
simulations of the nuclear magnetic resonance (NMR) application of the
Deutsch-Jozsa algorithm to a 3-spin system for all possible balanced functions.
Three different kinds of initial states are considered: a thermal state, a
pseudopure state, and a pair (difference) of pseudopure states. Then,
simulations of several balanced functions and the two constant functions of a
5-spin system are described. Finally, corresponding experimental spectra
obtained by using a 16-frequency pulse to create an input equivalent to either
a constant function or a balanced function are presented, and the results are
compared with those obtained from computer simulations.Comment: accepted for publication in the Journal of Chemical Physic