Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
List of all members | Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes
Bayes_Opt Class Reference

A class implementing the BayesOpt algorithm as seen in: https://browse.arxiv.org/pdf/1807.02811.pdf. More...

#include <Bayes_Opt.h>

Public Member Functions

 Bayes_Opt (double(*f_pointer)(Matrix_real, void *), void *meta_data_in)
 Constructor of the class. More...
 
double Start_Optimization (Matrix_real &x, int max_iterations_in)
 
 ~Bayes_Opt ()
 Destructor of the class. More...
 

Public Attributes

Matrix_real covariance
 covariance matrix More...
 
double mu_0
 constant for the mean function More...
 

Protected Member Functions

void calculate_conditional_distribution (Matrix_real x, Matrix_real cov_x, double &mu_n, double &sigma2_n)
 
void calculate_conditional_distribution_combined (Matrix_real x, Matrix_real cov_x, Matrix_real cov_x_grad, Matrix_real cov_self_grad, double &mu_n, double &sigma2_n, Matrix_real &grad_mu, Matrix_real &grad_sigma)
 
double cdf (double mu, double sigma)
 
double expected_improvement (double mu_n, double sigma_n)
 
void expected_improvement_combined (double mu_n, double sigma_n, Matrix_real &grad_mu, Matrix_real &grad_sigma, double *f, Matrix_real &grad)
 
double grad_pdf (double mu, double sigma, double grad_mu, double grad_sigma)
 
double kernel (Matrix_real x0, Matrix_real x1)
 
void kernel_combined (Matrix_real x0, Matrix_real x, double &f, Matrix_real &grad, int grad_var, bool self)
 
double pdf (double mu, double sigma)
 
void update_covariance (Matrix_real cov_new)
 

Static Protected Member Functions

static double optimization_problem (Matrix_real x_Powell, void *void_instance)
 
static void optimization_problem_combined (Matrix_real x, void *void_instance, double *f0, Matrix_real &grad)
 

Protected Attributes

double alpha0
 amplitude of the kernel More...
 
double(* costfnc )(Matrix_real x, void *params)
 function pointer to evaluate the cost function and its gradient vector More...
 
double current_maximum
 
std::vector< double > f_prev
 
std::mt19937 gen
 
int initial_samples
 
long maximal_iterations
 maximal count of iterations during the optimization More...
 
void * meta_data
 additional data needed to evaluate the cost function More...
 
double num_precision
 numerical precision used in the calculations More...
 
int variable_num
 number of independent variables in the problem More...
 
std::vector< Matrix_realx_prev
 previous parameters More...
 

Detailed Description

A class implementing the BayesOpt algorithm as seen in: https://browse.arxiv.org/pdf/1807.02811.pdf.

Definition at line 59 of file Bayes_Opt.h.

Constructor & Destructor Documentation

◆ Bayes_Opt()

Bayes_Opt::Bayes_Opt ( double(*)(Matrix_real, void *)  f_pointer,
void *  meta_data_in 
)

Constructor of the class.

Parameters
f_pointerA function pointer (x, meta_data, f, grad) to evaluate the cost function and its gradients. The cost function and the gradient vector are returned via reference by the two last arguments.
meta_datavoid pointer to additional meta data needed to evaluate the cost function.
Returns
An instance of the class

Definition at line 76 of file common/Bayes_Opt.cpp.

◆ ~Bayes_Opt()

Bayes_Opt::~Bayes_Opt ( )

Destructor of the class.

Definition at line 433 of file common/Bayes_Opt.cpp.

Member Function Documentation

◆ calculate_conditional_distribution()

void Bayes_Opt::calculate_conditional_distribution ( Matrix_real  x,
Matrix_real  cov_x,
double &  mu_n,
double &  sigma2_n 
)
protected

Definition at line 220 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculate_conditional_distribution_combined()

void Bayes_Opt::calculate_conditional_distribution_combined ( Matrix_real  x,
Matrix_real  cov_x,
Matrix_real  cov_x_grad,
Matrix_real  cov_self_grad,
double &  mu_n,
double &  sigma2_n,
Matrix_real grad_mu,
Matrix_real grad_sigma 
)
protected

Definition at line 326 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cdf()

double Bayes_Opt::cdf ( double  mu,
double  sigma 
)
protected

Definition at line 271 of file common/Bayes_Opt.cpp.

Here is the caller graph for this function:

◆ expected_improvement()

double Bayes_Opt::expected_improvement ( double  mu_n,
double  sigma_n 
)
protected

Definition at line 211 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ expected_improvement_combined()

void Bayes_Opt::expected_improvement_combined ( double  mu_n,
double  sigma_n,
Matrix_real grad_mu,
Matrix_real grad_sigma,
double *  f,
Matrix_real grad 
)
protected

Definition at line 382 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ grad_pdf()

double Bayes_Opt::grad_pdf ( double  mu,
double  sigma,
double  grad_mu,
double  grad_sigma 
)
protected

Definition at line 275 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kernel()

double Bayes_Opt::kernel ( Matrix_real  x0,
Matrix_real  x1 
)
protected

Definition at line 253 of file common/Bayes_Opt.cpp.

Here is the caller graph for this function:

◆ kernel_combined()

void Bayes_Opt::kernel_combined ( Matrix_real  x0,
Matrix_real  x,
double &  f,
Matrix_real grad,
int  grad_var,
bool  self 
)
protected

Definition at line 302 of file common/Bayes_Opt.cpp.

Here is the caller graph for this function:

◆ optimization_problem()

double Bayes_Opt::optimization_problem ( Matrix_real  x_Powell,
void *  void_instance 
)
staticprotected

Definition at line 195 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ optimization_problem_combined()

void Bayes_Opt::optimization_problem_combined ( Matrix_real  x,
void *  void_instance,
double *  f0,
Matrix_real grad 
)
staticprotected

Definition at line 399 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:

◆ pdf()

double Bayes_Opt::pdf ( double  mu,
double  sigma 
)
protected

Definition at line 267 of file common/Bayes_Opt.cpp.

Here is the caller graph for this function:

◆ Start_Optimization()

double Bayes_Opt::Start_Optimization ( Matrix_real x,
int  max_iterations_in 
)

Definition at line 104 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_covariance()

void Bayes_Opt::update_covariance ( Matrix_real  cov_new)
protected

covariance matrix

Definition at line 279 of file common/Bayes_Opt.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ alpha0

double Bayes_Opt::alpha0
protected

amplitude of the kernel

Definition at line 77 of file Bayes_Opt.h.

◆ costfnc

double(* Bayes_Opt::costfnc) (Matrix_real x, void *params)
protected

function pointer to evaluate the cost function and its gradient vector

Definition at line 80 of file Bayes_Opt.h.

◆ covariance

Matrix_real Bayes_Opt::covariance

covariance matrix

Definition at line 65 of file Bayes_Opt.h.

◆ current_maximum

double Bayes_Opt::current_maximum
protected

Definition at line 94 of file Bayes_Opt.h.

◆ f_prev

std::vector<double> Bayes_Opt::f_prev
protected

Definition at line 90 of file Bayes_Opt.h.

◆ gen

std::mt19937 Bayes_Opt::gen
protected

Definition at line 99 of file Bayes_Opt.h.

◆ initial_samples

int Bayes_Opt::initial_samples
protected

Definition at line 97 of file Bayes_Opt.h.

◆ maximal_iterations

long Bayes_Opt::maximal_iterations
protected

maximal count of iterations during the optimization

Definition at line 71 of file Bayes_Opt.h.

◆ meta_data

void* Bayes_Opt::meta_data
protected

additional data needed to evaluate the cost function

Definition at line 83 of file Bayes_Opt.h.

◆ mu_0

double Bayes_Opt::mu_0

constant for the mean function

Definition at line 62 of file Bayes_Opt.h.

◆ num_precision

double Bayes_Opt::num_precision
protected

numerical precision used in the calculations

Definition at line 74 of file Bayes_Opt.h.

◆ variable_num

int Bayes_Opt::variable_num
protected

number of independent variables in the problem

Definition at line 68 of file Bayes_Opt.h.

◆ x_prev

std::vector<Matrix_real> Bayes_Opt::x_prev
protected

previous parameters

Definition at line 86 of file Bayes_Opt.h.


The documentation for this class was generated from the following files: