Implementation of line search methods for the CTMRG variational optimization (varipeps.optimization.line_search)
- varipeps.optimization.line_search.line_search(input_tensors: Sequence[Array], unitcell: PEPS_Unit_Cell, expectation_func: Expectation_Model, gradient: Array, descent_direction: Array, current_value: float | Array, last_step_size: float | Array | None = None, convert_to_unitcell_func: Map_To_PEPS_Model | None = None, generate_unitcell: bool = False, spiral_indices: Sequence[int] | None = None, additional_input: Dict[str, Array] = {}, reinitialize_env_as_identities: bool = True) Tuple[List[Array], PEPS_Unit_Cell, float | Array, float | Array][source]
Run two-way backtracing line search method for the CTMRG routine.
- Parameters:
input_tensors (sequence of
jax.numpy.ndarray) – Sequence of the current tensors which should be optimized.unitcell (
PEPS_Unit_Cell) – The PEPS unitcell to work on.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.gradient (
jax.numpy.ndarray) – The gradient of the CTMRG method and expectation function for the current step.descent_direction (
jax.numpy.ndarray) – The descent direction which should be used for the line search.current_value (
floatorjax.numpy.ndarray) – The current value of the evaluation of the expectation function.last_step_size (
floatorjax.numpy.ndarray, optional) – The step size found in the last line search.Default:Noneconvert_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 input.Default:Nonegenerate_unitcell (
bool, optional) – Force generation of unitcell from new tensorsDefault:Falsespiral_indices (sequence of
int, optional) – If spiral iPEPS ansatz is used, this argument contains the indices of the wave vectors in the input tensor list.Default:Noneadditional_input (
dictofstrtojax.numpy.ndarraymapping, optional) – Dict with additional inputs which should be considered in the calculation of the expectation value.Default:{}reinitialize_env_as_identities (
bool, optional) – Flag if the env tensors should be reinitialized with identities.Default:True- Returns:
Tuple with the optimized tensors, the new unitcell, the reduced expectation value and the step size found in the line search.
- Return type:
tuple(list(jax.numpy.ndarray),PEPS_Unit_Cell,float,float)- Raises:
ValueError – The parameters mismatch the expected inputs.
RuntimeError – The line search does not converge.