A method and apparatus for quantum computing. A computer-program source
code, data, and unsubstantiated output variables are converted into a
class of computable functions by a program compiler. The computable
functions are encoded, and a continualization method is applied to the
encoded functions to determine a first-order, time-dependent,
differential equation. Variational calculus is employed to construct a
Lagrangian whose minimum geodesic is the solution for the first-order,
time-dependent, differential equation. The Lagrangian is converted into a
quantum, canonical, Hamiltonian operator which is realized as an
excitation field via an excitation generator. The excitation field is
repeatedly applied to a quantum processor consisting of a lattice of
polymer nodes to generate an intensity-versus-vibrational-frequency
spectrum of the lattice nodes. The average vibrational spectrum intensity
values are used as coefficients in an approximating polynomial of the
encoding function to determine the substantiated output variables, or
program output.