  Currently, quantum hardware is restrained by noises and qubit numbers. Thus,
a quantum virtual machine that simulates operations of a quantum computer on
classical computers is a vital tool for developing and testing quantum
algorithms before deploying them on real quantum computers. Various variational
quantum algorithms have been proposed and tested on quantum virtual machines to
surpass the limitations of quantum hardware. Our goal is to exploit further the
variational quantum algorithms towards practical applications of quantum
machine learning using state-of-the-art quantum computers. This paper first
introduces our quantum virtual machine named Qsun, whose operation is
underlined by quantum state wave-functions. The platform provides native tools
supporting variational quantum algorithms. Especially using the parameter-shift
rule, we implement quantum differentiable programming essential for
gradient-based optimization. We then report two tests representative of quantum
machine learning: quantum linear regression and quantum neural network.
