Number of qubits in the system
Oracle function identifying marked states
Desired success probability (0 to 1)
Optional
statePreparation: StatePreparationOptional custom state preparation
Maximum iterations to consider (default: 100)
Optimal number of iterations
Finds the optimal number of iterations for a given target success probability.
Uses binary search to find the number of iterations that achieves the closest success probability to the target.