Abstract:
Quantum symbolic execution is a technique for generating test cases for quantum programs. At present, quantum symbol execution only mechanically divides the test case space continuously according to each conditional statement in the debugged program, without considering the entire expression and the nesting of conditional statements, which results in complex quantum circuits. To solve this problem, this paper proposed an optimization of quantum symbols. First, by simplifying the relational expression, the number of quantum modules was directly reduced, or the number of quantum modules was indirectly reduced through the substitution of values. Second, the methods of simplifying circuit for logic AND and logic OR were presented, respectively. Finally, it was proposed that the nested conditional statement was regarded as the logic AND of outer layer and inner layer to simplify the circuit, and optimize the division of the test case space in the quantum symbolic execution. Results show that this optimization method reduces the cost of implementing quantum symbolic execution circuits, including the number of quantum gates and qubits.