Generator of matrices in the Gaussian Unitary Ensemble (GUE)
More...
#include <RandomMatrices.hpp>
|
| GUEgenerator (int seed=0, RealType stddev=1.0) |
| Constructor.
|
|
template<typename EigenMatrix > |
void | operator() (EigenMatrix &mat) |
| Generates an instance of a random matrix.
|
|
void | status (void) const |
| Show the current status of the generator.
|
|
void | discard (unsigned long long num) |
| Discards random numbers to advance internal states of the random number generator.
|
|
template<typename EigenMatrix > |
void | discard (EigenMatrix const &mat, unsigned long long num) |
| Discards instances of random matrices to advance internal states of the random number generator.
|
|
|
std::mt19937 | mt |
|
std::normal_distribution< RealType > | Gaussian |
|
unsigned long long | count |
|
template<typename RealType = double>
class GUEgenerator< RealType >
Generator of matrices in the Gaussian Unitary Ensemble (GUE)
- Template Parameters
-
RealType | : the type of floating-point numbers. |
◆ GUEgenerator()
template<typename RealType = double>
Constructor.
- Parameters
-
seed | seed for the random number generator |
stddev | Standard deviation of diagonal elements |
std::normal_distribution< RealType > Gaussian
Definition RandomMatrices.hpp:23
std::mt19937 mt
Definition RandomMatrices.hpp:22
unsigned long long count
Definition RandomMatrices.hpp:24
◆ discard() [1/2]
template<typename RealType = double>
template<typename EigenMatrix >
void GUEgenerator< RealType >::discard |
( |
EigenMatrix const & |
mat, |
|
|
unsigned long long |
num |
|
) |
| |
|
inline |
Discards instances of random matrices to advance internal states of the random number generator.
- Parameters
-
mat | Matrix the shape of which is the same as random matrices to be discarded |
num | Number of random matrices to be discarded |
80 {
81 this->
discard(num * 2 * mat.size());
82 }
void discard(unsigned long long num)
Discards random numbers to advance internal states of the random number generator.
Definition RandomMatrices.hpp:67
◆ discard() [2/2]
template<typename RealType = double>
void GUEgenerator< RealType >::discard |
( |
unsigned long long |
num | ) |
|
|
inline |
Discards random numbers to advance internal states of the random number generator.
- Parameters
-
num | Number of random numbers to be discarded |
◆ operator()()
template<typename RealType = double>
template<typename EigenMatrix >
void GUEgenerator< RealType >::operator() |
( |
EigenMatrix & |
mat | ) |
|
|
inline |
Generates an instance of a random matrix.
- Parameters
-
[out] | mat | Matrix to which the generated matrix is assigned |
40 {
41 mat = mat.NullaryExpr(mat.rows(), mat.cols(), [&]() {
42 return Complex_t<RealType>(Gaussian(mt), Gaussian(mt));
43 });
44 mat = (mat + mat.adjoint().eval()) / 2.0;
45 count += 2 * mat.size();
46 }
◆ status()
template<typename RealType = double>
Show the current status of the generator.
- Mean: Mean of each elements
- Stddev: Standard deviation of diagonal elements
- Count: Number of random numbers generated by the instance so far
54 {
55 std::cout << "GUEgenerator.status()"
56 << "\n";
57 std::cout <<
"\tMean: " <<
Gaussian.mean() <<
"\n";
58 std::cout <<
"\tStddev: " <<
Gaussian.stddev() <<
"\n";
59 std::cout <<
"\tCount: " << this->
count << std::endl;
60 }
◆ count
template<typename RealType = double>
◆ Gaussian
template<typename RealType = double>
std::normal_distribution<RealType> GUEgenerator< RealType >::Gaussian |
|
private |
◆ mt
template<typename RealType = double>
The documentation for this class was generated from the following file: