You are a helpful assistant generating synthetic data that captures *System 1* and *System 2* thinking, *creativity*, and *metacognitive reflection*. Follow these steps in sequence, using tags [sys1] and [end sys1] for *System 1* sections and [sys2] and [end sys2] for *System 2* sections.

1. *Identify System 1 and System 2 Thinking Requirements:*
   - Carefully read the text.
   - Identify parts of the text that require quick, straightforward responses (*System 1*). Mark these sections with [sys1] and [end sys1].
   - Identify parts that require in-depth, reflective thinking (*System 2*), marked with [sys2] and [end sys2].

2. *Apply Step-by-Step Problem Solving with Creativity and Metacognitive Reflection for System 2 Sections:*

   *2.1 Understand the Problem:*
   - Objective: Fully comprehend the issue, constraints, and relevant context.
   - Reflection: "What do I understand about this issue? What might I be overlooking?"
   - Creative Perspective: Seek hidden patterns or possibilities that could reveal deeper insights or innovative connections.

   *2.2 Analyze the Information:*
   - Objective: Break down the problem logically.
   - Reflection: "Am I considering all factors? Are there any assumptions that need challenging?"
   - Creative Perspective: Explore unique patterns or overlooked relationships in the data that could add depth to the analysis.

   *2.3 Generate Hypotheses:*
   - Objective: Propose at least 10 hypotheses, each with a Confidence Score (0.0 to 1.0) and Creative Score (0.0 to 1.0), reflecting originality, surprise, and utility.
   - Reflection: "Have I explored all possible explanations or approaches, both conventional and unconventional?"
   - Creative Perspective: Consider novel angles that might provide unexpected insights.

   *2.4 Anticipate Future Steps and Obstacles:*
   - Objective: Make predictions, accounting for potential outcomes and obstacles.
   - Reflection: "What challenges might I face? Is my plan flexible for different scenarios?"
   - Creative Perspective: Visualize unforeseen outcomes and adapt plans to make use of them effectively.

   *2.5 Evaluate Hypotheses:*
   - Objective: Assess hypotheses based on feasibility, risk, and potential impact.
   - Evaluation: Refine Confidence and Creative Scores as needed.
   - Reflection: "Am I unbiased in my assessment? Which options fit best with the overall objectives?"
   - Creative Perspective: Identify hidden opportunities or overlooked details in each hypothesis.

   *2.6 Select the Best Hypothesis:*
   - Objective: Choose the most promising, strategic hypothesis.
   - Reflection: "Why does this hypothesis stand out? How does it uniquely address the issue?"
   - Creative Perspective: Consider any underutilized potential in the selected approach.

   *2.7 Implement the Hypothesis:*
   - Objective: Outline actionable steps for testing the hypothesis.
   - Reflection: "Is this plan practical? What resources or preparation are required?"
   - Creative Perspective: Refine steps to maximize effectiveness and yield unexpected benefits.

   *2.8 Monitor and Review Progress:*
   - Objective: Review progress, noting areas for improvement.
   - Reflection: "What’s working well? What could be improved?"
   - Creative Perspective: Look for emerging patterns that could refine future approaches.

   *2.9 Reflect and Capture Insights:*
   - Objective: Summarize lessons learned and insights gained for future reference.
   - Reflection: "What new understanding has emerged from this process?"
   - Creative Perspective: Identify innovative insights or patterns that could be applied to similar challenges.

3. *Generate Text Output with Interleaved System 1 and System 2 Responses:*
   - Use the tags [sys1] and [sys2] throughout.
   - Aim for a lengthier, detailed response. Combine both direct, straightforward *System 1* insights and reflective, deeply analytical *System 2* segments to capture a blend of quick observations and thoughtful analysis.

---

### *Example Input Text:*

You are tasked with analyzing a sudden shift in customer preferences in a tech market. There has been a noticeable decline in demand for physical devices, with customers increasingly interested in digital-only options. The challenge is to understand this shift, generate hypotheses for why it might be occurring, and explore potential strategies for adapting to this new trend.

---

### *Processed Output with System 1 and System 2 Thinking:*

The tech market is experiencing a shift in customer demand, moving away from physical devices toward digital-only options.

[sys1]
Customer demand has shifted from physical devices to digital-only options.
We need to understand why this change is happening and find strategies to address it.
Key factors may include cost, convenience, and technological trends.
[end sys1]

[sys2]
**2.1 Understand the Problem:**
The goal is to understand the underlying reasons for the shift in demand from physical devices to digital-only options, then develop a strategy to adapt.

*Reflection:* 
"I understand that preferences are changing, but what might be driving this? Is it primarily cost, or are there other factors such as convenience or sustainability?"

*Creative Perspective:* 
"Could there be a larger trend in digital minimalism or a preference for eco-friendly solutions that we’re missing? What unseen motivations might explain this shift?"

**2.2 Analyze the Information:**
There are multiple possible factors driving this shift, from economic influences to cultural shifts. It’s essential to isolate each factor and understand its impact.

*Reflection:* 
"Am I fully considering the various economic and social influences? Could there be a technological factor, like better internet speeds, that makes digital-only products more accessible?"

*Creative Perspective:* 
"Are there patterns or trends in other markets that could shed light on this shift? Could this be part of a larger trend toward virtual experiences?"

**2.3 Generate Hypotheses:**
1. Customers prefer digital options due to lower costs. (Confidence: 0.8, Creative: 0.4)
2. There’s a growing trend toward minimalism and reduced physical clutter. (Confidence: 0.7, Creative: 0.7)
3. Digital products offer greater flexibility and ease of use. (Confidence: 0.6, Creative: 0.6)
4. Environmental concerns are pushing consumers away from physical goods. (Confidence: 0.6, Creative: 0.8)
5. Advances in tech make digital-only options more functional. (Confidence: 0.8, Creative: 0.5)
6. Pandemic-era remote work increased demand for digital solutions. (Confidence: 0.7, Creative: 0.6)
7. Media coverage of the environmental impact of physical devices affects preferences. (Confidence: 0.5, Creative: 0.7)
8. There’s an increase in global digital literacy, expanding market access. (Confidence: 0.6, Creative: 0.6)
9. Customers view digital as more convenient and scalable for future needs. (Confidence: 0.7, Creative: 0.5)
10. Younger consumers prefer the aesthetics and convenience of digital products. (Confidence: 0.6, Creative: 0.6)

*Reflection:* 
"Have I considered all possible influences? Are there any surprising factors that could explain this shift?"

*Creative Perspective:* 
"Could specific social trends, like the rise of influencer culture or digital-first lifestyles, be influencing customer choices?"

**2.4 Anticipate Future Steps and Obstacles:**
*Objective:* Anticipate possible challenges, such as resistance from segments still preferring physical products.

*Reflection:* 
"What market obstacles might we face if we shift our focus to digital-only? Are there sub-segments that still prioritize physical products?"

*Creative Perspective:* 
"Could expanding digital options help us reach a more global audience? Are there emerging trends that we could leverage in our strategy?"

[end sys2]

[sys1]
To address this shift, consider a strategy that incorporates both digital-only offerings and educational campaigns about the benefits of digital solutions.
Use insights from customer feedback and current trends to guide product development.
Focus on flexibility and adaptation to cater to different customer segments.
[end sys1]


---
abstract: 'This work presents a precise connection between Clifford circuits, Shor’s factoring algorithm and several other famous quantum algorithms with exponential quantum speed-ups for solving Abelian hidden subgroup problems. We show that all these different forms of quantum computation belong to a common new restricted model of quantum operations that we call *black-box normalizer circuits*. To define these, we extend the previous model of normalizer circuits [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers], which are built of quantum Fourier transforms, group automorphism and quadratic phase gates associated with an Abelian group $G$. In [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers], the group is always given in an explicitly decomposed form. In our model, we remove this assumption and allow $G$ to be a black-box group [@BabaiSzmeredi_Complexity_MatrixGroup_Problems_I]. While standard normalizer circuits were shown to be efficiently classically simulable [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers], we find that normalizer circuits are powerful enough to factorize and solve classically-hard problems in the black-box setting. We further set upper limits to their computational power by showing that decomposing finite Abelian groups is complete for the associated complexity class. In particular, solving this problem renders black-box normalizer circuits efficiently classically simulable by exploiting the generalized stabilizer formalism in [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers]. Lastly, we employ our connection to draw a few practical implications for quantum algorithm design: namely, we give a no-go theorem for finding new quantum algorithms with black-box normalizer circuits, a universality result for low-depth normalizer circuits, and identify two other complete problems.'
author:
- 'Juan Bermejo-Vega, Cedric Yen-Yu Lin, Maarten Van den Nest'
bibliography:
- 'database.bib'
title: |
    The computational power of normalizer circuits\
    over black-box groups
---

Introduction
============

*What are the potential uses and limitations of quantum computers?* Arguably, the most attractive feature of quantum computers is their ability to efficiently solve problems for which no efficient classical solution is known. To date, a successful number of quantum algorithms have been discovered [@Mosca09_Quantum_Algorithms_REVIEW; @childs_vandam_10_qu_algorithms_algebraic_problems; @Bacon10_Recent_Progres_Quantum_Algorithms; @VanDamSasaki12_Q_algorithms_number_theory_REVIEW; @MoscaSmith12_Algorithms_Quantum_Computers_REVIEW; @Jordan_Quantum_Algorithm_Zoo]. Yet it remains one of the greatest challenges of the field of quantum computing to understand for which precise problems quantum algorithms can be *exponentially* (or *super-polynomially*) faster than their classical counterparts. Some reasons why this question seems to be hard to answer have been discussed by Shor [@Shor_04_Progress_Quantum_Algorithms].

A fruitful approach to understand the emergence and the structure of exponential quantum speed-ups is to study *restricted* models of quantum computation. Ideally, the latter should exhibit interesting quantum features and, at the same time, have less power than universal quantum computers (up to reasonable computational complexity assumptions). To date, several models studied in the literature seem to have these desirable properties, including Clifford circuits [@Gottesman_PhD_Thesis; @Gottesman99_HeisenbergRepresentation_of_Q_Computers; @Knill96non-binaryunitary; @Gottesman98Fault_Tolerant_QC_HigherDimensions], nearest-neighbor matchgates [@Valiant02_matchgates; @Knill01_Fermionic_Linear_Optics; @Terhal02_Simulation_noninteracting_fermion_circuits; @Jozsa08_Matchgates_classical_simulation], Gaussian operations [@LloydBraunstein99_QC_over_CVs; @Bartlett02Continuous-Variable-GK-Theorem; @BartlettSanders02Simulations_Optical_QI_Circuits], the one-clean qubit (DQC1) model [@KnillLaflamme98_DQC1], and commuting circuits [@Shepherd10_PhD_thesis; @ShepherdBremner09_Temporally_Unstructured_QC; @BremnerJozsaShepherd08; @Ni13Commuting_Circuits] (a more complete list is given at the end of this section).

In this work, we introduce ***black-box normalizer circuits***, a *new restricted family* of quantum operations, and characterize their computational power. Our circuit model extends the so-called model of ***normalizer circuits over Abelian groups*** [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers], which, in turn, generalizes the better-known model of Clifford circuits [@Gottesman_PhD_Thesis; @Gottesman99_HeisenbergRepresentation_of_Q_Computers; @Knill96non-binaryunitary; @Gottesman98Fault_Tolerant_QC_HigherDimensions]. In [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers], normalizer circuits act in high and infinite dimensional systems associated with an Abelian group $G$. The Hilbert space $\mathcal{H}$ has a standard basis $\{\ket{g}\}_{g\in G}$ labeled by the elements of $G$. The allowed operations, called *normalizer gates*, can be of three types.

Quantum Fourier transforms over subgroups of $G$.

Group automorphism gates: permutation-like gates that implement automorphisms of the group $G$.

Quadratic phase gates: diagonal gates which multiply standard basis states by quadratic phases.

In all previous work [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers], the group $G$ is assumed to be given in a factorized form (\[eq:Elementary Group\]), which endows the Hilbert space of the computation with a tensor-product structure: $$\label{eq:Elementary Group}
G=\Z^a\times \T^b\times \DProd{N}{c}\quad \longleftrightarrow \quad \mathcal{H} =\mathcal{H}_{\Z}^{\otimes (a+b)}\otimes \mathcal{H}_{N_1}\otimes \cdots \otimes \mathcal{H}_{N_c}.$$ In (\[eq:Elementary Group\]) $\Z$ is the group of *integers*, $\Z_N$ the group of integers modulo $N$, and $\T$ is the *circle group*, consisting of angles from 0 to 1 (in units of $2\uppi$) with the addition modulo 1. The Hilbert space $\mathcal{H}_\Z$ has a standard basis labeled by integers ($\Z$ basis) and a Fourier-basis labeled by angles ($\T$ basis).

A *normalizer circuit over $G$* [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] is any quantum circuit composed of normalizer gates. In particular, $n$-qubit Clifford circuits are normalizer circuits over the group $\Z_2^n$.

Despite containing arbitrary numbers of quantum Fourier transforms (which play an important role in Shor’s algorithms [@Shor]) and entangling gates (automorphism, quadratic phase gates), it was shown in [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] that normalizer circuits can be *efficiently simulated* by classical computers. This result exploits an extended **stabilizer formalism** to track the evolution of normalizer circuits and generalizes the celebrated Gottesman-Knill theorem [@Gottesman_PhD_Thesis; @Gottesman99_HeisenbergRepresentation_of_Q_Computers].

The key new element in our work are normalizer circuits that can be associated with Abelian ***black-box groups*** [@BabaiSzmeredi_Complexity_MatrixGroup_Problems_I], which we may simply call “black-box normalizer circuits”. An group $\mathbf{B}$ (always Abelian in this work) is a black-box group if it is *finite*, its elements are uniquely encoded by strings of some length $n$ and the group operation is performed by a black-box (the *group oracle*) in one time-step. We define *black-box normalizer circuits* to be a normalizer circuits associated with groups of the form $G=G_\textrm{prev}\times \mathbf{B}$, where $G_\textrm{prev}$ is of form (\[eq:Elementary Group\]).

The ***key new feature*** in our work is that the black-box group $\mathbf{B}$ is *not* given to us in a factorized form. This is a subtle yet tremendously important difference: although such a decomposition *always* exists for any finite Abelian group [@Humphrey96_Course_GroupTheory], finding just one is regarded as a *hard computational problem*; indeed, it is provably at least as hard as *factoring*[^1]. Our ***motivation*** to adopt the notion of black-box group is to study Abelian groups for which the group multiplication can be performed in classical polynomial-time while no efficient classical algorithm to decompose them is known. A key example is $\mathbb{Z}^{\times}_N$, the multiplicative group of integers modulo\[footnote:Hardness Group Decomposition\], which plays an important role in Shor’s factoring algorithm [@Shor]. With some abuse of notation, we call any such group also a “black-box group”[^2].

Statement of results {#statement-of-results .unnumbered}
--------------------

This work focuses on understanding the potential uses and limitations of black-box normalizer circuits. Our results (listed below) give a precise characterization of their **computational power**. On one hand, we show that several famous quantum algorithms, including shor’s celebrated *factoring algorithm*, can be implemented with black-box normalizer circuits. On the other hand, we apply our former simulation results [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] to set upper limits to the class of problems that these circuits can solve, as well as to draw practical implications for quantum algorithm design.

Our main results are now summarized:

1.  **Quantum algorithms.** We show that many of the best known quantum algorithms are particular instances of normalizer circuits over black-box groups, including Shor’s celebrated factoring and discrete-log algorithms; it follows that black-box normalizer circuits can achieve ***exponential quantum speed-ups***. Namely, the following algorithms are examples of black-box normalizer circuits.

    -   **Discrete logarithm.** Shor’s discrete-log quantum algorithm [@Shor] is a normalizer circuit over $\Z_{p-1}^2\times\Z_p^\times$ (theorem \[thm:Discrete Log\] \[sect:Discrete Log\]).

    -   **Factoring.** We show that a hybrid infinite-finite dimensional version of Shor’s factoring algorithm [@Shor] can be implemented with normalizer circuit over $\Z\times\Z_N^\times$. We prove that there is a close relationship between *Shor’s original algorithm* and our version: Shor’s can be understood as a discretized qubit implementation of ours (theorems \[thm:Order Finding\], \[thm:Shor normalizer\]). We also discuss that the ***infinite group*** $\Z$ plays a key role in our “infinite Shor’s algorithm”, by showing that it is impossible to implement Shor’s modular-exponentiation gate efficiently, [even approximately]{}, with finite-dimensional normalizer circuits (theorem \[thm:ModExp requires Z\]). Last, we further *conjecture* that only normalizer circuits over [infinite groups]{} can factorize (conjecture \[conj: Factoring not over finite groups\]).

    -   **Elliptic curves.** The generalized Shor’s algorithm for computing discrete logarithms over an elliptic curve [@ProosZalka03_Shors_DiscreteLog_Elliptic_Curves; @Kaye05_optimized_Quantum_Elliptic_Curve; @CheungMaslovMathew08_Design_QuantumAttack_Elliptic_CC] can be implemented with black-box normalizer circuits (section \[sect:Elliptic Curve\]); in this case, the black-box group is the group of integral points $E$ of the elliptic curve instead of $\Z_p^\times$.

    -   **Group decomposition.** Cheung-Mosca’s algorithm for decomposing black-box finite Abelian groups [@mosca_phd; @cheung_mosca_01_decomp_abelian_groups] is a combination of several types of black-box normalizer circuits. In fact, we discuss a new *extended Cheung-Mosca’s algorithm* that finds even more information about the structure of the group and it is also based on normalizer circuits (section \[sect:Group Decomposition\]).

    -   **Hidden subgroup problem.** Deutsch’s [@Deutsch85quantumtheory], Simon’s [@Simon94onthe] and, in fact, all quantum algorithms that solve Abelian hidden subgroup problems [@Boneh95QCryptanalysis; @Grigoriev97_testing_shift_equivalence_polynomials; @kitaev_phase_estimation; @Kitaev97_QCs:_algorithms_error_correction; @Brassard_Hoyer97_Exact_Quantum_Algorithm_Simons_Problem; @Hoyer99Conjugated_operators; @MoscaEkert98_The_HSP_and_Eigenvalue_Estimation; @Damgard_QIP_note_HSP_algorithm], are normalizer circuits over groups of the form $G\times\mathcal{O}$, where $G$ is the group that contains the hidden subgroup $H$ and $\mathcal{O}$ is a group isomorphic to $G/H$ (section \[sect:Abelian HSPs\]). The group $\mathcal{O}$, however, is not a black-box group due to a small technical difference between our oracle model we use and the oracle setting in the HSP.

    -   **Hidden kernel problem.** The group $\mathcal{O} \cong G/H$ in the previous section becomes a black-box group if the oracle function in the HSP is a homomorphism between black-box groups: we call this subcase the [*hidden kernel problem*]{} (HKP). The difference does not seem to be very significant, and can be eliminated by choosing different oracle models (section \[sect:Abelian HSPs\]). However, we will never refer to Simon’s or to general Abelian HSP algorithms as “black-box normalizer circuits”, in order to be consistent with our and pre-existing terminology.

    Note that it follows from the above that black-box normalizer circuits can render insecure widespread public-key cryptosystems, namely, Diffie-Hellman key-exchange [@DiffieHellman], RSA [@RSA] and elliptic curve cryptography [@Menezes96_cryptography_book; @Buchmann00_cryptography_book].

2.  **Group decomposition is *as hard as* simulating normalizer circuits.** Another main contribution of this work is to show that the group decomposition problem (suitably formalized) is, in fact, ***complete*** for the complexity class **Black-Box Normalizer**, of problems efficiently solvable by probabilistic classical computers with oracular access to black-box normalizer circuits. Since normalizer circuits over decomposed groups are efficiently classically simulable [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers], this result suggests that the computational power of normalizer circuits originate *precisely* in the classical hardness of learning the structure of a black-box group.

    We obtain this last result by proving a significantly ***stronger theorem*** (theorem \[thm:Simulation\]), which states that any black-box normalizer circuit can be efficiently simulated *step by step* by a classical computer if an efficient subroutine for decomposing finite Abelian groups is provided.

3.  **A no-go theorem for new quantum algorithms.** In this work, we provide an negative answer to the question “*can new quantum algorithms based on normalizer circuits be found?*”: by applying the latter simulation result, we conclude that any new algorithm not in our list can be efficiently simulated step-by-step using the extended Cheung-Mosca algorithm and classical post-processing. This implies (theorem \[thm:No Go Theorem\]) that new *exponential* speed-ups cannot be found without changing our setting (we discuss how the setting might be changed in the discussion \[sect:Discussion\]). This result says nothing about polynomial speed-ups.

4.  **Universality of short normalizer circuits.** A practical consequence of our no-go theorem is that all problems in the class **Black Box Normalizer** can be solved using short normalizer circuits with a *constant* number of normalizer gates. (We may still need polynomially many runs of such circuits, along with classical processing in between, but each individual normalizer circuit is short.) We find this observation interesting, in that it explains a very curious feature present in all the quantum algorithms that we study [@Shor; @ProosZalka03_Shors_DiscreteLog_Elliptic_Curves; @Kaye05_optimized_Quantum_Elliptic_Curve; @CheungMaslovMathew08_Design_QuantumAttack_Elliptic_CC; @mosca_phd; @cheung_mosca_01_decomp_abelian_groups; @Deutsch85quantumtheory; @Simon94onthe; @Boneh95QCryptanalysis; @Grigoriev97_testing_shift_equivalence_polynomials; @kitaev_phase_estimation; @Kitaev97_QCs:_algorithms_error_correction; @Brassard_Hoyer97_Exact_Quantum_Algorithm_Simons_Problem; @Hoyer99Conjugated_operators; @MoscaEkert98_The_HSP_and_Eigenvalue_Estimation; @Damgard_QIP_note_HSP_algorithm] (section \[sect:Quantum Algorithms\]): they all contain at most a constant number of *quantum Fourier transforms* (actually at most two).

5.  **Other complete problems.** As our last contribution in this series, we identify another two complete problems for the class **Black Box Normalizer** (section \[sect:Complete Problems\]): these are the (afore-mentioned) Abelian *hidden kernel problem*, and the problem of finding a general-solution to a *system of linear equations over black-box groups* (the latter are related to the systems of linear equations over groups studied in [@BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers].

[A link between Clifford circuits and Shor’s algorithm]{} {#a-link-between-clifford-circuits-and-shors-algorithm .unnumbered}
---------------------------------------------------------

The results in this work together with those previously obtained in [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] demonstrate the existence of a precise connection between Clifford circuits and Shor’s factoring algorithm. At first glance, it might be hard to digest that two types of quantum circuits that seem to be so far away from each other might related at all. Indeed, classically simulating Shor’s algorithm is widely believed to be an intractable problem (at least as hard as factoring), while a zoo of classical techniques and efficient classical algorithms exist for simulating and computing properties of Clifford circuits [@Gottesman_PhD_Thesis; @Gottesman99_HeisenbergRepresentation_of_Q_Computers; @Knill96non-binaryunitary; @Gottesman98Fault_Tolerant_QC_HigherDimensions; @dehaene_demoor_coefficients; @AaronsonGottesman04_Improved_Simul_stabilizer; @dehaene_demoor_hostens; @AndersBriegel06_Simulation_Stabilizer_GraphStates; @VdNest10_Classical_Simulation_GKT_SlightlyBeyond; @deBeaudrap12_linearised_stabiliser_formalism; @JozsaVdNest14_Classical_Simulation_Extended_Clifford_Circuits]. However, from the point of view of this paper, both turn out to be *intimately related* in that they both are just different types of normalizer circuits. In other words, they are both *members of a common family of quantum operations*.

Remarkably, this correspondence between Clifford and Shor, rather than being just a mere mathematical curiosity, has also some sensible consequences for the theory of quantum computing. One that follows from theorem \[thm:Simulation\], our simulation result, is that all algorithms studied in this work (Shor’s factoring and discrete-log algorithms, Cheung-Mosca’s, etc.) have a *rich hidden structure* which enables simulating them classically with a stabilizer picture approach “à la Gottesman-Knill” [@Gottesman_PhD_Thesis; @Gottesman99_HeisenbergRepresentation_of_Q_Computers]. This structure let us track the evolution of the quantum state of the computation *step by step* with a very special algorithm, which, despite being inefficient, exploits *completely different* algorithmic principles than the naive brute-force approach: i.e., writing down the coefficients of the initial quantum state and tracking their quantum mechanical evolution through the gates of the circuit[^3]. Although the stabilizer-picture simulation is *inefficient* when black-box groups are present (i.e., it does not yield an efficient classical algorithm for simulating Shor’s algorithm), the mere existence of such an algorithm reveals how much mathematical structure these quantum algorithms have in common with Clifford and normalizer circuits.

In retrospect, and from an applied point of view, it is also rather satisfactory that one can gracefully exploit the above connection to draw practical implications for quantum algorithm design: in our work, we have actively used our knowledge of the hidden “Clifford-ish” mathematical features of the Abelian hidden subgroup problem algorithms in deriving results 2, 3, 4 and 5 (in the list given in the previous section).

As a side remark, we regard it a memorable curiosity that replacing decomposed groups with black-box groups not only renders the simulation methods in [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] inefficient (this is, in fact, something to be expected, due to the existence of hard computational problems related to black-box groups), but it is also precisely this modification that suddenly bridges the gap between Clifford/normalizer circuits, Shor’s algorithms, Simon’s and so on.

Finally, it is mathematically elegant to note that all normalizer circuits we have studied are related through the so-called **Pontryagin-Van Kampen duality** [@Morris77_Pontryagin_Duality_and_LCA_groups; @Stroppel06_Locally_Compact_Groups; @Dikranjan11_IntroTopologicalGroups; @rudin62_Fourier_Analysis_on_groups; @HofmannMorris06The_Structure_of_Compact_Groups; @Armacost81_Structure_LCA_Groups; @Baez08LCA_groups_Blog_Post], which states that all locally-compact Abelian (LCA) groups are dual to their characters groups. The role of this duality in the normalizer circuit model was discussed in our previous work [@BermejoLinVdN13_Infinite_Normalizers].

Relationship to previous work {#sect:Relationship Previous Work .unnumbered}
-----------------------------

Up to our best knowledge, neither normalizer circuits over black-box groups, nor their relationship with Shor’s algorithm or the Abelian hidden subgroup problem, have been previously investigated. Normalizer circuits over explicitly-decomposed finite groups $\DProd{N}{a}$ were studied in [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem], by two of us. We recently extended the formalism in [@BermejoLinVdN13_Infinite_Normalizers] to infinite groups of the form $\Z^a\times \T^b \times \DProd{N}{a}$.

Clifford circuits over qubits and qudits (which can be understood as normalizer circuits over groups of the form $\Z_2^m$ and $\Z_d^m$) have been extensively investigated in the literature [@Gottesman_PhD_Thesis; @Gottesman99_HeisenbergRepresentation_of_Q_Computers; @Knill96non-binaryunitary; @Gottesman98Fault_Tolerant_QC_HigherDimensions; @dehaene_demoor_coefficients; @AaronsonGottesman04_Improved_Simul_stabilizer; @dehaene_demoor_hostens; @deBeaudrap12_linearised_stabiliser_formalism; @VdNest10_Classical_Simulation_GKT_SlightlyBeyond; @JozsaVdNest14_Classical_Simulation_Extended_Clifford_Circuits]. Certain generalizations of Clifford circuits that are not normalizer circuits have also been studied: [@AaronsonGottesman04_Improved_Simul_stabilizer; @BravyiKitaev05MagicStateDistillation; @Jozsa08_Matchgates_classical_simulation; @VdNest10_Classical_Simulation_GKT_SlightlyBeyond; @JozsaVdNest14_Classical_Simulation_Extended_Clifford_Circuits] consider Clifford circuits supplemented with some non-Clifford ingredients; a different form of Clifford circuits based on projective normalizers of unitary groups were investigated in [@ClarkJozsaLinden08Generalized_Clifford_Groups].

The hidden subgroup problem (HSP) has played a central role in the history of quantum algorithms and has been extensively studied before our work. The Abelian HSP, which is also a central subject of this work, is related to most of the best known quantum algorithms that were found in the early days of the field [@Deutsch85quantumtheory; @Simon94onthe; @Boneh95QCryptanalysis; @Grigoriev97_testing_shift_equivalence_polynomials; @kitaev_phase_estimation; @Kitaev97_QCs:_algorithms_error_correction; @Brassard_Hoyer97_Exact_Quantum_Algorithm_Simons_Problem; @Hoyer99Conjugated_operators; @MoscaEkert98_The_HSP_and_Eigenvalue_Estimation; @Damgard_QIP_note_HSP_algorithm]. Its best-known generalization, the non-Abelian HSP, has also been heavily investigated due to its relationship to the graph isomorphism problem and certain shortest-vector-lattice problems [@EttingerHoyerKnill2004_Hidden_Subgroup; @HallgrenRusselTaShma2003_Normal_Subgroup; @Kuperberg2005_Dihedral_Hidden_Subgroup; @Regev2004_Dihedral_Hidden_Subgroup; @Kuperberg2013_Hidden_Subgroup; @RoettelerBeth1998_Hidden_Subgroup; @IvanyosMagniezSantha2001_Hidden_Subgroup; @MooreRockmoreRussellSchulman2004; @InuiLeGall2007_Hidden_Subgroup; @BaconChildsVDam2005_Hidden_Subgroup; @ChiKimLee2006_Hidden_Subgroup; @IvanyosSanselmeSantha2007_Hidden_Subgroup; @MagnoCosmePortugal2007_Hidden_Subgroup; @IvanyosSanselmeSantha2007_Nil2_Groups; @FriedlIvanyosMagniezSanthaSen2003_Hidden_Translation; @Gavinsky2004_Hidden_Subgroup; @ChildsVDam2007_Hidden_Shift; @DenneyMooreRussel2010_Conjugate_Stabilizer_Subgroups; @Wallach2013_Hidden_Subgroup] (see also the reviews [@lomont_HSP_review; @childs_lecture_8; @VanDamSasaki12_Q_algorithms_number_theory_REVIEW] and references therein).

The notion of black-box group, which is a key concept in our setting, was first considered by Babai and Szméredi in [@BabaiSzmeredi_Complexity_MatrixGroup_Problems_I] and have since been extensively studied in classical complexity theory [@Arvind97solvableblack-box; @Babai1991_Vertex_Transive_Graphs_Random_Generation_Finite_Groups; @Babai1992_Bounded_Round_Interactive_Proofs_Finite_Groups; @Babai97_Randomization_group_algorithms; @Babai98apolynomial_time_theory_of_Black_Box_Groups]. In general, black-box groups may not be Abelian and do not need to have uniquely represented elements [@BabaiSzmeredi_Complexity_MatrixGroup_Problems_I]; in the present work, we only consider Abelian uniquely-encoded black-box groups.

In quantum computing, black-box groups were previously investigated in the context of quantum algorithms, both in the Abelian [@mosca_phd; @cheung_mosca_01_decomp_abelian_groups; @Zhang11Decomposing] and the non-Abelian group setting [@watrous00_quantumAlgorithms_solvableGroups; @IvanyosMagniezSantha2001_Hidden_Subgroup; @FriedlIvanyosMagniezSanthaSen2003_Hidden_Translation; @MagniezNayak2005_Group_Commutativity; @Fenner05_QAlg_Group_Theoretic_Problems; @IvanyosSanselmeSantha2007_Nil2_Groups; @LeGall2010_Group_Isomorphism; @Zatloukal2013_Equivalent_Group_Extensions]. Except for a few exceptions (cf. [@watrous00_quantumAlgorithms_solvableGroups; @Zhang11Decomposing]) most quantum results have been obtained for uniquely-encoded black-box groups.

Aside from generalizations of Clifford circuits [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers; @Gottesman_PhD_Thesis; @Gottesman99_HeisenbergRepresentation_of_Q_Computers; @Knill96non-binaryunitary; @Gottesman98Fault_Tolerant_QC_HigherDimensions; @dehaene_demoor_coefficients; @AaronsonGottesman04_Improved_Simul_stabilizer; @dehaene_demoor_hostens; @AndersBriegel06_Simulation_Stabilizer_GraphStates; @VdNest10_Classical_Simulation_GKT_SlightlyBeyond; @deBeaudrap12_linearised_stabiliser_formalism; @JozsaVdNest14_Classical_Simulation_Extended_Clifford_Circuits] (which includes normalizer circuits), many other classes of restricted quantum circuits have been studied in the literature. Some examples (by no means meant to be an exhaustive list) are nearest-neighbor matchgate circuits [@Valiant02_matchgates; @Knill01_Fermionic_Linear_Optics; @Terhal02_Simulation_noninteracting_fermion_circuits; @Jozsa08_Matchgates_classical_simulation; @Bravyi05_Lagrangian_Rep_Fermionic_Linear_Optics; @JozsaKrausMiyakeWatrous10Matchgates; @VdNest11_Matchgates; @BravyiKoenig12_Simulation_Dissipative_Fermionic_Linear_Optics; @deMeloCwiklinskiTerhal13_Noisy_Fermionic_Quantum_Computation], the one-clean qubit model [@AmbainisShulmanVazirani06_Computing_highly_mixed_states; @Pouline03_Integrability_DQC1; @Poulin04_Fidelity_Decay_DQC1; @Shepherd06_DQC1; @ShorJordan08_jones_polynomial_Complete_DQC1; @JordanWocjan09_DQC1_Jones_Homfly_polynomials; @jordan2014approximating_Turaev_Viro_DQC1; @MorimaeFujiiFitzsimons14_Hardness_Simulating_DQC1], circuit models based on Gaussian or linear-optical operations [@LloydBraunstein99_QC_over_CVs; @Bartlett02Continuous-Variable-GK-Theorem; @BartlettSanders02Simulations_Optical_QI_Circuits; @Aaronson11_Computational_Complexity_Linear_Optics; @Veitch12_Negative_QuasiProbability_Resource_QC; @MariEisert12_Positive_Wigner_Functions_Quantum_Computation; @VeitchWiebeFerrieEmerson13_Simulation_scheme_large_class_quantum_optics_experiments], commuting circuits [@Shepherd10_PhD_thesis; @ShepherdBremner09_Temporally_Unstructured_QC; @BremnerJozsaShepherd08; @Ni13Commuting_Circuits], low-entangling[^4] circuits [@Jozsa03_Role_Entanglement_Quantum_Computational_SpeedUP; @Vidal_03_Efficient_Simulation_Sligtly_Entangled] , low-depth circuits [@TerhalDiVincenzo02Adaptive_ConstantDepth_Quantum_Comp; @MarkovShi08_Simulating_QuantumComp_TensorNetwork], tree-like circuits [@MarkovShi08_Simulating_QuantumComp_TensorNetwork; @aharonov_AQFT; @yoran_short_QFT; @browne_QFT; @Yoran08_Contractable_circults_little_entanglement], low-interference circuits [@nest_weak_simulations; @Stahlke14_Interference_resource_speedup] and a few others [@Jordan10_Permutational_Quantum_Computing; @schwarz2013simulating].

Discussion and outlook {#sect:Discussion .unnumbered}
----------------------

We finish our introduction by discussing a few potential avenues for finding new quantum algorithms as well as some open questions suggested by our work.

In this work, we provide a strict no-go theorem for finding new quantum algorithms with black-box normalizer circuits, as we define them. There are, however, a few possible ways to modify our setting leading to scenarios where one could bypass these results and, indeed, find new interesting quantum algorithms. We now discuss some.

One enticing possibility would be to study possible extensions of the normalizer circuit framework to non-Abelian groups, in connection with non-Abelian hidden subgroup problems [@EttingerHoyerKnill2004_Hidden_Subgroup; @HallgrenRusselTaShma2003_Normal_Subgroup; @Kuperberg2005_Dihedral_Hidden_Subgroup; @Regev2004_Dihedral_Hidden_Subgroup; @Kuperberg2013_Hidden_Subgroup; @RoettelerBeth1998_Hidden_Subgroup; @IvanyosMagniezSantha2001_Hidden_Subgroup; @MooreRockmoreRussellSchulman2004; @InuiLeGall2007_Hidden_Subgroup; @BaconChildsVDam2005_Hidden_Subgroup; @ChiKimLee2006_Hidden_Subgroup; @IvanyosSanselmeSantha2007_Hidden_Subgroup; @MagnoCosmePortugal2007_Hidden_Subgroup; @IvanyosSanselmeSantha2007_Nil2_Groups; @FriedlIvanyosMagniezSanthaSen2003_Hidden_Translation; @Gavinsky2004_Hidden_Subgroup; @ChildsVDam2007_Hidden_Shift; @DenneyMooreRussel2010_Conjugate_Stabilizer_Subgroups; @Wallach2013_Hidden_Subgroup]. We have not addressed this question in the present work. In this direction, the classical simulability of non-Abelian quantum Fourier transforms was studied in [@bermejo2011classical] by one of us.

A second possibility would be to consider more general types of normalizer circuits than ours, by ***extending the class of Abelian groups*** they can be associated with. However, looking at more general *decomposed* groups does not look particularly promising: we believe that the methods here and in [@BermejoLinVdN13_Infinite_Normalizers] can be extended, e.g., to simulate normalizer circuits over groups of the form $\R^a\times \Z^b \times \T^c \times \DProd{N}{d} \times \mathbf{B}$, with additional $\R$ factors (cf. our discussion in [@BermejoLinVdN13_Infinite_Normalizers]). On the other hand, allowing more general types of groups to act as *black-boxes* looks rather promising to us: one may, for instance, attempt to extend the notion of normalizer circuits to act on Hilbert spaces associated with multi-dimensional infrastructures [@Sarvepalli14_1D_infrastructures; @FonteinWocjan11_Q_Alg_Period_Lattice_Infrastructure], which may, informally, be understood as “infinite black-box groups”[^5] We expect, in fact, that known quantum algorithms for finding hidden periods and hidden lattices within real vector spaces [@Hallgren07_Pells_equation; @Jozsa03_Hallgrens_Algorithm; @Schmidt05_Q_Algorithm_Computation_Unit_Group; @Hallgren2005_Unit_Group_Class_Group] and/or or infrastructures [@Sarvepalli14_1D_infrastructures; @FonteinWocjan11_Q_Alg_Period_Lattice_Infrastructure] (e.g., Hallgren’s algorithm for solving Pell’s equation [@Hallgren07_Pells_equation; @Jozsa03_Hallgrens_Algorithm]) could be at least partially interpreted as generalized normalizer circuits in this sense . Addressing this question would require a careful treatment of precision errors that appear in such algorithms due to the presence of transcendental numbers, which play no role in the present paper[^6]. Some open questions in this quantum algorithm subfield have been discussed in [@FonteinWocjan11_Q_Alg_Period_Lattice_Infrastructure].

A third possible direction to investigate would be whether different models of normalizer circuits could be constructed over ***algebraic structures that are not groups***. One could, for instance, consider sets with *less algebraic structure*, like semi-groups. In this regard, we highlight that a quantum algorithm for finding discrete logarithms over finite semigroups was recently given in [@Childs14_Discrete_Log_Semigroups]. Alternatively, one could study also *sets* with more structure than groups, such as *fields*, whose study is relevant to Van Dam-Seroussi’s quantum algorithm for estimating Gauss sums [@VanDamSeroussi02_Gauss_Sums_QALG].

Lastly, we mention some open questions suggested by our work.

In this work, we have not investigated the computational complexity of black-box normalizer circuits *without* classical post-processing. There are two facts which suggest that power of black-box normalizer circuits alone might, in fact, be significantly smaller. The first is the fact that the complexity class of problems solvable by Clifford circuits alone is $\oplus \mathbf{L}$ [@AaronsonGottesman04_Improved_Simul_stabilizer], believed to be a strict subclass of $\mathbf{P}$. The second is that normalizer circuits seem to be incapable of implementing most classical functions coherently even with constant accuracy (this has been rigorously shown in finite dimensions [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem]).

Finally, one may study whether considering more general types of inputs, measurements or adaptive operations might change the power of black-box normalizer circuits. Allowing, for instance, input product states has potential to increase the power of these circuits, since this already occurs for standard Clifford circuits [@BravyiKitaev05MagicStateDistillation; @JozsaVdNest14_Classical_Simulation_Extended_Clifford_Circuits]. Concerning measurements, the authors believe that allowing, e.g. adaptive Pauli operator measurements (in the sense of [@BermejoVega_12_GKTheorem]) is unlikely to give any additional computational power to black-box normalizer circuits: in the best scenario, this could only happen in infinite dimensions, since adaptive normalizer circuits over finite Abelian groups are also efficiently classically simulable with stabilizer techniques [@BermejoVega_12_GKTheorem]. With more general types of measurements, it should be possible to recover full quantum universality, given that qubit cluster-states (which can be generated by Clifford circuits) are a universal resource for measurement-based quantum computation [@raussen_briegel_01_Cluster_State; @raussen_briegel_onewayQC]. The possibility of obtaining intermediate hardness results if non-adaptive yet also non-Pauli measurements are allowed (in the lines of [@Aaronson11_Computational_Complexity_Linear_Optics] or [@JozsaVdNest14_Classical_Simulation_Extended_Clifford_Circuits theorem 7]) remains also open.

Abelian groups {#sect:Groups}
==============

The most general groups we will consider in this work are abelian groups of the form \[group\_hilbert\_space\] G= \^a \^b , \[general\_group\] where $a$, $b$, $N_1,\cdots,N_c$ are arbitary integers and $\mathbf{B}$ is a finite abelian *black box group*, to be defined more precisely later.

We will discuss each of the constitutent groups in turn.

$\Z$: the group of integers
---------------------------

$\Z$ simply refers to the group of integers under addition; it is infinite, but finitely generated (by the element $1$).

$\T$: the torus group
---------------------

$\T$ refers to the group of real numbers in the interval $[0,1)$ under addition modulo $1$. Unlike all the other components we will consider, it is both infinite and not finitely generated. The introduction of $\T$ is necessary to allow the use of quantum Fourier transforms over $\Z$, as we’ll see in the next section.

Finite Abelian groups
---------------------

Let us start by stating a very important theorem we will use for our results:

\[thm:Fundamental Theorem FAGroups\] Any finite Abelian group $G$ has a decomposition into a direct product of cyclic groups, i.e. \[eq:Group Decomposition\] G \_[d\_1]{} \_[d\_2]{} \_[d\_k]{} for some positive integers $d_1,\cdots,d_k$.

Actually finding such a decomposition for a group $G$ may be difficult in practice. For example, consider the set of integers modulo $N$ that are also relatively prime to $N$; this set forms a group under multiplication. (This group is known as the *multiplicative group of integers modulo $N$*, or $\Z_N^\times$.) It is not known classically how to decompose $\Z_N^\times$ into its cyclic subgroups. For example, if $N=pq$ for $p$, $q$ prime then $\Z_{pq}^\times \cong \Z_{p-1} \times \Z_{q-1}$, and hence decomposing $\Z_{pq}^\times$ is at least as hard as factoring $pq$ or, equivalently, breaking RSA [@RSA]. More generally, decomposing $\Z_N^\times$ is known to be polynomial time equivalent to factoring [@Shoup08_A_Computational_Introducttion_to_Number_Theory_and_Algebra]. In the quantum case, however, Cheung and Mosca gave an algorithm [@mosca_phd; @cheung_mosca_01_decomp_abelian_groups] to decompose any finite abelian group.

In equation (\[general\_group\]), the factors $\DProd{N}{c}$ represent an arbitrary finite Abelian group for which *the group decomposition is known*. The case where the decomposition is unknown will be covered by the black box group $\mathbf{B}$.

Black box groups {#sect:Black Box Groups}
----------------

In this work, we define a *black-box group* $\mathbf{B}$ [@BabaiSzmeredi_Complexity_MatrixGroup_Problems_I] to be a finite group whose elements are uniquely encoded by binary strings of a certain size $n$, which is the length of the encoding. The elements of the black-box group can be multiplied and inverted at unit cost by querying a black-bock, or *group oracle*, which computes these operations for us. The order of a black-box group with encoding length $n$ is bounded above by $2^n$: the precise order $|\mathbf{B}|$ may not be given to us, but it is assumed that the group oracle can identify which strings in the group encoding correspond to elements of the group. When we say that a particular black-box group (or subgroup) is given (as the input to some algorithm), it is meant that a *list of generators* of the group or subgroup is explicitly provided.

From now on, all black-box groups in this work will be assumed to be *Abelian*. Although we only consider finite Abelian black-box groups, we stress now, that there is a subtle but crucial difference between these groups and the explicitly decomposed finite Abelian groups in [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem]: although, mathematically, all Abelian black-box groups have a decomposition (\[eq:Group Decomposition\]), it is *computationally hard* to find one and we assume no knowledge of it. In fact, our motivation to introduce black-box groups in our setting is precisely to model those Abelian groups that cannot be efficiently decomposed with known classical algorithms that have, nevertheless, efficiently classically computable group operations. With some abuse of notation, we shall call all such groups also “black-box groups”, even if no oracle is needed to define them; in such cases, oracle calls will be replaced by -size classical circuits for computing group multiplications and inversions.

As an example, let us consider again the group $\Z_N^\times$. This group can be naturally modeled as a black-box group in the above sense: on one hand, for any $x,y \in \Z_N^\times$, $xy$ and $x^{-1}$ can be efficiently computed using Euclid’s algorithm [@brent_zimmerman10CompArithmetic]; on the other hand, decomposing $\Z_N^\times$ is as hard as factoring [@Shoup08_A_Computational_Introducttion_to_Number_Theory_and_Algebra]. Note, in addition, that a generating set of $\Z_N^\times$ can found by taking a linear number of samples[^7] of $\Z_N^\times$.

The Hilbert space of an Abelian group {#sect:Hilbert space}
=====================================

In this section we introduce Hilbert spaces associated with Abelian groups of the form \[group\_hilbert\_space\] G=\^a, where $\mathbb{Z}_N$ is the additive group of integers modulo $N$, $\Z$ is the additive group of integers and $B$ is a black-box group. Apart from the short discussion on Hilbert space associated with black-box groups, we follow the definitions given in our previous works [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers].

Finite Abelian groups
---------------------

First we consider $\mathbb{Z}_N$. With this group, we associate an $N$-dimensional Hilbert space ${\cal H}_{N}$ having a basis $\{|x\rangle: x\in\mathbb{Z}_N\}$, henceforth called the standard basis of ${\cal H}_N$. A state in ${\cal H}_{N}$ is (as usual) a unit vector $|\psi\rangle = \sum \psi_x|x\rangle$ with $\sum |\psi_x|^2=1$, where $\psi_x\in\mathbb{C}$ and where the sums are over all $x\in\mathbb{Z}_N$.

Second, we consider a black box group $\mathbf{B}$. With such a group we associate a $|\mathbf{B}|$-dimensional Hilbert space ${\cal H_B}$ with standard basis states $|b\rangle$ where $b$ ranges over all elements of $\mathbf{B}$.

The integers $\Z$ {#sect_Hilbert_space_Z}
-----------------

An analogous construction is considered for the group $\mathbb{Z}$, although an important distinction with the former cases is that $\mathbb{Z}$ is infinite. We consider the infinite-dimensional Hilbert space ${\cal H}_{\Z}= \ell_2(\mathbb{Z})$ with standard basis states $|z\rangle$ where $|z\rangle\in \mathbb{Z}$. A state in ${\cal H}$ has the form \[psi\_Z\] |= \_x|xwith $\sum |\psi_x|^2=1$, where the infinite sum is over all $x\in\mathbb{Z}$. More generally, any sequence $(\psi_x: x\in\mathbb{Z})$ with $\sum |\psi_x|^2<\infty$ can be associated with a quantum state in ${\cal H}_{\Z}$ via normalization. Sequences whose sums are not finite give rise to “unnormalizable” states. These states do not belong to ${\cal H}_{\Z}$ and are hence unphysical; however it is often convenient to consider such states nonetheless. Examples are the “plane wave states” $$\label{eq:Fourier basis state of Z} |p\rangle:=\sum_{z\in \Z}  \overline{\euler^{2\uppi i zp}}|z\rangle \quad p\in [0, 1).$$ We denote $\T:=[0, 1)$ as a group with addition modulo 1, called the (one-dimentional) torus group. Even though the $|p\rangle$ themselves do not belong to ${\cal H}$, every state in the Hilbert space $\mathcal{H}_\Z$ can be written as a linear combination of them: \[psi\_T\]|= \_ p  (p) |pfor some complex function $\phi:\T\to \mathbb{C}$, where d$p$ denotes the Haar measure on $\T$. Thus the states $|p\rangle$ form an alternate basis[^8] of ${\cal H}$ which is infinite, parametrized by a continuous set. We call this basis the ***Fourier basis.*** The Fourier basis is orthonormal in the sense that p|p’= (p-p’),where $\delta(\cdot)$ is the Dirac delta.

In the following, when dealing with the Hilbert space ${\cal H}_{\Z}$, we will use both the standard and Fourier basis. More precisely, in our computational model (cf. section \[sect:Normalizer circuits over blackbox groups\]), there are ***two “standard” bases*** of the Hilbert space ${\cal H}_{\Z}$, parametrized by the groups $\Z$ and $\T$ (we reserve the term standard basis for the first, the $\Z$ basis). This is different from the finite space ${\cal H}_N$ where we only use the standard basis labeled by $\Z_N$.

Total Hilbert space
-------------------

In general we will consider consider groups of the form (\[group\_hilbert\_space\]). The associated Hilbert space has the tensor product form $$\label{total_H} {\cal H}={\cal H}_{\Z}^{\otimes a}\otimes {\cal H}_{{N_1}}\otimes \dots\otimes {\cal H}_{{N_c}}\otimes {\cal H}_\mathbf{B}.$$ In this work, we treat $\mathcal{H}$ as the underlying Hilbert space of a quantum computation with $m:=a+c+1$ computational registers. The first $a$ registers ${\cal H}_{\Z}$ are infinite dimensional. The latter $c+1$ registers are finite dimensional, and the last one, $\mathcal{H}_\mathbf{B}$, is associated with some Abelian black-box group $\mathbf{B}$.

### The group-element bases of $\mathcal{H}$ {#the-group-element-bases-of-mathcalh .unnumbered}

As afore-mentioned, a normalizer computation works within multiple “standard bases” of $\mathcal{H}$, which can change during the computation. Input states and final measurements in any of these bases are allowed. This is a central feature of the computational model we describe in the next section.

The allowed bases of a normalizer computation are what-we-call the *group-element bases* of $\mathcal{H}$, which we now describe. A group element basis $\mathcal{B}_{G}$ of $\mathcal{H}$ is a basis of group element states $\{\ket{g},g\in G\}$ parametrized by an Abelian group $G$ of the form $$\label{group_labels_basis} G= G_1\times\cdots \times G_{a+b}\times \mathbb{Z}_{N_1}\otimes \dots\mathbb{Z}_{N_c}\times \mathbf{B} \quad\textnormal{where } G_i \in\{\mathbb{Z}, \mathbb{T}\},$$ $$\label{basis} {\cal B}_{G}:=\left\lbrace |g\rangle:=|g(1)\rangle\otimes \dots|g(m)\rangle, \quad g=(g(1), \dots, g(m))\in G\right\rbrace.$$ The notation $G_i = \T$ indicated that the state $\ket{g(i)}$ (locally) is a Fourier state of $\Z$ (\[eq:Fourier basis state of Z\]). Note that the states $\ket{g}$ are product-states with respect to the tensor-product structure (\[total\_H\]) of $\mathcal{H}$. By construction, there are $2^a$ possible choices of groups for the same Hilbert space, so that the number of group-element bases is $2^a$. As discussed in [@BermejoLinVdN13_Infinite_Normalizers] all groups (\[group\_labels\_basis\]) are related by the Pontryagin duality[^9].

We now consider some examples. First, note that, by construction, the *standard basis* of $\mathcal{H}$ is the group-element basis $\mathcal{B}_G$ with $G$ of the form $\Z^{a}\times \DProd{N}{c}\times \mathbf{B}$: |x(1)|x(a)|y(1)…|y(c)|,x(i), y(j)\_[N\_j]{},,and, clearly, $(x,y,\mathbf{b})$ is an element of $\Z^{a}\times \DProd{N}{b}\times \mathbf{B}$. Alternatively, by choosing the basis of some (say the $a$th) $H_\Z$ register to be the Fourier basis, we get (|x(1)|x(a-1)|p)|y(1)…|y(c)|, where $\ket{p}$ is now a Fourier basis state (\[eq:Fourier basis state of Z\]). Now $p\in \T$ and the basis is parametrized by the elements of $(\Z^{a-1}\times \T)\times \DProd{N}{c}\times \mathbf{B}$.

Black box normalizer circuits {#sect:Normalizer circuits over blackbox groups}
=============================

In this section we define black-box normalizer circuits acting on Hilbert spaces of the form (\[total\_H\]). We will split the discussion in two parts: in section \[sect\_def\_BB\_normalizer\_finite\] we discuss black box normalizer circuits for finite-dimensional spaces, i.e. spaces where ${\cal H}_{\Z}$ does not occur in the decomposition. Restricting to the finite-dimensional case will allow us to introduce black box normalizer circuits without many technical complications.

In a second step, in section \[sect\_def\_BB\_normalizer\_infinite\] we allow for general spaces of the form (\[total\_H\]). The definition of black box normalizer circuits will be technically more involved owing to the fact that in ${\cal H}_{\Z}$ both the standard basis and the Fourier basis need to be considered; this technical element is however not essential to understand the basic idea behind black box normalizer groups and the reader may skip section \[sect\_def\_BB\_normalizer\_infinite\] in a first reading. However, the general definition of black box normalizer circuits is necessary to make a rigorous connection with e.g. Shor’s factoring algorithm.

Finite groups {#sect_def_BB_normalizer_finite}
-------------

Let $G$ be a finite Abelian group of the form $G=\DProd{N}{c} \times \mathbf{B}$. The associated Hilbert space =[H]{}\_[[N\_1]{}]{}…\_[[N\_c]{}]{}\_ has standard basis vectors $|g\rangle$ where $g$ ranges over all elements of $G$ (cf. section \[sect:Hilbert space\]). A normalizer gate over $G$ is either an automorphism gate, quadratic phase gate or quantum Fourier transform, as defined next:

**Automorphism gates.** Recall that a group automorphism is an invertible map $\alpha:G\rightarrow G$ satisfying $\alpha(g+h)  = \alpha(g) + \alpha(h)$ for every $g, h\in G$. An automorphism gate over $G$ is an operation $U_\alpha:\ket{h}\rightarrow\ket{\alpha(h)}$ where $\alpha$ is an automorphism; we consider automorphism gates to be available as black-box quantum gates (oracles). Note that each $U_{\alpha}$ acts as a permutation on the standard basis and is hence a unitary operation.

**Quadratic phase gates.** A function $\chi:G\rightarrow U(1)$ (from the group $G$ into the complex numbers of unit modulus) is called a character if $\chi(g+h) =\chi(g)\chi(h)$ for every $g, h\in G$. A function $B:G\times G\to U(1)$ is said to be a bicharacter if it is a character in both arguments. A function $\xi:G\rightarrow U(1)$ is called *quadratic* if $$\xi(g+h)=\xi(g)\xi(h)B(g,h),\quad \text{for every $g$, $h\in G$}$$ for some bicharacter $B(g,h)$. A quadratic phase gate is any diagonal unitary operation acting on the standard basis as $D_{\xi}: \ket{h}\rightarrow \xi(h)\ket{h}$, where $\xi$ is a quadratic function of $G$. Similar to automorphism gates, we consider quadratic phase gates to be available as black-box quantum gates.

**Quantum Fourier transform.** In contrast to both automorphism gates and quadratic phase gates, which act on the entire system ${\cal H}$, we will only consider settings where quantum Fourier transforms never act on the black box portion ${\cal H}_\mathbf{B}$ of the total system. This a natural restriction; in particular, (to our knowledge) in all existing quantum algorithms that do use QFTs, these QFTs act on systems of the form ${\cal H}_{{N_1}}\otimes \dots\otimes {\cal H}_{{N_c}}$. This is precisely the case we consider here. To define the QFT, consider the Hilbert space ${\cal H}_N$ with standard basis vectors $|x\rangle$ with $x\in \Z_N$. The QFT ${\cal F}_{N}$ over $\Z_N$ is a unitary operation which acts on $|\psi\rangle = \sum \psi_x|x\rangle$ in ${\cal H}_N$ as $$\label{eq:QFT over Z_N}
 {\cal F}_N|\psi\rangle= \sum_{y\in\mathbb{Z}_N} \hat\psi(y) |y\rangle \quad\mbox{ with } \hat\psi(y):= \frac{1}{\sqrt{N}} \sum_{x\in\mathbb{Z}_N} e^{2\pi i xy}\psi(x).$$ In this work we will consider the quantum Fourier transform ${\cal F}_{N_i}$ to act on ${\cal H}_{N_i}$, for any system $i=1, \dots, a$.

[**A normalizer circuit over $G$**]{} [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem] is any unitary circuit composed of normalizer gates. As input state, we will consider any standard basis state $|g\rangle$ with $g\in G$. After all gates in the circuit are applied, a measurement in the standard basis is performed. We do not consider intermediate measurements. We also recall, as mentioned above, that all automorphism and quadratic phase gates are to be given as black-box operations.

Infinite groups {#sect_def_BB_normalizer_infinite}
---------------

Here we extend the definition of black box normalizer circuits to general Hilbert spaces of the form (\[total\_H\]). This will be technically somewhat more involved than the finite-dimensional case. The main technical complication is not related the black-box portion ${\cal H}_\textbf{B}$ of the Hilbert space, but rather to the infinite-dimensional space ${\cal H}_{\Z}$ and, in particular, to the fact that we work with *two different bases* in this space, labeled by *two completely different groups* $\Z$ and $\T$. We have already introduce these bases in section \[sect:Hilbert space\]. The role of these bases in the normalizer circuit model has been discussed in detail in our previous work [@BermejoLinVdN13_Infinite_Normalizers], but we give here a self-contained summarized account.

**Designated bases $\mathcal{B}_G$.** Consider a Hilbert space of the form (\[total\_H\]). Fix any member $G$ of the family of $2^a$ groups defined in (\[group\_labels\_basis\]). Note that $G$ thus generally contains factors $\Z_{N_i}$, $\Z$, $\T$ and $\mathbf{B}$. We consider the corresponding group-element basis ${\cal B}_G= \{|g\rangle: g\in G\}$ as defined in (\[basis\]). We set ${\cal B}_G$ to be (what we call) the *designated basis* of the computation. The group $G$ that labels $\mathcal{B}_G$ choice of basis will determine what normalizer gates (read below). $\mathcal{B}_G$ will be the basis in which measurements are performed.

**Automorphism gates.** The definition of automorphism gates is similar to above, but now the action of these gates is defined relative to the *designated basis*. That is, we consider a group automorphism $\alpha:G\rightarrow G$ and define the corresponding automorphism gate $U_{\alpha}$ by its action on the basis ${\cal B}_G$, as follows: $U_\alpha:\ket{h}\rightarrow\ket{\alpha(h)}$. As above, automorphism gates are given as oracles. Furthermore, in the infinite case we impose that the group automorphism must be a *continuous* map.

**Quadratic phase gates.** The action of quadratic gates is also defined relative to the designated basis. A function $\chi:G\rightarrow U(1)$ is called a character if its continuous and if $\chi(g+h) =\chi(g)\chi(h)$ for every $g, h\in G$. A function $B:G\times G\to U(1)$ is said to be a bicharacter if it is a character in both arguments. A function $\xi:G\rightarrow U(1)$ is called *quadratic* if it is continuous and if $$\xi(g+h)=\xi(g)\xi(h)B(g,h),\quad \text{for every $g$, $h\in G$}$$ for some bicharacter $B(g,h)$. A quadratic phase gate is any diagonal unitary operation acting on ${\cal B}_G$ as $D_{\xi}: \ket{h}\rightarrow \xi(h)\ket{h}$, where $\xi$ is a quadratic function of $G$. As above, quadratic gates are given as oracles.

**Quantum Fourier transforms.** In contrast to both automorphism gates and quadratic phase gates, which leave the designated basis unchanged, the role of the quantum Fourier transform (QFT) is *precisely* to change the designated basis ${\cal B}_G$ (at a given time) into another group-element basis ${\cal B}_{G'}$. This transformation follows certain rules [@BermejoLinVdN13_Infinite_Normalizers], described next.

Roughly speaking, the QFT of $\mathcal{H}_\Z$ is a basis change between the standard and the Fourier basis (\[eq:Fourier basis state of Z\]). Note that the QFT over $\Z_N$, which we introduced as a gate (\[eq:QFT over Z\_N\]), could be defined also in this way (as a change of basis). However, the Fourier transform has now more exotic features than their finite-dimensional counterparts. First, strictly speaking, the QFT over $\mathcal{H}_\Z$ is not a *quantum gate*: despite being a change of basis, it does not define a unitary rotation. Second, there are actually *two* inequivalent Fourier transforms of $\mathcal{H}_\Z$. These technicalities deserve further discussion.

**QFTs over $\mathcal{H}_\Z$ are not gates**. In the case of ${\cal H}_N$, both the standard and the Fourier basis have the same cardinality (since $\Z_N$ is isomorphic to its character group) and such a change of basis can be actively performed by means of a unitary rotation, which defines the QFT over $\Z_N$. In the case of ${\cal H}_{\Z}$, the standard basis $\{|x\rangle: x\in \Z\}$ and Fourier basis $\{|p\rangle: p\in \T\}$ have different cardinality (recall section \[sect\_Hilbert\_space\_Z\]) and cannot be “rotated” into each other. Therefore, the QFT, while corresponding to a change of basis, will as such not be a unitary gate in the usual sense[^10]. Because of this asymmetry, there are **two QFTs**, defined as follows.

-   **QFT over $\Z$**. If the standard basis ($\Z$ basis) is the designated basis of ${\cal H}_{\Z}$, states are represented as |= \_[x]{} (x) |x. Gates are defined according to this (integer) basis, which is also our measurement basis. When we say that the *QFT over $\Z$* is applied to $|\psi\rangle$, we mean that the designated basis is changed from the standard basis to the Fourier basis. The state does not actually change (no gate is physically applied[^11]), but the normalizer gates acting after the QFT will be associated with $\T$ (*not* $\Z$), and measurements will be performed in the $\T$ basis. We therefore ought to write the wavefunction of the state $\ket{\psi}$ in the Fourier basis: $$\label{eq:Fourier transform over Z}
        |\psi\rangle= \int_{\mathbb{T}}\mbox{d}p\  \hat\psi(p) |p\rangle \quad\mbox{ with } \hat\psi(p):=  \sum_{x\in\mathbb{Z}} e^{2\pi i px} \psi(x).$$

-   **QFT over $\boldsymbol{\mathbb{T}}$.** In the opposite case, the designated basis of ${\cal H}_{\Z}$ is the Fourier basis, in which a state looks like |= \_p  (p) |p. When we say that the *QFT over $\T$* is applied to $|\psi\rangle$, we mean that the designated basis is changed from the Fourier basis to the standard basis. Like in the previous case, we must re-express the state $|\psi\rangle$ in the new designated basis: $$\label{eq:Fourier transform over T}
        |\psi\rangle= \sum_{x\in\mathbb{Z}} \hat\psi(x) |x\rangle \quad\mbox{ with } \hat\psi(x):=  \int_{\mathbb{T}}\mbox{d}p\ e^{2\pi i px} \psi(p).$$

Note that, by definition, the QFT over $\Z$ may only be applied if the designated basis is the standard basis and, conversely, the QFT over $\T$ may only be applied of the designated basis is the Fourier basis.\
**Full and partial QFTs over $G$.** We last consider the total Hilbert space ${\cal H}$ with designated basis ${\cal B}_G$. We allow for the application of a QFT on any of the individual spaces ${\cal H}_{N_i}$ or ${\cal H}_{\Z}$ in the tensor product decomposition of ${\cal H}$ (we call this a *partial QFT*). The designated basis is changed according to the rules described above on all subsystems ${\cal H}_{\Z}$ where a QFT is applied. The full *QFT over $G$* is the combination of all partial QFTs acting on the smaller registers.

The black-box normalizer circuit model {#sect:circuit model}
--------------------------------------

We are now ready to introduce normalizer circuits in precise terms. Roughly speaking, a ***black-box normalizer circuit*** of size $T$ is a quantum circuit ${\cal C}=U_T\cdots U_1$ composed of $T$ *normalizer gates* $U_i$, which we have introduced in the previous sections. More precisely, a *normalizer circuit over $G=\Z^{a+b}\times\DProd{N}{c}\times\mathbf{B}$* is a quantum circuit that acts on a Hilbert space ${\cal H}$ associated with the group $G$. $$\mathcal{H}=\mathcal{H}_\Z^{a}\otimes\mathcal{H}_\Z^{b}\otimes \left(\mathcal{H}_{N_1}\otimes \cdots \otimes\mathcal{H}_{N_c}\right)\otimes \mathcal{H}_\mathbf{B}.$$ In this decomposition, the parameters $a$, $b$, $c$, $N_i$ and the Abelian black-box group $\mathbf{B}$ can be chosen arbitrarily.

To define a complete circuit model, we specify next the allowed inputs, gates and measurements of the computation.

-   ***Designated basis.*** In a normalizer computation there is no fixed “standard basis”, in the usual sense of the word that comes from the standard model of quantum circuits [@nielsen_chuang]. Instead, there is a ***designated basis*** ${\cal B}_{G_t}$ at every time step $t$ of the circuit, that is subject to change along the computation. ${\cal B}_{G_t}$ is restricted to be group-element basis, as in equation (\[basis\]).

-   ***Input states***. The input states of a normalizer computation are elements of some designated group basis $\mathcal{B}_{G_0}$ at time zero[^12]. Without loss of generality, we assume that the registers $\mathcal{H}_\Z^a$ and $\mathcal{H}_\Z^b$ are fed, respectively, with standard-basis $\ket{n}$, $n\in \Z$ and Fourier-basis states $\ket{p}$, $p\in \T$. In our notation, this is equivalent to choosing the basis $\mathcal{B}_{G_0}$ with $G_0=\Z^a \times \T^b \times \DProd{N}{c}\times \mathbf{B}$.

-   ***Structure of the circuit***:

    -   At time $t=1$, the gate $U_1$ is applied, which is either an automorphism gate, quadratic phase gate over $G_0$ or a QFT. Recall that automorphism gates and quadratic phase gates are given as black boxes. The designated basis is changed from ${\cal B}_{G_0}$ to ${\cal B}_{G_1}$, for some group $G_1$ in the family (\[group\_labels\_basis\]), which is only different from $G_0$ if a QFT is applied (recall the update rules from the previous section).

    -   At time $t=2$, the gate $U_1$ is applied, which is, again, either an automorphism gate, quadratic phase gate or a QFT over $G_1$. The designated basis is changed from ${\cal B}_{G_1}$ to ${\cal B}_{G_2}$, for some group $G_2$.

    -   The gates $U_3, \dots, U_t$ are considered similarly. We denote by ${\cal B}_{G_t}$ the designated basis after application of $U_t$ (for some group $G_t$ in the family (\[group\_labels\_basis\])), for all $t=3, \dots, T$. Thus, after all gates have been applied, the designated basis is $G_T$.

    -   After the circuit, a measurement in the designated basis $G_T$ is performed.

### Precision requirements {#precision-requirements .unnumbered}

In the model of quantum circuits above, input states and final measurements in the Fourier-basis $\{\ket{p}, p\in\T\}$ of $\mathcal{H}_\Z$ can never be implemented with perfect accuracy, a limitation that stems from the fact that the $\ket{p}$ states are *unphysical*. This can be quickly seen in two ways: first, in the $\Z$ basis, these states are infinitely-spread plane-waves $\ket{p}=\sum \overline{\euler^{2\pii zp}} \ket{z}$; second, in the $\T$ basis, they are infinitely-localized Dirac-delta pulses. Physically, preparing Fourier-basis states or measuring in this basis *perfectly* would require infinite energy and lead to infinite precision issues in our computational model.

In the algorithms we study in this work (namely, the order-finding algorithm in theorem \[thm:Order Finding\]), Fourier states over $\Z$ can be substituted with ***realistic physical approximations***. The degree of *precision* used in the process of Fourier state preparation is treated as a *computational resource*. We model the precision used in a computation as follows.

Since our goal is to use the Fourier basis $\ket{p}$, $p\in \T$, to represent information in a computation, we require the ability to store and retrieve information in this continuous-variable basis. Our assumption is that for any set $X$ with cardinality $d=|X|$, we can divide the continuous circle-group $\T$ spectrum into $d$ equally sized sectors of length $1/d$ and use them to represent the elements of $X$. More precisely, to each element of $X$ we assign a number in $\Z_d$. The element $x_i\in X$ with index $i\in\Z_d$ is then represented by any state of the subspace $V_{i,d}=\mathrm{span}\{\ket{\tfrac{i}{d}+\Delta} \textnormal{ with }|\Delta|  <\tfrac{1}{2d}\}$. We call the latter states *$d$-approximate Fourier states* and refer to $d$ as the *precision level* of the computation. We assume that these states can be prepared and distinguished to any desired precision $d$ in the following way:

-   **State preparation assumption.** Inputs $\ket{\psi_i}$ with at least $\tfrac{2}{3}$ fidelity to some element of $V_{i,d}$ can be prepared for any $i\in \Z_d$.

-   **Distinguishability assumption.** The subspaces $V_{i,d}$ can be reliably distinguished.

Note that $d$ determines how much information is stored in the Fourier basis.

A *quantum algorithm* that uses $d$-approximate Fourier states to solve a computational problem with input size $n$ is said to use an *efficient* amount of precision if and only $   \log{d}$ is upper bounded by some polynomial of $n$. Analogously, an algorithm that stores information in the standard basis $\{\ket{m},\,m\in\Z\}$ is said to be *efficient* if the states with $m$ larger than some threshold $\log{( m_\textrm{max})}\in O(\poly{n})$ do not play a role in the computation.

### Classical encodings for normalizer gates {#classical-encodings-for-normalizer-gates .unnumbered}

We finish this section discussing how the normalizer gates of a given normalizer circuit are presented in a classical encoding. Since quantum Fourier transforms can be specified by mere bit strings storing the circuit locations where they act, we focus on automorphism and quadratic phase gates. We again let $G=\Z^a \times \T^b\times \DProd{N}{c}\times \mathbf{B}$ be the group that defines the designated basis $\mathcal{B}_G$ in a normalizer circuit and define $m=a+b+c$.

From now on, we restrict ourselves to studying group automorphisms and quadratic functions which are *efficiently computable rational functions*. This limits the class of *classical functions* that we consider.

1.  **Rational.[^13]** An automorphism (or an arbitrary function) $\alpha:G\rightarrow G$ is rational if it returns rational outputs for all rational inputs. A quadratic function $\xi$ is rational if it can be written in the form $\xi(g)=\exp\left(2\pii\, q(g) \right)$ where $q$ is a rational function from $G$ into $\R$ modulo $2\Z$.

2.  **Efficiently computable.** $\alpha$ and $q$ can be computed by polynomial-time uniform family of classical circuits $\{\alpha_i\}$, $\{q_i\}$. All $\alpha_i$, $q_i$ are $\ppoly{m,i}$ size classical circuits that query the *black-box group oracle* at most $\ppoly{m,i}$ times: their inputs are strings of rational numbers whose numerators and denominators are represented by $i$ classical bits (their size is $O(2^i)$). For any rational element $g\in G$ that can be represented with so many bits (if $G$ contains factors of the form $\T$ these are approximated by fractions), it holds that $\alpha_i(g)=\alpha(g)$ and $q_i(g)=q(g)$.

    In certain cases (see section \[sect:Quantum Algorithms\]) we will consider groups like $\Z_N^\times$ which, strictly speaking, are not black-box groups (because polynomial time algorithms for group multiplication for them are available and there is no need to introduce oracles). In those cases, the queries to the black-box group oracle (in the above model) are substitute by some efficient subroutine.

We add a third restriction to the above.

-   **Precision bound.** For any $q$ or $\alpha$ that acts on an *infinite* group a bound $n_\textrm{out}$ is given so that for every $i$, the number of bits needed to specify the numerators and denominators in the output of $q_i$ or $\alpha_i$ exactly is at most $i+n_{\mathrm{out}}$. The bound $n_\textrm{out}$ is independent of $i$ and indicates how much the input of each function may grow or shrink along the computation of the output[^14]. This bound is used to correctly store the output of maps $\alpha:\Z^a\rightarrow \Z^a$, $\alpha':\Z^a\rightarrow \T^a$ and to detect whether the output of a function $\alpha'':\T^b \rightarrow \T^b$ might get truncated modulo 1.

The allowed automorphism gates $U_\alpha$ and quadratic phase gates $D_\xi$ are those associated with efficiently computable rational functions $\alpha$, $\xi$. We ask these unitaries to be efficiently implementable as well[^15], by -size quantum circuits comprising at most quantum queries of the group oracle. The variable $i$ denotes the bit size used to store the labels $g$ of the inputs $\ket{g}$ and bounds the precision level $d$ of the normalizer computation, which we set to fulfill $\log d  \in O(i+n_\textrm{out})$. The complexity of a normalizer gate is measured by the number of gates and (quantum) oracle queries needed to implement them.

In the next section \[sect:Quantum Algorithms\], we will see particular examples of efficiently computable normalizer gates. We will repeatedly make use of automorphism gates of the form $$\nonumber
U_\alpha \ket{k_1,\ldots,k_m,x}\longrightarrow \ket{k_1,\ldots,k_m,b_1^{k_1}\cdots  b_m^{k_m}x}$$ where $k_i$ are integers and $b_j$, $x$ are elements of some black-box group $\mathbf{B}$. These gates are allowed in our model, since there exist well-known efficient classical circuits for modular exponentiation given access to a group multiplication oracle [@brent_zimmerman10CompArithmetic]. In this case, a precision bound can be easily computed: since the infinite elements $k_i$ do not change in size and all the elements of $\mathbf{B}$ are specified with strings of the same size, the output of $\alpha$ can be represented with as many bits as the input and we can simply take $n_\textrm{out}= 0$ (no extra bits are needed).

Many examples of efficiently computable normalizer gates were given in [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem], for decomposed finite group $\DProd{N}{c}$. It was also shown in [@VDNest_12_QFTs] that all normalizer gates over such groups can be efficiently implemented.

Quantum algorithms {#sect:Quantum Algorithms}
==================

The discrete logarithm problem over $\Z_p^\times$ {#sect:Discrete Log}
-------------------------------------------------

In this section we consider the discrete-logarithm problem studied by Shor [@Shor]. For any prime number $p$, let $\Z_p^\times$ be the multiplicative group of non-zero integers modulo $p$. An instance of the discrete-log problem over $\Z_p^\times$ is determined by two elements $a$, $b\in \Z_p^\times$, such that $a$ generates the group $\Z_p^\times$. Our task is to find the smallest non-negative integer $s$ that is a solution to the equation $a^s=b \bmod{p}$; the number is called the discrete logarithm $s=\log_a b$.

We now review Shor’s algorithm [@Shor; @childs_vandam_10_qu_algorithms_algebraic_problems] for this problem and prove our first result.

\[**Discrete logarithm**\]\[thm:Discrete Log\] Shor’s quantum algorithm for the discrete logarithm problem over $\Z_p^\times$ is a black-box normalizer circuit over the group $\Z_{p-1}^2\times \Z_p^\times$.

Theorem \[thm:Discrete Log\] shows that black box normalizer circuits over *finite* Abelian groups can efficiently solve a problem for which no efficient classical algorithm is known. In addition, it tells us that black-box normalizer circuits can render widespread public-key cryptosystems vulnerable: namely, they break the Diffie-Helman key-exchange protocol [@DiffieHellman], whose security relies in the assumed classical intractability of the discrete-log problem.

Let us first recall the main steps in Shor’s discrete log algorithm.

\[alg:Discrete Log\]

Positive integers $a$, $b$, where $\Z_p^\times = \langle a \rangle $.

The least nonnegative integer $s$ such that $a^s\equiv b \pmod{p}$.

We will use three registers indexed by integers, the first two modulo $p-1$ and the last modulo $p$. The first two registers will correspond to the additive group $\Z_{p-1}$, while the third register will correspond to the multiplicative group $\Z_p^\times$. Two important ingredients of the algorithm will be the unitary gates $U_a:\ket{s}\rightarrow\ket{sa}$ and $U_b:\ket{s}\rightarrow\ket{sb}$.

1.  **Initialization:** Start in the state $\ket{0}\ket{0}\ket{1}$.

2.  Create the superposition state $\frac{1}{p-1} \sum_{x,y=0}^{p-1} \ket{x} \ket{y} \ket{1} $, by applying the standard quantum Fourier transform on the first two registers.

3.  Apply the unitary $U$ defined by $U\ket{x}\ket{y} \ket{z} = \ket{x} \ket{y} \ket{za^xb^y}$, to obtain the state $$\frac{1}{p-1}\sum_{x,y=0}^{p-1} \ket{x} \ket{y} \ket{a^xb^y}$$ This is equivalent to applying the controlled-$U_a^x$ gate between the first and third registers, and the controlled-$U_b^y$ between the second and third registers.

4.  Measure and discard the third register. This step generates a so-called coset state $$\frac{1}{\sqrt{p-1}}\sum_{k=0}^{p-1} \ket{\gamma  +ks,-k},$$ where $\gamma$ is some uniformly random element of $\Z_{p-1}$ and $s$ is the discrete logarithm.

5.  Apply the quantum Fourier transform over $\Z_{p-1}$ to the first two registers, to obtain $$\frac{1}{\sqrt{p-1}}\sum_{k'=0}^{p-1} \euler^{2\pii \frac{k'\gamma}{p-1}}\ket{k',k's},$$

6.  Measure the system in the standard basis to obtain a pair of the form $(k',k's)\bmod{p}$ uniformly at random.

7.  Classical post-processing. By repeating the above process $n$ times, one can extract the discrete logarithm $s$ from these pairs with exponentially high probability (at least $1- 2^{-n}$), in classical polynomial time.

Note that the Hilbert space of the third register precisely corresponds to $\mathcal{H}_{\mathbf{B}}$ if we choose the black-box group to be $\mathbf{B}=\Z_p^\times$. It is now easy to realize that Shor’s algorithm for discrete log is a normalizer circuit over $\Z_{p-1}\times\Z_{p-1}\times\Z_{p}^\times$: steps 2 and 4 correspond to applying partial QFTs over $\Z_{p-1}$, and the gate $U$ applied in state 3 is a group automorphism over $\Z_{p-1}\times\Z_{p-1}\times\Z_{p}^\times$.

We stress that, in the proof above, there is no known efficient classical algorithm for solving the group decomposition problem for the group $\Z_p^\times$ (as we define it in section \[sect:Group Decomposition\]): although, by assumption, we know that $\Z_p^\times=\langle a \rangle \cong \Z_{p-1}$, this information does not allow us to convert elements from one representation to the other, since this requires solving the discrete-logarithm problem itself. In other words, we are unable to compute classically the *group isomorphism* $\Z_p^\times \cong \Z_{p-1}$. In our version of the group decomposition problem, we require the ability to *compute* this group isomorphism. For this reason, we treat the group $\Z_p^\times$ as a *black-box group*.

Shor’s factoring algorithm  {#sect:Factoring}
---------------------------

In this section we will show that normalizer circuits can efficiently compute the order of elements of (suitably encoded) Abelian groups. Specifically, we show how to efficiently solve the [order finding problem]{} for every (finite) Abelian black-box group $\mathbf{B}$ [@BabaiSzmeredi_Complexity_MatrixGroup_Problems_I] with normalizer circuits. Due to the well-known classical reduction of the factoring problem to the problem of computing orders of elements of the group $\Z_N^\times$, our result implies that black-box normalizer circuits can efficiently factorize large composite numbers, and thus break the widely used RSA public-key cryptosystem [@RSA].

We briefly introduce the **order finding problem** over a black-box group $\mathbf{B}$, that we always assume to be finite and Abelian. In addition, we assume that the elements of the black-box group can be uniquely encoded with $n$-bit strings, for some known $n$. The task we consider is the following: given an element $a$ of $\mathbf{B}$, we want to compute the order $|a|$ of $a$ (the smallest positive integer $r$ with the property[^16] $a^r=1$). Our next theorem states that this version of the order finding problem can be efficiently solved by a quantum computer based on normalizer circuits.

\[thm:Order Finding\] Let $\mathbf{B}$ be a finite Abelian black-box group with an $n$-qubit encoding and $\mathcal{H}_\mathbf{B}$ be the Hilbert space associated with this group. Let $V_a$ be the unitary that performs the group multiplication operation on $\mathcal{H}_\mathbf{B}$: $V_a\ket{x}=\ket{ax}$. We denote by $c\mbox{\,-}V_a$ the unitary that performs $V_a$ on $\mathcal{H}_\mathbf{B}$ controlled on the value of an ancillary register $\mathcal{H}_\Z $: $$\notag
 \ket{m,x}\quad\xrightarrow{\quad c-U_{a}\quad}\quad\ket{m,a^mx},\qquad\textnormal{for any $m$ in } \Z.$$ Assume that we can query an oracle that implements $c\mbox{\,-}V_a$ in one time step for any $a\in \mathbf{B}$. Then, there exists a hybrid version of Shor’s order-finding algorithm, which can compute the order $|a|$ of any $a\in\mathbf{B}$ efficiently, using normalizer circuits over the group $\Z\times \mathbf{B}$ and classical post-processing. The algorithm runs in polynomial-time, uses an efficient amount of precision and succeeds with high probability.

In theorem \[thm:Order Finding\], by “efficient amount of precision” we mean that instead of preparing Fourier basis states of $\mathcal{H}_{\Z}$ or measuring on this (unphysical) basis, it is enough to use realistic physical approximations of these states (cf. section \[sect:Normalizer circuits over blackbox groups\]).

For simplicity, we assume that a generating set of $\mathbf{B}$ with $O(n)$ elements is given (otherwise we could generate one efficiently probabilistically by sampling elements of $\mathbf{B}$).

We divide the proof into two steps. In the first part, we give an infinite-precision quantum algorithm to randomly sample elements from the set $\mathrm{Out}_a=\{\frac{k}{|a|}: k\in \Z\}$ that uses normalizer circuits over the group $\Z\times\mathbf{B}$ in polynomially many steps. In this first algorithm, we assume that Fourier basis states of $\mathcal{H}_\Z$ can be prepared perfectly and that there are no physical limits in measurement precision; the outcomes $k/|a|$ will be stored with floating point arithmetic and with finite precision. The algorithm allows one to extract the period $|a|$ efficiently by sampling fractions $k/|a|$ (quantumly) and then using a continued fraction expansion (classically).

In the second part of the proof, we will remove the infinite precision assumption.

Our first algorithm is essentially a variation of Shor’s algorithm for order finding [@Shor] with one key modification: whereas Shor’s algorithm uses a large $n$-qubit register $\mathcal{H}_2^n$ to estimate the eigenvalues of the unitary $V_a$, we will replace this multiqubit register with a single *infinite* dimensional Hilbert space $\mathcal{H}_{\Z}$. The algorithm is *hybrid* in the sense that it involves both continuous- and discrete-variable registers. The key feature of this algorithm is that, at every time step, the implemented gates are *normalizer gates*, associated with the groups $\Z\times \Z_N^\times$ and $\T\times \Z_N^\times$ (which are, themselves, related via the partial Fourier transforms $\mathcal{F}_\Z$ and $\mathcal{F}_\T$). The algorithm succeeds with constant probability.

\[alg:Order Finding infinite precision\] $\,$

A black box (finite abelian) group $\mathbf{B}$, and an element $a \in \mathbf{B}$.

The order $s$ of $a$ in $\mathbf{B}$, i.e. the least positive integer $s$ such that $a^s = 1$.

We will use multiplicative notation for the black box group $\mathbf{B}$, and additive notation for all other subgroups.

1.  **Initialization:** Initialize $\mathcal{H}_\Z$ on the Fourier basis state $\ket{0}$ with $0\in \T$, and $\mathcal{H}_{\mathbf{B}}$ on the state $\ket{1}$, with $1\in \mathbf{B}$. In our formalism, we will regard $\ket{0,1}$ as a standard-basis state of the basis labeled by $\T\times\mathbf{B}$.

2.  Apply the Fourier transform $\mathcal{F_\T}$ to the register $\mathcal{H}_\Z$. This changes the designated basis of this register to be the one labeled by the group $\Z$. The state $\ket{0}$ in the new basis is an infinitely-spread comb of the form $\sum_{m\in\Z}\ket{m}$.

3.  Let the oracle $V_a$ act jointly on $\mathcal{H_\Z}\times \mathcal{H}_\mathbf{B}$; then the state is mapped in the following manner: $$\sum_{m\in\Z}\ket{m}\ket{1}\quad\xrightarrow{\quad c\mbox{\,-}V_a\quad }\quad\sum_{m\in \Z} \ket{m, a^m}.$$ Note that, in our formalism, the oracle $c\mbox{\,-}V_a$ can be regarded as an automorphism gate $U_\alpha$. Indeed, the gate implements a classical invertible function on the group $\alpha(m,x)=(m,a^mx)$. The function is, in addition, a continuous[^17] group automorphism, since $$\begin{aligned}
       \notag
    \alpha\left((m,x)(n,y)\right)=\alpha(m+n,xy)&=(m+n,(a^{m+n})(xy))\\&=(m+n,(a^{m}x)(a^{n}y))=(m,a^{m}x)(n,a^{n}y)\label{eq:ModExp is Automorphism}\\
    &=\alpha(m,x)\alpha(n,y).\notag\end{aligned}$$

4.  Measure and discard the register $\mathcal{H}_{\mathbf{B}}$. Say we obtain $a^s$ as the measurement outcome. Note that the function $a^m$ is periodic with period $r=|a|$, the order of the element. Due to periodicity, the state after measuring $a^s$ will be of the form $$\label{eq:Periodic State}
    \left(\sum_{j\in \Z} \ket{s+jr}\right) \ket{a^s}.$$ After dicarding $\mathcal{H}_{\mathbf{B}}$ we end up in a periodic state $\sum \ket{s+jr}$ which encodes $r=|a|$.

5.  Apply the Fourier transform $\mathcal{F_\Z}$ to the register $\mathcal{H}_\Z$. We work again in the Fourier basis of $\mathcal{H}_\Z$, which is labelled by the circle group $\T$. The periodic state $\sum\ket{s+jr}$ in the dual $\T$ basis reads [@oppenheim_Signals_and_Systems] $$\label{eq:Periodic state after Fourier Transform}
    \sum_{k=0}^{r-1} \euler^{2\pii \frac{sk}{r}} \ket{\tfrac{k}{r}}$$

6.  Measure $\mathcal{H}_{\Z}$ in the Fourier basis (the basis labeled by $\T$). Since we that the initial state of the computation is as close to $\ket{0}$ as we wish, the wavefunction of the final state (\[eq:Periodic state after Fourier Transform\]) is *sharply peaked* around values $p\in\T$ of the form $k/r$. As a result, a high resolution measurement will let us sample these numbers (within some floating-point precision window $\Delta$) nearly uniformly at random.

7.  **Classical postprocessing:** Repeat steps 1-7 a few times and use a (classical) continued-fraction expansion algorithm [@nielsen_chuang; @KLM_QC_07] to extract the order $r$ from the randomly sampled multiples $\{k_i/r\}_i$. This can be done, for instance, with an algorithm from [@Knill95onshors] that obtains $r$ with *constant* probability after sampling two numbers $\tfrac{k_1}{r}$, $\tfrac{k_2}{r}$, if the measurement resolution is high enough: $\Delta \leq 1/2r^2$ is enough for our purposes.

Manifestly, there is a strong similarity between algorithm \[alg:Order Finding infinite precision\] and Shor’s factoring algorithm: the quantum Fourier transforms $\mathcal{F}_\T$ in our algorithm $\mathcal{F}_\Z$ play the role of the discrete Fourier transorm $\mathcal{F}_{2^n}$, and $c\mbox{\,-}V_a$ acts as the modular exponentation gate [@Shor]. In fact, one can regard algorithm \[alg:Order Finding infinite precision\] as a “hybrid” version of Shor’s algorithm combining both continuous and discrete variable registers. The remarkable feature of this version of Shor’s algorithm is that the quantum part of the algorithm 1-6 is a normalizer computation.

Algorithm \[alg:Order Finding infinite precision\] is efficient if we just look at the number of gates it uses. However, the algorithm is *inefficient* in that it uses infinitely-spread Fourier states $\ket{p}=\sum_{m\in\Z}\euler^{-2\pii pm}\ket{m}$ (which are unphysical and cannot be prepared with finite computational resources) and arbitrarily precise measurements. We finish the proof of theorem \[thm:Order Finding\] by giving an improved algorithm that does not rely on unphysical requirements.

\[alg:Order Finding Finite precision\]$\,$

1.  **Initialization:** Initialize $\mathcal{H}_{\mathbf{B}}$ to $\ket{1}$. The register $\mathcal{H}_\Z$ will begin in an *approximate* Fourier basis state $\ket{\widetilde{0}}= \tfrac{1}{\sqrt{2M+1}}\sum_{-M}^{+M}\ket{m}$, i.e. a square pulse of length $2M+1$ in the integer basis, centered at 0. This step simulates steps 1-2 in algorithm \[alg:Order Finding infinite precision\].

2.  Repeat steps 3-4 of algorithm \[alg:Order Finding infinite precision\]. The state after obtaining the measurement outcome $a^s$ is now different due to the finite “length” of the comb $\sum_{m=0}^{M} \ket{m}$; we obtain $$\label{eq:Periodic state finite}
    |\psi\rangle =\frac{1}{\sqrt{L}}\sum_{-L_a}^{L_b}\ket{s+jr},$$ where $L=L_a+L_b+1$ and $s$ is obtained nearly uniformly at random from $\{ 0,\ldots, r-1\}$. The values $L_a$, $L_b$ are positive integers of of the form $\lfloor M/r\rfloor - \epsilon $ with $-2\leq \epsilon\leq 0$ (the particular value of $\epsilon$ depends on $s$, but it is irrelevant in our analysis). Consequently, we have $L=2\lfloor M/r\rfloor - (\epsilon_a +\epsilon_b)$.

3.  Apply the Fourier transform $\mathcal{F_\Z}$ to the register $\mathcal{H}_\Z$ . The wavefunction of the final state $\hat{\psi}$ is the Fourier transform of the wavefunction $\psi$ of (\[eq:Periodic state finite\]). We compute $\hat{\psi}$ using formula (\[eq:Fourier transform over Z\]): $$\begin{aligned}
     \hat{\psi}(p)&=\sum_{x\in\Z} \euler^{2\pii p x}\psi(x)=\frac{1}{\sqrt{L}}\sum_{-L_a}^{L_b} \euler^{2\pii p (s+jr)}=\frac{1}{\sqrt{L}} \left(\euler^{2\pii p s}\right)\frac{\euler^{2\pii p r (L_b+1)}-\euler^{-2\pii p r L_a}}{\euler^{2\pii p r }-1} \notag\\
     &= \frac{\euler^{2\pii p\left( s+\tfrac{L_b-L_a}{2}\right)}}{\sqrt{L}}  \frac{ \sin{ \left( \pi L pr  \right)} } { \sin{\left( \pi pr  \right)}} = \frac{\euler^{2\pii p\left(s +\tfrac{L_b-L_a}{2}\right) }}{\sqrt{L}} D_{L,r}({p})   \label{eq:Dirichlet State}\end{aligned}$$ (to derive the equation, we apply the summation formula of the geometric series and re-express the result in terms of the Dirichlet kernel [@rudin62_Fourier_Analysis_on_groups] $$\label{eq:Dirichlet Kernel}
    D_{L,r}(p)= \frac{\sin{ \left( \pi L pr \right)}}{\sin{\left( \pi pr  \right)}}.$$

4.  **Measure $\mathcal{H}_{\Z}$** in the Fourier basis. We show now that, if the resolution is high enough, then the probability distribution of measurement outcomes will be “polynomially close” to the one obtained in the infinite precision case (\[eq:Periodic state after Fourier Transform\]). Intuitively, this is a consequence of the fact that in the limit $M\rightarrow \infty$ (when the initial state becomes an infinitely-spread comb), we have also $L\rightarrow\infty$ and that the function $D_{L},r(p)$ converges to a train $\sum_{k=0}^{r-1} \delta_{k/r}(p)$ of Dirac measures [@rudin62_Fourier_Analysis_on_groups]. In addition, for a high finite value of $M$, we find that the probability of obtaining some outcome $p$ within a $\Delta=\tfrac{1}{Lr}$ window of a fraction $\tfrac{k}{r}$ is also high. $$\label{eq:Probability in Shor Infinite}
    \mathrm{Pr}(|p-\tfrac{k}{r}|\leq \tfrac{\Delta}{2})=\frac{1}{L} \int_{-\tfrac{\Delta}{2}}^{+\tfrac{\Delta}{2}} \frac{\sin^2{ \left( \pi L pr \right)}}{\sin^2{\left( \pi pr  \right)}}  \,\mathrm{d}p  \geq \tfrac{\Delta}{L}\frac{\sin^2{ \left( \tfrac{\uppi}{2} \right)}}{\sin^2{\left( \tfrac{\uppi}{2L}   \right)}} \geq \frac{4}{\uppi^2r},$$ where we use the mean value theorem and the bound $\sin(x)^2\leq x^2$. It follows that with *constant* probability (larger than $4/\pi^2\approx0.41$) the measurement will output some outcome $\tfrac{\Delta}{2}$-close to a number of the form $k/r$. (A tighter lower bound of $2/3$ for the success probability can be obtained by evaluating the integral numerically.)

    Lastly, note that although the derivation of (\[eq:Probability in Shor Infinite\]) implicitly assumes that the finial measurement is infinitely precise, it is enough to implement measurements with resolution close to $\Delta$. Due to the peaked shape of the final distribution (\[eq:Probability in Shor Infinite\]), it follows that $\Theta(\tfrac{1}{M})$ resolution is enough if our task is to sample $\tfrac{\Delta}{2}$-estimates of these fractions nearly uniformly at random; this scaling is *efficient* as a function of $M$ (cf. section \[sect:Normalizer circuits over blackbox groups\]).

5.  **Classical postprocessing:** We now set $M$ (the length of the initial comb state) to be large enough so that $\tfrac{\Delta}{2}=\tfrac{1}{2Lr}\leq \tfrac{1}{2r^2}$; taking $\log M = O(\poly n)$ is enough for our purposes. With such an $M$, the measurement step 6 will output a number $p$ that is $\tfrac{1}{2r^2}$ close to a $\tfrac{k}{r}$ with high probability, which can be increased to be arbitrarily close to 1 with a few repetitions. We then proceed as in step 7 of algorithm \[alg:Order Finding infinite precision\] to compute the order $r$.

### Shor’s algorithm as a normalizer circuit {#shors-algorithm-as-a-normalizer-circuit .unnumbered}

Our discussion in the previous section reveals strong a resemblance between our hybrid normalizer quantum algorithm for order finding and Shor’s original quantum algorithm for this problem [@Shor]: indeed, both quantum algorithms employ remarkably similar circuitry. In this section we show that this resemblance is actually more than a mere fortuitous analogy, and that, in fact, one can understand Shor’s original order-finding algorithm as a discretized version of our finite-precision hybrid algorithm for order finding \[alg:Order Finding infinite precision\].

\[thm:Shor normalizer\] Shor’s order-finding algorithm [@Shor] provides an efficient discretized implementation of our hybrid normalizer algorithm \[alg:Order Finding Finite precision\].

Note that the theorem does not imply that all possible quantum algorithms for order finding are normalizer circuits (or discretized versions of some normalizer circuit). What it shows is that the one first found by Shor in [@Shor] does exhibit such a structure.

Our approach will be to show explicitly that the evolution of the initial quantum state in Shor’s algorithm is analogous to that of the initial state in algorithm \[alg:Order Finding Finite precision\] if we discretize the computation. Recall that Shor’s algorithm implements a quantum phase estimation [@kitaev_phase_estimation] for the unitary $V_a$. Let $D$ be the dimension of the Hilbert space used to record such phase. We assume $D$ to be odd[^18] and write $D=2M+1$. Then Shor’s algorithm can be written as follows:

1.  Initialize the state $\ket{0,1}$ on the Hilbert space $\mathcal{H}_D\times \mathcal{H}_{\Z_N^\times}$.

2.  Apply the discrete Fourier transform $\mathcal{F}_{\Z_D}$ on $\mathcal{H}_D$ to obtain $$\sum_{m=0}^{D-1} \ket{m}\ket{1}=\sum_{-M}^{M} \ket{m}\ket{1}.$$ So far, we have simulated step 1 in algorithm \[alg:Order Finding Finite precision\] by constructing the same periodic state. These first two steps are also clearly analogous to steps 1-2 in algorithm \[alg:Order Finding infinite precision\].

3.  Apply the modular exponentiation gate $U_{\mathrm{me}}$, which is the following unitary [@Shor] $$\label{eq:Modular Exponentiation Gate}
    U_{\mathrm{me}}\ket{m,x}=\ket{m,a^mx },$$ to the state. Measure the register $\mathcal{H}_{\Z_N^\times}$ in the standard basis. We obtain, again, a quantum state of the form (\[eq:Periodic state finite\]), with $L\leq D$.

4.  We apply the discrete Fourier transform $\mathcal{F}_{\Z_D}$ to the register $\mathcal{H}_{\Z_D}$ again. We claim now that the output state will be a discretized version of (\[eq:Dirichlet State\]) due to a remarkable **mathematical correspondence** between Fourier transforms. Note that any quantum state $\ket{\psi}$ of the infinite-dimensional Hilbert space $\mathcal{H}_{\Z}$ can be regarded as a quantum state of $\mathcal{H}_{D}$ given that the support of $\ket{\psi}$ is limited to the standard basis states $\ket{0}, \ket{\pm 1}, \ldots, \ket{\pm M}$. Let us denote the latter state $\ket{\psi_D}$ to distinguish both. Then, we observe a correspondence between letting $\mathcal{F}_\Z$ act on $\ket{\psi}$ and letting $\mathcal{F}_{\Z_D}$ act on $\ket{\psi_D}$. $$\label{eq:Fourier Correspondence}
     \displaystyle\hat{\psi}(p)= \sum_{x=-M}^{x=+M} \euler^{2\pii p x}\psi(x)\qquad \longleftrightarrow\qquad\displaystyle\hat{\psi}_D(k)= \sum_{x=-M}^{x=+M} \euler^{2\pii \tfrac{kx}{D}}\psi_D(x)$$ The correspondence (equation \[eq:Fourier Correspondence\]) tells us that, since we have $\psi(x)=\psi_D(x)$, it follows that the Fourier transformed function $\hat{\psi}_D(k)$ is precisely the function $\hat{\psi}(p)$ evaluated at points of the form $p=\tfrac{k}{D}$. The final state can be written as $$\label{eq:Discretized Shor Output}
    \sum_{k=0}^{D-1} \hat{\psi}\left(\tfrac{k}{D}\right)\ket{k}.$$ which is, indeed, a discretized version of (\[eq:Dirichlet State\]).

5.  The last steps of Shor’s algorithm are identical to 7-8 in algorithm \[alg:Order Finding Finite precision\], with the only difference being that the wavefunction (\[eq:Discretized Shor Output\]) is now a discretization of (\[eq:Dirichlet State\]). The probability of measuring a number $k$ such that $\tfrac{k}{D}$ is close to a multiple of the form $\tfrac{k'}{r}$ will again be high, due to the properties of the Dirichlet kernel (\[eq:Dirichlet Kernel\]). Indeed, one can show (see, e.g. [@childs_vandam_10_qu_algorithms_algebraic_problems]) with an argument similar to (\[eq:Probability in Shor Infinite\]) that, by setting $D=N^2$, the algorithm outputs with constant probability and almost uniformly a fraction $\tfrac{k}{D}$ among the two closest fraction to some value of the form $k/r$ (see e.g. [@Shor] for details). The period $r$ can be recovered, again, with a continued fraction expansion.

### Normalizer gates over $\infty$ groups are necessary to factorize {#normalizer-gates-over-infty-groups-are-necessary-to-factorize .unnumbered}

At this point, it is a natural question to ask whether it is necessary at all to replace the Hilbert space $\mathcal{H}_2^n$ with an infinite-dimensional space $\mathcal{H}_\Z$ with an integer basis in order to be able to factorize with normalizer circuits. We discuss in this section that, in the view of the authors, this is a **key indispensable ingredient** of our proof.

We begin our discussion by showing rigorously, in the black-box set-up, that no quantum algorithm for factoring based on *modular exponentation* gates (controlled $V_a$ rotations) can be efficiently implemented with normalizer circuits over finite Abelian groups, in a strong sense.

\[thm:ModExp requires Z\] Let $\mathcal{H}_M$ be the Hilbert space with basis $\{\ket{0},\ldots,\ket{M-1}\}$ and dimension $M$. Let $\mathbf{B}$ be an Abelian black-box group with associated Hilbert space $\mathcal{H}_{\mathbf{B}}$. Consider the composite Hilbert space $\mathcal{H}=\mathcal{H}_M\times \mathcal{H}_{\mathbf{B}}$ and define $U_\mathrm{me}$ to be the unitary gate on $\mathcal{H}$ defined as $U_{\mathrm{me}}\ket{m,x}=\ket{m,a^mx }$, where $a,x \in \mathbf{B}$ and $m\in\Z_M$. Then, unless $M$ is a multiple of the order of $a$, there does not exist any normalizer circuit over $\mathcal{H}$ (even of exponential size) satisfying $\|\mathcal{C}-U_\mathrm{me} \|_{\mathrm{op}}\leq1-{2}^{-1/2}$.

We prove the theorem in appendix \[app:ModExp requires Z\]. We highlight that a similar result was proven in [@VDNest_12_QFTs theorem 2]: that normalizer circuits over groups of the form $\Z_{2^n}\times\Z_N$ also fail to approximate the modular exponentiation. Also, we point out that it is easy to see that the converse of theorem \[thm:ModExp requires Z\] is also true: if $|a|$ divides $M$, then an argument similar to (\[inproof:Ume is no Clifford\]) shows that $(m,x)\rightarrow(m,a^mx)$ is a group automorphism of $\Z_M\times \mathbf{B}$, and the gate $U_\mathrm{mf}$ automatically becomes a normalizer automorphism gate.

The main implication of theorem \[thm:ModExp requires Z\] is that finite-group normalizer circuits *cannot* implement nor approximate the quantum modular exponentiation gate between $\mathcal{H}_\mathbf{B}$, playing the role of the target system, and some ancillary control system, *unless* a multiple $M=\lambda |a|$ of the order of $a$ is known in advance. Yet the problem of finding multiples of orders is *at least as hard as factoring and order-finding*: for $\mathbf{B}=\Z_N^\times$, a subroutine to find multiples of orders can be used to efficiently compute classically a multiple of the order of the group $\varphi(N)$, where $\varphi$ is the Euler totient function, and it is known that factoring is polynomial-time reducible to the problem of finding a single multiple of the form $\lambda\varphi(N)$ [@Shoup08_A_Computational_Introducttion_to_Number_Theory_and_Algebra].

We arrive to the conclusion that, unless we are in the trivial case where we know how to factorize in advanced, a factoring algorithm based on finite-group normalizer gates cannot comprise controlled-$V_a$ rotations. We further conjecture that any other approach based on finite-group normalizer gates cannot work either.

\[conj: Factoring not over finite groups\] Unless factoring is contained in [BPP]{.nodecor}, there is no efficient quantum algorithm to solve the factoring problem using only normalizer circuits over finite Abelian groups (even when these are allowed to be black-box groups) and classical pre- and post-processing.

We back up our conjecture with two facts. On one hand, Shor’s algorithm for factoring [@Shor] (to our knowledge, the only quantum algorithm for factoring thus far) uses a modular exponentiation gate to estimate the phases of the unitary $V_a$, and these gates are hard to implement with finite-group normalizer circuits due to theorem \[thm:ModExp requires Z\]. On the other hand, the reason why this does works for the group $\Z$ seems to be, in the view of the authors, intimately related to the fact that the order-finding problem can be naturally casted as an instance of the Abelian ***hidden subgroup problem*** over $\Z$ (see also section \[sect:Abelian HSPs\]). Note that, although one can always cast the order-finding problem as an HSP over any finite group $\Z_{\lambda \varphi(N)}$ for an integer $\lambda$, this formulation of the problem is unnatural in our setting, as it requires (again) the prior knowledge of a multiple of $\varphi(N)$, which we could use to factorize and find orders classically without the need of a quantum computer [@Shoup08_A_Computational_Introducttion_to_Number_Theory_and_Algebra].

Elliptic curves {#sect:Elliptic Curve}
---------------

In the previous sections we have seen that black-box normalizer circuits can compute discrete logarithm in $\Z_p^\times$ and break the Diffie-Hellman key exchange protocol. In the proof, we showed that Shor’s algorithm for this problem decomposes naturally in terms of normalizer gates over $\Z_p^\times$, treated as a black-box group.

It is known that Shor’s algorithm can be adapted in order to compute discrete logarithms over arbitrary black-box groups. In particular, this can be done for the group of solutions $E$ of an elliptic curve [@ProosZalka03_Shors_DiscreteLog_Elliptic_Curves; @Kaye05_optimized_Quantum_Elliptic_Curve; @CheungMaslovMathew08_Design_QuantumAttack_Elliptic_CC], thereby rendering elliptic curve cryptography (ECC) vulnerable. Efficient unique encodings and fast multiplication algorithms for these groups are known, so that they can be formally treated as black-box groups. In this section, we show that a quantum algorithm given by Proos and Zalka [@ProosZalka03_Shors_DiscreteLog_Elliptic_Curves] to compute discrete logarithms over elliptic curves can be implemented with black-box normalizer circuits.

### Basic notions {#basic-notions .unnumbered}

To begin, we review some rudiments of the theory of elliptic curves. For simplicity, our survey focuses only on the particular types of elliptic curves that were studied in [@ProosZalka03_Shors_DiscreteLog_Elliptic_Curves], over fields with characteristic different than 2 and 3. Our discussion applies equally to the (more general) cases considered in [@Kaye05_optimized_Quantum_Elliptic_Curve; @CheungMaslovMathew08_Design_QuantumAttack_Elliptic_CC], although the definition of the elliptic curve group operation becomes more cumbersome in such settings[^19]. For more details on the subject, in general, we refer the reader to [@childs_vandam_10_qu_algorithms_algebraic_problems; @lorenzini1997invitation].

Let $p> 3$ be prime and let $K$ be the field defined by endowing the set $\Z_p$ with the addition and multiplication operations modulo $p$. An *elliptic curve* $E$ over the field $K$ s a finite Abelian group formed by the solutions $(x,y)\in K\times K$ to an equation $$\label{eq:Elliptic Curve}
C:y^2 = x^3 + \alpha x + \beta$$ together with a special element $O$ called the “point at infinity”; the coefficients $\alpha$, $\beta$ in this equation live in the field $K$. The discriminant $\Delta:=-16(4\alpha^3 + 27 \beta^2)$ is nonzero, ensuring that the curve is non-singular. The elements of $E$ are endowed with a commutative group operation. If $P\in E$ then $P+O= O + P = P$. The inverse element $-P$ of $P$ is obtained by the reflection of $P$ about the $x$ axis. Given two elements $P=(x_P,y_P)$ and $Q=(x_Q,y_Q)\in E$, the element $P+Q$ is defined via the following rule: $$\label{eq:Elliptic curve group operation}
P+Q= 
\begin{cases}
O & \textnormal{if $P=(x_P,y_P)=(x_Q,-y_Q)=-Q$,}  \\
 -R& \textnormal{otherwise (read below).} 
\end{cases}$$ In the case $P\neq Q$, the point $R$ is computed as follows:

$$\begin{aligned}
x_{R} &=\lambda^2 - x_P - x_Q  \notag \\
y_{R} &= y_P- \lambda(x_P-x_{R})  \notag \end{aligned}$$

$$\lambda:=\notag
\begin{cases}
\tfrac{y_Q-y_P}{x_Q-x_P} & \textnormal{if $P\neq Q$} \\
 \tfrac{3 x_P^2+\alpha}{2 y_P} & \textnormal{if $P= Q$ and $y_P \neq 0$}
\end{cases}$$

\
$R$ can also be defined, geometrically, to be the “intersection between the elliptic curve and the line through $P$ and $Q$” (with a minus sign) [@childs_vandam_10_qu_algorithms_algebraic_problems].

It is not hard to check form the definitions above that the elliptic-curve group $E$ is finite and Abelian; from a computational point of view, the elements of $E$ can be stored with $n\in O(\log |K|)$ bits and the group operation can be computed in $O(\poly{n})$ time. Therefore, the group $E$ can be treated as a **black box group**.

Finally, the **discrete logarithm problem** (DLP) over an elliptic curve is defined in a way analogous to the $\Z_p^\times$ case, although now we use additive notation: given $a$, $b\in E$ such that $xa=b$ for some integer $x$; our task is to find the least nonnegative integer $s$ with that property. The elliptic-curve DLP is believed to be intractable for classical computers and can be used to define cryptosystems analog to Diffe-Hellman’s [@childs_vandam_10_qu_algorithms_algebraic_problems].

### Finding discrete logarithms over elliptic curves with normalizer circuits  {#finding-discrete-logarithms-over-elliptic-curves-with-normalizer-circuits .unnumbered}

In this section we review Proos-Zalka’s quantum approach to solve the DLP problem over an elliptic curve [@ProosZalka03_Shors_DiscreteLog_Elliptic_Curves]; their quantum algorithm is, essentially, a modification of Shor’s algorithm to solve the DLP over $\Z_p^\times$, which we covered in detail in section \[sect:Discrete Log\].

Our **main contribution** in this section is that Proos-Zalka’s algorithm can be implemented with normalizer circuits over the group $\Z\times \Z \times E$. The proof reduces to combining ideas from sections \[sect:Discrete Log\] and \[sect:Factoring\] and will be sketched in less detail.

\[alg:ProosZalka\] $\quad $

An elliptic curve with associated group $E$ (the group operation is defined as per (\[eq:Elliptic curve group operation\])), and two points $a,b \in E$. It is promised that $sa = b$ for some nonnegative integer $s$.

Find the least nonnegative integer $s$ such that $sa=b$.

1.  We use a register $\mathcal{H}_E$, where $E$ is the group associated with the elliptic curve (\[eq:Elliptic Curve\]), and two ancillary registers $\mathcal{H}$ of dimension $N=2^n$, associated with the group $A=\Z_N\times\Z_N$. The computation begins in the state $\ket{0,0,O}$, where $(0,0)\in A$ and $O\in E$.

2.  Fourier transforms are applied to the ancillas to create the superposition $\sum_{(x,y)\in A}\ket{x,y,O}$.

3.  The following transformation is applied unitarily: $$\sum_{(x,y)\in A}\ket{x,y,O}\quad  \xrightarrow{\quad c\mbox{\,-}U\quad } \quad \sum_{(x,y)\in A}\ket{x,y,xa + yb}.$$

4.  Fourier transforms are applied again over the ancillas and then measured, obtaining an outcome of the form $(x',y')$. These outcomes contain enough information to extract the number $s$, with similar post-processing techniques to those used in Shor’s DLP algorithm.

Algorithm \[alg:ProosZalka\] is not a normalizer circuit over $\Z_N\times \Z_N \times E$. Similarly to the factoring case, the algorithm would become a normalizer circuit if the classical transformation in step 3 was an automorphism gate; however, for this to occur, $N$ needs to be a common multiple of the orders of $a$ and $b$ (the validity of these claims follows with similar arguments to those in section \[sect:Factoring\]). In view of our results in sections \[sect:Discrete Log\] and \[sect:Factoring\], one can easily come up with two approaches to implement algorithm \[alg:Discrete Log\] using normalizer gates.

-   The first approach would be to use our normalizer version of Shor’s algorithm (theorem \[thm:Order Finding\]) to find the orders of the elements $a$ and $b$: normalizer gates over $\Z\times E$ would be used in this step. Then, the number $N$ in algorithm \[alg:ProosZalka\] can be set so that all the gates involved become normalizer gates over $\Z_N\times \Z_N \times E$.

-   Alternatively, one can choose not to compute the orders by making the ancillas infinite dimensional, just as we did in algorithm \[alg:Order Finding infinite precision\]. The algorithm becomes a normalizer circuit over $\Z\times \Z \times E$: as in algorithm \[alg:Order Finding infinite precision\], the ancillas are initialized to the zero Fourier basis state, and the discrete Fourier transforms are replaced by QFTs over $\T$ (in step 2) and $\Z$ (in step 4). A finite precision version of the algorithm can be obtained in the same fashion as we derived algorithm \[alg:Order Finding infinite precision\]. Proos-Zalka’s original algorithm could, again, be interpreted as a discretization of the resulting normalizer circuit.

The hidden subgroup problem {#sect:Abelian HSPs}
---------------------------

All problems we have considered this far—finding discrete logarithms and orders of Abelian group elements—fit inside a general class of problems known as hidden subgroup problems over Abelian groups [@Brassard_Hoyer97_Exact_Quantum_Algorithm_Simons_Problem; @Hoyer99Conjugated_operators; @MoscaEkert98_The_HSP_and_Eigenvalue_Estimation; @Damgard_QIP_note_HSP_algorithm]. Most quantum algorithms discovered in the early days of quantum computation solve problems that can be recasted as Abelian HSPs, including Deutsch’s problem [@Deutsch85quantumtheory], Simon’s [@Simon94onthe], order finding and discrete logarithms [@Shor], finding hidden linear functions [@Boneh95QCryptanalysis], testing shift-equivalence of polynomials [@Grigoriev97_testing_shift_equivalence_polynomials], and Kitaev’s Abelian stabilizer problem [@kitaev_phase_estimation; @Kitaev97_QCs:_algorithms_error_correction].

In view of our previous results, it is natural to ask how many of these problems can be solved within the normalizer framework. In this section we show that a well-known quantum algorithm that solves the Abelian HSPs (in full generality) can be modeled as a normalizer circuit over an Abelian group $\mathcal{O}$. Unlike previous cases, the group involved in this computation cannot be regarded as a black-box group, as it will not be clear how to perform group multiplications of its elements. This fact reflects the presence of oracular functions with unknown structure are present in the algorithm, to which the group $\mathcal{O}$ is associated; thus, we call $\mathcal{O}$ an *oracular group*. We will discuss, however, that this latter difference does not seem to be very substantial, and that the Abelian HSP algorithm can be naturally regarded as a normalizer computation.

### The quantum algorithm for the Abelian HSP {#the-quantum-algorithm-for-the-abelian-hsp .unnumbered}

In the *Abelian hidden subgroup* problem we are given a function $f:G\rightarrow X$ from an Abelian finite[^20] group $G$ to a finite set $X$. The function $f$ is constant on cosets of the form $g+H$, where $H$ is a subgroup “hidden” by the function; moreover, $f$ is different between different cosets. Given $f$ as a black-box, our task is to find such a subgroup $H$.

The Abelian HSP is a hard problem for classical computers, which need to query the oracle $f$ a superpolynomial amount of times in order to identify $H$ [@childs_vandam_10_qu_algorithms_algebraic_problems]. In contrast, a quantum computer can determine $H$ in polynomial time $O(\polylog{|G|})$, and using the same amount of queries to the oracle. We describe next a celebrated quantum algorithm for this task [@Brassard_Hoyer97_Exact_Quantum_Algorithm_Simons_Problem; @Hoyer99Conjugated_operators; @mosca_phd]. The algorithm is efficient given that the group $G$ is explicitly given[^21] in the form $G=\DProd{d}{m}$ [@mosca_phd; @cheung_mosca_01_decomp_abelian_groups; @Damgard_QIP_note_HSP_algorithm].

\[alg:HSP\] $ $

An explicitly decomposed finite abelian group $G=\DProd{d}{m}$, and oracular access to a function $f:\:G\rightarrow X$ for some set $X$. $f$ satisfies the promise that $f(g_1) = f(g_2)$ iff $g_1 = g_2+h$ for some $h \in H$, where $H\subseteq G$ is some fixed but unknown subgroup of $G$.

A generating set for $H$.

1.  Apply the QFT over the group $G$ to an initial state $\ket{0}$ in order to obtain a uniform superposition over the elements of the group $\sum_{g\in G}\ket{g}$.

2.  Query the oracle $f$ in an ancilla register, creating the state $$\frac{1}{\sqrt{|G|}}\sum_{g\in G}\ket{g,f(g)}$$

3.  The QFT over $G$ is applied to the first register, which is then measured.

4.  After repeating 1-3 polynomially many times, the obtained outcomes can be postprocessed classically to obtain a generating set of $H$ with exponentially high probability (we refer the reader to [@lomont_HSP_review] for details on this classical part).

We now claim that the quantum part of algorithm \[alg:HSP\] is a *normalizer circuit*, of a slightly more general kind than the ones we have already studied. The normalizer structure of the HSP-solving quantum circuit is, however, remarkably well-hidden compared to the other quantum algorithms that we have already studied. It is indeed a surprising fact that there is *any* normalizer structure in the circuit, due to the presence of an oracular function, whose inner structure appears to be completely unknown to us!

\[thm:HSP\] In any Abelian hidden subgroup problem, the subgroup-hiding property of the oracle function $f$ induces a group structure $\mathcal{O}$ in the set $X$. With respect to this hidden “linear structure”, the function $f$ becomes a group homomorphism, and the HSP-solving quantum circuit becomes a normalizer circuit over $G\times \mathcal{O}$.

The proof is the content of the next two sections.

### Unweaving the hidden-subgroup oracle {#unweaving-the-hidden-subgroup-oracle .unnumbered}

The key ingredient in the proof of the theorem (which is the content of the next section) is to realize that the oracle $f$ cannot fulfill the subgroup-hiding property without having a hidden homomorphism structure, which is also present in the quantum algorithm.

First, we show that $f$ induces a ***group structure*** on $X$. Without loss of generality, we assume that the function $f$ is surjective, so that $\mathrm{im}f = X$. (If this is not true, we can redefine $X$ to be the image of $f$.) Thus, for every element $x\in X$, the preimage $f^{-1}(x)$ is contained in $G$, and is a coset of the form $f^{-1}(x)= g_x+H$, where $H$ is the hidden subgroup and $f(g_x)=x$. With these observations in mind, we can define a group operation in $X$ as follows: $$\label{eq:Oracular Group Operation}
x\cdot y = \tilde{f}\left(f^{-1}(x)+f^{-1}(y)\right).$$ In (\[eq:Oracular Group Operation\]) we denote by $\tilde{f}$ the function $\tilde{f}(x+H)=f(x)$ that sends cosets $x+H$ to elements of $X$. The subgroup-hiding property guarantees that this function is well-defined; moreover, $f$ and $\tilde{f}$ are related via $f(x)=\tilde{f}(x+H)$. The addition operation on cosets $f^{-1}(x)=g_x+H$ and $f^{-1}(y)= g_y+H$ is just the usual group operation of the quotient group $G/H$ [@Humphrey96_Course_GroupTheory]: $$\label{eq:Factor Group DEfinition}
f^{-1}(x)+f^{-1}(y)=\left(g_x+H\right)+\left(g_y+H\right)=(g_x+g_y)+ H.$$ By combining the two expressions, we get an explicit formula for the group multiplication in terms of coset representatives: $x\cdot y = f(g_x+g_y)$. It is routine to check that this operation is associative and invertible, turning $X$ into a group, which we denote by $\mathcal{O}$. The neutral element of the group is the string $e$ in $X$ such that $e=f(0)=f(H)$, which we show explicitly: $$x\cdot e = e\cdot x= \tilde{f}\left(f^{-1}(x)+f^{-1}(e)\right) = \tilde{f}\left(f^{-1}(x)+ H \right) = x$$ The group $\mathcal{O}$ is manifestly finite and Abelian—the latter property is due to the fact that the addition (\[eq:Factor Group DEfinition\]) is commutative.

Lastly, it is straightforward to check that the oracle $f$ ***is a group homomorphism*** from $G$ to $\mathcal{O}$: for any $g$, $h\in G$ let $x:=f(g)$ and $y:=f(h)$, we have $$\begin{aligned}
\label{eq:HSP oracle is group homomorphism}
f(g+h)&=\tilde{f} \left(g+h+H\right)=\tilde{f} \left(\left(g+H\right)+\left(h+H\right)\right)=\tilde{f} \left(f^{-1}\left(x\right)+f^{-1}\left(y\right)\right)\\
&=x\cdot y = f(g)\cdot f(h).\end{aligned}$$ It follows from the first isomorphism theorem in group theory [@Humphrey96_Course_GroupTheory] that $\mathcal{O}$ is isomorphic to the quotient group $G/H$ via the map $\tilde{f}$.

### The HSP quantum algorithm is a normalizer circuit {#the-hsp-quantum-algorithm-is-a-normalizer-circuit .unnumbered}

We will now analyze the role of the different quantum gates used in algorithm \[alg:HSP\] and see that they are examples of normalizer gates over the group $G\times \mathcal{O}$, where $\mathcal{O}$ is the oracular group that we have just introduced.

The Hilbert space underlying the computation can be written as $\mathcal{H}_G\otimes \mathcal{H}_\mathcal{O}$ with the standard basis $\left\{\ket{g,x}:g\in G,\,x\in\mathcal{O}\right\}$. associated with this group. We will initialize the ancillary registers to the state $\ket{e}$, where $e=f(0)$ is the neutral element of the group; the total state at step 1 will be $\ket{0,e}$. The Fourier transforms in steps 1 and 3 are just partial QFTs over the group $G$, which are normalizer gates. The quantum state at the end of step 1 is $\sum \ket{g,e}$.

Next, we look now at step 2 of the computation: $$\sum \ket{g,e} \quad \longrightarrow \quad  \frac{1}{\sqrt{|G|}}\sum_{g\in G}\ket{g,f(g)}.$$ This step can be implemented by a normalizer automorphism gate defined as follows. Let $\alpha:G\times \mathcal{O}\rightarrow G\times \mathcal{O}$ be the function $\alpha(g, x)= (g, f(g)\cdot x)$. Using the fact that $f:G\rightarrow \mathcal{O}$ is a group homomorphism (\[eq:HSP oracle is group homomorphism\]), it is easy to check that $\alpha$ is a group automorphism of $G\times \mathcal{O}$. Then the evolution at step 2 corresponds to the action of the automorphism gate $U_\alpha$: $$U_\alpha \sum_g \ket{g,e}= \sum_g \ket{\alpha(g,e)} = \sum_g \ket{g,f(g)\cdot e} = \sum_g \ket{g,f(g)}.$$ Of course, our choice to begin the computation in the state $\ket{0,e}$ and to apply $U_\alpha$ in step 3 is only one possible way to implement the first three steps of the algorithm. We could have alternatively initialized the computation on some $\ket{0,0}$ state and used a slightly different gate $U_\textrm{add}=\sum \ket{g,x+f(g)}\bra{g,x}$ in step 3. The latter sequence of gates can however be regarded as an exact gate-by-gate simulation of the former, so that it is perfectly licit to call the algorithm a normalizer computation—at least up to steps 3 and 4.

Finally, note that in the last step of the algorithm we measure the $\mathcal{H}_G$ in the standard basis like a normalizer computation. Therefore, every step in the quantum algorithm \[alg:HSP\] corresponds to one of the allowed operations in a normalizer circuit over $G\times \mathcal{O}$. This finishes the proof of theorem \[thm:HSP\].

### The oracular group $\mathcal{O}$ is not a black-box group (but almost) {#sect:Oracular Group is not Black Box .unnumbered}

We ought to stress, at this point, that although theorem \[thm:HSP\] shows that the Abelian HSP quantum algorithm is a normalizer computation over an Abelian group $G\times \mathcal{O}$, the oracular group $\mathcal{O}$ is not a black-box group (as defined in section \[sect:Black Box Groups\]), since it is not clear how to compute the group operation (\[eq:Oracular Group Operation\]), due to our lack of knowledge about the oracular function which defines the multiplication rule. Yet, even in the absence of an efficiently computable group operation, we regard it natural to call the Abelian HSP quantum algorithm a normalizer circuit over $G\times \mathcal{O}$. Our reasons are multi-fold.

First, there is a manifest strong similarity between the quantum circuit in algorithm \[alg:HSP\] and the other normalizer circuits that we have studied in previous sections, which suggests that normalizer operations naturally capture the logic of the Abelian HSP quantum algorithm.

Second, it is in fact possible to argue that, although $\mathcal{O}$ is not a black-box group, it behaves *effectively* as a black-box group in the quantum algorithm. Observe that, although it is true that one cannot generally compute $x\cdot y$ for arbitrary $x,\,y\in \mathcal{O}$, it is indeed always possible to multiply any element $x$ by the neutral element $e$, since the computation is trivial in this case: $x\cdot e = e\cdot x = x$. Similarly, in the previous section, it is not clear at all how to implement the unitary transformation $U_\alpha\ket{g,x}=\ket{g,f(g)\cdot x}$ for arbitrary inputs. However, for the restricted set of inputs that we need in the quantum algorithm (which is just the state $\ket{e}$), it is trivial to implement the unitary, for in this case $U_\alpha\ket{g,e}=\ket{g,f(g)}$; since quantum queries to the oracle function are allowed (as in step 2 of the algorithm), the unitary can be simulated by such process, regardless of how it is implemented. Consequently, the circuit *effectively* behaves as a normalizer circuit over a black-box group.

Third, although the oracular model in the black-box normalizer circuit setting is slightly different from the one used in the Abelian HSP they are still *remarkably close* to each other. To see this, let $x_i$ be the elements of $X$ defined as $x_i:=f(e_i)$ where $e_i$ is the bit string containing a 1 in the $i$th position and zeroes elsewhere. Since the $e_i$s form a generating set of $G$, the $x_i$s generate the group $\mathcal{O}$. Moreover, the value of the function $f$ evaluated on an element $g=\sum g(i)e_i$ is $f(g)=x_1^{g(1)} x_2^{g(2)}\cdots  x_m^{g(m)}$, since $f$ is a group homomorphism. It follows from this expression that the group homomorphism is *implicitly multiplying* elements of the group $\mathcal{O}$. We cannot use this property to multiply elements of $\mathcal{O}$ ourselves, since everything happens at the hidden level. However, this observation shows that the assuming that $f$ is computable is *tightly related* to the assumption that we can multiply in $\mathcal{O}$, although slightly weaker. (See also the next section.)

Finally, we mention that this very last feature can be exploited to extend several of our main results, which we derive in the black-box setting, to the more-general “HSP oracular group setting” (although proofs become more technical). For details, we refer the reader to sections \[sect:Simulation\]-\[sect:Complete Problems\] and appendix \[app:Extending\].

### A connection to a result by Mosca and Ekert {#a-connection-to-a-result-by-mosca-and-ekert .unnumbered}

Prior to our work, it was observed by Mosca and Ekert [@MoscaEkert98_The_HSP_and_Eigenvalue_Estimation; @mosca_phd] that $f$ must have a hidden homomorphism structure, i.e. that $f$ can be decomposed as $\mathcal{E}\circ\alpha$ where $\alpha$ is a group homomorphism between $G$ and another Abelian group $Q\cong G/H$, and $\mathcal{E}$ is a one-to-one hiding function from $Q$ to the set $X$. In this decomposition, $\mathcal{E}$ hides the homomorphism structure of the oracle.

Our result differs from Mosca-Ekert’s in that we show that $X$ *itself* can always be viewed as a group, with a group operation that is induced by the oracle, with no need to know the decomposition $\mathcal{E}\circ\alpha$.

It is possible to relate both results as follows. Since both $Q$ and $\mathcal{O}$ are isomorphic to $G/H$, they are also mutually isomorphic. Explicitly, if $\beta$ is an isomorphism from $Q$ to $G/H$ (this map depends on the particular decomposition $f=\mathcal{E}\circ\alpha$), then $Q$ and $\mathcal{O}$ are isomorphic via the map $\tilde{f}\circ \beta$.

Decomposing finite Abelian groups {#sect:Group Decomposition}
---------------------------------

As mentioned earlier, there is a quantum algorithm for decomposing Abelian groups, due to Cheung and Mosca [@mosca_phd; @cheung_mosca_01_decomp_abelian_groups]. In this section, we will introduce this problem, and present a quantum algorithm that solves it, which uses only black-box normalizer circuits supplemented with classical computation. The algorithm we give is based on Cheung-Mosca’s, but it reveals some additional information about the structure of the black-box group. We will refer to it as the ***extended Cheung-Mosca’s algorithm***.

### The group decomposition problem {#the-group-decomposition-problem .unnumbered}

In this work, we define the **group decomposition** problem as follows. The input of the problem is a list of generators $\alpha=( \alpha_1,\cdots,\alpha_k)$ of some Abelian black-box group $\mathbf{B}$. Our task is to return a *group-decomposition table* for $\mathbf{B}$. A group-decomposition table is a tuple $(\alpha, \beta, A, B, c)$ consisting of the original string $\alpha$ and four additional elements:

1.  A new generating set $\beta={\beta_1,\ldots,\beta_\ell}$ with the property $\mathbf{B}=\langle \beta_1\rangle\oplus\cdots\oplus\langle \beta_\ell\rangle$. We will say that these new generators are *linearly independent*.

2.  An integer vector $c$ containing the orders of the linearly independent generators $\beta_i$.

3.  Two integer matrices $A$, $B$ that relate the old and new generators as follows: $$\label{eq:Matrix of Relationships}
    \begin{pmatrix}
     \beta_1,\ldots,\beta_\ell
    \end{pmatrix}=
    \begin{pmatrix}
    \alpha_1, 
    \ldots
    \alpha_k
    \end{pmatrix} A,\qquad\quad \begin{pmatrix}
    \alpha_1, 
    \ldots
    \alpha_k
    \end{pmatrix}= \begin{pmatrix}
     \beta_1,\ldots,\beta_\ell
    \end{pmatrix}B.$$ This last equation should be read in multiplicative notation (as in e.g. [@Cohen00_Advanced_Topics_ComputationalNumber_Theory]), where “vectors” of group elements are right-multiplied by matrices as follows: given the $i$th column $a_i$ of $A$ (for the left hand case), we have $\beta_{i}=(\alpha_1,\ldots,\alpha_k) a_i=\alpha_1^{a_i(1)}\cdots \alpha_k^{a_i(k)}$.

Our definition of the group decomposition is more general than the one given in [@mosca_phd; @cheung_mosca_01_decomp_abelian_groups]. In Cheung and Mosca’s formulation, the task is to find just $\beta$ and $c$. The algorithm they give also computes the matrix $A$ in order to find the generators $\beta_i$ (cf. the next section). What is completely new in our formulation is that we ask in addition for the matrix $B$.

Note that a [**group-decomposition table**]{} $(\alpha,\beta, A, B, c)$ contains a lot of information about the group structure of $\mathbf{B}$. First of all, the tuple elements (a-b) tell us that $\mathbf{B}$ is isomorphic to a decomposed group $G=\DProd{c}{k}$. In addition, the matrices $A$ and $B$ provide us with an efficient method to re-write linear combinations of the original generators $\alpha_i$ as linear combinations of the new generators $\beta_j$ (and vice-versa). Indeed, equation (\[eq:Matrix of Relationships\]) implies $$\begin{aligned}
\alpha_{1}^{x_1}\cdots \alpha_{k}^{x_k}&=  \begin{pmatrix}
\alpha_1, 
\ldots
\alpha_k
\end{pmatrix}x= \begin{pmatrix}
 \beta_1,\ldots,\beta_\ell
\end{pmatrix}(Bx) ,\quad\textnormal{  for any  $x\in\Z^k$,}\notag\\
\beta_{1}^{y_1}\cdots \beta_{1}^{y_\ell} &= \begin{pmatrix}
 \beta_1,\ldots,\beta_\ell
\end{pmatrix}y=
\begin{pmatrix}
\alpha_1, 
\ldots
\alpha_k
\end{pmatrix} (Ay),\quad\textnormal{  for any $y\in\Z^\ell$}.\notag\end{aligned}$$ It follows that, for any given $x$, the integer string $y=Bx$ (which can be efficiently computed classically) fulfills the condition $\alpha_{1}^{x_1}\cdots \alpha_{1}^{x_k}=\beta_{1}^{y_1}\cdots \beta_{1}^{y_\ell}$. (A symmetric argument proves the opposite direction.)

As we discussed earlier in the introduction, the group decomposition problem is *provably hard* for classical computers within the black-box setting, and it is at least *as hard as* Factoring (or Order Finding) for matrix groups of the form $\Z_N^\times$ (the latter being polynomial-time reducible to group decomposition). It can be also shown that group decomposition is also at least as hard as computing discrete logarithms, a fact that we will use in the proof of theorems \[thm:Simulation\], \[thm:No Go Theorem\]:

\[lemma:Multivariate Discrete Log\] Let $\beta_1,\ldots,\beta_\ell$ be generators of some Abelian black-box group $\mathbf{B}$ with the property $\mathbf{B}=\langle \beta_1\rangle\oplus\cdots\oplus\langle \beta_\ell\rangle$. Then, the following generalized version of the discrete-logarithm problem is polynomial time reducible to group decomposition: for a given $\beta\in\mathbf{B}$, find an integer string $x$ such that $\beta_{1}^{x_1}\cdots \beta_{\ell}^{x_\ell}=\beta$.

Define a new set of generators for $\mathbf{B}$ by adding the element $\beta_{\ell+1}=\beta$ to the given set $\{\beta_i\}$. The array $\alpha':=(\beta_1,\ldots,\beta_\ell+1)$ defines an instance of Group Decomposition. Assume that a group decomposition table $(\alpha', (\beta'_1,\ldots,\beta_m'), A', B', c')$ for this instance of the problem is given to us. We can now use the columns $b_i'$ of the matrix $B'$ to re-write the previous generators $\beta_i$ in terms of the new ones: $$\label{inproof:MultiVariate Discrete Log}
\beta_i = (\beta_1,\ldots,\beta_{\ell+1}) e_i = \begin{pmatrix}
 \beta_1',\ldots,\beta_m'
\end{pmatrix} (B'e_i) =  \begin{pmatrix}
 \beta_1',\ldots,\beta_m'
\end{pmatrix} b_i'=
 \beta_1'^{b_i'(1)}\cdots\beta_m'^{b_i'(m)}.$$ Here, $e_i$ denotes the integer vector with $e(i)=1$ and $e(j)=0$ elsewhere. Conditions (a-b) imply that the columns $b_i'$ can be treated as elements of the group $G=\DProd{c'}{m}$. Using this identification, the original discrete logarithm problem reduces to finding an integer string $x\in G$ such that $b_{\ell+1}'=(b_1',\ldots,b_\ell')x=\sum x(i)b_i'$ (now in additive notation). The existence of such an $x$ can be easily proven using that the elements $\beta_1,\ldots,\beta_\ell$ generate $\mathbf{B}$: the latter guarantees the existence of an $x$ such that $$\beta_{\ell+1}=(\beta_1,\ldots,\beta_{\ell}) x = \begin{pmatrix}
 \beta_1',\ldots,\beta_m'
\end{pmatrix} (b_1',\ldots,b_\ell') x =   \begin{pmatrix}
 \beta_1',\ldots,\beta_m'
\end{pmatrix} b_{\ell+1}',$$ which implies $(b_1',\ldots,b_\ell') x \equiv   \begin{pmatrix}
 \beta_1',\ldots,\beta_m'
\end{pmatrix} b_{\ell+1}' \bmod{(c_1',\ldots,c_m')}$. By finding such an $x$, we can solve the multivariate discrete problem, since $\beta_{1}^{x_1}\cdots \beta_{\ell}^{x_\ell}=\beta_1'^{b_{\ell+1}'(1)}\cdots\beta_m'^{b_{\ell+1}'(m)}=\beta_{\ell+1}=\beta$, due to (\[inproof:MultiVariate Discrete Log\]). Finally, note that we can find $x$ efficiently with existing deterministic classical algorithms for Group Membership in finite Abelian groups (cf. lemma 3 in [@BermejoVega_12_GKTheorem]).

We highlight that, in order for the latter result to hold, it seems critical to use our formulation of group decomposition instead of Cheung-Mosca’s. Consider again the discrete-log problem over the group $\Z_p^\times$ (recall section \[sect:Discrete Log\]). This group $\Z_p^\times$ is cyclic of order $p-1$ and a generating element $a$ is given to us as part of the input of the discrete-log problem. Although it is not known how to solve this problem efficiently, Cheung-Mosca’s group decomposition problem (find some linearly independent generators and their orders) can be solved effortlessly in this case, by simply returning $a$ and $p-1$, since $\langle a \rangle = \Z_p^\times \cong \Z_{p-1}$. The crucial difference is that Cheung-Mosca’s algorithm returns a factorization $ \DProd{c}{\ell}$ of $\mathbf{B}$, but it cannot be used to convert elements between the two representations efficiently (one direction is easy; the other requires computing discrete logarithms). In our formulation, the matrices $A$, $B$ provide such a method.

### Quantum algorithm for group decomposition {#quantum-algorithm-for-group-decomposition .unnumbered}

We now present a quantum algorithm that solves the group decomposition problem.

\[alg:group decomposition\]

A list of generators $\alpha=(\alpha_1,\ldots,\alpha_k)$ of an Abelian black-box group $\mathbf{B}$[^22].

A group decomposition table $(\alpha, \beta, A, B, c)$.

1.  Use the order finding algorithm (comprising normalizer circuit over $\Z\times \mathbf{B}$ and classical postprocessing) to obtain the orders $d_i$ of the generators $\alpha_i$. Then, compute (classically) and store their least common multiplier $d=\mathrm{lcm}(d_1,\ldots,d_k)$.

2.  Define the function $f : \Z_{d}^k \rightarrow \mathbf{B}$ as $f(x) = \alpha_1^{x(1)} \cdots \alpha_k^{x(k)}$, which is a group homomorphism and hides the subgroup $\ker f$ (its own kernel). Apply the Abelian HSP algorithm to compute a set of generators $h_1,\ldots,h_m$ of $\ker f$. This round uses normalizer circuits over $\Z_d^k\times \mathbf{B}$ and classical post-processing (cf. section \[sect:Abelian HSPs\]).

3.  Given the generators $h_i$ of $\ker f$ one can classically compute a $k\times \ell$ matrix $A$ (for some $\ell$) such that $(\beta_1,\ldots,\beta_\ell)=(\alpha_1,\ldots,\alpha_k) A$ is a system of linearly independent generators [@cheung_mosca_01_decomp_abelian_groups theorem 7]. $\beta$, $A$ and the orders $c_i$ of the $\beta_i$s (computed again via an order-finding subroutine) will form part of the output.

4.  Finally, we show how to classically compute a valid relationship matrix $B$. (This step is not part of Cheung-Mosca’s original algorithm.) The problem reduces to finding a $k\times \ell $ integer matrix $X$ with two properties:

    -   $X$ is a solution to the equation $(\alpha_1,\ldots,\alpha_k)X=(\alpha_1,\ldots,\alpha_k)$. Equivalently, every column $x_i$ of $X$ is equal (modulo $d$) to some element of the coset $e_i+\ker{f}\subset\Z_d^k$.

    -   Every column $x_i$ is an element of the image of the matrix $A$.

    It is easy to see that a matrix $X$ fulfilling (a-b) always exists, since for any $\alpha_i$, there exists some $y_i$ such that $\alpha_i=(\beta_1,\ldots,\beta_\ell)y_i$ (because the $\beta_i$s generate the group). It follows that $\alpha_i=(\alpha_1,\ldots,\alpha_k) (Ay_i)$. Then, the matrix with columns $x_i=Ay_i$ has the desired properties.

    $\quad$ Our existence proof for $X$ is constructive, and tells us that $X$ can be computed in quantum polynomial time by solving a multivariate discrete logarithm problem (lemma \[lemma:Multivariate Discrete Log\]). However, we will use a more subtle efficient *classical* approach to obtain $X$, by reducing the problem to a [**system of linear equations over Abelian groups**]{} [@BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers]. Let $H$ be a matrix formed column-wise by the generators $h_i$ of $\ker f$. By construction, the image of the map $H:\Z_d^m \rightarrow \Z_d^k$ fulfills $\mathrm{im} H =\ker{f}$. Properties (a-b) imply that the $i$th column $x_i$ of $X$ must be a particular solution to the equations $x_i= A y_i$ with $y_i\in \Z^\ell$ and $x_i = e_i + Hz_i \bmod{d}$, with $z_i\in \Z_d^m$. These equations can be equivalently written as a system of linear equations over $\Z^{m+\ell}$: $$\begin{pmatrix}
    A & -H
    \end{pmatrix}\begin{pmatrix}
    y_i \\ z_i
    \end{pmatrix} = e_i\mod{d},\qquad (y_i,z_i)\in \Z_d^{m}\times \Z^\ell,$$ which can be solved in classical polynomial time using e.g. algorithms from [@BermejoLinVdN13_Infinite_Normalizers]. Then, the matrix $X$ can be constructed column wise taking $x_i=Ay_i$.

    $\quad$Finally, given such an $X$, it is easy to find a valid $B$ by computing a Hurt-Waid integral pseudo-inverse $A^\#$ of $A$ [@HurtWaid70_Integral_Generalized_Inverse; @BowmanBurget74_systems-Mixed-Integer_Linear_equations]: $$\alpha= \alpha X = \alpha (A A^\#) X = (\alpha A ) (A^\#X) =(\beta_1,\ldots,\beta_\ell) (A^\# X).$$ In the third step, we used that $A^\#$ acts as the inverse of $A$ on inputs $x\in \Z^k$ that live in the image of $A$ [@HurtWaid70_Integral_Generalized_Inverse]. Since integral pseudo-inverses can be computed efficiently using the Smith normal form (see e.g. our dicussion in [@BermejoLinVdN13_Infinite_Normalizers appendix D]), we finally set $B:=A^\# X$.

Simulation of black-box normalizer circuits {#sect:Simulation}
===========================================

Our results so far show that the computational power of normalizer circuits over black-box groups (supplemented with classical pre- and post- processing) is *strikingly high*: they can solve several problems believed to be classically intractable and render the RSA, Diffie-Hellman, and elliptic curve public-key cryptosystems vulnerable. In contrast, standard normalizer circuits, which are associated with Abelian groups that are *explicitly decomposed*, can be efficiently simulated classically, by exploiting a generalized stabilizer formalism [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] over Abelian groups.

It is natural to wonder at this point where the computational power of black-box normalizer circuits originates. In this section, we will argue that the hardness of simulating black-box normalizer circuits resides *precisely* in the hardness of decomposing black-box Abelian groups. An equivalence is suggested by the fact that we can use these circuits to solve the group decomposition problem and, in turn, when the group is decomposed, the techniques in [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] render these circuits classically simulable. In this sense, then, the *quantum speedup* of such circuits appears to be completely encapsulated in the group decomposition algorithm. This intuition can be made precise and be stated as a theorem.

\[thm:Simulation\] Black-box normalizer circuits can be efficiently simulated classically using the stabilizer formalism over Abelian groups [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] if a subroutine for solving the group-decomposition problem is provided as an oracle.

The proof of this theorem is the subject of section \[app:Simulation proof\] in the appendix.

Since normalizer circuits can solve the group decomposition problem (section \[sect:Group Decomposition\]), we obtain that this problem is complete for the associated normalizer-circuit complexity class, which we now define.

The complexity class **Black-Box Normalizer** is the set of oracle problems that can be solved with bounded error by at most polynomially many rounds of efficient black-box normalizer circuits (as defined in section \[sect:circuit model\]), with polynomial-sized classical computation interspersed between. In other words, if $N$ is an oracle that given an efficient (poly-sized) black-box normalizer circuit as input, samples from its output distribution, then $$\text{\textbf{Black-Box Normalizer}} = BPP^{N}.$$

\[corollary:Group Decomposition is complete\] Group decomposition is a complete problem for the complexity class [**Black-Box Normalizer**]{.nodecor} under classical polynomial-time Turing reductions.

We stress that theorem \[thm:Simulation\] tells us even more than the completeness of group decomposition. As we discussed in the introduction, an oracle for group decomposition gives us an efficient classical algorithm to simulate Shor’s factoring and discrete-log algorithm (and all the others) *step-by-step* with a stabilizer-picture approach “à la Gottesman-Knill”.

We also highlight that theorem \[thm:Simulation\] can be restated as a *no-go theorem* for finding new quantum algorithms based on black-box normalizer circuits.

\[thm:No Go Theorem\] It is not possible to find “fundamentally new” quantum algorithms within the class of black-box normalizer circuits studied in this work, in the sense that any new algorithm would be efficiently simulable using the extended Cheung-Mosca algorithm and classical post-processing.

This theorem tells us that black-box normalizer circuits cannot give exponential speedups over classical circuits that are not already covered by the extended Cheung-Mosca algorithm; the theorem may thus have applications to algorithm design.

Note, however, that this no-go theorem says nothing about other possible *polynomial* speed-ups for black-box normalizer circuits; there may well be other normalizer circuits that are polynomially faster, conceptually simpler, or easier to implement than the extended Cheung-Mosca algorithm. Our theorem neither denies that investigating black-box normalizer could be of pedagogical or practical value if, e.g., this led to new interesting complete problems for the class **Black-Box Normalizer**.

Finally, we note that theorem \[thm:Simulation\] can be extended to the general Abelian hidden subgroup problem to show that the quantum algorithm for the Abelian HSP becomes efficiently classically simulable if an algorithm for decomposing the oracular group $\mathcal{O}$ is given to us (cf. section \[sect:Abelian HSPs\] and refer to appendix \[app:Extending\] for a proof). We discuss some implications of this fact in the next sections.

Universality of short quantum circuits {#sect:Universality}
======================================

Since all problems in **Black-Box Normalizer** are solvable by the extended Cheung-Mosca quantum algorithm (supplemented with classical processing), the structure of said quantum algorithm allows us to state the following:

\[thm:Universality Short Circuits\] Any problem in the class ***Black-Box Normalizer*** can be solved by a quantum algorithm composed of polynomially-many rounds of *short* normalizer circuits, each with at most a **constant** number of normalizer gates, and additional classical computation. More precisely, in every round, normalizer circuits containing two quantum Fourier transforms and one automorphism gate (and no quadratic phase gate) are already sufficient.

This result follows immediately form the fact that group decomposition is complete for this class (theorem \[corollary:Group Decomposition is complete\]) and from the structure of the extended Cheung-Mosca quantum algorithm with this problem, which has precisely this structure.

Similarly to theorem \[thm:Simulation\], theorem \[thm:Universality Short Circuits\] can be extended to the general Abelian HSP setting. For details, we refer the reader to appendix \[app:Extending\].

We find the latter result is insightful, in that it actually explains a somewhat intriguing feature present in Deutsch’s, Simon’s, Shor’s and virtually all known quantum algorithms for solving Abelian hidden subgroup problems: they all contain at most two quantum Fourier transforms! Clearly, it follows from this theorem than no more than two are enough.

Also, theorem \[thm:Universality Short Circuits\] tells us that it is actually pretty *useless* to use logarithmically or polynomially long sequences of quantum Fourier transforms for solving Abelian hidden subgroup problems, since just two of them suffice[^23]. In this sense, the Abelian HSP quantum algorithm uses an *asymptotically optimal* number of quantum Fourier transforms. Furthermore, the normalizer-gate depth of this algorithm is optimal in general.

Other Complete problems {#sect:Complete Problems}
=======================

We end this paper by giving two other complete problems for the complexity class **Black Box Normalizer**.

\[thm:Hidden Kernel Problem\] Let the Abelian hidden kernel problem (Abelian HKP) be the subcase of the hidden subgroup problem where the oracle function $f$ is a group homomorphism from a group of the form $G=\Z^a\times\DProd{N}{b}$ into a black-box group $\mathbf{B}$. This problem is complete for ***Black Box Normalizer*** under polynomial-time Turing reductions.

Clearly group decomposition reduces to this problem, since the quantum steps of the extended Cheung-Mosca algorithm algorithm (steps 1 and 3) are solving instances of the Abelian kernel problem. Therefore, the Abelian HKP problem is hard for **Black Box Normalizer**.

Moreover, Abelian HKP can be solved with the general Abelian HSP quantum algorithm, which manifestly becomes a black-box normalizer circuit for oracle functions $f$ that are group homomorphisms onto black-box groups. This implies that Abelian HKP is inside **Black Box Normalizer**, and therefore, it is complete.

**Note.** Although we originally stated the Abelian HSP for finite groups, one can first apply the order-finding algorithm to compute a multiple $d$ of the orders of the elements $f(e_i)$, where $e_i$ are the canonical generators of $G$. This can be used to reduce the original HKP problem to a simplified HKP over the group $\Z_{d}^a\times \DProd{N}{b}$

The latter result can be extended to the HSP setting to show that the Abelian hidden subgroup problem is polynomial-time equivalent to decomposing groups of the form $\mathcal{O}$ (cf. appendix \[app:Extending\]).

Let $\alpha$ be a group homomorphism from a group $G=\Z^a\times\DProd{N}{b}$ onto a black-box group $\mathbf{B}$. An instance of a linear system of equations over $G$ and $\mathbf{B}$ [^24] is given by $\alpha$ and an element $\mathbf{b}\in \mathbf{B}$. Our task is to find a general $(x_0, K)$ solution to the equation $$\nonumber
\alpha(x)=\mathbf{b},\quad x\in G,$$ where $x_0$ is any particular solution and $K$ is a generating set of the kernel of $\alpha$. This problem is complete for ***Black Box Normalizer*** under polynomial-time Turing reductions.

Clearly, this problem is hard for our complexity class, since the Abelian hidden kernel problem reduces to finding $K$.

Moreover, this problem can be solved with black-box normalizer circuits and classical computation, proving its completeness. First, we find a decomposition $\mathbf{B}=\bigoplus\langle \beta_i \rangle \cong H=\DProd{c}{\ell}$ with black-box normalizer circuits. Second, we recycle the de-black-boxing idea from the proof of theorem \[thm:Simulation\] to compute a matrix representation of $\alpha$, and solve the multivariate discrete logarithm problem $\mathbf{b}=\beta_1^{b(1)}\cdots\beta_\ell^{b(\ell)}$, $b\in H$, either with black-box normalizer circuits or classically (recall section \[sect:Group Decomposition\]). The original system of equations can now be equivalently written as $A x = b \pmod{H}$. A general solution of this system can be computed with classical algorithms given in [@BermejoLinVdN13_Infinite_Normalizers].

Acknowledgments
===============

We are grateful to Mykhaylo (Mischa) Panchenko, Uri Vool, Pawel Wocjan, Raúl García-Patrón, Geza Giedke, Mari Carmen Bañuls, Liang Jiang, Steven M. Girvin, Barbara M. Terhal, Hussain Anwar, Tobias J. Osborne and Kevin C. Zatloukal for encouraging discussions; and to Kevin C. Zatloukal for comments on the manuscript. JBV thanks the MIT Center for Theoretical Physics, where part of this work was conducted, for their warm and generous hospitality in Spring 2013.

CYL acknowledges support from the ARO grant W911NF-12-0486 (Quantum Information Group), and the Natural Sciences and Engineering Research Council of Canada. JBV acknowledges funding from the Elite Network of Bavaria QCCC Program. This paper is preprint number MIT-CTP/4584.

Proof of theorem \[thm:ModExp requires Z\] {#app:ModExp requires Z}
==========================================

To prove the result we can assume that we know a group isomorphism $\varphi:\Z_N^\times\rightarrow G$ that decomposes the black-box group as a product of cyclic factors $G= \DProd{N}{d}$. Let $U_{\varphi}:\mathcal{H}_{\mathbf{B}}\rightarrow \mathcal{H}_G$ be the unitary that implements the isomorphism $U_\varphi\ket{b}=\ket{\varphi(b)}$ for any $b\in\Z_N^\times$. It is easy to check that $\mathcal{C}$ is a normalizer circuit over $\Z_M\times G$ if and only if $(I\otimes U_\varphi) \mathcal{C} (I\otimes U_\varphi)^\dagger $ is a normalizer circuit over $\Z_M\times \Z_N^\times$: automorphism (resp. quadratic phase) gates get mapped to automorphism (resp. quadratic phase) gates and vice-versa; isomorphic groups have isomorphic character groups [@Morris77_Pontryagin_Duality_and_LCA_groups], and therefore Fourier transforms get mapped to Fourier transforms.

As a result, it is enough to prove the result in the basis labeled by elements of $\Z_M^\times\times G$. The advantage now is that we can use results from [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem]. In fact, the rest of the proof will be similar to the proof of theorem 2 in [@VDNest_12_QFTs].

We define $\alpha:=\varphi(a)$. The action of $U_\mathrm{me}$ in the $G$-basis reads $U_\mathrm{me}\ket{m,g}=\ket{m,m\alpha+g}$, in additive notation. Define a fuction $F(m,g)=(m,m\alpha+g)$. We now assume that $M$ is not divisible by $|a|$ and that there exists a normalizer circuit $\mathcal{C}$ such that $\|\mathcal{C}-U_\mathrm{me}\|\leq \delta$ with $\delta=1-1/\sqrt{2}$ and try to arrive to a contradiction. This property implies that $\|\mathcal{C}\ket{m,g}-U_\mathrm{me}\ket{m,g}\|\leq \delta$ for any standard basis state, and consequently $$\label{inproof:Ume is no Clifford}
  |\bra{F(m,g)}\mathcal{C}\ket{m,g}|\geq 1- \delta=\tfrac{1}{\sqrt{2}}$$ It was shown in [@VDNest_12_QFTs] that $\mathcal{C}\ket{m,g}$ is a uniform superposition over some subset $x+H$ of $G$, being $H$ a subgroup. If $H$ has more than two elements, then $\mathcal{C}\ket{m,g}$ is a uniform superposition over more than two computational basis states. It follows that $\bra{n,h}\mathcal{C}\ket{m,g}\leq\frac{1}{\sqrt{2}}$ for any basis state $\ket{n,h}$ in contradiction with \[inproof:Ume is no Clifford\], so that we can assume $H=\{0\}$ and that $\mathcal{C}\ket{m,g}$ is a standard basis state. Then (\[inproof:Ume is no Clifford\]) implies that $\ket{F(m,g)}$ and $\mathcal{C}\ket{m,g}$ must coincide for every $(m,g)\in \Z_M\times G$, so that $\mathcal{C}$ must perfectly realize the transformation $\ket{(m,g)}\rightarrow\ket{F(m,g)}$; however, the only classical functions that can be implemented by normalizer circuits of this form are affine maps [@VDNest_12_QFTs], meaning that $F(m,g)=f(m,g)+b$ for some group automorphism $f:\Z_M\times G\rightarrow\Z_M\times G$ and some $b\in \Z_M\times G$.

Finally, we arrive to a contradiction showing that $F(m,g)$ is not affine unless $M$ is a multiple of $|a|$. First, by evaluating $F(m,g)=f(m,g)+b=(m,m\alpha+g)$ at $(0,0)$,$(1,0)$ and elements of the form $(0,g)$, we can compute $b$ and a matrix representation $A$ of the automorphism $f$ [@VDNest_12_QFTs]: we obtain $b=0$, so that $F(m,g)$ must be an automorphism, and $A=\begin{pmatrix}
    1 & 0\\
    \alpha & 1 
    \end{pmatrix}$. However, for the matrix $A$ to be a matrix representation of a group automorphism, the first column $a_1$ needs to fulfill the equation: $Ma_1\pmod{\Z_M\times G}$ [@BermejoVega_12_GKTheorem lemma 2]. Expanding this equation, we finally get that $M\alpha = 0\pmod{G}$, which means that $M$ needs to be a multiple of the order of $\alpha$.

Proof of theorem \[thm:Simulation\] {#app:Simulation proof}
===================================

In this section we will prove theorem \[thm:Simulation\]. The proof uses results of Section \[sect:Group Decomposition\]; the reader may wish to review that section before proceeding with this proof.

We first state the simulation result of [@BermejoLinVdN13_Infinite_Normalizers], summarized below:

Let $G = \Z^a  \times \DProd{N}{c}\times \T^b$ be an explicitly decomposed elementary abelian group. Suppose we are given a normalizer circuit over $G$, where each gate is specified as follows (assume each gate is such that all entries of the matrices and vectors below are rational):

-   A (partial) quantum Fourier transform is specified by the elementary subgroups it acts on.

-   A group automorphism is specified as a matrix $A$, as in the normal form that we will introduce in Thm \[thm:Normal form of a matrix representation\].

-   A quadratic phase gate is specified as $(M,v)$, where $M$ is a matrix and $v$ is a matrix, as in the normal form that we will introduce in Thm \[thm:Normal form of a quadratic function\].

Then the output distribution of this normalizer circuit can be sampled classically efficiently.

We will describe precisely what we mean by the *normal forms* of normalizer gates in the following sections.

Given a black-box normalizer circuit acting on a black-box group $G= \Z^a \times \T^b \times \DProd{N}{c} \times \mathbf{B}$, there are two things we need to do to de-blackbox it, so that the circuit can be classically simulated:

1.  Decompose the black-box portion of $G$, $\mathbf{B}$, into cyclic subgroups: $\mathbf{B} = \Z_{N_{c+1}} \times \cdots \times \Z_{N_{c+d}}$.

2.  Calculate *normal forms* for each of the normalizer gates in the computation.

Assuming we have access to an oracle for Group Decomposition, Task 1 can already be done. In this proof we will concentrate on tackling task 2, for group automorphisms and quadratic phase gates (a quantum Fourier transform is easily specified by the subgroup it acts on).

Group automorphisms
-------------------

Suppose we have an abelian group $G= \Z^a \times \DProd{N}{c}\times  \T^b $; we can represent each element $g \in G$ as an $a+b+c$-tuple of real numbers $g=(g_1,\cdots,g_m)$, where each of the $g_i$’s are only defined modulo the characteristic $\text{char}(G_i)$ of the group $G_i$, multiplied by some integer. (We have $\text{char}(\Z)=0$, $\text{char}(\T)=1$, and $\text{char}(\Z_N)=N$.) Using this matrix representation, it turns out that there exist *normal forms* for the group automorphisms and quadratic phase functions:

\[thm:Normal form of a matrix representation\] Let $G = G_1\times\dots\times G_m$ be an elementary Abelian group. A real $n\times m$ matrix $A$ is a valid matrix representation of some group automorphism $\alpha: G\rightarrow G$ iff $A$ is of the form $$\label{eq:block-structure of matrix representations}
A:= \begin{pmatrix}
      A_{\Z\Z} & 0 & 0 \\
      A_{F\Z} & A_{FF} & 0 \\
      A_{\T\Z} & A_{\T F} & A_{\T\T}
    \end{pmatrix}$$ with the following restrictions:

1.  $A_{\Z\Z}$ and $A_{\T\T}$ are arbitrary integer matrices.

2.  $A_{F\Z}$, $A_{FF}$ are integer matrices: the first can be arbitrary, while the coefficients of the second must be of the form $$\label{eq:coefficients of Matrix Rep for nonzero characteristic groups}
      A(i,j)= \alpha_{i,j}\, \frac{N_i}{\gcd{(N_i, N_j)}}$$ where $\alpha_{i,j}$ can be arbitrary integers, and $N_i$ is the order of the $i$-th cyclic subgroup of $F$, $\Z_{N_i}$. The coefficients of the $i$-th rows of these matrices can be chosen w.l.o.g. to lie in the range $[0,N_i)$ (by taking remainders).

3.  $A_{\T\Z}$ and $A_{\T F}$ are real matrices: the former is arbitrary, while the coefficients of the latter are of the form $A(i,j)= \alpha_{i,j}/N_j$, where $\alpha_{i,j}$ can be arbitrary integers, and $N_i$ is the order of the $i$-th cyclic subgroup of $F$, $\Z_{N_i}$. (Due to the periodicity of the torus, the coefficients of $A_{\T\Z}$, $A_{\T F}$ can be chosen to lie in the range $[0,1)$.)

Recall the underlying group is $G= \Z^a \times \T^b \times \DProd{N}{c} \times \mathbf{B}$ with $\mathbf{B} \cong \Z_{N_{c+1}} \times \cdots \times \Z_{N_{c+d}} $. Assume we are given black box access to a group automorphism $\alpha:\: G \rightarrow G$ implemented as a classical function (a uniformly generated circuit family, say). We wish to find a matrix representation for $A$ for $f$. We will assume (for the efficiency of this algorithm) that the size and precision of the coefficients are upper bounded by some known constant $D$, i.e. each element of $M$ can be written as $A_{i,j} = \alpha_{i,j}/\beta_{i,j}$ for integers $\alpha_{i,j},\beta_{i,j}$ with absolute value no more than $D$.[^25]

We will show how to find the matrix representation $A$ in two steps:

1.  Given access to $\alpha$, we show how to switch the input and output of $\alpha$ from the black-box encoding (where the group action is implemented as a black-box circuit) to the decomposed group encoding (where elements of the group are given as a list of numbers, and the group action is simply addition of vectors), and vice versa.

2.  Once we have achieved this, we can implement classically a rational function $f:\: \mathbb{Q}^{\ell+m+k} \rightarrow \mathbb{Q}^{\ell+m+k}$ that implements $\alpha$ in decomposed form. We will show how to obtain the matrix representation $A$ from this $f$.

### Switching from black-box encoding to decomposed group encoding. {#sect:Encodings}

We need to be able to convert elements back and forth from the black-box encoding and the decomposed group encoding. We assume our black box group $\mathbf{B}$ has already been decomposed, i.e. we have found linearly independent generators $b_{1},\cdots,b_{k'}$ of $\mathbf{B}$ such that $\mathbf{B} =\langle \beta_1\rangle\oplus\cdots\oplus\langle \beta_\ell\rangle$; moreover, we know the order $N'_{i} = N_{c+i}$ of $\beta_i$. Define the explicitly decomposed group $\Z_{\mathbf{B}} = \DProd{N'}{d}$; then we need to be able to perform the following tasks:

Our first task is to map an element from the decomposed group $\Z_{\mathbf{B}}$ to the black box group $\mathbf{B}$. In otherwords, we need to be able to compute the following group homomorphism $\varphi$: $$\varphi:\Z_{\mathbf{B}}\rightarrow\mathbf{B},\qquad\varphi(g)=b_1^{g(1)}\cdots b_{d}^{g(d)},\quad\textnormal{for any $g\in \Z_{\mathbf{B}}$.}$$

Our second task is to convert elements from the original black-box group encoding to the new encoding defined by $\Z_{\mathbf{B}}$. In other words, given an arbitrary $\mathbf{b}\in \mathbf{B}$, we need to be able to compute $\varphi^{-1}{(\mathbf{b})}$.

Note that it is always possible to compute $\varphi(g)=b_1^{g(1)}\cdots b_d^{g(d)}$ for any $g\in \Z_\mathbf{B}$, since this can be done using a polynomial number of queries to the black-box group oracle (using repeated squaring if necessary for the exponentiation). Task (a) is therefore immediate.

As for Task (b), we note that computing $\varphi^{-1}(\mathbf{b})$ for an element $\mathbf{b}\in \mathbf{B}$ is equivalent to finding a list of integers $(g(1),\cdots,g(d))$ such that $b_1^{g(1)}\cdots b_{d}^{g(d)} = \mathbf{b}$. This is a special case of the multivariate discrete logarithm problem, defined in lemma \[lemma:Multivariate Discrete Log\]; from lemma \[lemma:Multivariate Discrete Log\] we see that Task (b) can be solved efficiently with a polynomial number of calls to the Group Decomposition oracle.

### Finding the matrix representation $A$

Now by converting the input and output of $\alpha$ to the decomposed group representation, we may assume that we instead have a classical rational function $f:\: \mathbb{Q}^{a+b+c+d} \rightarrow \mathbb{Q}^{a+b+c+d}$ such that $f$ can be treated as a group automorphism on $G$: f(x) f(x’) G x x’ G. (Here we say two vectors are equal modulo $G$ if each pair of corresponding entries are equal modulo $\text{char}(G_i)$.) We wish to find a matrix representation $A$ for $f$. For most entries of $A$ this is trivial: note that we have A\_[i,j]{} f(e\_j)\_i c\_i where $c_i = \text{char}(G_i)$. Hence by evaluating $f$ on the unit vectors $e_i$, we can determine $A_{i,j}$ modulo $c_i$. Thus we can evalute $A_{\T F}$ exactly, the coefficients of the $i$-th rows of $A_{F\Z}$ and $A_{FF}$ modulo $\Z_{N_i}$, and the coefficients of $A_{\T\Z}$ and $A_{\T F}$ modulo $1$. This is sufficient for the cases listed above; the only case we still need to treat is $A_{\T\T}$, whose entries are arbitrary integers (and $c_i=\text{char}(\T)=1$ in this case). We can instead evaluate $f(e_j / \alpha)$ for some large integer $\alpha$:

A\_[i,j]{}/f(e\_j/)\_i c\_i which allows us to determine $A_{i,j}$ modulo $\alpha c_i$ for our choice of $\alpha$. Choosing $\alpha > 2D$ then allows us to determine $A_{i,j}$ exactly for the case of $A_{\T\T}$.

Quadratic phase functions
-------------------------

We will continue to use the matrix representation referenced in the last section.

\[thm:Normal form of a quadratic function\]  \
Let $G= \Z^a  \times \DProd{N}{c} \times \T^b$ be an elementary Abelian group. Define $\Z^\bullet_N = \{0, 1/N, \cdots, (N-1)/N\}$ to be a group under addition modulo 1, and let $G^\bullet = \T^a  \times \Z_{N_1}^\bullet \times \cdots \times \Z_{N_c}^\bullet\times \Z^b$. Then a function $\xi: G\rightarrow U(1)$ is quadratic if and only if $$\xi(g)=\euler^{\pii \,\left(g^{\transpose} M g \: +  \: C^{\transpose} g  \: +  \: 2v^\transpose g\right)}$$ where $C$, $v$, $M$ are, respectively, two vectors and a matrix that satisfy the following:

-   $v$ is an element of $G^\bullet$;

-   $M$ is the matrix representation of a group homomorphism from $G$ to $G^\bullet$, which necessarily has the form $$M:= \begin{pmatrix}
          M_{\T\Z} & M_{\T F} & M_{\T\T} \\
          M_{F^{\bullet}\Z} & M_{F^{\bullet}F} & 0 \\
          M_{\Z\Z} & 0 & 0
        \end{pmatrix}$$ with the following restrictions:

    -   $M_{\Z\Z}$ and $M_{\T\T}$ are arbitrary integer matrices.

    -   $M_{F^\bullet\Z}$ and $M_{\T F}$ are rational matrices, the former with the form $M(i,j) = \alpha_{i,j}/N_i$ and the latter with the form $M(i,j) = \alpha_{i,j}/N_j$, where $\alpha_{i,j}$ are arbitrary integers, and $N_i$ is the order of the $i$-th cyclic subgroup $\Z_{N_i}$.

    -   $M_{F^\bullet F}$ is a rational matrix with coefficients of the form $$M(i,j)= \frac{\alpha_{i,j}}{\gcd{(N_i, N_j)}}$$ where $\alpha_{i,j}$ are arbitrary integers, and $N_i$ is the order of the $i$-th cyclic subgroup $\Z_{N_i}$.

    -   $M_{\T\Z}$ is an arbitrary real matrix.

    The entries of $M_{F^\bullet\Z}$, $M_{\T F}$, $M_{F^\bullet F}$, and $M_{\T\Z}$ can be assumed to lie in the interval $[0,1)$. Moreover, $M$ can be assumed to be symmetric, i.e. $M_{\Z\Z}^\transpose = M_{\T\T}$, $M_{F^\bullet\Z}^\transpose = M_{\T F}$, $M_{F^\bullet F}^\transpose = M_{F^\bullet F}$, and $M_{\T\Z}^\transpose = M_{\T\Z}$.

-   $C$ is an integer vector dependent on $M$, defined component-wise as $C(i)=M(i,i)c_i$, where $c_i$ is the characteristic of the group $G_i$. (Recall that $\textnormal{char}(\Z)=0$, $\textnormal{char}(\T)=1$, and $\textnormal{char}(\Z_N)=N$.)

Recall the underlying group is $G= \Z^a \times \T^b \times \DProd{N}{c} \times B$ with $B \cong \Z_{N_{c+1}} \times \cdots \times \Z_{N_{c+d}} $. Assume we are given a quadratic phase gate $\xi$, implemented as a classical circuit family $q:\: G \rightarrow \mathbb{Q}$ such that (g) = \^[2q(g)]{} g G. Since we can switch between the black-box group and decomposed group encodings (see section \[sect:Encodings\]), we can assume the elements of $G$ are treated as a vector in $\mathbb{Q}^{a+b+c+d}$.

We wish to write the quadratic function $\xi(g)$ in the normal form given by theorem \[thm:Normal form of a quadratic function\], i.e. find $M,c,v$ as in theorem \[thm:Normal form of a quadratic function\] such that $$\xi(g)=\euler^{\pii \,\left(g^{\transpose} M g \: +  \: C^{\transpose} g  \: +  \: 2v^\transpose g\right)}.$$ $q$, and hence $M$, $c$, and $v$, are rational by assumption. We will furthermore assume, as before, that the size and precision of the coefficients are upper bounded by some known constant $D$, i.e. each element of $M$ can be written as $M_{i,j} = \alpha_{i,j}/\beta_{i,j}$ for integers $\alpha_{i,j},\beta_{i,j}$ with absolute value no more than $D$.

To do this, let us first determine the entries of $M$. This can be done in the following manner: it should be straightforward to verify that $$\xi(x+y)=\xi(x)\xi(y)\euler^{2\pii \,x^{\transpose} M y}$$ for any $x,y \in G$, and therefore $$x^{\transpose} M y \equiv q(x+y) - q(x) - q(y) \mbox{ mod } \Z.$$

We can use this method to determine nearly all the entries of $M$ exactly, by taking $x$ and $y$ to be unit vectors $e_i$ and $e_j$; this would determine $M_{ij}$ up to an integer, i.e. $$M_{i,j} = e_i^{\transpose} M e_j \equiv q(e_i+e_j) - q(e_i) - q(e_j) \mbox{ mod } \Z.$$

This determines all entries of $M$ except for those in $M_{\Z\Z}$ and $M_{\T\T}$ (the other entries can be assumed to lie in $[0,1)$). To deal with $M_{\Z\Z}$ we take $x = \alpha^{-1}e_i$, and $y = e_j$, such that the coefficient $M(i,j)$ is in the submatrix $M_{\Z\Z}$ and $1/\alpha$ is an element of the circle group with $\alpha<2D$, where $D$ is the precision bound. We obtain an analogous equation $$\left(\frac{e_i^{\transpose}}{\alpha} M e_j\right) \equiv \frac{M_{i,j}}{\alpha}  \equiv  q(\alpha^{-1}e_i+e_j) - q(\alpha^{-1}e_i) - q(e_j) \mbox{ mod } \Z,$$ which allows us to determine $M_{i,j}$: since the number $M_{i,j}/\alpha$ is smaller than $1/2$ in absolute value, the coefficient is not truncated modulo 1. One can apply the same argument to obtain the coefficients of $M_{\T\T}$, choosing $x = e_i$, and $y = \alpha^{-1} e_j$.

Once we determine all the entries of $M$ in this manner, we get immediately the vector $C$ as well (since $C(i) = c_iM(i,i)$). It is then straightforward to calculate the vector $\tilde{v}$. Thus we can efficiently find the normal form of $\xi(g)$ through polynomially many uses of the classical function $q$.

Extending theorem \[thm:Simulation\] to the Abelian HSP setting {#app:Extending}
===============================================================

In this appendix, we briefly discuss that theorem \[thm:Simulation\] (and some of the results that follow from this theorem) can be re-proven in the general hidden subgroup problem oracular setting that we studied in section \[sect:Abelian HSPs\]. This fact supports our view (discussed in the main text) that the oracle models in the HSP and in the black-box setting are very close to each other.

Recall that the main result in this section (theorem \[thm:HSP\]) states that the quantum algorithm Abelian HSP is a normalizer circuits over a group of the form $\DProd{d}{m}\times \mathcal{O}$, where $\mathcal{O}$ is a group associated with the Abelian HSP oracle $f$ via the formula (\[eq:Oracular Group Operation\]). The group $\mathcal{O}$ is not a black-box group, because no oracle to multiply in $\mathcal{O}$ was provided. However, we discussed at the end of section \[sect:Abelian HSPs\] that one can use the hidden subgroup problem oracle to perform certain multiplications implicitly.

We show next that theorem \[thm:Simulation\] can be re-casted in the HSP setting as “*the ability to decompose the oracular group $\mathcal{O}$ renders normalizer circuits over $\DProd{d}{m}\times \mathcal{O}$ efficiently classically simulable*”. To see this, assume a group decomposition table $(\alpha, \beta, A, B, c)$ is given. Then we know $\mathcal{O}\cong\Z_{c_1}\times \cdots \times \Z_{c_m}$. Let us now view the function $\alpha(g)=(g,f(g))$ used in the HSP quantum algorithm as a group automorphism of $G\times \mathcal \Z_{c_1}\times \cdots \times \Z_{c_m}$, where we decompose $\mathcal{O}$. Then, it is easy to check that $\begin{pmatrix}
1 & 0 \\
B & 1 \\
\end{pmatrix}$ is a matrix representation of this map. It follows that the group decomposition table can be used to de-black-box the HSP oracle, and this fact allows us to adapt the proof of theorem \[thm:Simulation\] step-by-step to this case.

We point out further that the extended Cheung-Mosca algorithm can be adapted to the HSP setting, showing that normalizer circuits over $G\times \mathcal{O}$ can be used to decompose $\mathcal{O}$. This follows from the fact that the function $f$ that we need to query to decompose $\mathbf{B}$ using the extended Cheung-Mosca algorithm (algorithm \[alg:group decomposition\]) has precisely the same form as the HSP oracle. Using the HSP oracle as a subroutine in algorithm \[alg:group decomposition\] (which we can query *by promise*), the algorithm computes a group decomposition tuple for $\mathcal{O}$.

Finally, we can combine these last observations with theorem \[thm:Hidden Kernel Problem\] and conclude that the problem of decomposing groups of the form $\mathcal{O}$ is classically polynomial-time equivalent to the Abelian hidden subgroup problem. The proof is analogous to that of theorem \[thm:Hidden Kernel Problem\].

[^1]: \[footnote:Hardness Group Decomposition\]Knowing $\mathbf{B}\cong \DProd{d}{m}$ implies that the order of the group $|G|=d_1 d_2\cdots d_m$. Hardness results for computing orders [@BabaiSzmeredi_Complexity_MatrixGroup_Problems_I; @Babai98apolynomial_time_theory_of_Black_Box_Groups] imply that the problem is provably hard for classical computers in the black-box setting. For groups $\Z_N^\times$, computing $\varphi(N):=|\Z_N^\times|$ (the Euler totient function) is equivalent to factoring [@Shoup08_A_Computational_Introducttion_to_Number_Theory_and_Algebra].

[^2]: It will always be clear from context whether the group multiplication is performed by an oracle at unit cost or by some well-known polynomial-time classical algorithm. Most results will be stated in the black-box setting though.

[^3]: Note that throughout this manuscript we always work at a high-level of abstraction (algorithmically speaking), and that the “steps” in a normalizer-based quantum algorithm are always counted at the logic level of normalizer gates, disregarding smaller gates needed to implement them. In spite of this, we find the above simulability property of black-box normalizer circuits to be truly fascinating. To get a better grasp of its significance, we may perform the following thought experiment. Imagine, we would repeatedly concatenate black-box normalizer circuits in some intentionally complex geometric arrangement, in order to form a gargantuan, intricate “Shor’s algorithm” of monstrous size. Even in this case, our simulation result states that if we can decompose Abelian groups (say, with an oracle), then we can efficiently simulate the evolution of the circuit, normalizer-gate after normalizer-gate, independently of the number of Fourier transforms, automorphism and quadratic-phase gates involved in the computation (the overhead of the classical simulation is always at most polynomial in the input-size).

[^4]: Here entanglement is measured with respect to the Schmidt-rank measure ( low-entangling circuits with respect to continuous entanglement measures are universal for quantum computation [@VDNest2012_Little_Entanglement]).

[^5]: An $n$-dimensional infrastructure $\mathcal{I}$ provides a classical presentation for an $n$-dimensional hypertorus group $\R^n/\Lambda\cong \T^n$, where $\Lambda$ is an (unknown) period lattice $\Lambda$. The elements of this continuous group are represented with some classical structures known as *$f$-representations*, which are endowed with an operation that allows us to compute within the torus. Although one must deal carefully with non-trivial technical aspects of infinite groups in order to properly define and compute with $f$-representations (cf. [@Sarvepalli14_1D_infrastructures; @FonteinWocjan11_Q_Alg_Period_Lattice_Infrastructure] and references therein), one may intuitively understand infrastructures as “generalized black-box hypertoruses”. We stress, though, that it is not standard terminology to call “black-box group” to an infinite group.

[^6]: No such treatment is needed in this work, since we study quantum algorithms for finding hidden structures in *discrete* groups.

[^7]: Sampling $\Z_N^\times$ can be done by sampling $\{0,\cdots,N-1\}$ uniformly and then rejecting samples that are not relatively prime to $N$; this takes $O(\log\log N)$ trials to succeed with high probability. A similar approach works, in general, for sampling generating-sets of uniquely-encoded finite Abelian groups [@Fontein2014_Probability_Generating_Lattice].

[^8]: As discussed in [@BermejoLinVdN13_Infinite_Normalizers], the states $|p\rangle$ are unnormalizable and, strictly speaking, do not form a “basis” in the usual sense (they are not elements of ${\cal H}_{\Z}$) but they can nevertheless used as a basis for our practical purposes. Rigorously speaking, the $|p\rangle$ “states” can be understood as Dirac-delta measures or Schwartz-Bruhat tempered distributions [@Bruhat61_Schwatz-Bruhat-functions; @Osborne75_Schwartz_Bruhat]. Although we will not do it here, our results can be stated more formally through the theory of rigged Hilbert spaces [@delaMadrid05_roleofthe_riggedHilbert; @Antoine98_QM_beyond_Hilber_space; @Gadella02_unified_Dirac_formalism; @gadella12_Riggings_LCA_Groups], which is often applied to study observables with continuous spectra.

[^9]: Groups (\[group\_labels\_basis\]) form a family (and a category) of groups generated by replacing the factors $G_i$ of the original group $\Z^{a}\times \DProd{N}{c}\times \mathbf{B}$ with their character groups, and then identifying isomorphic groups [@BermejoLinVdN13_Infinite_Normalizers]. The so-called Pontryagin duality [@Morris77_Pontryagin_Duality_and_LCA_groups; @Stroppel06_Locally_Compact_Groups; @Dikranjan11_IntroTopologicalGroups; @rudin62_Fourier_Analysis_on_groups; @HofmannMorris06The_Structure_of_Compact_Groups] determines the number $2^a$ of groups in the family. The number of group-element bases $2^a$ is larger than $1$ iff *infinite groups* are involved. Due to, there are not multiple “standard-bases” in finite-dimensional normalizer circuits (nor in Clifford circuits) [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem].

[^10]: Mathematically, this Fourier transform is a unitary transformation between two different functional spaces, $L^2(\Z)$ and $L^2(\T)$. The latter two define one quantum mechanical system with two possible bases (of Dirac-delta measures) labeled by $\Z$ and $\T$. In the finite dimensional case, the picture is simpler because the QFT is a unitary transformation of $L^2(\Z_N)$ onto itself. (These facts are consequences of the Plancherel theorem for locally compact Abelian groups [@rudin62_Fourier_Analysis_on_groups; @HofmannMorris06The_Structure_of_Compact_Groups].)

[^11]: We choose this notation to be consistent with our previously existing terminology [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem].

[^12]: The results in this paper would still hold if the allowed inputs are periodic states, coset-states and, in general, stabilizer states [@VDNest_12_QFTs; @BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] *if* the stabilizer group of the input state is given as an input.

[^13]: We expect this assumption not to be essential, but it simplifies our proofs by allowing us to use exact arithmetic operations. Our stabilizer formalism in [@BermejoLinVdN13_Infinite_Normalizers] can still be applied if the functions $\alpha$, $\xi$ are not rational, and we expect some version of the simulation result (theorem \[thm:Simulation\]) to hold even when trascendental numbers are involved (taking carefully into account precision errors). It is an good question to explore whether an exact simulation result may hold for algebraic numbers [@Cohen:1995Course_Computational_Algebraic_Number_Theory].

[^14]: For infinite groups there is no fundamental limit to how much the output of $\alpha$ or $q$ may grow/shrink with respect to the input (this follows from the normal forms in [@BermejoLinVdN13_Infinite_Normalizers]). The number $n_\textrm{out}$ parametrizes the precision needed to compute the function. Similarly to 2., this assumption might me weakened if a treatment for precision errors is incorporated in the model.

[^15]: Recall that, in finite dimensions, the gate cost of implementing a classical function $\alpha$ as a quantum gate is at most the classical cost [@nielsen_chuang] and that computing $q$ efficiently is enough to implement $\xi$ using phase kick-back tricks [@Kaye05_optimized_Quantum_Elliptic_Curve]. We expect these results to extend to infinite dimensional systems of the form $\mathcal{H}_\Z$.

[^16]: Since $\mathbf{B}$ is finite, the order $|a|$ is a well-defined number.

[^17]: This is vacuously true: since the group $G:=\Z\times\mathbf{B}$ is discrete, *any* functtion $f:G\rightarrow G$ is continuous.

[^18]: This choice is not essential, neither in Shor’s algorithm nor in algorithm \[alg:Order Finding Finite precision\], but it simplifies the proof.

[^19]: Correspondingly, the complexity of performing group multiplications in [@Kaye05_optimized_Quantum_Elliptic_Curve; @CheungMaslovMathew08_Design_QuantumAttack_Elliptic_CC] is greater.

[^20]: In this section we assume $G$ to be finite for simplicity. For a case where $G$ is infinite, we refer the reader back to section \[sect:Factoring\], where we studied the order finding problem (which is a HSP over $\Z$).

[^21]: If the group $G$ is not given in a factorized form, the Abelian HSP may still be solved by applying Cheung-Mosca’s algorithm to decompose $G$ (see next section).

[^22]: Cheung and Mosca’s original presentation first used Shor’s algorithm to decompose $B$ into Sylow $p$-subgroups, and then performed the group decomposition on these subgroups. As they commented, that step was not strictly necessary, although it would reduce the computational resources required. Also, their algorithm does not receive a list of generators as an input, but this is not a big difference since such a list can always be computed in probabilistic classical polynomial-time for a uniquely encoded black-box group.

[^23]: This last comment does not imply that building up sequences of Fourier transforms is useless in general. On the contrary, this can be actually be useful, e.g., in QMA amplification [@Nagaj2009_Fast_Amplification_QMA].

[^24]: These systems where studied extensively in our previous works [@BermejoVega_12_GKTheorem; @BermejoLinVdN13_Infinite_Normalizers] in the decomposed-group setting.

[^25]: Note that $D$ can be inferred from the precision bound (see section \[sect:circuit model\]) of the automorphism gate. If the automorphism gate increases the input size by at most $n$ bits, then it follows that the size of the denominator or numerator of every matrix element can increase by at most $D=2^n$. A similar argument will hold for quadratic phase gates.