qubiter.adv_applications.CostMinimizer module¶
-
class
qubiter.adv_applications.CostMinimizer.
CostMinimizer
(init_x_val, print_hiatus=1, verbose=False)[source]¶ Bases:
object
This is an abstract class embodying the ideal of a class for minimizing a real valued cost function cost_fun with respect to its N variables x_val.
Variables: - cur_cost (float) – current cost
- cur_targ_cost (float) – current target cost
- cur_x_val (np.ndarray) – current x value
- init_x_val (np.ndarray) – initial x value
- iter_count (int) – iteration count. An iteration is every time the cost function is called
- print_hiatus (int) – the current values of x_val and cost are printed when iter_count % print_hiatus == 0 iff print_hiatus > 0
- verbose (bool) –
-
__init__
(init_x_val, print_hiatus=1, verbose=False)[source]¶ Constructor
Parameters: - init_x_val (np.ndarray) –
- print_hiatus (int) –
- verbose (bool) –
-
broadcast_cost_fun_call
()[source]¶ This method prints current cost and x_val each time cost function is called. It also prints targ_cost if there is one.
Returns: Return type: None