Quantum++  v0.8.2
C++11 quantum computing library
number_theory.h File Reference

Number theory functions. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 qpp
 Quantum++ main namespace.
 

Functions

std::vector< int > qpp::x2contfrac (double x, idx n, idx cut=1e5)
 Simple continued fraction expansion. More...
 
double qpp::contfrac2x (const std::vector< int > &cf, idx n)
 Real representation of a simple continued fraction. More...
 
double qpp::contfrac2x (const std::vector< int > &cf)
 Real representation of a simple continued fraction. More...
 
ubigint qpp::gcd (ubigint m, ubigint n)
 Greatest common divisor of two non-negative integers. More...
 
ubigint qpp::gcd (const std::vector< ubigint > &ns)
 Greatest common divisor of a list of non-negative integers. More...
 
ubigint qpp::lcm (ubigint m, ubigint n)
 Least common multiple of two positive integers. More...
 
ubigint qpp::lcm (const std::vector< ubigint > &ns)
 Least common multiple of a list of positive integers. More...
 
std::vector< idx > qpp::invperm (const std::vector< idx > &perm)
 Inverse permutation. More...
 
std::vector< idx > qpp::compperm (const std::vector< idx > &perm, const std::vector< idx > &sigma)
 Compose permutations. More...
 
std::vector< ubigint > qpp::factors (ubigint n)
 Prime factor decomposition. More...
 
bool qpp::isprime (ubigint n)
 Primality test. More...
 
ubigint qpp::modpow (ubigint a, ubigint n, ubigint p)
 Integer power modulo p. More...
 

Detailed Description

Number theory functions.