46 if (
gates.size() == 0 ) {
51 if (solution_guess.
size() == 0 ) {
62 int iteration_loops_max = 1;
71 std::uniform_real_distribution<> distrib_real(0.0, 2*
M_PI);
74 long long max_inner_iterations_loc;
75 if (
config.count(
"max_inner_iterations_bayes_opt") > 0 ) {
76 config[
"max_inner_iterations_bfgs"].get_property( max_inner_iterations_loc );
78 else if (
config.count(
"max_inner_iterations") > 0 ) {
79 config[
"max_inner_iterations"].get_property( max_inner_iterations_loc );
87 for (
long long idx=0; idx<iteration_loops_max; idx++) {
91 double f = cBayes_Opt.
Start_Optimization(solution_guess, static_cast<int>(max_inner_iterations_loc));
99 solution_guess[jdx] = solution_guess[jdx] + distrib_real(
gen);
104 std::stringstream sstream;
void print(const std::stringstream &sstream, int verbose_level=1) const
Call to print output messages in the function of the verbosity level.
A class implementing the BayesOpt algorithm as seen in: https://browse.arxiv.org/pdf/1807.02811.pdf.
double optimization_problem(double *parameters)
Evaluate the optimization problem of the optimization.
scalar * get_data() const
Call to get the pointer to the stored data.
double Start_Optimization(Matrix_real &x, int max_iterations_in)
std::vector< Gate * > gates
The list of stored gates.
int size() const
Call to get the number of the allocated elements.
std::map< std::string, Config_Element > config
config metadata utilized during the optimization
Header file for the paralleized calculation of the cost function of the final optimization problem (s...
volatile double current_minimum
The current minimum of the optimization problem.
Header file for DFE support in unitary simulation.
int max_inner_iterations
the maximal number of iterations for which an optimization engine tries to solve the optimization pro...
Matrix_real optimized_parameters_mtx
The optimized parameters for the gates.
Class to store data of complex arrays and its properties.
void solve_layer_optimization_problem_BAYES_OPT(int num_of_parameters, Matrix_real &solution_guess)
Call to solve layer by layer the optimization problem via Bayes algorithm.
std::mt19937 gen
Standard mersenne_twister_engine seeded with rd()