Skip to main content

simon

Function simon 

Source
pub fn simon<F>(
    oracle: F,
    n: usize,
    max_shots: usize,
    rng: &mut LcgRng,
) -> QuantumResult<SimonResult>
where F: Fn(usize) -> usize,
Expand description

Run Simon’s algorithm to recover the hidden period of a two-to-one oracle.

oracle(x) returns f(x) for query index x ∈ [0, 2^n), where f obeys the Simon promise f(x) = f(y) ⇔ y = x ⊕ s. The routine repeatedly runs the quantum circuit (seeded by rng) until n − 1 linearly independent constraints have been collected (or max_shots is exhausted), then solves for s classically.

§Errors