MakarovSuites
English
EnglishDeutschРусскийУкраїнськаFrançaisEspañolItalianoPolski
Contact & licences

Math

Fourier, a period, and a factor

Compare a peak with its neighbour. Then measure: a peak suggests a denominator, not a guaranteed factor. Ideal CPU simulation, 12 qubits; no noise or physical device. N=21 uses Q=128 < N²: reduced precision. Coprime bases only; otherwise gcd(a,N) already finds a factor.

Fourier, a period, and a factor — Actual application image
Actual application image

What happens

Compare a peak with its neighbour. Then measure: a peak suggests a denominator, not a guaranteed factor.

Equations used in the module
Equations
Q = 2^t; |ψ⟩ = Q^(-1/2) Σ_(x=0)^(Q−1) |x⟩|a^x mod N⟩
S_z(y) = Σ_(x: a^x mod N=z) exp(2πixy/Q); m_z = count(x in branch z)
P(y given z) = |S_z(y)|²/(Q m_z); P(z)=m_z/Q
P(y) = Σ_z |S_z(y)|²/Q²; Σ_y P(y)=1
y/Q ≈ p/d, 1 ≤ d < N; verify a^d mod N = 1 before factor extraction
d even: h=a^(d/2) mod N; g−=gcd(h−1,N), g+=gcd(h+1,N)
accept only 1<g−,g+<N and g−g+=N; h=±1 mod N is trivial
N=15: t=8, work=4; N=21: t=7, work=5, Q=128<N² (reduced precision)
ideal numerical state vector, 12 qubits; modular oracle is a basis permutation
sample frequency=count/n; SE=sqrt(P(1−P)/n), n>0

Related experiments

Back to catalogue
Simson line — Actual application image

Math

Simson line

Collapse a coloured pedal triangle into the Simson line. Then move P around a fixed triangle and reveal the Steiner deltoid behind the growing family of lines.

Power of a point — Actual application image

Math

Power of a point

Carry a point into a circle and watch the directed product of a secant's two segments change sign; turn the secant and the product stays. Then find the points of equal power for two circles, and the radical centre of three.

Circle of Apollonius — Actual application image

Math

Circle of Apollonius

Carry a probe with two measuring tapes to A and B and leave a mark wherever |XA| : |XB| = k; reveal the circle the marks lie on, then carry k slowly through 1 and watch the circles open into the perpendicular bisector.