Abstract
We investigate optimizing quantum tree search algorithms by employing a nested Grover Algorithm. This approach seeks to enhance results compared to previous Grover-based methods by expanding the tree of partial assignments to a specific depth and conducting a quantum search within the subset of remaining assignments. The study explores the implications and constraints of this approach, providing a foundation for quantum artificial intelligence applications. Instead of utilizing conventional heuristic functions that are incompatible with quantum tree search, we introduce the partial candidate solution, which indicates a node at a specific depth of the tree. By employing such a function, we define the concatenated oracle, which enables us to decompose the quantum tree search using Grover’s algorithm. With a branching factor of 2 and a depth of m, the costs of Grover’s algorithm are . The concatenated oracle allows us to reduce the cost to for m partial candidate solutions.
Keywords: quantum tree search, Grover’s algorithm, heuristics, nested search
1. Introduction
We investigate the optimization of quantum tree search algorithms by employing a nested Grover Algorithm. We explore the implications of this approach and identify the resulting constraints. Our findings demonstrate the potential for enhanced results compared to previously developed Grover-based methods. Instead of adopting the hybrid divide-and-conquer methods that are predicated on quantum backtracking and quantum walk, as indicated in [1,2], we will proceed with the initial conception of a nested version of Grover’s nested search, as described in [3]. In a nested version of Grover search, the complete tree of partial assignments is expanded to a specific depth, and then a quantum search is conducted within the subset of partial assignments that have not yet been eliminated.
It is claimed that, for certain reasonable distributions of problems, the average complexity of the original nested version of Grover search [3] will be less than that obtained from Grover search. This claim is supported by references [1,3]. Building upon the initial concept of a nested version of Grover search, we will adopt a combinatorial approach to address the limitations inherent in the original work, as described in [3]. For simplicity, we assume that the tree is uniform and its size is known beforehand. We will demonstrate our approach on simple examples using Qiskit, see [4]. The main contributions of this paper are as follows:
We introduce the definition of a partial candidate solution and the contented oracles.
We analyze the constraints of the original Grover’s nested search as introduced in [3];
We introduce the iterative approach with a quadratic speedup in comparison to the original Grover’s algorithm;
We investigate the possibilities of dividing the original space into two disentanglement subspaces and the resulting consequences;
We introduce the concept of performing a permutation on a subspace and the corresponding constraint.
Our approach imposes specific constraints that elucidate the concepts of partial candidate solutions within the context of quantum tree search. This work provides the foundation for quantum artificial intelligence applications, including quantum problem-solving and quantum production systems.
2. Quantum Tree Search
In this section, we outline the application of Grover’s algorithm to the tree search problem. Nodes and edges in a search tree represent states and transitions between states [5]. The initial state is the root, and from each state, either B states can be reached or it is a leaf. From a leaf no other state can be reached. b represents the branching factor of a node, indicating the number of possible choices. A leaf can either be the goal of the computation or an impasse when there are no valid transitions to a succeeding state. Each node except the root has a unique parent node, which is called the parent. Every node and its parent are connected by an edge. Each parent has b children. If and the depth of the tree is m, each of the m questions has a yes/no reply and can be represented by a bit (as shown in Figure 1). The m answers are collectively represented by a binary number of length m.
Figure 1.

Search tree for and depth . Each question can be represented by a bit. Each binary number (11, 10, 01, 00) represents a path descriptor m from the root to the leaf.
There are possible binary numbers of length m. Each binary number represents a path from the root to a leaf. For each goal, a specific binary number indicates the solution. This binary number is called a path descriptor, since it describes a path from the root of the tree to the leaf, see Figure 2 with and depth .
Figure 2.
Search tree for and depth . Each question can be represented by a bit.
For a constant branching factor , each question has b possible answers. The m answers can be represented by a base-b number with m digits. In a quantum computation, we can simultaneously represent all possible path descriptors. There is one path descriptor for each leaf off the tree. Using Grover’s algorithm, we search through all possible paths and verify whether each path leads to the goal state. This type of procedure is known as a quantum tree search [6]. For possible paths, the costs are (approximately) , corresponding to the reduced branching factor .
Grover’s Algorithm
For a function
| (1) |
we seek to identify the value of x representing a path descriptor for which , where , the path descriptor leading to the solution. This task is equivalent to a decision problem with a binary answer: 1 indicating a successful search and 0 indicating an unsuccessful search. The instance x is the input to the problem.
Grover’s amplification algorithm implements exhaustive search in steps in an n-dimensional Hilbert space [7,8,9,10]. This algorithm is derived from the Householder reflection of the state of m qubits, where . Grover’s amplification algorithm is optimal for exhaustive search, as demonstrated by the lower bound established by [11]. One can prove that a better algorithm cannot exist [12,13]. It follows that using a quantum computer, NP-complete problems remain NP-complete. Grover’s amplification algorithm provides a quadratic speedup over classical computers, which would require n steps to solve the problem.
For k solutions and more than two qubits (, ) the number r of iterations is the largest integer
| (2) |
The value of r depends on the relation of n versus k. For and we need only one rotation, and we also need only one rotation for
to find one of the k solutions. The iterative amplification algorithm requires the value of k in order to determine the number of iterations. We can determine the value of k by the quantum counting algorithm [14,15,16].
Uniform distributions are essential for Grover’s algorithm. If the distribution is non-uniform, the algorithm may not function properly or require adaptation which leads to the same complexity [3,17,18,19]. Consequently, we cannot simply mark potential solutions by assigning higher amplitude values to speed up the search. For instance, an adapted algorithm for sparse distributions where the majority of amplitudes are zero must generate a uniform distribution for the unmarked sets, with the resulting complexity [17,18,19].
In our analysis in relation to the O notation and for simplification, we will assume the approximate complexity of Grover’s algorithm as
| (3) |
instead of using the accurate Equation (2).
3. Nested Grover’s Search
Is it possible to integrate nested Grover’s search techniques into the quantum tree search algorithm to enhance the search process? Can the nested Grover’s search be based on heuristic functions? A heuristic function estimates the cheapest cost from a node to the goal. The local path descriptor y describes the path from the root to the node. Therefore, each node in the tree can be described by a local path descriptor. However, we cannot employ a heuristic function to generate a non-uniform distribution, as it does not confer any advantage in Grover’s search. Furthermore, we cannot compare branches represented by distinct path descriptors. This is also the reason why the min-max algorithm cannot be applied to quantum tree search in games. The reason for this is that distinct branches correspond to distinct superpositions, and these superpositions interact solely through interference.
3.1. Partial Candidate Solution
Within the context of quantum tree search, instead of employing a heuristic function , we will utilize the function , which represents a partial candidate solution, and y denotes a path from the root to the corresponding node. In contrast to the heuristic function , which can mark multiple nodes, should exclusively mark a single partial solution that includes the node indicated by the path y.
3.2. Decomposition
The idea of saving the costs is based on the inequality that represents the decomposition of the Hilbert space of dimension into subspaces and of dimension and , see Figure 3. For the value g we assume
Figure 3.
The decomposition of the Hilbert space of dimension into subspaces and of dimension and . In our example, and .
The costs of Grover’s algorithm for the quantum tree search algorithm are
However, the costs associated with Grover’s algorithm for the quantum tree of each subspace would be significantly reduced to
(see Figure 4) with
| (4) |
since
because
Figure 4.
The concept of cost savings is predicated on the inequality that decomposes the Hilbert space of dimension into subspaces of dimensions and , respectively. On the left side, the sum of the costs of Grover’s algorithm, with leaves for addition resulting in , is represented. On the right side, the original costs of Grover’s algorithm are , corresponding to the multiplication operation.
3.3. Nested Grover’s Search and Entanglement
Following, alternatively, the idea that Grover should speed up the search on Hilbert space of dimension , a set ℵ of v partial candidate solutions
is defined that acts on g lower qubits with
| (5) |
on the subspace of dimension , with y being a local path descriptor. Throughout the paper, we will employ the little-endian notation, which stores the least-significant byte at the smallest address. Qubits are represented from the most significant bit (MSB) on the left to the least significant bit (LSB) on the right (little-endian), similar to binary numbers or bit-string representation on classical computers. We illustrate the fundamental concept of nested Grover search through a simple SAT example, characterized by , , and .
as indicated by the circuit in Figure 5a, with the results of measurement shown in Figure 5b. In the initial step, we determine the set ℵ using Grover’s algorithm on the subspace . In the subsequent step, we anticipate utilizing this set to expedite the search for the solution indicated by the oracle , which operates on m qubits. Grover’s amplification is applied to the subspace defined by the upper qubits. However, due to entanglement, we are unable to employ Grover’s algorithm on the upper subspace defined by upper qubits, as both subspaces and become entangled.
Figure 5.
(a) Circuit using Grover’s amplification representing oracles , for lower qubits and the global oracle . Note, qubits 3 and 5 are auxiliary qubits used in Grover’s algorithm to mark the solution. We will employ the little-endian notation as used in Qiskit, see [4]. Notation: H indicates Hadamard gate, X indicates NOT Gate, h1 and h2 oracle circuits that marks the solution in the auxiliary qubits. O represents the global oracle circuits and G Grover’s algorithm circuits. Composed quantum circuits are indicated dark red, quantum gates with colours orange and blue. (b) Due to the entanglement of the lower qubits with the upper qubits, the solution indicated by 10101 is indicated only approximately by .
To comprehend the behavior we introduce concatenated oracles.
3.4. Concatenated Oracles
Concatenation is an associative operation but not a commutative operation. We use for the operation concatenation the specific symbol ‖. If we assume that x is represented by m bits with the notation
then concatenation is often simply the placement of the binary numbers next to each other,
For example, for a binary number of 10 and 11 we get
We extend the concatenation for the oracle function
| (6) |
Using compact notation,
and the oracle function
with
| (7) |
solution being
with being the upper part of the oracle function that acts on the upper qubits, describing the upper subspace of the dimension and being the lower part of the oracle function that acts on the lower qubits, describing the lower subspace of the dimension with
Note that and do not indicate partial candidate solutions; they are exact copies of the oracle function, and it can be challenging to specify them precisely. Also, u indicates the path descriptor. An example is represented in Figure 6.
Figure 6.
Search tree for and depth . With , , , and . Bold lines denote the path to the solution. The dotted line represents the path to the partial candidate solution that does not lead to a solution. Upper-field circles signify partial candidate solutions, while the bold circle in the leaf signifies the solution, which is composed of and u.
In the case we constraint y values to some values with
the constraint oracle can be expressed as with
3.5. Not Entangled Subspaces
Imagine we know that acts on the upper subspace defined by lower qubits and given set ℵ of t partial candidate solutions that act on the subspace defined by upper g qubits,
If we apply both oracles and use Grover’s algorithm to each Hilbert space defined by the subspace and , the results are not entangled since both subspaces are not entangled. In the first step, we determine ℵ using Grover’s algorithm on the Hilbert space defined by the subspace . In the second step, we determine using Grover’s algorithm on the upper qubits of the upper subspace with
| (8) |
If we measure both subspaces, we see that each solution in the lower subspace defines a new combination of the one solution in the upper subspace . One of the combination could correspond to the global solution of the space as described by the oracle , however we do not know if this is the case.
For example in the preceding example we introduce with and
and the oracle for the upper qubits
as indicated by the circuit in Figure 7a, with the results of measurement shown in Figure 7b.
Figure 7.
(a) Circuit employing Grover’s amplification to represent oracles , for lower qubits, and the oracle for the upper qubits . When we measure, we are not guaranteed to obtain the solution , since was not checked and the possible combinations may be not present. Notation: H indicates Hadamard gate, X indicates NOT Gate, h1 and h2 partial candidate solution circuits that marks the solution in the auxiliary qubit, u represents upper part of the oracle function circuit and G Grover’s algorithm circuits. Composed quantum circuits are indicated dark red, quantum gates with colours orange and blue. (b) Due to the combinatorial problem that results in our case, we yield two solutions with equal probability, corresponding to the number of partial candidate solutions, since with .
The approach can be broadly characterized as
| (9) |
| (10) |
after applying Grover’s algorithm to subspace
| (11) |
and the subspace
| (12) |
since both subspaces and are not entangled.
3.6. Entangled Subspaces
In original nested Grover’s search (see Section 3.3), after applying Grover’s algorithm to the subspace we get
| (13) |
both subspaces and are entangled because
| (14) |
Applying Grover’s algorithm to the subspace results in the creation of entanglement.
| (15) |
In our preceding example with (see Figure 5) after applying Grover’s algorithm to the subspace
| (16) |
| (17) |
| (18) |
After applying Grover’s algorithm to the subspace we get
| (19) |
with the state
After applying Grover’s algorithm to the subspace we get
see Figure 5b. Grover’s algorithm operates on the initial two qubits (upper qubits). It operates on two subspaces of , one for and the other for . In the subspace defined by , there is no marking. In the other subspace, there is a marking. As a result of Grover’s amplification, the first subspace exhibits a uniform distribution, while the second subspace contains a marking indicating the solution. Each of the two subspaces defined by and defined by has a probability of being measured of . In the first subspace, the uniform distribution of each state is represented by . In the second subspace, the solution is represented by , as indicated in Figure 5b. The number of partial candidate solutions, denoted as v, is inversely proportional to the probability of measuring the solution, which is represented as . How can this problem be effectively addressed? Two potential solutions to this problem are the iterative approach and the idea of the disentanglement of the two subspaces and .
4. The Iterative Approach
With the set ℵ of v partial candidate solutions
and the global oracle , we built a circuit with one possible could-be solution of the set ℵ and the global oracle. We determine in the first step one solution of one using Grover’s algorithm on the subspace , and in the second step we the global oracle acts on m qubits. Subsequently, we apply Grover’s amplification to the subspace , which is defined by the upper qubits. Figure 8 indicates an example representing the decomposed search tree for .
Figure 8.
Example for . Determine the solution by Grover’s algorithm on the subspace . Verify if the solution indicated by the oracle exists. Repeat the procedure for The bold line signifies the verification of the partial candidate solution.
If a solution exists, the subspaces and are not entangled with . In this case, by measuring , we obtain the solution. This is because the number of partial candidate solutions represented in our circuit is “one,” and the probability of measuring a solution, if it exists, is We measure the state and test whether a solution is present. If it is, we terminate the process; otherwise, we select another potential solution from the set For the simple preceding SAT example with and and we get two circuits, see Figure 9.
Figure 9.
(a) Circuit using Grover’s amplification representing oracle for lower qubits and the global oracle . Notation: H indicates Hadamard gate, X indicates NOT Gate, h1 and h2 partial candidate solution circuits that marks the solution in the auxiliary qubits. O represents the global oracle circuits and G Grover’s algorithm circuits. Composed quantum circuits are indicated dark red, quantum gates with colours orange and blue. (b) Since the solution does not exist, when measuring we get the combination of with all four possible combinations of the two upper qubits and with the probability . (c) The solution for a circuit with . It is the same circuit as shown in (a), only is replaced with .
4.1. Algorithm
Given set ℵ of v partial candidate solutions
and the global oracle .
For to v:
-
1.
For the could-be solution build a circuit;
-
2.
Determine the solution by Grover algorithm on the subspace ;
-
3.
Verify if the solution indicated by the oracle exists;
-
4.
If solution exists success, exit the loop, otherwise, continue the loop.
Since both subspaces and are not entangled, if a solution exists, it is readily apparent. We measure the state and verify whether it is a valid solution. If it is a solution, we conclude the process. Otherwise, we select another partial candidate solution from the set ℵ.
4.2. Optimal Dimension
How can we choose an optimal dimension of the two subspaces and ? The optimal dimension of the two subspaces results in the minimal costs represented by the minimum of the function
| (20) |
which is equivalent to
| (21) |
with the solution
4.3. Costs
Within the subspace , the costs associated with Grover’s algorithm are , while within the subspace , the corresponding costs remain . We need to verify the proposed solution leads to a global solution. Subsequently, we must repeat the procedure in the worst case v times, leading to the cost
| (22) |
with the constraint for v that the cost are below with
| (23) |
since . We observe that maximal possible value for v is approximately equal to the number of nodes located at one-fourth of the depth of the search tree. We can express the cost of iterative search it in O notation, given , as
| (24) |
5. Disentanglement of and
Can we disentangle the spaces and with by knowing the function ? We test the global oracle over the whole space of dimension m that defines the Hilbert space . The test should not entangle both subspaces and . We rely on the assumption that exists and can be decomposed as
Knowing , assuming the is correct and with set ℵ the task is to verify if
is true. If it is true, then we can decompose after Grover’s algorithm on the subspace
| (25) |
| (26) |
| (27) |
After Grover’s search on the subspace , if true,
| (28) |
If not true, for
and for
In the event that does not exist for any z
| (29) |
Since we do not know which we have to test all combinations, but we can reuse the set ℵ once computed.
| (30) |
| (31) |
After Grover’s algorithm on the subspace ,
and if u is not present we get a general superposition. We arrive at the decomposition
| (32) |
We have determined the correct by measuring with a probability of approximately 1 in . Subsequently, we can estimate the path descriptor using Grover’s algorithm on the subspace . The probability measurement of indicates that does not equal l and does not constitute a valid solution. However, for , it necessitates a substantial number of measurements to ascertain that the probability deviates from 1.
5.1. Example with
Our previous example with
After Grover’s algorithm on the subspace we get the decomposition
| (33) |
with
Because of the equality we know that is correct and can estimate the path descriptor by Grover’s algorithm on the subspace .
5.2. Costs
Within the subspace , the cost associated with Grover’s algorithm is . For v combinations in the subspace , the corresponding cost is . Additionally, given , we need to determine the path descriptor by Grover’s algorithm in the subspace . The complete costs are
| (34) |
We can express the cost of iterative search in O notation, given that as before, with
For , the actual costs are less than the cost of the iterative algorithm with
| (35) |
| (36) |
| (37) |
and they are cheaper in relation to .
| (38) |
For , a substantial number of measurements is necessary. A practical approach would be to select , resulting in approximately faster costs
compared to the iterative approach with possible iterations.
Implementation
For the ℵ of v partial candidate solution functions that acts on g lower qubits on the subspace
we introduce a variable
| (39) |
and extend the upper oracle in relation to the variable
| (40) |
For example, for the case , . To determine a possible solution we have to measure v subspaces .
For example, in the preceding SAT example with and we introduce the variable
where corresponds to . The decomposition
is represented by the quantum circuit in Figure 10a.
Figure 10.
(a) Circuit employing Grover’s amplification to represent oracles , representing the decomposition . The subspace is represented by the qubits 0–2, subspace is represented by the qubits 4–6 and subspace is represented by the qubits 8–10. Notation: H indicates Hadamard gate, X indicates NOT Gate, h1 and h2 partial candidate solution circuits that marks the solution in the auxiliary qubits. O represents the global oracle circuits and G Grover’s algorithm circuits. Composed quantum circuits are indicated dark red, quantum gates with colours orange and blue. Notation: H indicates Hadamard gate, X indicates NOT Gate, h1 and h2 partial candidate solution circuits that marks the solution in the auxiliary qubits. O represents the global oracle circuits, U upper part of the oracle function and G Grover’s algorithm circuits. Composed quantum circuits are indicated dark red, quantum gates with colours orange and blue. (b) We measure the subspace representing the solution. (c) We measure the subspace representing a non-solution.
6. Permutation in the Subspace
We can map the set of solutions determined by the function of the set ℵ into in the subspace into another ordering that uses only the corresponding subset that could lead to a decomposition. For example, the superposition
is mapped by a permutation matrix P
| (41) |
into the decomposition , see Figure 11.
Figure 11.
(a) After applying Grover’s algorithm, with two solutions indicated by and . (b) Mapping by permutation operator P indicated by the gate “Unitary” of the register into . Notation: H indicates Hadamard gate, X indicates NOT Gate, h1 and h2 partial candidate solution circuits that marks the solution in the auxiliary qubits. G indicates Grover’s algorithm circuits and Unitary the permutation operator P circuit. Composed quantum circuits are indicated dark red, quantum gates with colours orange and blue. (c) Measuring the circuit (a). (d) Measuring the circuit (b) representing .
We can represent the permutation matrix P as
The operation corresponds to the mapping by permutation operator P of a register of m qubits into a register of m qubits, of which the first g qubits are , with
| (42) |
Since Qiskit uses little-endian notation we indicate the inverse order by a permutation matrix
| (43) |
into the decomposition . We can represent the permutation matrix , and due to little-endian notation we get
The operation corresponds to the mapping by permutation operator of a register of m qubits into a register of m qubits, of which the last g qubits are , with
| (44) |
We can apply such a permutation operator for a nested Grover’s algorithm for tree search, as indicated in Figure 12. Grover’s algorithm is applied on the qubits 2, 4 and 5.
Figure 12.
(a) The corresponding circuit; the permutation operator is indicated by the gate “Unitary”. After applying Grover’s algorithm with two solutions indicated by and , using the oracle on the original space to mark the solution and mapping . Qubit 2 indicates the marked solution describing the subspace by permuted values and . Qubits 4 and 5 correspond to the subspace . Grover’s algorithm is applied on the qubits 2, 4 and 5. We the transpose to determine the solution by the oracle in the original space. This is quite elegant, but until now, there appears to be no straightforward method to ascertain the mapping represented by . Notation: H indicates Hadamard gate, X indicates NOT Gate, h1 and h2 partial candidate solution circuits that marks the solution in the auxiliary qubits. O represents the global oracle circuits, G indicates Grover’s algorithm circuits and Unitary the permutation operator P circuit. Composed quantum circuits are indicated dark red, quantum gates with colours orange and blue. (b) Determining the correct solution in the original space.
6.1. Costs
Ignoring the costs of the permutation operator P with the preparation costs v by basis encoding in subspace , as described by [20,21,22], the costs corresponding to the Grover’s algorithm applied to qubits are
| (45) |
With the preparation costs using Grover’s algorithm in subspace the costs are
| (46) |
in O notation, given , with
6.2. Permutation Operator P
There appears to be no straightforward method to ascertain the mapping represented by P. The permutation operator P is defined by the v paths to partial could-be solutions. Due to entanglement we cannot determine the operator P using and the resulting paths. Due to entanglement we cannot determine the permutation operator P without knowing the paths that indicate which nodes indicate partial could-be solutions. Knowing the paths we can determine the permutation operator P by controlled not gates, see Figure 13a. Using the regularities, permutation operator P can be considerably compressed, see Figure 13c, leading to reduced costs.
Figure 13.
(a) Representation of the permutation operator by controlled not gates. First we indicate the two paths in superposition by two flag qubits 4 and 5. We used the two flag qubits and the knowledge of the two paths to perform the permutation mapping. Knowing the permutation mapping, we disentangle the two flag qubits 4 and 5 by mapping them to zero. Notation: H indicates Hadamard gate, X indicates NOT Gate and is used in as well in controlled not gates, h1 and h2 partial candidate solution circuits that marks the solution in the auxiliary qubits. G indicates Grover’s algorithm circuit. (b) The correct mapping without entanglement of the additional qubits 3, 4 and 5 that are mapped to 0. (c) A compressed representation of the permutation operator P.
Knowing paths defines distinct nodes of the same depth simultaneously. For instance, in the quantum search tree depicted in Figure 6, the two extended oracles would be and , with , and we would seek the solution u. This approach is appropriate for a tree search where we presume that certain nodes at a depth g signify potential solutions. Alternatively, we could implement the two extended oracles directly through a quantum circuit using concatenation.
7. Discussion
7.1. Partial Candidate Solution
Within the context of quantum tree search, instead of employing a heuristic function , we will utilize the function , which signifies a potential solution, and y represents a path from the root to the corresponding node. In contrast to the heuristic function , which can mark multiple nodes, should exclusively mark a single potential solution for the node. A set of partial candidate solutions can be identified by determining their similarity or distance to the goal state. However, how can we pinpoint a single potential solution, a single partial candidate solution? One approach to achieve this is to introduce an additional constraint that narrows the set to a single function, denoted by . Such a constraint could, for instance, specify the possible position within a subtree, thereby reducing the set to a single function. It is important to note that this approach is highly probabilistic and may occasionally yield non-existent partial candidate solutions or values exceeding one. Additionally, we have to take care that v is a constraint, as indicated by the Equation (23). In addition, further research should investigate the partial candidate solution function on examples, as indicated in the paper [5].
7.2. Generalized Quantum Tree Search
We must have prior knowledge of the depth m off the search tree. This constraint can be circumvented through iterative deepening. In an iterative deepening search, we progressively increase the search limit from one to two to three to four and continue until a goal is discovered. For each limit, a search is conducted from the root to the maximum depth of the search tree. Should the search prove unsuccessful, a new search is initiated with a deeper limit. During the iterative deepening search, states are generated multiple times [23,24]. The time complexity of an iterative deepening search is comparable to that of a search to the maximum depth [23]. A quantum iterative deepening search is equivalent to an iterative deepening search [6]. For each limit , a quantum tree search is performed from the root, where represents the maximum depth of the search tree. The potential solutions are determined through measurement.
For a non-constant branching factor, the maximal branching factor has to be used for the quantum tree search [6]. For the maximum value of , the quantum algorithm using qubit representation outperforms the classical tree search described by the effective branching factor b in the specified case
| (47) |
For a large number of instances with varying initial and goal states, the effective branching factor converges to the average branching factor for an uninformed tree search, as shown in [5].
Consider each branching factor as a potential local path. For a non-constant branching factor, the quantum tree search utilizes the maximal branching factor, denoted by . If, in a node , , only are required, and local paths are not utilized. To address this limitation, we augment the path descriptor by repeating the paths. This approach ultimately leads to k solutions that converge to the effective branching factor, as demonstrated in [5].
8. Conclusions
A primary outcome of the investigation is that conventional heuristic functions are unsuitable for quantum tree search due to the inability to disentangle the subspaces utilized by Grover’s algorithm. Furthermore, the theoretical concepts of the potential permutations within the subspace suggest that due to entanglement, we cannot determine the permutation operator P without knowing the paths that represent the values of the heuristic functions.
Consequently, only partial candidate solutions possess the capability to disentangle these subspaces. We assume the existence of a set of partial candidate solutions, denoted by ℵ, that can be determined, for instance, by their similarity to the goal state. We impose the constraint that within this set, only one maximal partial candidate solution, denoted by , identifies a potential solution. Each partial candidate solution of the set ℵ can be constrained to be valid only in a specific subtree. It is important to note that a partial candidate solution is not a position in the search tree itself, as its values are unknown and are determined by Grover’s algorithm and may occasionally yield non-existent partial candidate solutions or values exceeding one candidate solution.
With the existence of the partial candidate solution , the iterative approach represents a considerable speedup with the costs
| (48) |
We can express the cost of iterative search it in O notation, given , since as
Combinatory approach with the possible existence of the upper oracle allows us to disentangle and using
which speeds up the costs minimally.
The work suggests a novel direction based on a partial candidate solution rather than heuristic functions that are unsuitable for quantum tree search. All Qiskit (v2.2) examples are presented in a Jupyter Notebooks that can be freely downloaded at https://github.com/andrzejwichert/Nested-Quantum-Tree-Search (accessed on 16 December 2025).
Institutional Review Board Statement
The funders had no role in the study design, data collection and analysis, decision to publish, or preparation of the manuscript. This article does not contain any studies with human participants or animals performed by any of the authors.
Data Availability Statement
The data presented in this study are openly available in [Nested-Quantum-Tree-Search] at https://github.com/andrzejwichert/Nested-Quantum-Tree-Search (accessed on 16 December 2025).
Conflicts of Interest
The authors declare no conflicts of interest.
Funding Statement
This work was supported by national funds through FCT, Fundação para a Ciência e a Tecnologia, under project UIDB/50021/2020. The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.
Footnotes
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
References
- 1.Montanaro A. Quantum-Walk Speedup of Backtracking Algorithms. Theory Comput. 2018;14:1–24. doi: 10.4086/toc.2018.v014a015. [DOI] [Google Scholar]
- 2.Rennela M., Brand S., Laarman A., Dunjko V. Hybrid divide-and-conquer approach for tree search algorithms. Quantum. 2023;7:959. doi: 10.22331/q-2023-03-23-959. [DOI] [Google Scholar]
- 3.Cerf N.J., Grover L.K., Williams C.P. Nested quantum search and structured problems. Phys. Rev. A. 2000;61:032303. doi: 10.1103/PhysRevA.61.032303. [DOI] [Google Scholar]
- 4.Qiskit-Contributors Qiskit: An Open-Source Framework for Quantum Computing. 2023. [(accessed on 16 December 2023)]. Available online: https://zenodo.org/records/8190968.
- 5.Wichert A. Quantum Artificial Intelligence with Qiskit. CRC Press; Boca Raton, FL, USA: 2024. [Google Scholar]
- 6.Tarrataca L., Wichert A. Quantum Iterative Deepening with an application to the Halting problem. PLoS ONE. 2013;8:e57309. doi: 10.1371/journal.pone.0057309. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Grover L.K. STOC ’96: Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing. ACM; New York, NY, USA: 1996. A fast quantum mechanical algorithm for database search; pp. 212–219. [DOI] [Google Scholar]
- 8.Grover L.K. Quantum Mechanics helps in searching for a needle in a haystack. Phys. Rev. Lett. 1997;79:325. doi: 10.1103/PhysRevLett.79.325. [DOI] [Google Scholar]
- 9.Grover L.K. STOC ’98: Proceedings of the Thirtieth Annual ACM Symposium on Theory of Computing. ACM; New York, NY, USA: 1998. A framework for fast quantum mechanical algorithms; pp. 53–62. [DOI] [Google Scholar]
- 10.Grover L.K. Quantum Computers Can Search Rapidly by Using Almost Any Transformation. Phys. Rev. Lett. 1998;80:4329–4332. doi: 10.1103/PhysRevLett.80.4329. [DOI] [Google Scholar]
- 11.Aharonov D. Ph.D. Thesis. Hebrew University; Jerusalem, Israel: 1999. Noisy Quantum Computation. [Google Scholar]
- 12.Bennett C.H., Bernstein E., Brassard G., Vazirani U. Strengths and Weaknesses of Quantum Computing. SIAM J. Comput. 1997;26:1510–1523. doi: 10.1137/S0097539796300933. [DOI] [Google Scholar]
- 13.Boyer M., Brassard G., Hoeyer P., Tapp A. Tight bounds on quantum searching. Fortschritte Phys. 1998;46:493. doi: 10.1002/(SICI)1521-3978(199806)46:4/5<493::AID-PROP493>3.0.CO;2-P. [DOI] [Google Scholar]
- 14.Brassard G., Hoyer P., Tapp A. Automata, Languages and Programming. Springer; Berlin/Heidelberg, Germany: 1998. Quantum Counting. [Google Scholar]
- 15.Brassard G., Hoyer P., Mosca M., Tapp A. Quantum Amplitude Amplification and Estimation. arXiv. 2000 doi: 10.48550/arXiv.quant-ph/0005055.quant-ph/0005055 [DOI] [Google Scholar]
- 16.Kaye P.R., Laflamme R., Mosca M. An Introduction to Quantum Computing. Oxford University Press; New York, NY, USA: 2007. [Google Scholar]
- 17.Ventura D., Martinez T. Quantum associative memory with exponential capacity; Proceedings of the 1998 IEEE International Joint Conference on Neural Networks Proceedings. IEEE World Congress on Computational Intelligence; Anchorage, AK, USA. 4–9 May 1988; pp. 509–513. [Google Scholar]
- 18.Ventura D., Martinez T. Quantum associative memory. Inf. Sci. 2000;124:273–296. doi: 10.1016/S0020-0255(99)00101-2. [DOI] [Google Scholar]
- 19.Tay N., Loo C., Perus M. Face Recognition with Quantum Associative Networks Using Overcomplete Gabor Wavelet. Cogn. Comput. 2010;2:297–302. doi: 10.1007/s12559-010-9047-2. [DOI] [Google Scholar]
- 20.Trugenberger C.A. Probabilistic Quantum Memories. Phys. Rev. Lett. 2001;87:067901. doi: 10.1103/PhysRevLett.87.067901. [DOI] [PubMed] [Google Scholar]
- 21.Trugenberger C.A. Quantum Pattern Recognition. Quantum Inf. Process. 2003;1:471–493. doi: 10.1023/A:1024022632303. [DOI] [Google Scholar]
- 22.Diamantini M.C., Trugenberger C.A. Mirror modular cloning and fast quantum associative retrieval. arXiv. 2022 doi: 10.48550/arXiv.2206.01644.2206.01644 [DOI] [Google Scholar]
- 23.Korf R.E. Depth-first iterative-deepening: An optimal admissible tree search. Artif. Intell. 1985;27:97–109. doi: 10.1016/0004-3702(85)90084-0. [DOI] [Google Scholar]
- 24.Russell S., Norvig P. Artificial Intelligence: A Modern Approach. Prentice Hall; Hoboken, NJ, USA: 2010. Prentice Hall series in artificial intelligence. [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
The data presented in this study are openly available in [Nested-Quantum-Tree-Search] at https://github.com/andrzejwichert/Nested-Quantum-Tree-Search (accessed on 16 December 2025).












