q5m.js - Quantum Computing Library - v0.1.1
    Preparing search index...

    Function findOptimalIterations

    • 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.

      Parameters

      • numQubits: number

        Number of qubits in the system

      • oracle: AmplitudeOracle

        Oracle function identifying marked states

      • targetProbability: number

        Desired success probability (0 to 1)

      • OptionalstatePreparation: StatePreparation

        Optional custom state preparation

      • maxIterations: number = 100

        Maximum iterations to consider (default: 100)

      Returns number

      Optimal number of iterations