  The quantum instruction set (QIS) is defined as the quantum gates that are
physically realizable by controlling the qubits in quantum hardware. Compiling
quantum circuits into the product of the gates in a properly defined QIS is a
fundamental step in quantum computing. We here propose the quantum variational
instruction set (QuVIS) formed by flexibly designed multi-qubit gates for
higher speed and accuracy of quantum computing. The controlling of qubits for
realizing the gates in a QuVIS is variationally achieved using the fine-grained
time optimization algorithm. Significant reductions in both the error
accumulation and time cost are demonstrated in realizing the swaps of multiple
qubits and quantum Fourier transformations, compared with the compiling by a
standard QIS such as the quantum microinstruction set (QuMIS, formed by several
one- and two-qubit gates including one-qubit rotations and controlled-NOT
gates). With the same requirement on quantum hardware, the time cost for QuVIS
is reduced to less than one half of that for QuMIS. Simultaneously, the error
is suppressed algebraically as the depth of the compiled circuit is reduced. As
a general compiling approach with high flexibility and efficiency, QuVIS can be
defined for different quantum circuits and be adapted to the quantum hardware
with different interactions.
