seemps.analysis.optimization.optimize_mps#
- seemps.analysis.optimization.optimize_mps(mps: MPS, num_indices: int = 100, make_canonical: bool = True)[source]#
Returns the minimum and maximum values of a given MPS, together with their indices. Performs two full sweeps using optima_tt, one for the left-to-right and right-to-left directions respectively.
- Parameters:
- mps
MPS The MPS to optimize.
- num_indices
int, default=100 The maximum amount of indices to retain from each tensor. A larger number increases the probability of finding the global maxima, but has a larger cost.
- make_canonicalbool, default=True
Whether to canonicalize the MPS prior to the search and orthogonalize its tensors.
- mps
- Returns:
Examples
# Compute the two extrema of a given univariate function. # Assume that the function is already loaded. mps_function_1d = ... (i_min, y_min), (i_max, y_max) = optimize_mps(mps)