Implementation of the basinhopping optimizer for the PEPS model (varipeps.optimization.basinhopping)

class varipeps.optimization.basinhopping.PEPS_AD_Basinhopping(initial_guess: ~varipeps.peps.unitcell.PEPS_Unit_Cell | ~typing.Sequence[~jax.Array], expectation_func: ~varipeps.expectation.model.Expectation_Model, convert_to_unitcell_func: ~varipeps.mapping.model.Map_To_PEPS_Model | None = None, autosave_filename: ~os.PathLike = 'data/autosave.hdf5', autosave_func: ~typing.Callable[[~os.PathLike, ~typing.Sequence[~jax.Array], ~varipeps.peps.unitcell.PEPS_Unit_Cell], None] = <function autosave_function>)

Bases: object

Class to wrap the basinhopping algorithm for the variational update of PEPS or mapped structures.

The parameters of the class initialization are the same as for optimize_peps_network.

Parameters:
  • initial_guess (PEPS_Unit_Cell or sequence of jax.numpy.ndarray) – The PEPS unitcell to work on or the tensors which should be mapped by convert_to_unitcell_func to a PEPS unitcell.

  • expectation_func (Expectation_Model) – Callable to calculate one expectation value which is used as loss loss function of the model. Likely the function to calculate the energy.

  • convert_to_unitcell_func (Map_To_PEPS_Model, optional) – Function to convert the input_tensors to a PEPS unitcell. If ommited, it is assumed that a PEPS unitcell is the first input parameter.

    Default: None

  • autosave_filename (os.PathLike, optional) – Filename where intermediate results are automatically saved.

    Default: 'data/autosave.hdf5'

  • autosave_func (callable, optional) – Function which is called to autosave the intermediate results. The function has to accept the arguments (filename, tensors, unitcell).data (Unit_Cell_Data): Instance of unit cell data class

    Default: <function autosave_function>

autosave_filename: PathLike = 'data/autosave.hdf5'
autosave_func(tensors: Array, unitcell: PEPS_Unit_Cell, counter: int | None = None, auxiliary_data: Dict[str, Any] | None = None) None
convert_to_unitcell_func: Map_To_PEPS_Model | None = None
expectation_func: Expectation_Model
initial_guess: PEPS_Unit_Cell | Sequence[Array]
run() OptimizeResult

Run the basinhopping algorithm for the setup initialized in the class object.

For details see scipy.optimize.basinhopping.

Returns:

Result from the basinhopping algorithm with additional fields unitcell and result_tensors for the result tensors and unitcell in the normal format of this library.

Return type:

scipy.optimize.OptimizeResult