Quantum++
v0.8.8
C++11 quantum computing library
|
Number theory functions. More...
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... | |
bigint | qpp::gcd (bigint m, bigint n) |
Greatest common divisor of two integers. More... | |
bigint | qpp::gcd (const std::vector< bigint > &ns) |
Greatest common divisor of a list of integers. More... | |
bigint | qpp::lcm (bigint m, bigint n) |
Least common multiple of two integers. More... | |
bigint | qpp::lcm (const std::vector< bigint > &ns) |
Least common multiple of a list of 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< bigint > | qpp::factors (bigint n) |
Prime factor decomposition. More... | |
bool | qpp::isprime (bigint n) |
Primality test. More... | |
bigint | qpp::modpow (bigint a, bigint n, bigint p) |
Fast integer power modulo p based on the SQUARE-AND-MULTIPLY algorithm. More... | |
std::tuple< bigint, bigint, bigint > | qpp::egcd (bigint m, bigint n) |
Extended greatest common divisor of two integers. More... | |
bigint | qpp::modinv (bigint a, bigint p) |
Modular inverse of a mod p. More... | |
Number theory functions.