// quantum computing emulation library, R. Perry, January 2022 // #ifndef _QCE_LIB_H_ #define _QCE_LIB_H_ namespace qce { // non-template functions, defined in lib.cc: // // SRAND set srand() using time(0) or SRAND environment variable // drand 0.0 <= drand() < 1.0 // irand(n) 0 <= irand() < n // printb print binary // bitrev bit reverse, used by qfft() // error print error message and exit // emalloc malloc with exit on error // unsigned int SRAND(); double drand(); unsigned long irand( unsigned long n); void printb( unsigned long x, unsigned int n); unsigned long bitrev( unsigned long x, unsigned int nbits); void error( const char *msg); void *emalloc( unsigned long size); } // namespace qce #endif // _QCE_LIB_H_