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
RL_experience Class Reference

A class for RL_experience optimization according to https://towardsdatascience.com/how-to-implement-an-adam-optimizer-from-scratch-76e7b217f1cc. More...

#include <RL_experience.h>

Public Member Functions

RL_experience copy ()
 Call to make a copy of the current instance. More...
 
int draw (const int &curent_index, std::mt19937 &gen)
 Call to draw the next index. More...
 
void export_probabilities ()
 ??????????? More...
 
void import_probabilities ()
 ??????????? More...
 
RL_experienceoperator= (const RL_experience &experience)
 Assignment operator. More...
 
void reset ()
 ????????????? More...
 
 RL_experience ()
 Nullary constructor of the class. More...
 
 RL_experience (Gates_block *gates_in, unsigned long long iteration_num_in)
 Contructor of the class. More...
 
 RL_experience (const RL_experience &experience)
 Copy constructor. More...
 
void update_probs ()
 Call to update the trained probabilities and reset the counts. More...
 
virtual ~RL_experience ()
 Destructor of the class. More...
 

Public Attributes

double eta
 
double exploration_rate
 
Gates_blockgates
 attribute stroing the gate structure More...
 
std::vector< inthistory
 
unsigned long long iteration_num
 
matrix_base< intparameter_counts
 array containing the counts of successive parameters used in the optimization. Element (i,j) means that after the i-th parameter the j-th parameter was chosen A_ij times. More...
 
int parameter_num
 number of involved parameters More...
 
Matrix_real parameter_probs
 
matrix_base< inttotal_counts
 total counts in one row of parameter_counts — reset when probabilites are updated More...
 
matrix_base< unsigned long long > total_counts_probs
 total counts used to evasluate one row in parameter_probs More...
 

Detailed Description

A class for RL_experience optimization according to https://towardsdatascience.com/how-to-implement-an-adam-optimizer-from-scratch-76e7b217f1cc.

Definition at line 38 of file RL_experience.h.

Constructor & Destructor Documentation

◆ RL_experience() [1/3]

RL_experience::RL_experience ( )

Nullary constructor of the class.

Returns
An instance of the class

Definition at line 35 of file RL_experience.cpp.

Here is the call graph for this function:

◆ RL_experience() [2/3]

RL_experience::RL_experience ( Gates_block gates_in,
unsigned long long  iteration_num_in 
)

Contructor of the class.

Constructor of the class.

Parameters
gates_inConstructor of the class.
???????????????????????????????
???????????????????????????????
???????????????????????????????
Returns
An instance of the class

Definition at line 55 of file RL_experience.cpp.

Here is the call graph for this function:

◆ RL_experience() [3/3]

RL_experience::RL_experience ( const RL_experience experience)

Copy constructor.

Parameters
experienceAn instance of class
Returns
Returns with the instance of the class.

Definition at line 77 of file RL_experience.cpp.

Here is the call graph for this function:

◆ ~RL_experience()

RL_experience::~RL_experience ( )
virtual

Destructor of the class.

Definition at line 151 of file RL_experience.cpp.

Member Function Documentation

◆ copy()

RL_experience RL_experience::copy ( )

Call to make a copy of the current instance.

Returns
Returns with the instance of the class.

Definition at line 129 of file RL_experience.cpp.

Here is the call graph for this function:

◆ draw()

int RL_experience::draw ( const int curent_index,
std::mt19937 &  gen 
)

Call to draw the next index.

Parameters
curent_indexThe current index after which the next one is selected
Returns
Returns with the selected index

Definition at line 207 of file RL_experience.cpp.

Here is the call graph for this function:

◆ export_probabilities()

void RL_experience::export_probabilities ( )

???????????

Parameters
???????????

Definition at line 324 of file RL_experience.cpp.

Here is the call graph for this function:

◆ import_probabilities()

void RL_experience::import_probabilities ( )

???????????

Parameters
???????????

Definition at line 363 of file RL_experience.cpp.

Here is the call graph for this function:

◆ operator=()

RL_experience & RL_experience::operator= ( const RL_experience experience)

Assignment operator.

Parameters
experienceAn instance of class
Returns
Returns with the instance of the class.

Definition at line 101 of file RL_experience.cpp.

Here is the call graph for this function:

◆ reset()

void RL_experience::reset ( )

?????????????

Definition at line 160 of file RL_experience.cpp.

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

◆ update_probs()

void RL_experience::update_probs ( )

Call to update the trained probabilities and reset the counts.

Definition at line 265 of file RL_experience.cpp.

Member Data Documentation

◆ eta

double RL_experience::eta

Definition at line 44 of file RL_experience.h.

◆ exploration_rate

double RL_experience::exploration_rate

Definition at line 77 of file RL_experience.h.

◆ gates

Gates_block* RL_experience::gates

attribute stroing the gate structure

Definition at line 56 of file RL_experience.h.

◆ history

std::vector<int> RL_experience::history

Definition at line 73 of file RL_experience.h.

◆ iteration_num

unsigned long long RL_experience::iteration_num

Definition at line 53 of file RL_experience.h.

◆ parameter_counts

matrix_base<int> RL_experience::parameter_counts

array containing the counts of successive parameters used in the optimization. Element (i,j) means that after the i-th parameter the j-th parameter was chosen A_ij times.

Definition at line 63 of file RL_experience.h.

◆ parameter_num

int RL_experience::parameter_num

number of involved parameters

Definition at line 50 of file RL_experience.h.

◆ parameter_probs

Matrix_real RL_experience::parameter_probs

Definition at line 59 of file RL_experience.h.

◆ total_counts

matrix_base<int> RL_experience::total_counts

total counts in one row of parameter_counts — reset when probabilites are updated

Definition at line 66 of file RL_experience.h.

◆ total_counts_probs

matrix_base<unsigned long long> RL_experience::total_counts_probs

total counts used to evasluate one row in parameter_probs

Definition at line 69 of file RL_experience.h.


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