density_optimization

_add_all_energy_differences(ax: Axes, callback: BasicCallback, energies_label: Energies, stopping_index: int = None, **kwargs)[source]

Add all energy differences to the given axis.

Parameters:
  • ax – The axis to add the energy differences to.

  • callback – The callback object.

  • energies_label – The label energies.

  • stopping_index – The index at which the optimization stopped. Optional.

  • **kwargs – Additional arguments for uniform plot interface.

_add_coefficient_differences_lines(ax: Axes, callback: BasicCallback, coeffs_label: Tensor, basis_l: Tensor = None, stopping_index: int = None, **kwargs)[source]

Add the coefficient differences to the given axis as a plot.

Parameters:
  • ax – The axis to add the coefficient difference to.

  • callback – The callback object.

  • coeffs_label – The label coefficients.

  • basis_l – Angular momentum of basis functions.

  • stopping_index – The index at which the optimization stopped. Optional.

  • **kwargs – Additional arguments for uniform plot interface.

_add_coefficient_differences_pixels(ax: Axes, callback: BasicCallback, coeffs_label: Tensor, **kwargs)[source]

Add the coefficient differences to the given axis as a pixel image.

Parameters:
  • ax – The axis to add the coefficient difference to.

  • callback – The callback object.

  • coeffs_label – The label coefficients.

  • **kwargs – Additional arguments for uniform plot interface.

_add_density_and_gradient(ax: Axes, callback: BasicCallback, energies_label: Energies, coeffs_label: Tensor, sample: OFData, stopping_index: int = None, **kwargs)[source]

Add the density and gradient to the given axis as a pixel image.

Parameters:
  • ax – The axis to add the density and gradient to.

  • callback – The callback object.

  • energies_label – The label energies used to obtain the overlap matrix via the mol.

  • coeffs_label – The label coefficients.

  • sample – The sample used for transformations.

  • stopping_index – The index at which the optimization stopped. Optional.

  • **kwargs – Additional arguments for uniform plot interface.

_add_density_difference(ax: Axes, callback: BasicCallback, energies_label: Energies, coeffs_label: Tensor, sample: OFData, stopping_index: int = None, **kwargs)[source]

Add the density difference to the given axis.

Parameters:
  • ax – The axis to add the density difference to.

  • callback – The callback object.

  • energies_label – The label energies.

  • coeffs_label – The label coefficients.

  • stopping_index – The index at which the optimization stopped. Optional.

  • **kwargs – Additional arguments for uniform plot interface.

_add_gradient_norm(ax: Axes, callback: BasicCallback, stopping_index: int = None, **kwargs)[source]

Add the gradient norm to the given axis.

Parameters:
  • ax – The axis to add the gradient norm to.

  • callback – The callback object.

  • stopping_index – The index at which the optimization stopped. Optional.

  • **kwargs – Additional arguments for uniform plot interface.

_add_integrated_negative_density(ax: Axes, callback: BasicCallback, energies_label: Energies, sample: OFData, stopping_index: int = None, **kwargs)[source]

Add the integrated negative density to the given axis.

Parameters:
  • ax – The axis to add the integrated negative density to.

  • energies_label – The label energies.

  • sample – The sample used for transformations.

  • stopping_index – The index at which the optimization stopped. Optional.

  • **kwargs – Additional arguments for uniform plot interface.

plot_density_optimization(callback: BasicCallback, energies_label: Energies, coeffs_label: Tensor, sample: OFData, stopping_index: int = None, basis_l: Tensor = None, figure_path: Path | str = None, enable_grid_operations: bool = False)[source]

Plot the density optimization.

If a figure path is given, the figure is saved to that path.

Parameters:
  • callback – The callback object.

  • energies_label – The label energies.

  • coeffs_label – The label coefficients.

  • sample – The sample used for transformations.

  • stopping_index – The index at which the optimization stopped. Optional.

  • basis_l – Angular momentum of basis functions. Optional.

  • figure_path – The path to save the figure. If None, the figure is not saved.

  • enable_grid_operations – If False, plots requiring computations on the grid (the integrated negative density plot) are not shown.