Fig. 1
From: Experimental demonstration of quantum finite automaton

State diagrams of deterministic finite automata (DFAs) and quantum finite automata (QFAs). a The state diagram of a typical DFA. S0 and S1 are the two possible states of the DFA, where S0 is both the start state and the accepted state. For each state, there is a transition arrow leading out to a next state for both 0 and 1. Upon reading a symbol (0 or 1), the DFA will jump deterministically from one state to another following the transition arrow. The current DFA accepts only binary numbers that are multiples of 2. b The state diagram of a general QFA. Inside the QFA is an m-dimensional quantum state, with |ψ0〉 as the start state and |0〉, |1〉, ..., |m−2〉, |m−1〉 being its m orthonormal basis states, where some of these basis states are designated as accepted states. The input string σ1σ2⋯σn−1σn determines how the quantum state will evolve. Every time a symbol σi is read in, a corresponding unitary operator \(U_{\sigma _i}\) is applied on the quantum state. After reading the last symbol of the string, the final quantum state would be measured and thus projected to one of the m basis states. The input string would then be accepted or rejected by the QFA according to whether or not the quantum state is projected to one of the accepted states. c A DFA for solving a promise problem. This DFA can be used to determine whether the length of an input string is an integer multiple of a prime number P or not. d A QFA for solving the same promise problem. Inside the DFA is a three-dimensional quantum state, with |0〉, |1〉, and |2〉 being its 3 orthonormal basis states, where |0〉 is both the start state and the only accepted state. The quantum state will go through n copies of unitary operator U, where n is the length of the input string