{'fraction_non_alphanumeric': 0.049323736119073404, 'fraction_numerical': 0.010913646304435526, 'mean_word_length': 3.5891064990743446, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Hidden Symmetry Subgroup Problems

We advocate a new approach of addressing hidden structure problems and finding efficient quantum algorithms. We introduce and investigate the Hidden Symmetry Subgroup Problem (HSSP), which is a generalization of the well-studied Hidden Subgroup Problem (HSP). Given a group acting on a set and an oracle whose level sets define a partition of the set, the task is to recover the subgroup of symmetries of this partition inside the group. The HSSP provides a unifying framework that, besides the HSP, encompasses a wide range of algebraic oracle problems, including quadratic hidden polynomial problems. While the HSSP can have provably exponential quantum query complexity, we obtain efficient quantum algorithms for various interesting cases. To achieve this, we present a general method for reducing the HSSP to the HSP, which works efficiently in several cases related to symmetries of polynomials. The HSSP therefore connects in a rather surprising way certain hidden polynomial problems with the HSP. Using this connection, we obtain the first efficient quantum algorithm for the hidden polynomial problem for multivariate quadratic polynomials over fields of constant characteristic. We also apply the new methods to polynomial function graph problems and present an efficient quantum procedure for constant degree multivariate polynomials over any field. This result improves in several ways the currently known algorithms.


Introduction
The main goal of quantum computing is to identify suitable classes of problems and to find efficient quantum algorithms for them that provide a significant speed-up over their classical counterparts. The vast majority of such examples consists of group-theoretical problems that can be formulated within the framework of the hidden subgroup problem (HSP). This problem can be cast in the following terms: We are given a finite group G and a black-box function from G to some finite set. The level sets of the function correspond to the right cosets of some subgroup H. We say that f hides H and the task is to determine this hidden subgroup. One query of the function counts as one step in the computation and an algorithm is efficient if its running time is polynomial in the logarithm of the size of the group. While no classical algorithm is known to solve this problem with polynomial query complexity, the problem is computationally solvable in quantum polynomial time for every abelian group [24,5,17].
Several attempts were made to extend the quantum solution of the abelian HSP. Most of the research focused on the HSP in non-abelian groups since these include several algorithmically important problems. For example, it is known that efficient solutions for the dihedral and the symmetric group would imply efficient solutions for some lattice problems [22] and for graph isomorphism, respectively. While some progress has been made in this direction [3,10,12,13,14,18,19], the HSP for the dihedral and symmetric groups remains unsolved. It is already known that the methods for solving the abelian case fail for several non-abelian groups [21,15]. The goal of obtaining efficient quantum algorithms for larger classes of non-abelian groups turned out to be rather elusive.
Another idea for generalizing the problem was proposed by Childs, Schulman and Vazirani [6] who considered properties of algebraic sets hidden by black-box functions. One of these problems is the hidden polynomial problem (HPP) where the hidden object is a polynomial. To recover it we have at our disposal an oracle whose level sets coincide with the level sets of the polynomial. Childs et al. [6] showed that the quantum query complexity of this problem is polynomial in the logarithm of the field size provided that the degree and the number of variables are held constant, leaving the question of the time complexity as an open question. The authors also formulated computationally efficient quantum procedures for some related problems, such as the hidden radius and the hidden flat of centers. Nonetheless, to the best of our knowledge, no efficient quantum polynomial time algorithm has been proposed for the general HPP, not even for the simplest problem of hidden quadratic polynomials in one variable (HQPP).
In [9], Decker, Draisma and Wocjan defined a related problem that we refer to as the hidden polynomial graph problem (HPGP) to distinguish it from the HPP. Here, similarly to the HPP, the hidden object is a polynomial, but the oracle is more powerful because it can also be queried on the graphs that are defined by the polynomial functions. They obtained a polynomial time quantum algorithm that correctly identifies the hidden polynomial when the degree and the number of variables are considered to be constant. Their proof applies to all finite fields whose characteristic is not in a finite set of exceptional characteristics that depend on the degree of the polynomials.
In this paper, we advocate a third possible approach to find hidden structures. We consider a group G acting on some finite set M , and we suppose that we have at our disposal a black-box function whose level sets define a partition of M . The object we would like to recover is the group of symmetries of this partition inside G, i.e., the subgroup whose orbits under the action coincide with the classes of the partition. We call this problem the hidden symmetry subgroup problem (HSSP). It is easy to see that the HSP is a special case of the HSSP when the group acts on itself and the action corresponds to the group operation. But, for some actions, the HSSP is provably harder than any HSP. We show that Grover's search can be cast as an HSSP, establishing that certain cases of the HSSP have exponential quantum query complexity. This is in contrast to the HSP that has polynomial quantum query complexity for all groups [11].
The potential of the HSSP lies mainly in the possibility of extending the HSP techniques to more general group actions that still admit efficient quantum procedures. We demonstrate the power of this new approach by designing and improving quantum algorithms for several algebraic problems. To achieve this we reduce both the HQPP and the univariate HPGP to appropriate HSSPs for which we can give efficient quantum solutions in some interesting cases. Besides the construction of efficient algorithms, the formulation of problems as HSSP can also shed new light on their structure. For example, the apparent difficulty of the HQPP over prime fields might be explained by the equivalence of this problem to the HSP in the dihedral group, a connection discovered via their relations to the HSSP. It is also worth to note that the hidden shifted multiplicative character problem of van Dam, Hallgren and Ip [8] is a version of the HSSP with an additional promise on the input.
To establish our algorithmic results, we first concentrate on the question of whether the HSSP can be reduced in some cases to the related HSP that we obtain by forgetting about the action. We design a reduction scheme, which involves the generalization of bases known from the theory of permutation groups. We are able to show that when the action has an efficiently computable generalized base then the HSSP is indeed efficiently reducible to the related HSP (Proposition 2). Then we describe a probabilistic construction of such bases for a large class of Frobenius groups. Therefore, the above reduction applies to these groups (Theorem 1). These groups include among others a large variety of affine groups and the HSSP is efficiently solvable for these groups by a quantum algorithm. We remark that in [20] it is proved that the HSSP (in a slightly different formulation) can be solved efficiently for some of these affine groups. The proof uses essentially the same reduction technique.
We then establish several surprising connections between hidden polynomial problems and the HSSP. In fact, the HQPP turns out to be equivalent in a very strong sense to the HSSP over a related affine group. Combined with the above reduction to the related HSP, we are able to give the first ever quantum polynomial time solution for the HQPP over fields of constant characteristic (Theorem 2). We then give a quantum reduction of the multivariate quadratic HPP to the HQPP, which implies that over fields of constant characteristic this multivariate problem is also solvable in quantum polynomial time (Theorem 3).
Finally, for dealing with the HPGP, we define a class of semidirect product groups which we call function graph groups. We show that the HPGP for univariate polynomials of degree at most d coincides with the HSSP over a corresponding function graph group. These groups turn out to have a base of size d, and therefore our general reduction to the related HSP applies (Theorem 4). Based on this reduction, we improve the results of [9] by showing that there is a quantum polynomial time algorithm for the HPGP over every field when the degree of the polynomials is constant (Theorem 5).

Preliminaries
We first fix some useful notation: n denotes a positive integer, p a prime number, q a prime power, Z n the additive group of integers modulo n, F q the finite field of size q, and F (d) q [x] the set of univariate polynomials of degree at most d over F q .

Level sets and problem classes
Simply speaking, we study the general problem of determining hidden objects related to a given algebraic structure. The algebraic structure is specified by parameters of the problem, which are finite groups, families of subgroups of a given group, group actions, finite fields, and integers in the present case. We assume that we have access to an unknown member of a family of black-box functions f : A → S, where A is part of the structure and S is some finite set. We consider this function f as the oracle input. We are restricted to identifying the hidden object solely from the information we obtain by querying the oracle f . In fact, the only useful information we can obtain is the structure of the level sets f −1 (s) = {a ∈ A : f (a) = s}, s ∈ S, that is, we can only determine whether two elements in A are mapped to the same value or not. All non-empty level sets together constitute a partition of A which we denote by π f . Definition 1. The hidden subgroup problem HSP is parametrized by a finite group G and a family H of subgroups of G.

HSP(G, H)
Oracle input: A function f from G to some finite set S such that for some subgroup H ∈ H, we have f (x) = f (y) ⇐⇒ Hx = Hy. Output: H.
The hidden polynomial problem HPP is parametrized by a finite field F q and two positive integers n and d.
Oracle input: A function f from F n q to some finite set S such that for some n-variate polynomial P of degree d over F q , we have f (x) = f (y) ⇐⇒ P(x) = P(y). Output: P.
For every u ∈ F q we define a monic quadratic polynomial over F q by P u (x) = x 2 − 2ux. The hidden quadratic polynomial problem HQPP is parametrized by some finite field F q .

HQPP(F q ).
Oracle input: A function f from F q to some finite set S such that we have f (x) = f (y) ⇐⇒ P u (x) = P u (y). Output: P u .
The hidden polynomial graph problem HPGP is parametrized by a finite field F q and two positive integers n and d.
Oracle input: A function f from F n q × F q to a finite set S such that for some n-variate In all these problems we say that the input f hides the output of the problem.
In the definition of the HQPP we restrict our attention to monic polynomials with zero constant term because adding a constant to a polynomial or multiplying all coefficients with the same nonzero constant do not change the partition π f . Furthermore, observe that for the HPGP we have a more powerful oracle at our disposal than for the HPP, because an HPGP oracle f (x, y) restricted to y = 0 is equivalent to an HPP oracle.
In all these problems the task is to determine the output hidden by the oracle input. We measure the time complexity of an algorithm by the overall running time when a query counts as one computational step. An algorithm is efficient if its time complexity is polynomial in the logarithm of the size of the group or field, and in the size of the integers in unary in the parametrization of the problem.

Semidirect product groups
Let K and H be finite groups and let φ : h → φ h be a homomorphisms from H to the group of automorphisms of K. Then the semidirect product K ⋊ φ H is the cartesian product of K and H equipped with the multiplication defined as (k, h) · (k ′ , h ′ ) = (k · φ h (k ′ ), h · h ′ ). We use the notation K ⋊ H for K ⋊ φ H whenever φ is clear from the context. . . , π ℓ } of the set M , we define the subgroup π * = {g ∈ G : (∀i) g • π i = π i }. We call π * ≤ G the group of symmetries of π within G. This is the subgroup of elements that stabilize every class of the partition π under the given action. Let (S(G), ⊆) be the lattice of subgroups of G under the inclusion relation, and let (Π(M ), ≤) be the lattice of partitions of M , where by definition π ≤ π ′ if π ′ is finer than π. The maps H → H * and π → π * define an order-reversing Galois connection between (S(G), ⊆) and (Π(M ), ≤), that is H ≤ π * if and only if π ⊆ H * . The subgroup H * * is the closure of H [4], it consists of the elements in G which stabilize every H-orbit. The closure of a partition π is π * * , it consists of the orbits of its group of symmetries. It is always true that H ⊆ H * * . The subgroup H is closed if H = H * * , or equivalently, there exists a partition π such that H = π * . Similarly, π is closed if π = π * * . We denote by C(G) the family of all closed subgroups in G. In general, there can be several subgroups whose orbits coincide with the level sets of f , but the closures of these subgroups are the same. The unique closed subgroup that satisfies the promise is π * f , and this is exactly the output of the problem. We will say that f hides H by symmetries. In fact, it would be natural to extend HSSP to the more general setting where f is an arbitrary function on M and the task is to determine the (closed) subgroup π * f . The restriction we use in this paper is that π f is a closed partition with π * f ∈ H. We define an algorithm for solving the HSSP as efficient if it is polylogarithmic in |G|.

The hidden symmetry subgroup problem
It is easy to see that the HSP is a special case of the HSSP when we set M = G and choose the group action • to be the group operation, that is g • h = gh. For this action every subgroup of G is closed, and a function f hides a subgroup H if and only if f hides H by symmetries.
Given HSSP(G, M, •, H), by forgetting about the group action we obtain HSP(G, H). We call this problem the related HSP.

Related results
While the HSP is generally hard in non-abelian groups, its query complexity is always small, due to a classical result of Ettinger, Høyer and Knill [11].
Fact 1. For every finite G, the HSP(G, C(G)) has polynomial query complexity.
Among groups where the HSP is solvable in quantum polynomial time, some affine groups will be of importance for us. For a subgroup H of F * q , let Aff q (H) denote the semidirect product F q ⋊ H, and let FC be the family of conjugates of H by an element of F q (for a detailed discussion of these groups see Section 4.2). The following positive results on the solvability of the HSP were obtained respectively by Moore et al. [19] and Friedl et al. [12].
The following cases of the HSP can be solved in polynomial time: (a) HSP(Aff q (H), FC), where q is a prime and H ≤ F * q such that 1 < |H| ≤ q − 1 and |H| = Ω(q/polylog(q)).
(b) HSP(G, C(G)), where G is a finite group such that G ′ is commutative and every element of G ′ has an order bounded by a constant.
The query complexity of the HPP was investigated by Childs, Schulman and Vazirani [6]. They showed the following. Here, like in the case of the HQPP, polynomials are determined up to constant terms and scalar factors. We are not aware of any results regarding the quantum computational complexity even in the univariate quadratic case. For the HPGP, Decker, Draisma and Wocjan [9] showed the following.

A general reduction of the HSSP to the HSP
How much greater is the complexity of an HSSP compared to the complexity of the related HSP? To analyze this, we first give a simple example, which shows that the query complexity of the HSSP can be exponentially higher than the query complexity of the related HSP. Then, more interestingly, we will establish a general condition on the group action under which the HSSP can be reduced in polynomial time to the related HSP.

HSSP with exponential query complexity
While the quantum query complexity of the HSP is polylogarithmic in the size of the group, we show in this section that the query complexity of an HSSP can be in the order of |G| 1/4 . More precisely, we show that Grover's search problem can be reduced to some specific HSSP.
For a prime power q, the general affine group Aff q of invertible affine transformations over F q is defined as the semidirect product Proof. Grover's search over F q can be trivially reduced to this HSSP. Indeed, if the oracle input is f c , defined by f c (x) = δ c,x , where δ c,x is the Kronecker delta, then f c hides H c as symmetry subgroup. From any generator (b, a) of H c one recovers c simply by computing (1 − a) −1 b. Hence, the query complexity of the HSSP is at least the query complexity Ω(q 1/2 ) of Grover's search [2].

A reduction scheme of the HSSP to the HSP
In this section, we describe a rather natural framework for reducing the HSSP to the related HSP. Essentially, the same idea was used in [20] for reducing certain hidden shift problems to the HSP in the affine group over prime fields. We assume that we are given a black-box function f over M , which hides some subgroup H of G by symmetries. With the help of f , we would like to construct a suitable function f HSP over G, which hides H. A first approach could be to define , where m is a fixed element of M . Unfortunately, this works only in very exceptional cases because f HSP takes constant values on the left cosets of the stabilizer H m of m. Therefore, even in the simple case when f hides the trivial subgroup, the function f HSP will not work unless the stabilizer of m is trivial. As a straightforward refinement of this idea, we can pick several elements m 1 , . . . , m t ∈ M , and define For the trivial hidden subgroup, this idea works when the common stabilizer of m 1 , . . . , m t is trivial, that is, In the theory of permutation groups such a system of elements is called a base [23]. Of course, bases exist only if the action of G is faithful. The following definition includes further conditions on m 1 , . . . , m t in order to make the above construction work in general. The following lemma states that the HSSP is indeed reducible to the HSP via an H-strong base.
Lemma 1 (Reduction of HSSP to HSP). Let G be a finite group, and let • be an action of G on M . Suppose that the function f : G → S hides some H ∈ H by symmetries. Let B = {m 1 , . . . , m t } be an H-strong base. Then H is hidden by the function f HSP (g) = (f (g • m 1 ), . . . , f (g • m t )).
Proof. We will show that for every x, y ∈ G, we have f HSP (x) = f HSP (y) if and only if y ∈ Hx. To see the "only if" part, suppose that f HSP (x) = f HSP (y). Then by definition m xG m , for every m ∈ B, from which we can deduce y ∈ m∈B HxG m . Now observe that xG m x −1 = G x•m , and therefore y ∈ m∈B HG x•m x. From this we can conclude y ∈ Hx because B is an H-strong base. To show the reverse implication, suppose that y = hx for some h ∈ H. This implies The following statement is immediate from Lemma 1.

The HSSP for Frobenius complements and the HQPP
In view of Proposition 2, we are interested in group actions for which there exist easily computable (and therefore also small) bases for some interesting families of subgroups. If in addition the related HSP is easy to solve then we have efficiently solvable HSSPs. It turns out that Frobenius groups under some conditions not only have these properties, but also that the HQPP can be cast as one of these HSSPs.

Strong bases in Frobenius groups
A Frobenius group is a transitive permutation group acting on a finite set such that only the identity element has more than one fixed point and some non-trivial element fixes a point (see for example [16]). Let us recall here some notions and facts about these groups. Let G be a Frobenius group with action • M on M . The identity element together with the elements of G that have no fixed points form a normal subgroup K, the Frobenius kernel, for which we also have |K| = |M |.
It is a subgroup complementary to K, that is K ∩ H = {1} and G = KH. Hence, the group G is a semidirect product K ⋊ H of K and H. We define the binary operation , when x ∈ K and g = yh with y ∈ K and h ∈ H. It is a straightforward computation to check that • K is an action of G on K. Furthermore, we can identify the action • M with the action • K via the map φ : M → K defined as follows. For any n ∈ M , there exists g n ∈ G such that g n • M m = n since G is transitive. If g n = y n h n with y n ∈ K and h n ∈ H, by definition we set φ(n) = y n . Then indeed for every g ∈ G and n ∈ M , we have g • K φ(n) = φ(g • M n). From now on we will suppose without loss of generality that the action is • K which we denote for simplicity by •.
Observe then that with respect to •, the Frobenius complement H is the stabilizer of e, the identity element of K. The orbits of H are {e} and some other subsets of K, each consisting of |H| elements. The other Frobenius complements are H x = xHx −1 , for x ∈ K. They are closed subgroups and their orbits form closed partitions. We denote by FC the set of Frobenius complements in G.
Let H be the Frobenius complement H e . Since the Frobenius complements are all conjugates of H, being an FC-strong base is equivalent to being an H-strong base.
To characterize H-strong bases it will be convenient to use the following notion. For u, v ∈ K with u = v, we say that z ∈ K separates u and v if v • z ∈ H • (u • z). We have the following characterization. Proof. To see the "if" part of the statement, suppose that g ′ ∈ z∈B HG g•z for some g ′ , g ∈ G.
We will prove that g ′ ∈ H. Let g = yh and g ′ = y ′ h ′ , where y, y ′ ∈ K and h, h ′ ∈ H. Then for every z ∈ B, there exists h z ∈ H such that g ′ • (g • z) = h z • (g • z). Using the definition of •, this equality can be rewritten as , that is, no element in B separates u and v. Therefore, by the assumption we get u = v, which is equivalent to y ′ = e. Thus g ′ = h ′ is indeed an element of H.
To see the reverse implication, assume that there exist u, v ∈ K, u = v, such that none of the elements z ∈ B separate u and v. This means that for every z ∈ B there exists an element , that is, vu −1 ∈ z∈B HG u•z . As vu −1 ∈ H, this contradicts the definition of a strong base.
Our next lemma gives a lower bound on the number of elements in K that separate u and v. Proof. If z does not separate u and v then there exists an element h ∈ H such that vz = huzh −1 which can also be written as hu −1 h −1 v = hzh −1 z −1 . We say that such an element h belongs to z. The identity element h = e does not belong to any element z ∈ K since u = v. We claim that h = e cannot belong to two distinct elements of K. Indeed, if hzh −1 z −1 = hz ′ h −1 z ′−1 then hz ′−1 zh −1 = z ′−1 z, which in turn implies that z ′−1 z = e as e is the only element of K stabilized by the elements of H. Therefore, there are at most |H| − 1 elements in K which do not separate u and v. In other words, at least |K| − |H| + 1 of the elements of K separate u and v. Note that H has (|K| − 1)/|H| orbits of length |H| on the nontrivial elements of K, and thus |H| divides but is not equal to |K| − 1, which implies |H| ≤ (|K| − 1)/2. From this we can indeed conclude, since then |K| − |H| + 1 > |K|/2.
We have the following result regarding the existence of small strong bases for FC.
Proposition 3. Let G be a Frobenius group with kernel K such that the cardinality of the Frobenius complements is different from |K| − 1. Let B ⊆ K be a uniformly random set of size ℓ, where ℓ = Θ(log |K| log 1/ǫ). Then B is an FC-strong base with probability of at least 1 − ǫ.
Proof. Let B be a uniformly random subset of K of size ℓ. By Lemma 2 it is sufficient to prove that with a probability of at least 1 − ǫ, for every u = v, there exists an element in B which separates u and v. We will in fact upper bound the probability of the opposite event. For a fixed pair u = v, by Lemma 3, the probability that a random z does not separate u and v is at most 1/2. Therefore, the probability that none of the elements in B separates u and v is less than 2 −ℓ . Thus, the probability that for some pair u = v none of the elements in B separates u and v is less than |K| 2 2 −ℓ , which is at most ǫ by the choice of ℓ.
If G is a Frobenius group that satisfies the condition of Proposition 3 then we can compute efficiently a small base for the Frobenius complements, because there are efficient algorithms for random sampling nearly uniformly in black-box groups [1]. Therefore, by Proposition 2 we can efficiently reduce the HSSP to the related HSP and we obtain the following result. We remark that the reduction of Grover's search to a specific HSSP in Proposition 1 can be extended to arbitrary Frobenius groups when |H| = |K| − 1, that is, sharply 2-transitive groups. Therefore, for such groups it not only follows that small H-bases fail to exist but it also follows that even the quantum query complexity of the HSSP is Ω(|G| 1/4 ). Also, the only strong base in a sharply 2-transitive group is the whole K.

Affine groups
As any affine group, the general affine group Aff q = F q ⋊ F * q defined in Section 3.1 is a Frobenius group. Its kernel is F q . In the terminology of Frobenius groups, we have proved in Proposition 1 that for Aff q the HSSP for the complements is difficult. Let H be a proper subgroup of F * q which is not the trivial group. We define the group Aff q (H) as F q ⋊ H. With the restriction of the natural action, denoted here by •, Aff q (H) is also a Frobenius group. In contrast to the difficulty in the full affine group, we obtain the following positive results for the smaller Frobenius groups. They are consequences of the analogous results for the related HSP stated in Facts 1 and 2, via the reduction of Theorem 1. Statements (a) and (b) are not new, they are proved in a slightly different formulation in [20], using implicitly the randomized construction for a strong base. For (c) note that the derived subgroup in Aff q (H) is indeed commutative. Corollary 1. Let q be a prime power and let H ≤ F * q such that 1 < |H| < q − 1. The following results hold for HSSP(Aff q (H), F q , •, FC): (a) It has polynomial query complexity.
(b) It can be solved in quantum polynomial time when q is prime and |H| = Ω(q/polylog(q)).
(c) It can be solved in quantum polynomial time when q is the power of a fixed prime.
The case of Aff q ({±1}), when q is an odd prime power is particularly interesting. It turns out that the HSSP over Aff q ({±1}) for the Frobenius complements is essentially the same problem as the HQPP over F q .

HSP(Aff q ({±1}), FC)
Proof. The first two problems are equivalent as we claim that every f : F q → S, as oracle input for HQPP(F q ) hides the polynomial P u if and only if as oracle input for HSSP(Aff q ({±1}), F q , •, FC) it hides the Frobenius complement H u . To see this, observe that the level sets of P u are of the form {x + u, −x + u}, which are exactly the orbits of H u . Therefore, we have the following equivalences: The reduction from the second problem to the third one is provided by Theorem 1. Note that we can construct a base deterministically by choosing two different elements of order two.

Examining the possible collisions gives that for
Together with Corollary 1 (c) the statements of this proposition imply the following result.

Theorem 2. HQPP(F q ) is solvable in quantum polynomial time over constant characteristic fields.
We observe that in contrast to the constant characteristic case, the HQPP appears to be difficult over prime fields F p , as it is equivalent to the HSP in the dihedral group D 2p ∼ = Aff p ({±1}).
Note that in [8] van Dam, Hallgren and Ip gave a polynomial time solution to a problem which can be considered as a version of HSSP(Aff q (H), F q , •, FC) where the function hiding the complement is promised to be a shifted multiplicative character χ : F * q → C * . This strong promise (in our oracle model we can only check for equality of the output values) makes the problem efficiently solvable even in the case H = {±1} where the HSSP with general hiding function appears to be difficult.
We also remark that strong bases in the Frobenius group Aff q (H) with |H| = (q − 1)/2 play an important role (under the name factoring sets) in certain algorithms for factoring univariate polynomials over F q , see [7]. This is because a set B which separates two (unknown) field elements u and v can be used to find a proper decomposition of a polynomial having both u and v as roots. In fact, an efficient deterministic construction of strong bases for such affine groups over prime fields would imply an efficient deterministic algorithm for factoring polynomials over finite fields.

Multivariate quadratic hidden polynomials
In this part, we reduce the HPP for multivariate polynomials of degree at most two to the univariate HQPP. As already noted, adding a constant term does not change the level sets, therefore we consider polynomials with zero constant term. Thus, we assume that the hidden polynomial is of the form Also, as the partition π P remains the same when we multiply all coefficients with the same non-zero element from F q , we consider that the HPP has been solved if we determine the ratios between all the pairs of the n(n + 1)/2 coefficients a ij and b k .
Proposition 5. The problem HPP(F q , n, 2) can be reduced on a quantum computer to O(n 2 ) instances of HQPP(F q ) in time (n + log q) O(1) .
Proof. In order to simplify the following discussions we define a ji to be a ij for j > i. Additionally, if q = 2 then we also assume a ii = 0 because x 2 = x holds over F 2 . We assume that we have a procedure R for determing the coefficients of a univariate quadratic polynomial up to a common factor. Its oracle input is a function on F q that has the same level set structure as a polynomial of the form ax 2 + bx. We assume that R decides whether a is zero and if a = 0 then R returns the quotient b/a. We start with the case n = 2. We have an oracle with the same level sets as the polynomial We use the oracle with the inputs (x 1 , x 2 ) := (x, 0). This way, we obtain an instance of HQPP for the univariate polynomial a 11 x 2 + b 1 x. We use R to decide whether a 11 is zero or not and if a 11 = 0 then we compute the quotient b 1 /a 11 . Furthermore, we set (x 1 , x 2 ) := (x, 1) for the inputs of the oracle to compute (a 12 + b 1 )/a 11 in the second step. From this result we can easily compute the quotient a 12 /a 11 . Similarly, using the substitutions (x 1 , x 2 ) := (0, x) and (x 1 , x 2 ) := (1, x) we decide whether a 22 is zero or not. If a 22 = 0 then we obtain the quotients a 12 /a 22 and b 2 /a 22 . We now consider the following different cases.
• a 11 , a 22 = 0: If a 12 = 0 then we have determined all coefficients of P up to a common factor. If a 12 = 0 then we use the inputs (x 1 , x 2 ) := (x, x) and we obtain HQPP for (a 11 + a 22 ) x. With R we can determine whether a 11 + a 22 is zero or not. If it is non-zero then we find an element r ∈ F q such that b 1 + b 2 = r(a 11 + a 22 ). When we write b i /a ii = c i then the equation (r − c 1 )a 11 = (c 2 − r)a 22 follows. Since a ii = 0, we can compute easily all coefficients of P up to a common factor. If a 11 + a 22 = 0 then we also can compute all coefficients easily.
• a 11 = a 22 = 0, q = 2: We use the inputs (x 1 , x 2 ) := (x, x) and obtain HQPP for the polynomial a 12 x 2 + (b 1 + b 2 )x that can be used to decide whether a 12 = 0 or not. If it is non-zero then we compute (b 1 + b 2 )/a 12 . Furthermore, we can choose α ∈ F × q , α = 1, and we use the inputs (x 1 , x 2 ) := (x, αx) to compute the fraction (b 1 + αb 2 )/(αa 12 ). From these two fractions we can determine b 1 /a 12 and b 2 /a 12 . If a 12 = 0 then we have the polynomial b 1 x 1 + b 2 x 2 and we can determine the ratio between b 1 and b 2 by the algorithm for the abelian HSP over the additive group of F 2 q . Note that we use a quantum computer for an efficient implementation of this step of the reduction. This shows that we can find all coefficients of a bivariate polynomial up to a common factor when we use R only a constant number of times and some additional operations, which can be performed efficiently on a quantum computer.
Next we consider the case n = 3. Substituting zero in x 3 , we can use the algorithm for the bivariate case to test whether a 11 = 0. If a 11 = 0 we can determine the quotient of the remaining coefficients (except for a 23 ) and a 11 by substituting zero in x 2 or x 3 and using the algorithm for the bivariate case. For a 23 we can substitute (x 1 , x 2 , x 3 ) = (x, y, y) and obtain the polynomial a 11 x 2 + (a 12 + a 13 )xy + (a 22 + a 23 + a 33 ) Then the algorithm for the bivariate case gives us (a 22 + a 23 + a 33 )/a 11 from which we can compute a 23 /a 11 . The cases where any of the coefficients b 1 , a 22 , b 2 , a 33 , or b 3 is non-zero can be treated in a similar way. It remains to handle the case of a polynomial of the form a 12 x 1 x 2 + a 13 x 1 x 3 + a 23 x 2 x 3 . Then substituting 1 in x 3 gives the polynomial a 12 x 1 x 2 + a 13 x 1 + a 23 x 2 and the ratio between the three coefficients can be found by the bivariate algorithm.
The case n = 4 can be handled as follows. We apply the algorithm of the preceding paragraph to the four polynomials obtained by substituting zero in x 1 , x 2 , x 3 , and x 4 , respectively. Observe that these steps determine the ratio between pairs of coefficients that have indices that fit in a three-element subset of {1, 2, 3, 4}. By transitivity, we are done unless our polynomial is of the form a 12 x 1 x 2 +a 34 x 3 x 4 , a 13 x 1 x 3 +a 24 x 2 x 4 , or a 14 x 1 x 4 +a 23 x 2 x 3 . If it is of the form a 12 x 1 x 2 +a 34 x 3 x 4 then we can determine the ratio between the coefficients by using the bivariate algorithm by substituting x 1 in x 2 and x 3 in x 4 . The two remaining polynomials can be treated in a similar way.
Finally we consider the case n > 4. Using O(n 2 ) applications of the bivariate algorithm, we find indices i = j such that at least one of a ii , b i or a ij is non-zero. The ratio between this coefficient and any other can be computed using the algorithm for two, three, or four variables. The cost of these steps amounts to O(n 2 ) applications of the procedure R and a polynomial number of other operations.
Theorem 3. HPP(F q , n, 2) can be solved by a polynomial time quantum algorithm over fields of constant characteristic.

Function graph groups and the HPGP
For dealing with the HPGP we define a family of semidirect product groups that we call function graph groups. We show that each instance of the HPGP (F q , 1, d) can be reduced to the HSP for an appropriate function graph group corresponding to univariate polynomials of degree at most d. These special function graph groups are semidirect products of groups of q-power order. Therefore, they cannot be Frobenius groups.

The HPGP as HSSP over function graph groups
It will be convenient to work in a more general setting.
Definition 4. Let A and B be two abelian groups. The family of functions mapping A to B forms an abelian group F with the addition defined as (Q 1 + Q 2 )(x) = Q 1 (x) + Q 2 (x). For every t ∈ A, the shift map a t defined as (a t Q)(x) = Q(x − t) is an automorphism of this group. A function group from A to B is a subgroup K of F which is closed under the shift maps. We denote the restriction of a t to K also with a t . Then the map t → a t is a homomorphism from A to the automorphism group of K. The function graph group Fg(K) is defined as the semidirect product K ⋊ t →at A.
The multiplication of Fg(K) is given by the rule The shifting action • of Fg(K) on A × B is defined as For t ∈ A and Q ∈ K, we set a Q,t = (Q − a t Q, t), the conjugate of the element (0, t) by (Q, 0). Furthermore, let A Q = {a Q,t : t ∈ A} be the conjugate of the subgroup {(0, t) : t ∈ A} by (Q, 0). Then every A Q is a subgroup of Fg(K) that is complementary to the normal subgroup {(Q, 0) : Q ∈ K}. We call them standard complements, and we denote by SC the family {A Q : Q ∈ K} of the standard complements.
We are now ready to show a connection between function graph problems and the orbits of the standard complements in function graph groups. Proposition 6. Let Fg(K) be a function graph group, let • be its shifting action on A × B, and let A Q be a standard complement. Then A Q is closed and the orbits of A Q are the level sets of the function f : This is a contradiction since a Q,t (x, y) = (x, y ′ ) is only possible if t = 0 and y ′ = y.
To see the second part of the statement, observe that f (x, We now specialize function graph groups to polynomials which relate them to the HPGP. Let A and B be the additive group of F q and let K be F

Small bases for standard complements
In this section, we construct strong bases for the standard complements in function graph groups. The next lemma gives a simple characterization of such bases.
This can be rewritten as ( We first prove the "only if" part of the lemma. To this end, let D be an A Q -strong base and let R ∈ C be a function such that R(x i ) = 0 for all i. Let be any element. Since D is a base we know that the intersection is equal to A Q and from this (Q ′ , t ′ ) = (Q − a t ′ Q, t ′ ) follows. We also know that (a −t ′ Q ′ − a −t ′ Q + Q)(x i ) = 0 for all i and the same is true for a −t ′ Q ′ + R − a −t ′ Q + Q. Hence, we also have (Q ′ + a t ′ R, t ′ ) in the intersection and (Q ′ + a t ′ R, t ′ ) = (Q − a t ′ Q, t ′ ) follows. We have (Q ′ , t ′ ) = (Q ′ + a t ′ R, t ′ ) and this directly implies To see the "if" part of the lemma, observe that the second statement of the lemma, applied to the function We apply the shift map a t ′ to this equality and we obtain Q ′ = Q − a t ′ Q. Hence, we have (Q ′ , t ′ ) = a Q,t ′ ∈ A Q and this shows that D is an SC-strong base.
Combining the statements of this section we obtain the following result. Proof. Univariate polynomials of degree d have at most d roots over a field. Therefore, by Proposition 7, Lemma 4 and Lemma 1, we can associate in polynomial time an instance of HPGP(F q , 1, d) that hides a polynomial Q with symmetries to an instance of HSP(Fg(F , SC) that hides the subgroup A Q . Then the polynomial Q (up to a constant term) can be recovered from generators for A Q as follows. The elements (Q − a t 1 Q, t 1 ), . . . , (Q − a t ℓ Q, t ℓ ) generate A Q if and only if t 1 , . . . , t ℓ generate the additive group of F q . It follows that for arbitrary s ∈ F q , we can efficiently compute Q − a s Q using the group operation in A Q ≤ Fg(F We remark that the group Fg(F (d) q [x]) is of nilpotency class d + 1. However, we can actually give a reduction to the HSP in a group of class d. To this end, observe that the hidden subgroup is a conjugate of the complement F q . Therefore, it can be found in the subgroup generated by the commutator of F q with F (d) q [x] (this is an abelian normal subgroup) and the complement F q . This semidirect product group has nilpotency class d.
Note that semidirect product groups Fg(F ) are metabelian and that their exponent is the characteristic of F q . Therefore, for fixed characteristic, we can apply Fact 2 (b) to obtain the following result.
Corollary 2. Assume that q is a power of a fixed prime p. Then HPGP(F q , 1, d) can be solved by a quantum algorithm in time polynomial in d and log q.
This corollary allows us to complete Fact 4 (b), because it can be applied to fields of characteristic in the set E d that were left open. Since E d is finite it follows that for fixed d we can solve HPGP(F q , 1, d) in quantum polynomial time for all finite fields. Together with Fact 4 (a) this improves the overall result of [9]: the HPGP(F q , n, d) can be solved efficiently for all finite fields when n and d are constant. We further improve this result in the next section where we present a more powerful reduction of the multivariate problem to the univariate case.
We conclude this section by showing that the HSP for semidirect product groups of the form We prove the theorem in the remainder of the subsection. For this, we consider n-variate polynomials of the special form Note that we changed the notation by replacing the polynomials Q(x 1 ) in Def. 1 by polynomials Q(x 1 , . . . , x n ) ∈ F q [x 1 , . . . , x n ]. This makes the following discussion easier. Recall that the constant term of the polynomials Q(x 1 , . . . , x n ) is assumed to be zero since it cannot be determined. Furthermore, the identity x q = x in F q implies that we can only distinguish polynomials that are reduced modulo x q i − x i for all variables x i . Hence, for a maximum total degree d we only consider local degrees of at most min{d, q − 1}, i.e., the power of each x i in all monomials occuring in Q(x 1 , . . . , x n ) is less or equal to this minimum.
For each j with 1 ≤ j ≤ n let be the set of all exponent vectors for the monomials of total degree at most d when the variables are restricted to x 1 , . . . , x j . For each α ∈ I (j) let denote the corresponding monomial. For j and j ′ with 1 ≤ j < j ′ ≤ k, a monomial m α with α = (α 1 , . . . , α j ) ∈ I (j) is also defined byα = (α 1 , . . . , α j , 0, . . . , 0) ∈ I (j ′ ) . Finally, denote the evaluation of the monomial m α at the point v. For q > ℓ, the number of such monomials is given by the simple expression For q ≤ ℓ, the number of such monomials is determined with the inclusion-exclusion principle, which leads to the expression We use the convention that the binomial coefficient is zero if the number at the top is negative. With the help of I (j) we can define the generalized Vandermonde matrix and describe an efficient construction.
Lemma 5. Let d be the maximum total degree of the monomials in I (j) over the field F q . Then there is a classical algorithm for constructing a set V (j) ⊂ F j q of cardinality |I (j) | such that the square matrix has full rank. This matrix is called the generalized Vandermonde matrix. The running time of the algorithm is polynomial in |I (j) |.
Proof. This statement is proved in [25]. For the sake of completeness we present here another proof which is also much simpler than the original one. The condition that M (j) has full rank is equivalent to the following condition: for every (non-zero) polynomial there is at least one v ∈ V (j) such that F (v) = 0.
has the full rank |I (1) | = b. Observe that we obtain a (square) Vandermonde matrix by multiplying ) from the left. We choose v 1 to be equal to 1. Assume that we have already determined a suitable V (j−1) for some j ≥ 2. We show how to obtain V (j) using V (j−1) .

4.
Determine a (non-trivial) vector c = (c α ) ∈ F |I (j) | q in the kernel of L (j)

Set
G(x 1 , . . . , x j ) ← α∈I (j) c α m α 6. Determine a vector u ∈ F j q such that G(u) = 0 Add the row vector m α (u) α∈I (j) at the bottom of L (j) 9. UNTIL the rank of L (j) is maximal We now explain how the different steps can be implemented efficiently and why the algorithm produces a valid V (j) .
We can compute a non-trivial vector c in the kernel of L (j) in step 4 with Gaussian elimination. To find a u with G(u) = 0 in step 5, we write G in the form At least one of the polynomials F i is non-zero because G is non-zero. Set F to be the non-zero F i with the smallest i. We can write F as F (x 1 , . . . , x j−1 ) = β∈I (j−1) d β m β ∈ F q [x 1 , . . . , x j−1 ] with appropriate coefficients d β ∈ F q . There exists a vector v = (v 1 , . . . , v j−1 ) ∈ V (j−1) with F (v) = 0. This is because otherwise we would have a non-trivial linear dependency of the rows of L (j−1) corresponding to the elements in V (j−1) . Hence, the polynomial P (x) := G(v 1 , . . . , v j−1 , x) is a non-zero univariate polynomial that can be written as a linear combination of monomials m γ with γ ∈ I (1) . The element w ∈ F q with P (w) = 0 can be found among the elements of V (1) . We obtain the desired vector u by setting it equal to (v 1 , . . . , v j−1 , w). By adding the new row vector to L (j) in step 8 we achieve that the vector c is no longer in the kernel of the new augmented matrix. Hence, we reduced the dimension of the kernel of the linear map defined by this matrix. In other words, we have increased its rank by exactly 1. This shows that the algorithm terminates.
We are now ready to describe the improved reduction. Lemma 6. Let V (n) be as in Lemma 5. Then the coefficients of the hidden polynomial of Eq. (4) can be determined by solving the univariate HPGP for the polynomials Q(v 1 x, v 2 x, . . . , v n x) for all v ∈ V (n) .
Proof. The unknown polynomials can be expressed as where Q ℓ denotes the homogeneous part of total degree ℓ.
For each v = (v 1 , . . . , v n ) ∈ F n q , the substitution x i → v i x in the hidden multivariate polynomial Q leads to the univariate polynomial We determine the coefficients Q ℓ (v) of P v (x) by using the quantum algorithm for the univariate case. Let z = [q α ] T α∈I (n) be the column vector whose entries are the unknown coefficients we seek to learn. Let y = [Q 1 (v) + . . . + Q d (v)] v∈V (n) be the column vector whose entries are the sum of evaluations of the homogeneous part Q ℓ at the points v ∈ V (n) . We have M (n) z = y. Hence, we can recover y since the generalized Vandermonde matrix M (n) has full rank.
Theorem 5 follows directly from Lemma 6. Note that in the course of the above reduction, we learn d|I (n) | log 2 (q) bits by solving |I (n) | instances of the univariate case (each instance yielding exactly d coefficients in F q ). The absolute lower bound is given by |I (n) | log 2 (q), which corresponds to the number of bits necessary to specify all coefficients of the hidden polynomial Q. This discussion shows that our method is optimal up to the factor d.
Theorem 5 also gives an instance of the HSSP which is solvable in quantum polynomial time, although no small strong bases exist (and therefore the reduction scheme of Section 3 does not work directly). Let A and B be the additive group of F n q and F q , respectively, and and let K be F  q [x 1 , . . . , x n ]), F n q × F q , •, SC) can be solved in quantum polynomial time. On the other hand, as multivariate polynomials have many zeros, there are no bases of polynomial size for the action • for n ≥ 2, see Lemma 4.