← Atlas

Algorithms · Computational number theory

The principal ideal problem in a real quadratic field

Given an invertible ideal I in a real quadratic field, determine whether there exists an α with I = αZ[√d] — that is, whether the ideal is principal — and if there is, find α.

Attested & literatureUpdated

Open on the mapView frozen graph

A small worked example, computed in your browser. It is not a result from this record's papers.

Order-finding for 7 mod 15

3 counting qubits, 4 work qubits, finding the order of 7 modulo 15 (the order is 4: 7⁴ mod 15 = 1).

q0q1q2q3q4q5q6Step 1 of 5 · XXStep 2 of 5 · Hadamard layer(3)Hadamard layer(3)Step 3 of 5 · Controlled x7 mod 15Controlled x7 mod 15Step 4 of 5 · Controlled x4 mod 15Controlled x4 mod 15Step 5 of 5 · QFT inverse(3)QFT inverse(3)

Step 1 of 5 · X

Probability of each outcome after this step

  • 0001000100%
  1. Prepares the work register as |0001⟩ = 1.

    The whole state moves from 0000000 to 0001000 — one certain outcome before, one certain outcome after, no superposition either side.

  2. Spreads the 3 counting qubits into an equal superposition of all 8 values.

    Probability spreads from 1 outcome to 8. All 8 are equally likely.

  3. Multiplies the work register by 7 mod 15, controlled by the first counting qubit: the k=0 controlled power of the order-finding unitary.

    Probability moves: 4 outcomes appear that had none, 4 drop to zero, 8 carry probability now. Down: 0001001 12.5% → 0.0%, 0001011 12.5% → 0.0%. This is the step that entangles the qubits: from here on no single qubit has a state of its own, only the register as a whole does.

  4. Multiplies the work register by 4 mod 15 (7 squared, mod 15), controlled by the second counting qubit: the k=1 controlled power. The k=2 power would multiply by 7⁴ mod 15 = 1, so it is the identity and is left out entirely.

    Probability moves: 4 outcomes appear that had none, 4 drop to zero, 8 carry probability now. Up: 0100010 0.0% → 12.5%. Down: 0001010 12.5% → 0.0%, 0001110 12.5% → 0.0%.

  5. An inverse QFT on the counting register reads the phase found by the controlled multiplications into a 3-bit estimate.

    Probability moves: 12 outcomes appear that had none, 4 drop to zero, 16 carry probability now. Down: 0111001 12.5% → 0.0%, 0111101 12.5% → 0.0%.

Readout The counting register reads 000, 010, 100 or 110, each equally likely, corresponding to the four powers k = 0, 1, 2, 3 of the order r = 4; the work register ends entangled with the counting outcome, holding one of 1, 7, 4 or 13. Repeating this and applying the continued-fractions step of the full algorithm to a nonzero outcome recovers the order r = 4 exactly.

Open in Studio
  • Record typeLiterature reference
  • Speedup class (secondary source)Superpolynomial
  • Primary source on the speedupStated by the primary source: "Assuming the GRH, the best algorithms for Pell's equation and the principal ideal problem have expected time L(1/2,b′), for some constant b′, so there is a sub-exponential gap between the best known classical algorithms."
  • Reported costPolynomial in log Δ when the regulator is larger than some absolute constant, with success probability Ω(1/log Δ) per run; polynomially many repetitions in log Δ raise that to probability exponentially close to one.
  • Papers1

This record is not a concrete circuit.

References

  • Polynomial-Time Quantum Algorithms for Pell's Equation and the Principal Ideal Problem

    Sean Hallgren · 2007

    Primary source, and the source of this record's cost claim. Consult it for Theorem 3 specifically, which carries two conditions the regulator theorem does not — a lower bound on the regulator and a per-run success probability of only Ω(1/log Δ) — and for the two-dimensional analogue of the real hidden-subgroup construction that the principality test is built on.

Attested & literature
  • Peer-reviewed paper
Method
Curation only. The problem statement was recorded from the literature; the speedup class is checked against the record's own primary paper, which states it; the primary reference's title, authors and submission year were read from its arXiv abs page; the complexity claim was taken from a clause of that paper's abstract (section 4, Theorem 3 of doi:10.1145/1206035.1206039: "The above algorithm approximates the distance of a principal ideal in time polynomial in log∆ when the regulator is larger than some absolute constant. The algorithm is successful with probability Ω(1/log(∆)). Polynomial in log∆ repetitions gives probability exponentially close to one."). No circuit was constructed, simulated or run.
Result
Pass · the record's problem, speedup class and primary reference agree with the two sources named above.
Caveat
This is a literature record: nothing was constructed, compiled, simulated or run, and no ideal was tested for principality here. The theorem is narrower than the regulator theorem in the same paper and the difference is worth carrying: it applies only when the regulator exceeds an absolute constant, and a single run succeeds with probability only Ω(1/log Δ), so the useful statement requires polynomially many repetitions rather than being a one-shot high-probability test. What is approximated is the distance of the ideal, not an exact generator α. The result is for real quadratic fields only; arbitrary degree is not covered by this paper, and the companion STOC 2005 paper that goes further reaches only constant degree. The classical comparison quoted here is against the best known algorithms and is itself conditional on the generalized Riemann hypothesis on the classical side, so the sub-exponential gap is a gap between a proved quantum bound and a conditional classical one, not a proved separation. The same paper notes separately that computing the class group does need the GRH.
Polynomial-Time Quantum Algorithms for Pell's Equation and the Principal Ideal Problem ↗
Kind
curated reference
Reviewed by
Leona Quantum curation pass
License
Citation metadata only; source publication terms apply
principal ideal problemreal quadratic fieldideal classhidden subgroup problemperiod finding

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.