Skip to main content

shor_factor

Function shor_factor 

Source
pub fn shor_factor(
    n: u64,
    bases: &[u64],
    counting_qubits: usize,
) -> QuantumResult<ShorResult>
Expand description

End-to-end Shor factoring driver using quantum order finding.

Tries the supplied candidate bases in turn; for each coprime base it runs order_finding and attempts factor_from_order. Returns as soon as a non-trivial factor is found. Even N short-circuits to the factor 2, and a base sharing a common factor with N yields that factor directly via gcd.

§Errors