Skip to content
This repository was archived by the owner on Jun 9, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions include/rng_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class RandomNumberGenerator
std::size_t _num_generated_or_skipped_state_numbers=0;
std::size_t _num_generated_or_skipped_pool_numbers =0;

using FloatType =
typename std::conditional<std::is_floating_point<Type>::value, Type,
float>::type;

#ifdef USE_MKL
// vsl streams for random numbers
VSLStreamStatePtr _pool_stream;
Expand All @@ -54,10 +58,10 @@ class RandomNumberGenerator
std::mt19937 _pool_generator;
std::mt19937 _state_generator;
std::mt19937 _local_generator;
std::uniform_real_distribution<Type> u_distribution
= std::uniform_real_distribution<Type>(0.0,1.0); // uniform in [0,1[
std::normal_distribution<Type> n_distribution
= std::normal_distribution<Type>(0.0,1.0); // mean=0, std.dev.=1
std::uniform_real_distribution<FloatType> u_distribution
= std::uniform_real_distribution<FloatType>(0.0,1.0); // uniform in [0,1[
std::normal_distribution<FloatType> n_distribution
= std::normal_distribution<FloatType>(0.0,1.0); // mean=0, std.dev.=1
#endif

public:
Expand Down
2 changes: 1 addition & 1 deletion include/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

using ComplexSP = std::complex<float>;
using ComplexDP = std::complex<double>;
// using ComplexPosit = sw::universal::posit<24, 1>;
using ComplexPosit = std::complex<sw::universal::posit<24, 1>>;

namespace iqs {

Expand Down
1 change: 1 addition & 0 deletions src/qureg_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ QubitRegister<Type>::~QubitRegister()

template class QubitRegister<ComplexSP>;
template class QubitRegister<ComplexDP>;
template class QubitRegister<ComplexPosit>;

} // end namespace iqs

Expand Down
1 change: 1 addition & 0 deletions src/qureg_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,7 @@ void QubitRegister<Type>::ResetStatistics()

template class QubitRegister<ComplexSP>;
template class QubitRegister<ComplexDP>;
template class QubitRegister<ComplexPosit>;

} // end namespace iqs

Expand Down