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).
Step 1 of 5 · X
Probability of each outcome after this step
- 0001000100%
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.
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.
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.
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%.
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
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 α. The principal ideal problem is solved with the same period-finding-over-the-reals machinery that gives the regulator, but in two dimensions rather than one. Where the regulator is the period of a function on the reals, deciding principality asks for the distance of a given ideal, which the paper handles on Z × R by analogy with Shor's discrete-logarithm algorithm — the two-dimensional version of the same construction. The paper is explicit that the object being sampled is not a group but, as it puts it, a group-like subset of the reals, modulo an irrational number, which is why the standard hidden-subgroup analysis does not apply unchanged.
TakesNothingWhat joins here
No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
ReturnsNothingWhat joins here
No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →
The principal ideal problem is solved with the same period-finding-over-the-reals machinery that gives the regulator, but in two dimensions rather than one. Where the regulator is the period of a function on the reals, deciding principality asks for the distance of a given ideal, which the paper handles on Z × R by analogy with Shor's discrete-logarithm algorithm — the two-dimensional version of the same construction. The paper is explicit that the object being sampled is not a group but, as it puts it, a group-like subset of the reals, modulo an irrational number, which is why the standard hidden-subgroup analysis does not apply unchanged. This record's speedup class, "Superpolynomial", is a secondary source's classification of the algebraic and number theoretic algorithms it files this under — not a claim its primary paper makes. Stated 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 cost: Polynomial 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..
TakesNothingWhat joins here
No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
ReturnsNothingWhat joins here
No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.
Nothing in the Atlas meets this end.
This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →
- Record type
- Literature reference
- Speedup class (secondary source)
- Superpolynomial
- Primary source on the speedup
- Stated 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 cost
- Polynomial 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.
- Speedup class
- Superpolynomial (checked against the record's own primary paper, which states it)
- Complexity basis
- 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."
- Circuit
- Not supplied
This record is not a concrete circuit.
Quantum vs classical
Classical baseline
Compare Computational number theory with the strongest classical method for the same instance, input budget, and output metric.
Quantum claim
This reference exposes a quantum circuit pattern; it does not imply an application-level speedup without a matched benchmark.
How to compare
Report input loading, circuit depth, repetitions, classical preprocessing, post-processing, and wall-clock time together.
Nobody has reviewed this record for gaps yet.
ALGORITHM: The principal ideal problem in a real quadratic field
PROBLEM: 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 α.
IDEA: The principal ideal problem is solved with the same period-finding-over-the-reals machinery that gives the regulator, but in two dimensions rather than one. Where the regulator is the period of a function on the reals, deciding principality asks for the distance of a given ideal, which the paper handles on Z × R by analogy with Shor's discrete-logarithm algorithm — the two-dimensional version of the same construction. The paper is explicit that the object being sampled is not a group but, as it puts it, a group-like subset of the reals, modulo an irrational number, which is why the standard hidden-subgroup analysis does not apply unchanged.
REPORTED COST: Polynomial 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.
BASIS: 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."
PRIMARY SOURCE: Sean Hallgren (2007), Polynomial-Time Quantum Algorithms for Pell's Equation and the Principal Ideal Problem — https://doi.org/10.1145/1206035.1206039
This is a literature reference record, not an executable circuit.A reference record, not runnable source. Leona cannot execute it, so it cannot be saved to your Library as a circuit.
Where this sits
This record is named by the layer graph at:
- Period finding over the reals Method
Takes A circuit evaluating f on a superposition of inputs, the promise that f is periodic, the kind of object its period is (an integer in a finite cyclic group, an irrational real, a lattice of rank r), and — where the period is not an integer — the precision wanted. Returns The period: an exact integer where the group is finite, or an approximation to the requested precision together with the classical post-processing that turned the measured samples into it.
Related entries
- Pell's equation by computing the regulator
Algorithms
- The class group of a constant-degree number field
Algorithms
- Shor period finding
Algorithms
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.