Aenigma Forums

General Forums => Public Tavern => Topic started by: Dalden on 17. November 2008, 13:58:44 (01:58 PM)

Title: Coding for quantum computers
Post by: Dalden on 17. November 2008, 13:58:44 (01:58 PM)
For the geeky...

Quantum Meta-Vax 9000: Runtime libraries, reference manual:


FUNCTION  fileExists

PROTOTYPE
             std::pair<std::complex<float>> fileExists (const char *path);

ARGUMENTS
             path - absolute or relative path to a file to test for existence.

RETURNS

             A pair of complex floats, both normalized in the range (-1.0 - +1.0, -1.0i - +1.0i)

                 pair.first - the fractional extent to which the file exists.

                 pair.second - the fractional extent to which the file does not exist.

             Each complex float represents a unit eigenvector in the Heisenberg

             phase-space of the file.

 BUGS

             Under conditions of parity violation, lepton number may not be preserved.

             May accidentally collapse the quantum vacuum into a lower metastable

             state and destroy the universe.  In this case, fileExists() will throw a

             UniverseNotFound exception.

USAGE

              std::pair<std::complex<float>> result;

              result = fileExists ("/etc/passwd");

              if ((pow (acos (imag (result.first) / real (result.first)), 2.0)

                 + pow (acos (imag (result.second) / real (result.second)), 2.0)

              >= 0.5)
             {

                  cout << "Wtf?" << endl;
             }
             else if ((pow (acos (real (result.first) / imag (result.first)), 2.0)

                 + pow (acos (real (result.second) / imag (result.second)), 2.0)
              < -0.5)

             {

                  cout << "File is at right angles to reality?" << endl;
             }

             else  [  .  .  .  ]