The invention provides a
quantum compiler efficiency evaluation method based on a metamorphic test, and the method comprises the steps: obtaining a
coupling graph Q and an allowable
quantum gate set G of a target
quantum chip, and setting the layer depth of a circuit; the evaluation stage comprises at least one of the following two tests: 1, generating an
executable random circuit C meeting physical constraints based on a
coupling graph Q, compiling the C to obtain a compiled circuit C ', rejecting a non-operational instruction from the C and the C', constructing a gate-level
dependency graph, and performing isomorphic judgment on a graph with a
label; 2, generating an
executable front-section circuit according to the
coupling graph Q, taking a physical bit corresponding relation at the end of the
executable front-section circuit as a fragment entry
layout, performing optimal compiling scheduling on randomly generated small fragments on the Q to obtain an optimal result C *, accessing the fragments according to the mapping of the C * to form a middle-section window, generating an executable rear-segment circuit on the Q by taking the physical bit corresponding relation at the end of the segment as a starting point, and combining the front end, the
middle segment and the rear segment to obtain a test circuit C; c ''is obtained by compiling the Cs, the number of swap gates is used as a main index in a fragment window, the total number of two-bit gates or weighted depth is used as an auxiliary index, and the C' 'and the C * are compared to obtain a swap gate difference value; in the output stage, an evaluation report is generated based on an isomorphic conclusion in the function preserving test and a swap gate difference value in the optimal fragment benchmarking test; according to the method, the efficiency can be improved through two metamorphic relations of isomorphic maintenance and optimal comparison.