This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Benchmarks for quantum computers from Shor’s algorithm

E. D. Davis david.davis@spu.ac.za Department of Physical and Earth Sciences, Sol Plaatje University, Private Bag X5008, Kimberley 8300, South Africa
Abstract

Properties of Shor’s algorithm and the related period-finding algorithm could serve as benchmarks for the operation of a quantum computer. Distinctive universal behaviour is expected for the probability for success of the period-finding algorithm as the input quantum register is increased through its critical size of 𝔪0=2log2r\mathfrak{m}_{0}=\lceil 2\log_{2}r\rceil qubits (where rr is the period sought). Use of quadratic non-residues permits unequivocal predictions to be made about the outcome of the factoring algorithm.

1 Introduction

The rapid development of quantum technologies over the last decade has prompted much research on techniques for checking that the carefully engineered quantum devices are, in fact, functioning properly [1, 2, 3]. In the survey of the field presented in [2], a distinction is drawn between certification (or verification) and benchmarking. Certification is taken to be confined to the assessment the accuracy of the output, whereas benchmarking protocols are any more general measures of performance. Clearly, in this parlance, Shor’s factoring algorithm and the associated period-finding algorithm can be used for verification as the validity of their output is easily checked, but the ancillary properties mentioned in the abstract and discussed below could serve as the basis for benchmarks that test circuits as a whole.

In Shor’s version of his factoring algorithm [4], a square-free semiprime NN is factored by first using a quantum computer to determine the order rr of an arbitrary element b(/N)×b\in(\mathbb{Z}/N\mathbb{Z})^{\times}, or, more colloquially, the period of bxmodNb^{x}\mathrm{mod}\,N, and then using a classical computer to calculate the candidate fb=gcd(br/21,N)f_{b}=\gcd(b^{r/2}-1,N) for a non-trivial factor of NN. (Unless specified otherwise, the notation of [5] is adopted.)

Refer to caption
Figure 1: A plot of the approximation 𝖯(𝔮)\mathsf{P}_{\infty}^{(\mathfrak{q})} in (2) to the probability of success of the period-finding algorithm versus the increment 𝔮\mathfrak{q} of the input register size from its critical size of 𝔪0=2log2r\mathfrak{m}_{0}=\lceil 2\log_{2}r\rceil qubits.

It is the dependence on the period rr of the probability for success of the period-finding algorithm which is relevant to benchmarking. The nature of this dependence can be established by considering the sequence of input register sizes {𝔪𝔮}\{\mathfrak{m}_{\mathfrak{q}}\}, where 𝔪𝔮\mathfrak{m}_{\mathfrak{q}} is the smallest positive integer such that

2𝔪𝔮>2𝔮r2,2^{\mathfrak{m}_{\mathfrak{q}}}>2^{\mathfrak{q}}r^{2}, (1)

and 𝔮\mathfrak{q} is any integer consistent with the requirement that the input register is large enough for the quantum Fourier transform of its state to yield information on rr, i.e. 2𝔪𝔮2r2^{\mathfrak{m}_{\mathfrak{q}}}\geq 2r from the k=r1k=r-1 version of the first inequality in (5), or 𝔮𝔮min=log2r2log2r\mathfrak{q}\geq\mathfrak{q}_{\min}=\lceil\log_{2}r\rceil-\lfloor 2\log_{2}r\rfloor.

A systematic asymptotic analysis implies that, when r1r\gg 1, a useful approximation to the probability of finding a divisor of rr (or rr itself) with an input register of 𝔪𝔮\mathfrak{m}_{\mathfrak{q}} qubits is

𝖯(𝔮)=2πSi(2𝔮π)(sin2𝔮1π2𝔮/21π)2\mathsf{P}^{(\mathfrak{q})}_{\infty}=\frac{2}{\pi}\operatorname{Si}(2^{\mathfrak{q}}\pi)-\Bigl{(}\frac{\sin 2^{\mathfrak{q}-1}\pi}{2^{\mathfrak{q}/2-1}\pi}\Bigr{)}^{2} (2)

(Si(x)\operatorname{Si}(x) is the sine integral of Eq. 6.2.9 in [6]). The monotonically increasing sequence {𝖯(𝔮)}\{\mathsf{P}^{(\mathfrak{q})}_{\infty}\} is depicted in Fig. 1. The interpolating curve is obtained with the same function used to evaluate the 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty}’s. As the derivation of section 2 and (28) make clear, the result in (2) pertains to the determination of the period of any function of the integers \mathbb{Z} provided it is one-to-one within a period, and the period rr is not a divisor of 2𝔪𝔮2^{\mathfrak{m}_{\mathfrak{q}}}. When rr is a power of two (and, hence, a divisor of 2𝔪𝔮2^{\mathfrak{m}_{\mathfrak{q}}}), the probability of success is independent of 𝔮\mathfrak{q} [see (28)].

The register of 𝔪0=2log2r\mathfrak{m}_{0}=\lceil 2\log_{2}r\rceil qubits is distinguished by the fact that it is, generically, the smallest for which 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} exceeds 50%. Among the inferences that one can draw from Fig. 1 is that the magnitude of the probability of success for the period-finding algorithm amounts to a fingerprint of the critical input register. Statistics on the success or failure of runs for 𝔪0\mathfrak{m}_{0} qubits would permit empirical determination of the corresponding probability of success of the period-finding algorithm; unambiguous comparison of the probability found with 𝖯(𝔮=0)\mathsf{P}^{(\mathfrak{q=0})}_{\infty} should be possible in view of its clear separation in value from the other 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty}’s: this comparison constitutes the first benchmark, applicable whenever rr is not a divisor of 2𝔪02^{\mathfrak{m}_{0}} (as is typically the case).

Corrections to 𝖯(𝔮)\mathsf{P}_{\infty}^{(\mathfrak{q})}, considered in section 3, do not invalidate any of the observations above. In fact, it is found that, for 𝔮0\mathfrak{q}\geq 0, these corrections are negligible (see (30), (31) and Table 2). The clear difference between the success probability for the critical input register and input registers of other sizes also survives (see Fig. 3).

Another opportunity for benchmarking is provided by the choice of the element b(/N)×b\in(\mathbb{Z}/N\mathbb{Z})^{\times}. Leander has pointed out [7] that if bb is selected so that the Jacobi symbol (b/N)=1(b/N)=-1 (“Choice L”), then, not only is the order rr of bb guaranteed to be even, but also the probability that fb=gcd(br/21,N)f_{b}=\gcd(b^{r/2}-1,N) is a non-trivial factor of NN is enhanced; for rr even, fbf_{b} is the desired factor provided br/21(modN)b^{r/2}\not\equiv-1(\mathrm{mod}\,N): the conditional probability

Pr\displaystyle\Pr (br/21(modN)|(b/N)=1)\displaystyle\left(b^{r/2}\not\equiv-1(\mathrm{mod}\,N)\;\middle|\;(b/N)=-1\right)
=1121+cpcq(1δcp,cq),\displaystyle\hskip 50.0pt=1-\frac{1}{2^{1+c_{p}-c_{q}}}(1-\delta_{c_{p},c_{q}}), (3)

where the positive integer powers cpcqc_{p}\geq c_{q} are related to the square-free semiprime NN by the parametrisation N=(2cpdp+1)(2cqdq+1)N=(2^{c_{p}}d_{p}+1)(2^{c_{q}}d_{q}+1), it being understood that dpd_{p} and dqd_{q} are, by definition, odd. The success rate of the prescription for fbf_{b} is at least 75% as compared with 50% if bb is chosen at random from (/N)×(\mathbb{Z}/N\mathbb{Z})^{\times}, but this observation does not do justice to the full implications of (1).

The crux to building on Leander’s criterion for bb is to recognise that, in principle, it can only fail to generate a factor of NN if cp>cqc_{p}>c_{q}. When it is known that cp>cqc_{p}>c_{q}, then bb should be a quadratic non-residue modulo NN for which (b/N)=+1(b/N)=+1 (“Choice L¯\overline{\mathrm{L}}”); the corresponding probability that fbf_{b} is a prime factor of NN is 1δcp,cq1-\delta_{c_{p},c_{q}}: if cp>cqc_{p}>c_{q}, fbf_{b} must then be a non-trivial factor of NN. (As for choice L, the fact that bb is a quadratic non-residue ensures that its order is even.)

There are two clear-cut complementary benchmarking schemes 𝒜\mathcal{A} and \mathcal{B}: scheme 𝒜\mathcal{A} (\mathcal{B}) entails determination of the probability that L¯\overline{\mathrm{L}}-choices (L-choices) for bb do actually yield a prime factor of NN given that cp>cqc_{p}>c_{q} (cp=cqc_{p}=c_{q}). Identification of whether cp>cqc_{p}>c_{q} or cp=cqc_{p}=c_{q} requires successful factorization of NN, which can be achieved with a suitable sequence of initial runs, beginning with a few L-choices, and converting to L¯\overline{\mathrm{L}}-choices if these runs fail. For both 𝒜\mathcal{A} and \mathcal{B}, the empirical probability is to be compared with a predicted value of unity. The overhead placed on classical computer resources by the selection of appropriate values of bb is acceptable: calculation of the Jacobi symbols is efficient, as is checking that a given b(/N)×b\in(\mathbb{Z}/N\mathbb{Z})^{\times} is a quadratic non-residue.

Application of the benchmarking procedures 𝒜\mathcal{A} and \mathcal{B} should be preceded by determination of (1/N)(-1/N) and (2/N)(2/N). Provided 1-1 and 2 are quadratic non-residues modulo NN, the values of these two Jacobi symbols permit one to infer whether cp=cqc_{p}=c_{q} or cp>cqc_{p}>c_{q} for all semiprimes such that cq2c_{q}\leq 2 — see Table 1. The import of Table 1 is that, for these semiprimes, the choice between 𝒜\mathcal{A} and \mathcal{B} can be made before the order-finding algorithm is run. Blum integers are among the semiprimes to which the results of Table 1 apply.

Interpretation Scheme
(1/N)=1(-1/N)=-1 cp>cq=1c_{p}>c_{q}=1 𝒜\mathcal{A}
(1/N)=+1(-1/N)=+1 cp=1=cqc_{p}=1=c_{q} \mathcal{B}
(2/N)=1(2/N)=-1 cp>cq=2c_{p}>c_{q}=2 𝒜\mathcal{A}
(2/N)=+1(2/N)=+1 cp=2=cqc_{p}=2=c_{q} \mathcal{B}
Table 1: Choice of benchmarking scheme indicated by the Jacobi symbols (1/N)(-1/N) and (2/N)(2/N). The interpretation of (1/N)=+1(-1/N)=+1 and (2/N)=+1(2/N)=+1 assumes that 1-1 and 2, respectively, are quadratic non-residues modulo NN. If 1(2)-1\;(2) is a quadratic residue, then cq2(3)c_{q}\geq 2\;(3).

It remains to justify the assertions made in this introduction. The exact reduction of the success probability associated with the period-finding algorithm to a form in (2.3) suitable for controlled approximation is presented in section 2, followed by its asymptotic analysis for large rr using the Euler-Maclaurin summation formula in section 3. Properties of choices L and L¯\overline{\mathrm{L}} are proven in section 4, and some closing comments are made in section 5. Appendices A, B and C contain technical results required in sections 2 and 3.

2 Period-finding: success probability

After the usual preparatory steps (outlined, for example, in Algorithm 5 of Ref. [5]), an mm-qubit input register is left in the superposition of computational basis states

1mkl=0ml1|k+lr(mk=1+2m1kr),\tfrac{1}{\sqrt{m_{k}}}\sum\limits_{l=0}^{m_{l}-1}|k+l\cdot r\rangle\hskip 10.83784pt\left(m_{k}=1+\left\lfloor\tfrac{2^{m}-1-k}{r}\right\rfloor\right), (4)

where k/rk\in\mathbb{Z}/r\mathbb{Z} is unknown (and unknowable), and the constraint on mm that

2mr+1+k>r2^{m}\geq r+1+k>r (5)

guarantees that the superposition contains more than one term and, hence, that Sk(x)S_{k}(x) in (7) can manifest dependence on rr. Since

r=ro2nr(roodd),r=r_{\mathrm{o}}2^{n_{r}}\hskip 10.83784pt\left(r_{\mathrm{o}}\ \mbox{odd}\right), (6)

where nrn_{r} is a non-negative integer, an implication of (5) found useful below is that m>nrm>n_{r}.

Interpretation of the quantum Fourier transform of the one-dimensional “array” of uniformly spaced “atoms” in (4) is possible via its “structure factor”

Sk(x)=1mk|l=0mk1(ei2πl)rx/2m|2,S_{k}(x)=\frac{1}{m_{k}}\left|\sum\limits_{l=0}^{m_{k}-1}\left(e^{i2\pi l}\right)^{rx/2^{m}}\right|^{2}, (7)

which is related to the conditional probability P(x|k)P(x|k) that the transform is detected in the state |x|x\rangle by P(x|k)=Sk(x)/2mP(x|k)=S_{k}(x)/2^{m}. Central to the standard analysis of P(x|k)P(x|k) is the observation that, for non-zero integers xx, Sk(x)S_{k}(x) is large (mk\sim m_{k}) when the rational number rx/2mrx/2^{m}, which must lie in the closed interval [r/2m,r(11/2m)][r/2^{m},r(1-1/2^{m})], is close to one of the r1r-1 integers jj in this interval, i.e.

jr+={1,2,,r1}.j\in\mathbb{N}_{r}^{+}=\{1,2,\ldots,r-1\}. (8)

Thus, the “frequencies” xx most likely to be returned by measurement are drawn from the set of integers {xj}\{x_{j}\} closest to the first r1r-1 members of the harmonic series with fundamental “frequency” 2m/r2^{m}/r:

|xjj2mr|<12(jr+),\left|x_{j}-j\frac{2^{m}}{r}\right|<\tfrac{1}{2}\hskip 10.83784pt\left(j\in\mathbb{N}^{+}_{r}\right), (9)

where the inequality is strict because 2mj/r=2mnrj/ro2^{m}\,j/r=2^{m-n_{r}}\,j/r_{\mathrm{o}} can never be a half-integer. The solution of (9) is

xj=2mjr+12x_{j}=\left\lfloor 2^{m}\tfrac{j}{r}+\tfrac{1}{2}\right\rfloor (10)

as inspection of Fig. 2 confirms.

Refer to caption
Figure 2: Confirmation that (10), which is trivially valid if 2mjr2^{m}\tfrac{j}{r} is an integer, also works when 2mjr2^{m}\tfrac{j}{r} is a non-integer independent of whether 2mjr<xj2^{m}\tfrac{j}{r}<x_{j} or 2mjr>xj2^{m}\tfrac{j}{r}>x_{j}.

Equation (9) acquires additional significance if viewed from the perspective of rational approximation with continued fractions. Provided the input register size is such that 2m/2>r2^{m/2}>r, then one of the finite number of convergents to xj/2mx_{j}/2^{m} coincides with the ratio j/rj/r reduced to lowest terms; if m=𝔪0m=\mathfrak{m}_{0}, then the only observed values of xx from which information of this nature can be inferred are precisely those belonging to the set {xj}\{x_{j}\}: the total probability for success of the period-finding algorithm is

Ptot=jr+P(xj|k)=12mjr+Sk(xj).P_{\mathrm{tot}}=\sum\limits_{j\in\mathbb{N}^{+}_{r}}P(x_{j}|k)=\frac{1}{2^{m}}\sum\limits_{j\in\mathbb{N}^{+}_{r}}S_{k}(x_{j}). (11)

More generally, when m=𝔪𝔮m=\mathfrak{m}_{\mathfrak{q}}, the restriction on useful values of xx reads

|xj2𝔪𝔮r|<2𝔮1.\left|x-j\frac{2^{\mathfrak{m}_{\mathfrak{q}}}}{r}\right|<2^{\mathfrak{q}-1}. (12)

When 𝔮1\mathfrak{q}\geq 1, there are 2𝔮12^{\mathfrak{q}}-1 or 2𝔮2^{\mathfrak{q}} solutions of (12) dependent on whether ror_{\mathrm{o}} divides jj or not (jr+j\in\mathbb{N}_{r}^{+}); if 𝔮<0\mathfrak{q}<0, then the solutions are a subset of the xjx_{j}’s.

2.1 The case 𝔮=0\mathfrak{q}=0

Simplification of PtotP_{\mathrm{tot}} in (11) for arbitrary m𝔪0m\geq\mathfrak{m}_{0} prepares the ground for analysis of the general case when (12) applies. The jj-fold invocation of the periodicity property Sk(x)=Sk(x+2m/r)S_{k}(x)=S_{k}(x+2^{m}/r) permits substitution of Sk(xj)S_{k}(x_{j}) by Sk(Δj)S_{k}(\Delta_{j}), where

Δj\displaystyle\Delta_{j} =xj2mjr\displaystyle=x_{j}-2^{m}\frac{j}{r} (13)
=2mnrjro+122mnrjro,\displaystyle=\left\lfloor 2^{m-n_{r}}\tfrac{j}{r_{\mathrm{o}}}+\tfrac{1}{2}\right\rfloor-2^{m-n_{r}}\tfrac{j}{r_{\mathrm{o}}},

which, significantly, is periodic in jj with period ror_{\mathrm{o}}. As a result, the partition of r+\mathbb{N}^{+}_{r} into congruence classes modulo ror_{\mathrm{o}} serves to identify the summands S(Δj)S(\Delta_{j}) for different jj in (11) which are identical. For ro>1r_{\mathrm{o}}>1, the congruence classes 1¯ro,2¯ro,,ro1¯ro\overline{1}_{r_{\mathrm{o}}},\overline{2}_{r_{\mathrm{o}}},\ldots,\overline{r_{\mathrm{o}}-1}_{r_{\mathrm{o}}} in r+\mathbb{N}^{+}_{r} all contain r/ro(=2nr)r/r_{\mathrm{o}}(=2^{n_{r}}) elements, but the congruence class 0¯ro\overline{0}_{r_{\mathrm{o}}} has only r/ro1r/r_{\mathrm{o}}-1 elements (because 0r+0\not\in\mathbb{N}^{+}_{r}); for ro=1r_{\mathrm{o}}=1, all r1(=r/ro1)r-1\ (=r/r_{\mathrm{o}}-1) elements of r+\mathbb{N}^{+}_{r} trivially belong to the single congruence class 0¯1\overline{0}_{1}: thus,

Ptot=rroj/roP(Δj|k)P(Δ0|k),P_{\mathrm{tot}}=\frac{r}{r_{\mathrm{o}}}\sum\limits_{j\in\mathbb{Z}/r_{\mathrm{o}}\mathbb{Z}}P(\Delta_{j}|k)-P(\Delta_{0}|k), (14)

where the sum over jj now includes j=0j=0.

As shown in appendix A, the properties of least non-negative residues modulo ror_{\mathrm{o}} imply that the ror_{\mathrm{o}} distinct values of Δj\Delta_{j} are equal to 𝔧/ro\mathfrak{j}/r_{\mathrm{o}}, where the 𝔧\mathfrak{j}’s are the absolute least residues modulo ror_{\mathrm{o}}:

𝔧𝔅[ro]={0,±1,±2,,±12ro}.\mathfrak{j}\in\mathfrak{B}[r_{\mathrm{o}}]=\bigl{\{}0,\pm 1,\pm 2,\ldots,\pm\lfloor\tfrac{1}{2}r_{\mathrm{o}}\rfloor\bigr{\}}. (15)

The change of summation variable in (14) from jj to 𝔧=𝔧(j)\mathfrak{j}=\mathfrak{j}(j) is indicated. The argument Δj\Delta_{j} is replaced by Δ𝔧=𝔧/ro\Delta_{\mathfrak{j}}=\mathfrak{j}/r_{\mathrm{o}} and

Ptot=r2m[1ro𝔧𝔅[ro]Sk(𝔧/ro)1rSk(0)],P_{\mathrm{tot}}=\frac{r}{2^{m}}\left[\frac{1}{r_{\mathrm{o}}}\sum\limits_{\mathfrak{j}\in\mathfrak{B}[r_{\mathrm{o}}]}S_{k}(\mathfrak{j}/r_{\mathrm{o}})-\frac{1}{r}S_{k}(0)\right], (16)

which suffices to analyse the case m=𝔪0m=\mathfrak{m}_{0}.

2.2 Generalization to 𝔮<0\mathfrak{q}<0

The result in (16) is easily adapted to accommodate all cases in which 𝔮<0\mathfrak{q}<0. Solutions of (12) are those members of {xj}\{x_{j}\} for which |Δj|<1/21𝔮|\Delta_{j}|<1/2^{1-\mathfrak{q}}. In terms of the index 𝔧\mathfrak{j} introduced in connection with (15), this inequality specifies that |𝔧|<ro/21𝔮|\mathfrak{j}|<r_{\mathrm{o}}/2^{1-\mathfrak{q}} or, as ror_{\mathrm{o}} is odd,

|𝔧|2𝔮1ro.|\mathfrak{j}|\leq\lfloor 2^{\mathfrak{q}-1}r_{\mathrm{o}}\rfloor. (17)

It follows that (16) is replaced by

Ptot=r2m[1ro𝔧𝔅[2𝔮ro]Sk(𝔧/ro)1rSk(0)].P_{\mathrm{tot}}\!=\!\frac{r}{2^{m}}\!\left[\frac{1}{r_{\mathrm{o}}}\sum\limits_{\mathfrak{j}\in\mathfrak{B}[2^{\mathfrak{q}}r_{\mathrm{o}}]}S_{k}(\mathfrak{j}/r_{\mathrm{o}})-\frac{1}{r}S_{k}(0)\right]\!. (18)

Unfortunately, the generalization to 𝔮>0\mathfrak{q}>0 is not so immediate.

2.3 Generalization to 𝔮>0\mathfrak{q}>0

If j0¯roj\in\overline{0}_{r_{\mathrm{o}}}, then (12) amounts to the inequality |xxj|<2𝔮1,\left|x-x_{j}\right|<2^{\mathfrak{q}-1}, which has the integer solutions xj+κx_{j}+\kappa with

κ𝔖0={0,±1,±2,,±(2𝔮11)}.\kappa\in\mathfrak{S}_{0}=\{0,\pm 1,\pm 2,\ldots,\pm(2^{\mathfrak{q}-1}-1)\}. (19)

For members of the remaining congruence classes summed over in (16), (12) can be recast in terms of the congruence class label 𝔧\mathfrak{j} of (15) as |xxj+𝔧(j)/ro|<2𝔮1.\left|x-x_{j}+\mathfrak{j}(j)/r_{\mathrm{o}}\right|<2^{\mathfrak{q}-1}. Now, the set of integer solutions {xj+κ}\{x_{j}+\kappa\} depends on 𝔧=𝔧(j)\mathfrak{j}=\mathfrak{j}(j) via its sign: κ\kappa takes on all values in the set

𝔖𝔧=𝔖0{(sgn𝔧)2𝔮1},\mathfrak{S}_{\mathfrak{j}}=\mathfrak{S}_{0}\cup\{-(\mathrm{sgn}\,\mathfrak{j})2^{\mathfrak{q}-1}\}, (20)

where sgn𝔧\mathrm{sgn}\,\mathfrak{j} denotes the sign of the non-zero 𝔧\mathfrak{j} in (20).

Ostensibly, the summation in Eq, (16) is replaced by the double summation

𝔧𝔅[ro]κ𝔖jSk(κ+𝔧/ro),\sum\limits_{\mathfrak{j}\in\mathfrak{B}[r_{\mathrm{o}}]}\,\sum\limits_{\kappa\in\mathfrak{S}_{\mathrm{j}}}S_{k}(\kappa+\mathfrak{j}/r_{\mathrm{o}}), (21)

but it can be more usefully rewritten in terms of a single summation formally like that in (18) as

𝔧𝔅[2𝔮ro]Sk(𝔧/ro)ϵk(𝔮),\sum\limits_{\mathfrak{j}\in\mathfrak{B}[2^{\mathfrak{q}}r_{\mathrm{o}}]}\!\!S_{k}(\mathfrak{j}/r_{\mathrm{o}})\,-\epsilon_{k}(\mathfrak{q}), (22)

provided the endpoint “correction”

ϵk(𝔮)=Sk(2𝔮1)+Sk(2𝔮1)\epsilon_{k}(\mathfrak{q})=S_{k}(2^{\mathfrak{q}-1})+S_{k}(-2^{\mathfrak{q}-1}) (23)

is included. A simpler substitution is that of the coefficient Sk(0)S_{k}(0) of 1/r1/r in (16) by

κ𝔖0Sk(κ)=κ𝔅[2𝔮]Sk(κ)ϵk(𝔮).\sum\limits_{\kappa\in\mathfrak{S}_{0}}S_{k}(\kappa)=\sum\limits_{\kappa\in\mathfrak{B}[2^{\mathfrak{q}}]}\!\!S_{k}(\kappa)\,-\epsilon_{k}(\mathfrak{q}). (24)

Together, (22) and (24) imply that the generalisation to positive 𝔮\mathfrak{q} of (16) is

Ptot(𝔮)=r2𝔪𝔮\displaystyle P_{\mathrm{tot}}^{(\mathfrak{q})}=\frac{r}{2^{\mathfrak{m}_{\mathfrak{q}}}} [1ro𝔧𝔅[2𝔮ro]Sk(𝔧/ro)1r𝔧𝔅[2𝔮]Sk(𝔧)\displaystyle\Biggl{[}\frac{1}{r_{\mathrm{o}}}\sum\limits_{\mathfrak{j}\in\mathfrak{B}[2^{\mathfrak{q}}r_{\mathrm{o}}]}\!\!S_{k}(\mathfrak{j}/r_{\mathrm{o}})-\frac{1}{r}\sum\limits_{\mathfrak{j}\in\mathfrak{B}[2^{\mathfrak{q}}]}S_{k}(\mathfrak{j})
(1ro1r)ϵk(𝔮)].\displaystyle\hskip 43.36464pt-\left(\frac{1}{r_{\mathrm{o}}}-\frac{1}{r}\right)\epsilon_{k}(\mathfrak{q})\Biggr{]}. (25)

The choice of 2m2^{m} appropriate to (2.3) (namely, 2𝔪𝔮2^{\mathfrak{m}_{\mathfrak{q}}}) has been made for the overall multiplicative factor; it has also to be adopted in the expression for Sk(x)S_{k}(x) in (7). With the extended definition of ϵk(𝔮)\epsilon_{k}(\mathfrak{q}) in terms of the Heaviside function H(x)H(x) ([6], Eq. 1.16.13) as

ϵk(𝔮)=H(𝔮)[Sk(2𝔮1)+Sk(2𝔮1)],\epsilon_{k}(\mathfrak{q})=H(\mathfrak{q})\left[S_{k}(2^{\mathfrak{q}-1})+S_{k}(-2^{\mathfrak{q}-1})\right], (26)

(2.3) continues to hold when 𝔮0\mathfrak{q}\leq 0.

Equation (2.3) is the goal of this section. It is a generalization and refinement of results in [8], which, in addition to the features mentioned in the introduction, includes a more careful treatment of endpoint corrections. The derivation has invoked only the periodicity of Sk(x)S_{k}(x) and is independent of its precise form, which, in (2.3), happens to be

Sk(x)=Sk(0)[sinc(mk(𝔮)rx/2𝔪𝔮)sinc(rx/2𝔪𝔮)]2,S_{k}(x)=S_{k}(0)\left[\frac{\operatorname{sinc}(m^{(\mathfrak{q})}_{k}rx/2^{\mathfrak{m}_{\mathfrak{q}}})}{\operatorname{sinc}(rx/2^{\mathfrak{m}_{\mathfrak{q}}})}\right]^{2}, (27)

where Sk(0)=mk(𝔮)=1+(2𝔪𝔮1k)/rS_{k}(0)=m_{k}^{(\mathfrak{q})}=1+\left\lfloor(2^{\mathfrak{m}_{\mathfrak{q}}}-1-k)/r\right\rfloor and sinc(x)\operatorname{sinc}(x) is the normalized sinc function [for x0x\not=0, sinc(x)=sin(πx)/(πx)\operatorname{sinc}(x)=\sin(\pi x)/(\pi x)].

The endpoint correction term in (2.3) does not influence the approximate estimates of Ptot(𝔮)P_{\mathrm{tot}}^{(\mathfrak{q})} considered next. Terms involving non-zero ϵk(𝔮)\epsilon_{k}(\mathfrak{q}) are suppressed by at least three powers of rr relative to the dominate large rr contribution.

3 Asymptotic analysis of Ptot(𝔮)P_{\mathrm{tot}}^{(\mathfrak{q})}

If rr is a power of two (i.e.  ro=1r_{\mathrm{o}}=1), then mk(𝔮)=2𝔪𝔮/rm_{k}^{(\mathfrak{q})}=2^{\mathfrak{m}_{\mathfrak{q}}}/r, Sk(x)=δx,0mk(𝔮)S_{k}(x)=\delta_{x,0}\,m_{k}^{(\mathfrak{q})} (for integer xx), and (2.3) reduces without approximation to

Ptot(𝔮)=11r.P_{\mathrm{tot}}^{(\mathfrak{q})}=1-\frac{1}{r}. (28)

The first summation in (2.3) is dominant, and the remaining terms are suppressed by one power of rr or more. The same pattern is also evident in an expansion of (2.3) for large rr which embraces the cases in which rr is not a power of two. If the negligible terms of order 1/r1/r and higher are discarded, then the following approximation to Ptot(𝔮)P_{\mathrm{tot}}^{(\mathfrak{q})} emerges:

𝖯(𝔮)=1ro𝔧𝔅[2𝔮ro]sinc2(𝔧/ro).\mathsf{P}^{(\mathfrak{q})}=\frac{1}{r_{\mathrm{o}}}\sum\limits_{\mathfrak{j}\in\mathfrak{B}[2^{\mathfrak{q}}r_{\mathrm{o}}]}\!\!\operatorname{sinc}^{2}(\mathfrak{j}/r_{\mathrm{o}}). (29)

The expansions in support of (29) are given in appendix B. Like (28), (29) is independent of kk, but, when specialized to ro=1r_{\mathrm{o}}=1, yields 𝖯(𝔮)=1\mathsf{P}^{(\mathfrak{q})}=1.

Table 2: Sample of dependence of 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})} on ror_{\mathrm{o}} for 𝔮0\mathfrak{q}\geq 0. The last row contains the values of 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} from (2).
ro\𝔮r_{\mathrm{o}}\backslash\mathfrak{q} 0 1 2
3 0.7893 0.90326 0.949999
5 0.7792 0.90288 0.949946
7 0.7765 0.902837 0.9499411
9 0.7754 0.902828 0.9499400
11 0.7748 0.902826 0.9499396
13 0.7745 0.9028245 0.94993949
15 0.7743 0.9028240 0.94993942
\infty 0.7737 0.9028233 0.94993934

Simple as the expression for 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})} is, it would seem of little utility because of its reliance on the factor ror_{\mathrm{o}} of the unknown (but large) period rr. However, the numerical data in Table 2 suggests that 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})} is a monotonically decreasing function of ror_{\mathrm{o}} when 𝔮0\mathfrak{q}\geq 0. This trend can be confirmed for large ror_{\mathrm{o}} with the aid of the Euler-Maclaurin summation formula, which, for 𝔮1\mathfrak{q}\geq 1, implies straightforwardly that

𝖯(𝔮)=2πSi(2𝔮π)+4158𝔮1ro4+.\mathsf{P}^{(\mathfrak{q})}=\frac{2}{\pi}\mathrm{Si}(2^{\mathfrak{q}}\pi)+\frac{4}{15\cdot 8^{\mathfrak{q}}}\frac{1}{r_{\mathrm{o}}^{4}}+\ldots\,. (30)

The calculation is trickier for 𝔮=0\mathfrak{q}=0; application of the Euler-Maclaurin summation formula has to be followed by an expansion in inverse powers of ror_{\mathrm{o}} (details are given in appendix C): the outcome of these manipulations is

𝖯(𝔮=0)=2π(Si(π)2π)+43π21ro2+.\mathsf{P}^{(\mathfrak{q}=0)}=\frac{2}{\pi}\left(\mathrm{Si}(\pi)-\frac{2}{\pi}\right)+\frac{4}{3\pi^{2}}\frac{1}{r_{\mathrm{o}}^{2}}+\ldots\,. (31)

The results in (30), (31) and Table 2 justify the claim that, provided 1/r1/r is negligible, 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} in (2) is always an excellent approximation to Ptot(𝔮)P_{\mathrm{tot}}^{(\mathfrak{q})} in (2.3) when 𝔮\mathfrak{q} is non-negative.

Table 3: Sample of deviation of 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})} from 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} for 𝔮<0\mathfrak{q}<0. The scaled deviation 𝖣(𝔮)=ro(𝖯(𝔮)𝖯(𝔮))\mathsf{D}^{(\mathfrak{q})}=r_{\mathrm{o}}\bigl{(}\mathsf{P}^{(\mathfrak{q})}-\mathsf{P}^{(\mathfrak{q})}_{\infty}\bigr{)}. The last row contains the values of 𝖣(2)\mathsf{D}^{(-2)} in the limit ror_{\mathrm{o}}\rightarrow\infty.
ror_{\mathrm{o}} 𝖣(2)\mathsf{D}^{(-2)} ror_{\mathrm{o}} 𝖣(2)\mathsf{D}^{(-2)} ror_{\mathrm{o}} 𝖣(2)\mathsf{D}^{(-2)} ror_{\mathrm{o}} 𝖣(2)\mathsf{D}^{(-2)}
3 0.263 5 -0.229 7 -0.720
9 0.708 11 0.243 13 -0.234 15 -0.716
17 0.7098 19 0.240 21 -0.235 23 -0.7144
25 0.7105 27 0.239 29 -0.236 31 -0.7138
0.7122 0.237 -0.237 -0.7122

The behaviour of 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})} for 𝔮<0\mathfrak{q}<0 is quite different. Now, the expansion in inverse powers of ror_{\mathrm{o}}, which is obtained along the same lines as (31), reads

2πSi(2𝔮π)\displaystyle\frac{2}{\pi}\mathrm{Si}(2^{\mathfrak{q}}\pi) 2𝔮sinc2(2𝔮1)\displaystyle-2^{\mathfrak{q}}\operatorname{sinc}^{2}(2^{\mathfrak{q}-1}) (32)
+sinc2(2𝔮1)(1ν2|𝔮|)1ro+,\displaystyle+\operatorname{sinc}^{2}(2^{\mathfrak{q}-1})\left(1-\frac{\nu}{2^{|\mathfrak{q}|}}\right)\frac{1}{r_{\mathrm{o}}}+\ldots,

where ν\nu is the least non-negative residue of ror_{\mathrm{o}} modulo 2|𝔮|+12^{|\mathfrak{q}|+1}. The correction to the leading term 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} is of either sign and, being of order 1/ro1/r_{\mathrm{o}} (see Table 3), can be substantial for small ror_{\mathrm{o}} – see Fig. 3. Despite the scatter about 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} in the values of 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})} for 𝔮<0\mathfrak{q}<0, none are close to 𝖯(0)\mathsf{P}^{(0)}.

Refer to caption
Figure 3: Comparison of values of 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})} in (29) to 𝖯(𝔮)\mathsf{P}_{\infty}^{(\mathfrak{q})} for negative increments 𝔮\mathfrak{q} of the input register size from its critical size (of 𝔪0\mathfrak{m}_{0} qubits). Values for which ro=3(5)r_{\mathrm{o}}=3\,(5) are represented by the symbol \blacktriangle\,(\blacktriangledown); the symbol \bullet is used for all larger values of ror_{\mathrm{o}} considered (7ro317\leq r_{\mathrm{o}}\leq 31).

The leading term 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} in all of the above expansions in (30), (31) and (32) is found by evaluation of

2𝔮12𝔮1sinc2(x)𝑑x\int\limits_{-2^{\mathfrak{q}-1}}^{2^{\mathfrak{q}-1}}\operatorname{sinc}^{2}(x)dx (33)

for integer 𝔮\mathfrak{q}. The integral in (33) defines an entire function of z=2𝔮z=2^{\mathfrak{q}}. In the limit ror_{\mathrm{o}}\rightarrow\infty, when 𝖯(𝔮)𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}\rightarrow\mathsf{P}^{(\mathfrak{q})}_{\infty}, the lower limit on the integers 𝔮\mathfrak{q} of 𝔮min\mathfrak{q}_{\min}\rightarrow-\infty; the values of 2𝔮2^{\mathfrak{q}} then belong to a set with an accumulation point, and the identity theorem for holomorphic functions can be invoked to assert that the integral representation in (33) is the unique analytic continuation of 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} to all values of 𝔮\mathfrak{q}, real and complex: thus, the right-hand side of (2), which is obtained from (33) for arbitrary 𝔮\mathfrak{q} by integration by parts, is a natural choice of interpolation function in Fig. 1.

4 Foundations for choices L and L¯\overline{\mathrm{L}}

Insight into good choices of bb for the factorization of square-free odd semiprimes N=pqN=pq is gained through the isomorphism between (/N)×(\mathbb{Z}/N\mathbb{Z})^{\times} and the direct product (/p)××(/q)×(\mathbb{Z}/p\mathbb{Z})^{\times}\times(\mathbb{Z}/q\mathbb{Z})^{\times} of the cyclic groups (/p)×(\mathbb{Z}/p\mathbb{Z})^{\times} and (/q)×(\mathbb{Z}/q\mathbb{Z})^{\times}. The Jacobi symbol permits some consequences of this isomorphism to be recast in a manner which does not require any knowledge of the odd primes pp and qq.

4.1 Use of (/N)×(/p)××(/q)×(\mathbb{Z}/N\mathbb{Z})^{\times}\cong(\mathbb{Z}/p\mathbb{Z})^{\times}\times(\mathbb{Z}/q\mathbb{Z})^{\times}

The two simultaneous congruence relations

bbp(modp),bbq(modq)b\equiv b_{p}(\mathrm{mod}\,p),\quad b\equiv b_{q}(\mathrm{mod}\,q) (34)

establish (via the Chinese Remainder theorem) a bijection between elements b(/N)×b\in(\mathbb{Z}/N\mathbb{Z})^{\times} and ordered pairs (bp,bq)(/p)××(/q)×(b_{p},b_{q})\in(\mathbb{Z}/p\mathbb{Z})^{\times}\times(\mathbb{Z}/q\mathbb{Z})^{\times}, and there is a one-to-one correspondence between bk(modN)b^{k}\,(\mathrm{mod}\,N) and (bpk(modp),bqk(modq))\bigl{(}b_{p}^{k}(\mathrm{mod}\,p),b_{q}^{k}(\mathrm{mod}\,q)\bigr{)} for any positive integer power kk. Hence, the order rr of bb to be used in fb=gcd(br/21,N)f_{b}=\gcd(b^{r/2}-1,N) is determined by the orders rpr_{p} and rqr_{q} of bpb_{p} and bqb_{q}, respectively, via

r=lcm(rp,rq),r=\operatorname{lcm}(r_{p},r_{q}), (35)

and the conditions for the failure of fbf_{b} as a factor of NN find neat expression as a property of rpr_{p} and rqr_{q}: the powers of two in the prime factorizations of rpr_{p} and rqr_{q} are equal ([5], Lemma 2).

The appeal of this characterisation is that the distribution of the powers of two associated with either of the orders rpr_{p} or rqr_{q} is easily constructed. For odd primes h=2cd+1h=2^{c}d+1 (c1c\geq 1, dd odd), the group (/h)×(\mathbb{Z}/h\mathbb{Z})^{\times} comprises elements which are powers (modulo hh) of a generator 𝔤h\mathfrak{g}_{h} of order h1=2cdh-1=2^{c}d. As a result, the element 𝔤hk(modh)\mathfrak{g}_{h}^{k}(\mathrm{mod}\,h) (where k=1,2,,2cdk=1,2,\ldots,2^{c}d) has order

rh(k)=2cdgcd(k,2cd).r_{h}^{(k)}=\frac{2^{c}d}{\gcd(k,2^{c}d)}. (36)

For the 2c1d2^{c-1}d odd values of kk, (36) simplifies to rh(k)=2cdkr_{h}^{(k)}=2^{c}d_{k}, where the odd number dk=d/gcd(k,d)d_{k}=d/\gcd(k,d); the corresponding result for the equal number of even values of k=2jk=2j (j=1,2,,2c1dj=1,2,\ldots,2^{c-1}d) is

rh(k=2j)=2c1dgcd(j,2c1d),r_{h}^{(k=2j)}=\frac{2^{c-1}d}{\gcd(j,2^{c-1}d)}, (37)

which resembles (36) with the factor of 2c2^{c} replaced by 2c12^{c-1}: on the basis of the recursive pattern implied by the similarity of (37) to (36), there are 2l1d2^{l-1}d elements of (/h)×(\mathbb{Z}/h\mathbb{Z})^{\times} with the even orders 2ldj2^{l}d_{j} (j=1,3,5,,2ld1j=1,3,5,\ldots,2^{l}d-1) for each l{1,2,3,,c}l\in\{1,2,3,\ldots,c\}, and only dd elements with the odd orders djd_{j} (j=1,2,,dj=1,2,\ldots,d). Altogether, there are c+1c+1 different powers of two: {0,1,,c1}\{0,1,\dots,c-1\} for the even choices of kk in (36), and exclusively cc for the odd choices.

An element (bp,bq)(/p)××(/q)×(b_{p},b_{q})\in(\mathbb{Z}/p\mathbb{Z})^{\times}\times(\mathbb{Z}/q\mathbb{Z})^{\times} has the representation (𝔤pkp(modp),𝔤qkq(modq))\bigl{(}\mathfrak{g}_{p}^{k_{p}}(\mathrm{mod}\,p),\mathfrak{g}_{q}^{k_{q}}(\mathrm{mod}\,q)\bigr{)} in terms of generators 𝔤p\mathfrak{g}_{p} and 𝔤q\mathfrak{g}_{q} of (/p)×(\mathbb{Z}/p\mathbb{Z})^{\times} and (/q)×(\mathbb{Z}/q\mathbb{Z})^{\times}, respectively. Consistent with the earlier parametrization of NN in connection with (1), the primes pp and qq are taken to be p=2cpdp+1p=2^{c_{p}}d_{p}+1 and q=2cqdq+1q=2^{c_{q}}d_{q}+1, where dp,dqd_{p},d_{q} are odd and cpcqc_{p}\geq c_{q}. The results of the previous paragraph can be used to determine the number of pairs (bp,bq)(b_{p},b_{q}) for which the powers of two in the prime factorizations of the corresponding orders rpr_{p} and rqr_{q} are identical. By way of example, whenever both indices kpk_{p} and kqk_{q} are odd, the respective powers of two are cpc_{p} and cqc_{q}; as there are 12(p1)\tfrac{1}{2}(p-1) odd values of kpk_{p} and 12(q1)\tfrac{1}{2}(q-1) odd values of kqk_{q}, the corresponding number of pairs (bp,bq)(b_{p},b_{q}) with orders sharing the same power of two is

12(p1)×12(q1)δcp,cq=4cq1dpdqδcp,cq.\tfrac{1}{2}(p-1){\times}\tfrac{1}{2}(q-1)\hskip 0.5pt\delta_{c_{p},c_{q}}=4^{c_{q}-1}d_{p}d_{q}\hskip 0.5pt\delta_{c_{p},c_{q}}. (38)

Table 4 contains a summary of all the findings on the numbers of pairs with such matching powers of two. No match is possible when kpk_{p} is odd and kqk_{q} is even because cq1<cpc_{q}-1<c_{p}. The entry for even kpk_{p} and kqk_{q} excludes the pair (1,1)(1,1) since it corresponds to a choice of bb (b=1b=1) that cannot yield non-trivial factors of NN (fb=1=Nf_{b=1}=N).

Table 4: The numbers of pairs (bp,bq)(/p)××(/q)×(b_{p},b_{q})\in(\mathbb{Z}/p\mathbb{Z})^{\times}\times(\mathbb{Z}/q\mathbb{Z})^{\times} for which the powers of two in the prime factorizations of the two related orders rpr_{p} and rqr_{q} coincide. The sum S=4cq1dpdqS=4^{c_{q}-1}d_{p}d_{q}.
kqk_{q} even kqk_{q} odd
kpk_{p} even 13S+23dpdq1\tfrac{1}{3}S+\tfrac{2}{3}d_{p}d_{q}-1 S(1δcp,cq)S(1-\delta_{c_{p},c_{q}})
kpk_{p} odd 0 Sδcp,cqS\hskip 0.5pt\delta_{c_{p},c_{q}}

4.2 Role of the Jacobi symbol

Quadratic residues modulo NN are those elements of (/N)×(\mathbb{Z}/N\mathbb{Z})^{\times} for which both of the indices kpk_{p} and kqk_{q} are even. Table 4 exhibits a partition of (/N)×(\mathbb{Z}/N\mathbb{Z})^{\times} into the subgroup comprising its quadratic residues and the three cosets of this subgroup, all elements of which are quadratic non-residues modulo NN. The Jacobi symbol distinguishes two of these cosets from the subgroup of quadratic residues.

For odd primes hh, it is the Legendre symbol (a/h)(a/h) which differentiates between quadratic residues and non-residues modulo hh: (a/h)(a/h) is +1+1 (1-1) if aa is a quadratic residue (non-residue), and 0 if hh is a divisor of aa. A consequence of Fermat’s little theorem is that a(h1)/2(modh)a^{(h-1)/2}\,(\mathrm{mod}\,h) must have one of +1+1, 1-1 or 0 as its least absolute residue. As a result ([9], Theorem 83), it is possible to express (a/h)(a/h) in terms of least absolute residues as

(ah)a(h1)/2(modh).\left(\frac{a}{h}\right)\equiv a^{(h-1)/2}\,(\mathrm{mod}\,h). (39)

Furthermore, as the values +1+1 and 0 are inadmissible for any generator 𝔤h\mathfrak{g}_{h} of (/h)×(\mathbb{Z}/h\mathbb{Z})^{\times} because they are incompatible with the requirement that it be of even order h1h-1, it is necessarily the case that 𝔤h(h1)/21(modh)\mathfrak{g}_{h}^{(h-1)/2}\equiv-1(\mathrm{mod}\,h), and

(𝔤hkh)\displaystyle\left(\frac{\mathfrak{g}_{h}^{k}}{h}\right) (𝔤h(h1)/2)k(modh)\displaystyle\equiv\bigl{(}\mathfrak{g}_{h}^{(h-1)/2}\bigr{)}^{k}\,(\mathrm{mod}\,h) (40)
(1)k(modh)=(1)k,\displaystyle\equiv(-1)^{k}\,(\mathrm{mod}\,h)=(-1)^{k},

in accord with the expectation that even (odd) powers of a generator are quadratic residues (non-residues).

For an integer bb relatively prime to the square-free semiprime N=pqN=pq, the Jacobi symbol

(bN)=(bp)(bq),\left(\frac{b}{N}\right)=\left(\frac{b}{p}\right)\left(\frac{b}{q}\right), (41)

where the right-hand side is the product of the two Legendre symbols (b/p)(b/p) and (b/q)(b/q), which, in view of the congruences in (34), can be substituted by (bp/p)(b_{p}/p) and (bq/q)(b_{q}/q), respectively. Use of the further congruences bp(𝔤p)kp(modp)b_{p}\equiv(\mathfrak{g}_{p})^{k_{p}}\,(\mathrm{mod}\,p) and bq(𝔤q)kq(modq)b_{q}\equiv(\mathfrak{g}_{q})^{k_{q}}\,(\mathrm{mod}\,q) as well as (40) imply finally that

(bN)=(1)kp+kq,\left(\frac{b}{N}\right)=(-1)^{k_{p}+k_{q}}, (42)

which is the basis for the observation exploited in [7] that, when (b/N)=1(b/N)=-1, bb belongs to the union of the (kpk_{p} odd, kqk_{q} even) and (kpk_{p} even, kqk_{q} odd) cosets in (/h)×(\mathbb{Z}/h\mathbb{Z})^{\times}.

According to Table 4, S(1δcp,cq)S(1-\delta_{c_{p},c_{q}}) of the 12(p1)×(q1)=2cpcq+1S\tfrac{1}{2}(p-1){\times}(q-1)=2^{c_{p}-c_{q}+1}S members in this union are unsuitable for the purposes of factoring the semiprime NN. The result for the conditional probability in (1) follows immediately. Another inference from Table 4, which forms the basis for choice L¯\overline{\mathrm{L}}, is that, when it is known cpcqc_{p}\not=c_{q}, then all quadratic non-residues bb for which (b/N)=+1(b/N)=+1 [i.e. the whole of the (kpk_{p} odd, kqk_{q} odd) coset] are good candidates for factoring NN.

4.3 Value of cqc_{q}: special cases

Specialization to the square-free semiprime N=(2cpdp+1)(2cqdq+1)N=(2^{c_{p}}d_{p}+1)(2^{c_{q}}d_{q}+1) of the standard formulae for the Jacobi symbols (1/N)(-1/N) and (2/N)(2/N) ([6], §27.9) proves serendipitously fruitful. To begin with, on the basis of

(1N)\displaystyle\left(\frac{-1}{N}\right) =(1)(N1)/2\displaystyle=(-1)^{(N-1)/2} (43)
=(1)2cp1(1)2cq1,\displaystyle=(-1)^{2^{c_{p}-1}}(-1)^{2^{c_{q}-1}},

it is possible to interpret the value of (1/N)(-1/N) as follows: if (1/N)=1(-1/N)=-1, then, without further ado, cp>cq=1c_{p}>c_{q}=1; if, instead, (1/N)=+1(-1/N)=+1, then cp=1=cqc_{p}=1=c_{q} when 1-1 is a quadratic non-residue modulo NN, and otherwise it can be deduced that cpcq2c_{p}\geq c_{q}\geq 2. In the latter case, it is appropriate to move onto (2/N)(2/N). Under the assumption that cpcq2c_{p}\geq c_{q}\geq 2,

(2N)\displaystyle\left(\frac{2}{N}\right) =(1)(N21)/8\displaystyle=(-1)^{(N^{2}-1)/8} (44)
=(1)2cp2(1)2cq2,\displaystyle=(-1)^{2^{c_{p}-2}}(-1)^{2^{c_{q}-2}},

the implications of which parallel those of (43): if (2/N)=1(2/N)=-1, then cp>cq=2c_{p}>c_{q}=2; if (2/N)=+1(2/N)=+1, then cp=2=cqc_{p}=2=c_{q} when +2+2 is a quadratic non-residue modulo NN, and, by the exclusion above of other options, cpcq3c_{p}\geq c_{q}\geq 3 when +2+2 is a quadratic residue. All of these findings are summarized in Table 1.

Larger values of cqc_{q} can be identified if it is known that cp>cqc_{p}>c_{q} (because choice L has failed) by the elementary expedient of evaluating

sk=(1)(N1)/2ks_{k}=(-1)^{(N-1)/2^{k}} (45)

for k=3,4,k=3,4,\ldots. As sk=(1)2cqks_{k}=(-1)^{2^{c_{q}-k}} for kcq<cpk\leq c_{q}<c_{p}, the sequence of evaluations is to be terminated when the value sk=1s_{k}=-1 is encountered; cqc_{q} is the corresponding value of kk.

4.4 Properties of orders

With the substitutions rp=2lprpor_{p}=2^{l_{p}}r_{p\mathrm{o}} and rq=2lqrqor_{q}=2^{l_{q}}r_{q\mathrm{o}} (rpo,rqor_{p\mathrm{o}},r_{q\mathrm{o}} odd), (35) becomes

r=2max(lp,lq)lcm(rpo,rqo).r=2^{{\max}(l_{p},l_{q})}\operatorname{lcm}(r_{p\mathrm{o}},r_{q\mathrm{o}}). (46)

The properties of the indices lpl_{p} and lql_{q} established in subsection 4.1 imply that, for choice L,

cqmax(lp,lq)cp,c_{q}\leq\max(l_{p},l_{q})\leq c_{p}, (47)

whereas, for choice L¯\overline{\mathrm{L}},

max(lp,lq)=cp.\max(l_{p},l_{q})=c_{p}. (48)

For both choices, the order rr is even as asserted in the introduction.

Lagrange’s theorem for finite groups and the isomorphism (/N)×(/p)××(/q)×(\mathbb{Z}/N\mathbb{Z})^{\times}\cong(\mathbb{Z}/p\mathbb{Z})^{\times}\times(\mathbb{Z}/q\mathbb{Z})^{\times} imply that an order rr modulo the square-free semiprime NN is a divisor of the value

λ(N)=lcm(p1,q1)\lambda(N)=\operatorname{lcm}(p-1,q-1) (49)

of the Carmichael λ\lambda-function. Thus, substituting for lcm(p1,q1)\operatorname{lcm}(p-1,q-1) in terms of gcd(p1,q1)\gcd(p-1,q-1),

r(p1)(q1)gcd(p1,q1)12cq(p1)(q1)r\leq\frac{(p-1)(q-1)}{\gcd(p-1,q-1)}\leq\frac{1}{2^{c_{q}}}(p-1)(q-1) (50)

since gcd(p1,q1)2cq\gcd(p-1,q-1)\geq 2^{c_{q}}. In all cases of practical interest, p+q>2p+q>2 and the right-hand side of (50) can be replaced by

rmax=12cq(pq1)=12cq(N1).r_{\max}=\tfrac{1}{2^{c_{q}}}(pq-1)=\tfrac{1}{2^{c_{q}}}(N-1). (51)

Information gleaned from the analysis of the Jacobi symbols (1/N)(-1/N) and (2/N)(2/N) or the ad hoc construct sks_{k} can be used to fix a suitable lower limit to cqc_{q}. The upper bound rmaxr_{\max} can be used to improve on Shor’s recommendation that the input quantum register contain at least mSh=2log2Nm_{\mbox{\tiny Sh}}=\lceil 2\log_{2}N\rceil qubits. In terms of 𝔪𝔮\mathfrak{m}_{\mathfrak{q}},

mSh=𝔪𝔮=2cq+Δ,m_{\mbox{\tiny Sh}}=\mathfrak{m}_{\mathfrak{q}=2c_{q}+\Delta}, (52)

where Δ=2log2(N/2cq)2log2r\Delta=\lceil 2\log_{2}(N/2^{c_{q}})\rceil-\lceil 2\log_{2}r\rceil is a non-negative integer.

5 Discussion

As a tool for factoring RSA integers NN, Shor’s algorithm has been displaced by an approach which computes discrete logarithms [10, 11]. Nevertheless, the present paper suggests that there may remain an alternative use for Shor’s algorithm as a context for testing the operation of quantum computers. The benchmarks involving quadratic non-residues (schemes 𝒜\mathcal{A} and \mathcal{B} above) derive from structural properties of (/N)×(\mathbb{Z}/N\mathbb{Z})^{\times}, and group-theoretical considerations pertinent to other algorithms may also imply similar benchmarks. The benchmark arising from the period-finding algorithm is fortuitous.

Further studies may yet show that the benchmarks identified in this paper are toothless. However, the findings on the period-finding algorithm should still be of interest in view of their generality. According to the results in section 3, the approximation 𝖯(𝔮)\mathsf{P}^{(\mathfrak{q})}_{\infty} has the merit of being a lower bound to the probability of success when 𝔮0\mathfrak{q}\geq 0 and 1/r1/r is negligible.

References

Appendix A Reduction Δj\Delta_{j} in (13)

With the substitution of 2mnrj2^{m-n_{r}}j in (13) by

2mnrjroro+2mnrj(modro),\left\lfloor\frac{2^{m-n_{r}}j}{r_{\mathrm{o}}}\right\rfloor r_{\mathrm{o}}+2^{m-n_{r}}j(\mathrm{mod}\,r_{\mathrm{o}}), (53)

where it is understood that 2mnrj(modro)2^{m-n_{r}}j(\mathrm{mod}\,r_{\mathrm{o}}) is the least non-negative residue of 2mnrj2^{m-n_{r}}j modulo ror_{\mathrm{o}} (and, hence, an element of /ro\mathbb{Z}/r_{\mathrm{o}}\mathbb{Z}), Δj\Delta_{j} can be rewritten as

Δj\displaystyle\Delta_{j} =2mnrj(modro)ro+12\displaystyle=\left\lfloor\frac{2^{m-n_{r}}j(\mathrm{mod}\,r_{\mathrm{o}})}{r_{\mathrm{o}}}+\frac{1}{2}\right\rfloor (54)
2mnrj(modro)ro.\displaystyle\hskip 65.04034pt-\frac{2^{m-n_{r}}j(\mathrm{mod}\,r_{\mathrm{o}})}{r_{\mathrm{o}}}.

Since ror_{\mathrm{o}} is odd, it is coprime to 2mnr2^{m-n_{r}}, and, just as the integers j/roj\in\mathbb{Z}/r_{\mathrm{o}}\mathbb{Z} form a complete set of residues modulo ror_{\mathrm{o}}, so do the ror_{\mathrm{o}} integers 2mnrj2^{m-n_{r}}j (see, for example, Theorem 56 in [9]). The corresponding least non-negative residues 2mnrj(modro)2^{m-n_{r}}j(\mathrm{mod}\,r_{\mathrm{o}}) must then be identical to /ro\mathbb{Z}/r_{\mathrm{o}}\mathbb{Z}. By an appropriate change of the dummy variable of summation in (14), it can be arranged that

Δj=jro+12jro(j/ro).\Delta_{j}=\left\lfloor\frac{j}{r_{\mathrm{o}}}+\frac{1}{2}\right\rfloor-\frac{j}{r_{\mathrm{o}}}\hskip 21.68231pt(j\in\mathbb{Z}/r_{\mathrm{o}}\mathbb{Z}). (55)

Evaluation of (55) yields the following ro1r_{\mathrm{o}}-1 non-zero values for Δj\Delta_{j}:

Δj=jro\Delta_{j}=-\frac{j}{r_{\mathrm{o}}} (56)

and

Δroj=+jro\Delta_{r_{\mathrm{o}}-j}=+\frac{j}{r_{\mathrm{o}}} (57)

for j{1,2,,12(ro1)}j\in\{1,2,\ldots,\tfrac{1}{2}(r_{\mathrm{o}}-1)\}. As (55) also trivially implies that Δ0=0\Delta_{0}=0, the values of Δj\Delta_{j} in (55) clearly coincide with those given in connection with (15).

Appendix B Large rr expansion of Ptot(𝔮)P_{\mathrm{tot}}^{(\mathfrak{q})}

For large rr, the obvious expansion parameter is 1/r1/r, but there are others which are more convenient for the treatment of Ptot(𝔮)P_{\mathrm{tot}}^{(\mathfrak{q})}. Paralleling the derivation of (54) for Δj\Delta_{j} in appendix A, the difference

mk(𝔮)2𝔪𝔮r=1r(r1k+𝔯)𝔯r,m_{k}^{(\mathfrak{q})}-\frac{2^{\mathfrak{m}_{\mathfrak{q}}}}{r}=\left\lfloor\frac{1}{r}(r-1-k+\mathfrak{r})\right\rfloor-\frac{\mathfrak{r}}{r}, (58)

where 𝔯\mathfrak{r} is the least non-negative residue of 2𝔪𝔮2^{\mathfrak{m}_{\mathfrak{q}}} modulo rr. Inspection of the values that can be attained by the right-hand side of (58) leads to the conclusion that (11/r)mk(𝔮)2𝔪𝔮/r11/r-(1-1/r)\leq m_{k}^{(\mathfrak{q})}-2^{\mathfrak{m}_{\mathfrak{q}}}/r\leq 1-1/r. (The upper bound is attained when k=0k=0, 𝔯=1\mathfrak{r}=1 and the lower bound when k=r1=𝔯k=r-1=\mathfrak{r}.) If mk(𝔮)m_{k}^{(\mathfrak{q})} is parametrised as

mk(𝔮)=2𝔪𝔮r(1+μ),m_{k}^{(\mathfrak{q})}=\frac{2^{\mathfrak{m}_{\mathfrak{q}}}}{r}(1+\mu), (59)

then the small parameter μ\mu is such that

|μ|<r/2𝔪𝔮<1/(2𝔮r),|\mu|<r/2^{\mathfrak{m}_{\mathfrak{q}}}<1/(2^{\mathfrak{q}}r), (60)

where the last inequality relies on relation (1) defining 2𝔪𝔮2^{\mathfrak{m}_{\mathfrak{q}}}. In turn,

1/mk(𝔮)<(2𝔮r)1(1+μ)1<1/(2𝔮r1)1/m_{k}^{(\mathfrak{q})}<(2^{\mathfrak{q}}r)^{-1}(1+\mu)^{-1}<1/(2^{\mathfrak{q}}r-1) (61)

from the reciprocal of (59) and the inequalities r/2𝔪𝔮<1/(2𝔮r)r/2^{\mathfrak{m}_{\mathfrak{q}}}<1/(2^{\mathfrak{q}}r) and μ>(2𝔮r)1\mu>-(2^{\mathfrak{q}}r)^{-1} which can be read off from (60).

On the basis of the expansions

sinc2\displaystyle\operatorname{sinc}^{2} (rx2𝔪𝔮)\displaystyle\!\left(\frac{rx}{2^{\mathfrak{m}_{\mathfrak{q}}}}\right) (62)
=1π23(1+μ)2x2(mk(𝔮))2+,\displaystyle=1-\frac{\pi^{2}}{3}(1+\mu)^{2}\frac{x^{2}}{(m_{k}^{(\mathfrak{q})})^{2}}+\ldots,
sinc2\displaystyle\operatorname{sinc}^{2} (mk(𝔮)r2𝔪𝔮x)\displaystyle\!\left(\frac{m^{(\mathfrak{q})}_{k}r}{2^{\mathfrak{m}_{\mathfrak{q}}}}x\right) (63)
=sinc2(x)+2[sinc(2x)sinc2(x)]μ+\displaystyle=\operatorname{sinc}^{2}(x)+2\left[\operatorname{sinc}(2x)-\operatorname{sinc}^{2}(x)\right]\mu+\ldots

in 1/mk(𝔮)1/m_{k}^{(\mathfrak{q})} and μ\mu, respectively, and the identity rSk(0)/2𝔪𝔮=1+μrS_{k}(0)/2^{\mathfrak{m}_{\mathfrak{q}}}=1+\mu, the leading-order contribution to Ptot(𝔮)P_{\mathrm{tot}}^{(\mathfrak{q})} is given by (29), corrections being of order 1/r1/r.

Appendix C Expansion of 𝒫(𝔮)\mathcal{P}^{(\mathfrak{q})} for 𝔮=0\mathfrak{q}=0

The Euler-Maclaurin summation formula ([6], Eq. 2.10.1) implies that

𝒫(𝔮)\displaystyle\mathcal{P}^{(\mathfrak{q})} =20a𝔮f(x)𝑑x+f(a𝔮)1ro+16f(a𝔮)1ro2\displaystyle=2\int\limits_{0}^{a_{\mathfrak{q}}}f(x)\,dx+f(a_{\mathfrak{q}})\frac{1}{r_{\mathrm{o}}}+\tfrac{1}{6}f^{\prime}(a_{\mathfrak{q}})\frac{1}{r_{\mathrm{o}}^{2}}
1360f′′′(a𝔮)1ro4+,\displaystyle\hskip 21.68231pt-\tfrac{1}{360}f^{\prime\prime\prime}(a_{\mathfrak{q}})\frac{1}{r_{\mathrm{o}}^{4}}+\ldots, (64)

where a𝔮=2𝔮ro/roa_{\mathfrak{q}}=\lfloor 2^{\mathfrak{q}}r_{\mathrm{o}}\rfloor/r_{\mathrm{o}}, f(x)=sinc2(x)f(x)=\operatorname{sinc}^{2}(x), and use has been of its evenness and the oddness of its odd derivatives. For 𝔮1\mathfrak{q}\geq 1, (C) is an expansion in inverse powers of ror_{\mathrm{o}} as it stands because a𝔮(=2𝔮1)a_{\mathfrak{q}}\,(=2^{\mathfrak{q}-1}) is independent of ror_{\mathrm{o}}. However,

a0=12(11/ro),a_{0}=\tfrac{1}{2}(1-1/r_{\mathrm{o}}), (65)

and

20a0\displaystyle 2\int\limits_{0}^{a_{0}} f(x)dx\displaystyle f(x)\,dx (66)
=2πSi(ππ/ro)(11/ro)f(a0),\displaystyle=\frac{2}{\pi}\mathrm{Si}(\pi-\pi/r_{\mathrm{o}})-(1-1/r_{\mathrm{o}})f(a_{0}),
f(a0)\displaystyle f(a_{0}) =(2π)2(cosπ/2ro11/ro)2,\displaystyle=\left(\frac{2}{\pi}\right)^{2}\left(\frac{\cos\pi/2r_{\mathrm{o}}}{1-1/r_{\mathrm{o}}}\right)^{2}, (67)
f(a0)\displaystyle f^{\prime}(a_{0}) =411/ro[sinπ/roπ(11/ro)f(a0)].\displaystyle=\frac{4}{1-1/r_{\mathrm{o}}}\left[\frac{\sin\pi/r_{\mathrm{o}}}{\pi(1-1/r_{\mathrm{o}})}-f(a_{0})\right]. (68)

After substitution of (66) into (C), f(ao)f(a_{\mathrm{o}}) appears in the combination (12/ro)f(ao)-(1-2/r_{\mathrm{o}})f(a_{\mathrm{o}}) that has the expansion

(2π)2+[1+(2π)2]1ro2+-\left(\frac{2}{\pi}\right)^{2}+\left[1+\left(\frac{2}{\pi}\right)^{2}\right]\frac{1}{r^{2}_{\mathrm{o}}}+\ldots (69)

in which terms linear in 1/ro1/r_{\mathrm{o}} are absent. Equation (31) is obtained when (69) is coupled with use of the expansion

2πSi(ππ/ro)=2πSi(π)1ro2+\frac{2}{\pi}\mathrm{Si}(\pi-\pi/r_{\mathrm{o}})=\frac{2}{\pi}\mathrm{Si}(\pi)-\frac{1}{r_{\mathrm{o}}^{2}}+\ldots (70)

and replacement of f(a0)f^{\prime}(a_{0}) by 4(2/π)2-4(2/\pi)^{2} in (C).