seemps.analysis.optimization.binary_search_mps#

seemps.analysis.optimization.binary_search_mps(mps: MPS, threshold: float, increasing: bool = True, search_environments: list[TypeAliasForwardRef('~seemps.typing.Vector')] | None = None) Vector[source]#

Performs a binary search for the smallest MPS index whose value crosses the given threshold.

Assumes a monotone input, either increasing or decreasing. For efficiency, the required search environments can be precomputed and cached using the get_search_environments() routine.