qxmt.visualization.plot_optimization_performance module

qxmt.visualization.plot_optimization_performance module#

qxmt.visualization.plot_optimization_performance.plot_optimization_history(cost_history, baseline_cost=None, cost_label=None, baseline_label=None, marker='o', markersize=5, title='Optimization History', step_num=10, x_label='Step', y_label='Cost', grid=False, save_path=None, **kwargs)

Plot the optimization history.

Parameters:
  • cost_history (list[float]) – The cost history of each optimization step.

  • baseline_cost (float) – The baseline cost of the optimization.

  • cost_label (Optional[str], optional) – The label of the cost history. Defaults to None.

  • baseline_label (Optional[str], optional) – The label of the baseline cost. Defaults to None.

  • marker (str, optional) – The marker of the cost history. Defaults to “o”.

  • markersize (int, optional) – The size of the marker. Defaults to 5.

  • title (str, optional) – The title of the plot. Defaults to “Optimization History”.

  • step_num (int, optional) – The number of steps to show on the x-axis. Defaults to 10.

  • x_label (str, optional) – The label of the x-axis. Defaults to “Step”.

  • y_label (str, optional) – The label of the y-axis. Defaults to “Cost”.

  • save_path (Optional[str | Path], optional) – The path to save the plot. Defaults to None.

  • **kwargs (Any) – Additional arguments for the plot method.

  • grid (bool)

Return type:

None