1. A heterogeneous computing method comprising: storing, in a classical memory in a heterogeneous computing system, variables defined by a computer program, the heterogeneous computing system comprising a quantum processor unit and a host processor unit; and executing the computer program in the heterogeneous computing system by: sending instructions from the host processor unit to the quantum processor unit, the instructions being generated by the host processor unit based on values of the variables stored in the classical memory, the instructions configured to cause the quantum processor unit to perform a data processing task defined by the computer program; updating the values of the variables in the classical memory based on output values generated by the quantum processor unit executing the instructions; and using a classical processor unit in the heterogeneous computing system to process the updated values of the variables.