**4. Discussion**

In applying the proposed method to mazes without odd cycles, we verified that the paths between the start and goal emerge as trapped states of the quantum walk, and the density on the shortest path was maximized autonomously. As the network without odd cycles is regarded as a bipartite graph, we concluded that the method can be applied to the bipartite graph except for the case where the eternal vibration emerges. The condition for the occurrence of the eternal vibration is not clear as of now as only a few examples were considered.

The key features of the proposed method are the self-loops at the start and the goal and the sink node attached to the goal. In previous studies, the start and goal were marked by reflection with phase inversion placed at the dead ends [18–20]. The correct path was then judged by the transient profile of the probabilities. Our method partially improves upon past works by incorporating self-loops, which can be placed anywhere in the maze, and by determining the correct path according to the eternally remaining densities.

We now consider the remaining densities on the correct path in terms of knowledge that has been proven mathematically. The eigenstate of the time evolution operator of the quantum walk with sinks was constructed on the path between two-self loops [28]. This eigenstate is called the trapped state, and it is not absorbed by the sink. In the Grover walk, the eigenstates are constructed between two self-loops and also around the cycles [28].

To generate a trapped state, the initial amplitude should be placed on the edge that is to be included in the trapped state. This was the reason why the initial amplitude was placed on the self-loop of the start node. If the initial amplitude is placed randomly at the edge, the trapped state on the correct path does not always emerge because the initial edge may not be included on the path between the start and the goal. Even if the initial state is on the correct path, a trapped state may also emerge in the cyclic structure that includes the initial edge. In this case, the shortest path may not have the maximum density. When placing the initial amplitude on a self-loop, the initial edge is not included in any cyclic structure in the network, and only the paths between the start and the goal emerge.

The role of the sink should also be considered. The dynamics of this type of Grover walk can be separated into an electric current component that propagates rapidly, and a random-walk component that propagates slowly [16]. The emergence of the trapped state results from the electric current component; hence, to observe the trapped state, the random-walk component must be eliminated by the sink.

Even without the mathematical knowledge above, the amplitude distribution after convergence can be interpreted by the simple rules observed in the numerical results. The key rule for determining amplitude distribution is that the sum of incoming/outgoing amplitudes to/from a node must be zero, separately. This rule is mathematically and numerically exact at all the nodes in the examples that converged. Figure 9a shows an example of amplitude distribution around a node on the correct path in the maze.

As the sum of incoming and outgoing amplitudes should be zero separately, amplitudes of plus and minus emerge alternately on the line. Figure 9b shows an example of an amplitude distribution around a dead-end node. As only one amplitude is incoming to the dead-end node, that should be zero to make the sum of the incoming amplitude zero. This is why the amplitudes vanish on the path to the dead-end.

Figure 9c shows an example of amplitude distribution around a self-loop. In this case, the amplitude on the self-loop acts as both incoming and outgoing amplitudes to keep the sum zero for both. This is the reason why the signs of the amplitudes are the same on the edges connected to the node involving the self-loop. These facts fit all the nodes included in the numerical results after convergence.

The sum rule above can be used to also explain the amplitude distribution around the even cycle and odd cycle. Figure 9d shows an example of the amplitude distribution around an even cycle. When the large positive amplitude enters the cycle, two small negative amplitudes are generated at the first branching node. Both amplitudes move on the cycle by changing the sign alternately and meet again on the join node. If the cycle is an even cycle, two small negative amplitudes make a large positive amplitude to the outside of the cycle to keep the sum rule. For the case of an odd cycle (Figure 9e), two amplitudes meet at the join node with different signs. To maintain the sum rule, only the smaller amplitude, which is nearly zero, generates the output. This is the reason why the maze, including the odd cycle, cannot be solved by this method.

The maze-solving speed of this method is clearly considerably slower than that of other known algorithms. Although the examples were limited, the convergence steps were difficult to predict by intuition in observing the structure of the network. At present, the intuitive unified parameter that connects the network structure and convergence speed has not been determined mathematically. Further analysis, considering some other aspect, such as the symmetry of the graph, may be required.

The general reason that the maximum densities emerge on the shortest path remains unclear at present; however, some tentative rules were observed numerically. In many cases, the absolute values of amplitude that remained could be approximated to a rational number composed of integers. When there is only one path to the goal, the absolute values of amplitudes on an edge become the inverse number of the number of edges included in the path. This is observed in Figures 2, 3, 4a and 5a. The preserved amount is not the square of the amplitude but the absolute value of amplitude. It is the same as the sum rule discussed above.

When there are multiple paths to the goal and they do not share edges mutually, the ratio of the absolute values of amplitudes is in inverse proportion to the ratio of the distance of the paths. This is observed in Figure 4b–f. When there are two paths to the goal and they share some edges, the ratio of the absolute values of amplitudes is in inverse proportion to the ratio of the distance of the non-shared part of the paths. This is observed in Figure 6a,c. When there are more than two paths to the goal and they share some edges, the dependence of the relative amount of amplitudes on the distance is unclear; however, certain rules clearly exist. This was seen in Figure 5b,d.

To apply the method presented for actual problems of the shortest path finding, the lengths of all the paths should be expressed by positive integers. The odd-loops must not be included; however, the odd-loops would be eliminated by a slight modification of the distance in the process of discretization of the network. The eternal vibration is still the obstacle of the path-finding problem. This should be analyzed more both mathematically and numerically. Additionally, this method cannot involve the negative distance that is considered in some classical algorithms.

Studying this maze-solving method may not appear to be of much use from the viewpoint of computational algorithms; however, it may help to understand the mechanisms of autonomous features that can be observed in a natural system because the quantum walk is a toy model that can be applied to the energy transportation in quantum fields, such as dressed photon phenomena [30].

While the emergence of the shortest path or some other optimized structure in a natural phenomenon may seem mysterious at first glance, they may have an analogy in maze-solving using the quantum walks. Moreover, the implicit existence of the sink node may play an important role in such systems.

**Figure 9.** Schematic for the interpretation of the amplitude distribution after convergence based on the sum rule on each node. (**a**) An example of distribution around a node on the correct path in the maze. The sums of incoming amplitudes (red arrows) and outgoing amplitudes (blue arrows) should be zero, respectively. (**b**) An example of distribution around a node at a dead-end. To make the sums of incoming/outgoing amplitudes zero, respectively, no amplitude should enter the dead-end. (**c**) An example of distribution around a node with a self-loop. Amplitude on the self-loop acts as both incoming and outgoing amplitudes. (**d**) An example of distribution around an even-cycle. (**e**) An example of distribution around an odd-cycle.

**Author Contributions:** Conceptualization, L.M.; methodology, L.M. and E.S.; software, K.Y. and H.L.; validation, L.M., E.S. and H.L.; formal analysis, K.Y. and H.L.; investigation, L.M. and E.S.; resources, all authors; data curation, L.M. and K.Y.; writing—original draft preparation, L.M.; writing—review and editing, L.M.; visualization, K.Y. and H.L.; supervision, L.M.; project administration, L.M.; funding acquisition, L.M. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research received no external funding.

**Data Availability Statement:** The data presented in this study are available on request from the corresponding author.

**Acknowledgments:** We thank Osamu Ogurisu and Hayato Saigo for helpful discussions.

**Conflicts of Interest:** The authors declare no conflict of interest.
