hiperwalk.ContinuousTime.optimal_runtime#
- ContinuousTime.optimal_runtime(state=None, delta_time=1)#
Find the optimal running time of a quantum-walk-based search.
This method simulates the use of the
set_evolution
operator, taking thestate
as an input for the simulation. It then calculates the success probability for each intermediate state and fits these probabilities to a sine-squared function. The optimal running time corresponds to the point in the domain where the sine-squared function reaches its first peak.- Parameters:
- state
numpy.ndarray
, default=None The state initial state for the simulation. If
None
, uses the uniform state.- delta_time
Time difference between two consecutive states to be saved by the simulation. See
time
argument insimulate()
for details.
- state
- Returns:
- int or float
The optimal runtime that was found after fitting the sine-squared function. The returned type depends on the quantum walk model.