Quantum++  v1.0.0-beta3
C++11 quantum computing library
random.h File Reference

Randomness-related 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

double qpp::rand (double a, double b)
 Generates a random real number uniformly distributed in the interval [a, b) More...
 
bigint qpp::rand (bigint a, bigint b)
 Generates a random big integer uniformly distributed in the interval [a, b]. More...
 
idx qpp::randidx (idx a=std::numeric_limits< idx >::min(), idx b=std::numeric_limits< idx >::max())
 Generates a random index (idx) uniformly distributed in the interval [a, b]. More...
 
template<typename Derived >
Derived qpp::rand (idx rows, idx cols, double a=0, double b=1)
 Generates a random matrix with entries uniformly distributed in the interval [a, b) More...
 
template<>
dmat qpp::rand (idx rows, idx cols, double a, double b)
 Generates a random real matrix with entries uniformly distributed in the interval [a, b), specialization for double matrices (qpp::dmat) More...
 
template<>
cmat qpp::rand (idx rows, idx cols, double a, double b)
 Generates a random complex matrix with entries (both real and imaginary) uniformly distributed in the interval [a, b), specialization for complex matrices (qpp::cmat) More...
 
template<typename Derived >
Derived qpp::randn (idx rows, idx cols, double mean=0, double sigma=1)
 Generates a random matrix with entries normally distributed in N(mean, sigma) More...
 
template<>
dmat qpp::randn (idx rows, idx cols, double mean, double sigma)
 Generates a random real matrix with entries normally distributed in N(mean, sigma), specialization for double matrices (qpp::dmat) More...
 
template<>
cmat qpp::randn (idx rows, idx cols, double mean, double sigma)
 Generates a random complex matrix with entries (both real and imaginary) normally distributed in N(mean, sigma), specialization for complex matrices (qpp::cmat) More...
 
double qpp::randn (double mean=0, double sigma=1)
 Generates a random real number (double) normally distributed in N(mean, sigma) More...
 
cmat qpp::randU (idx D)
 Generates a random unitary matrix. More...
 
cmat qpp::randV (idx Din, idx Dout)
 Generates a random isometry matrix. More...
 
std::vector< cmat > qpp::randkraus (idx N, idx D)
 Generates a set of random Kraus operators. More...
 
cmat qpp::randH (idx D)
 Generates a random Hermitian matrix. More...
 
ket qpp::randket (idx D)
 Generates a random normalized ket (pure state vector) More...
 
cmat qpp::randrho (idx D)
 Generates a random density matrix. More...
 
std::vector< idx > qpp::randperm (idx N)
 Generates a random uniformly distributed permutation. More...
 
std::vector< double > qpp::randprob (idx N)
 Generates a random probability vector uniformly distributed over the probability simplex. More...
 

Detailed Description

Randomness-related functions.