Is there anyway for example, to take a trivial program from C such as:
int main() {
int i = 1 + 1;
return 0;
}
And compile this down to some form of Quantum Abstract High-level language, i.e. Quantum C?
From what I understand, quantum arithmetic is quite tricky business that uses QFTs. My first thought was to do the following for the example above:
Initialise two qubits and set the amplitudes like following: $$ 0|1|0|0$$
Where 0100 = 2 in decimal.
Somehow return this quantum register.
Using the amplitudes, you could perform 32-bit arithmetic with 32 qubits?
I haven't answered the notion of creating a function or returning either.
Essentially what I'm asking is the following, can we take known quantum methods (using Unitary functions to perform calculation) and apply this to classical code and if so, how?
EDIT: I've looked further and seen a few papers on Quantum Full Adders, I assume this is the way to go for addition? Is this too much? In quantum computation books that describe quantum assembly, there is not much mention of addition.
int j = 1 + 2
? I think the problem is I never really understood how classical assembly understands such things. $\endgroup$