3
$\begingroup$

Is there a quantum circuit that encodes the statevector so that the coefficients of the statevector $|\psi\rangle$ corresponds to a discrete representation of $sin(kx)$ in $[0,1]$? In particular, I'd like to have a set of gates that scales and works for all qubit number $n$. I'd be happy with $sin(x)$ but ideally, I'm looking for higher frequencies multiples as well.

By statevector I am referring to the set of probabilities $(\psi_1,\psi_2,...,\psi_N)$ associated with $|00...0\rangle$, $|00...1\rangle$,...,$|11...1\rangle$ that one gets when reading the output. Please note that I am thinking in the framework of variational algorithms. In these cases, given a qubit register $|\textbf{q}\rangle=|q_1\rangle \otimes ... \otimes |q_n\rangle$, we encode vectors as \begin{equation} |\psi\rangle=\sum_{k=0}^{N-1} \psi_k |\text{binary(k)}\rangle \end{equation}

It is this vector in particular whose entries $\psi_i$ I want to encode to represent a sine. For example, for 3 qubits this vector will have $N=8$ entries. If you divide [0,1] uniformly in $[x_0, ...,x_{N-1}]$, I am looking for an unitary such that $\psi_i=sin(x_i)$. (Or I guess would be more correct to say $sin(2\pi x_i)$)

If possible, I'm looking for both theoretical explanation and practical circuit implementation that I could run and test (not just "theoretically there is an oracle..." etc.). Also, among the possible set of unitaries, clearly the shallower and less connected, the better.

If the question isn't clear please ask for clarification in the comments - I'll be happy to improve it.

$\endgroup$
2
  • $\begingroup$ So you're effectively after something that's the imaginary component of a state $U_{QFT}|0\rangle$, from the quantum Fourier transform? $\endgroup$
    – DaftWullie
    Commented May 17, 2021 at 14:45
  • $\begingroup$ No, as far as I understood when computing QFT your outputs are the projection along the $sin(kx)$ basis, whereas here I would like to assemble a state vector whose coefficients are a discrete representation of a sine function $\endgroup$
    – Enrico
    Commented May 17, 2021 at 19:03

1 Answer 1

2
$\begingroup$

It's worth noting that the Fourier transform implements $$ |\Psi\rangle=U_{QFT}|0\rangle=\frac{1}{\sqrt{2^n}}\sum_{j=0}^{2^n-1}e^{2\pi i\frac{j}{2^n}}|j\rangle, $$ so for some particular choice of frequency, what you're effectively asking for is, up to normalisation, $$ \text{Im}(|\Psi\rangle). $$

Now, there's a neat way to do this. There's a standard proof that demonstrates that only-real-amplitude quantum computation is just as powerful as quantum computation (see definition 1 in this paper) - you add a single ancilla qubit whose 0/1 value represents whether the amplitude is real or imaginary. So, if you implement the quantum Fourier transform using this circuit construction, and you measure that ancilla qubit, if you find it to be in the $|1\rangle$ state, you've created exactly the state you want. I believe this happens with probability $1/2$, so repeat until success is a very reasonable strategy. Alternatively, you could apply amplitude amplification, but that will make your circuit much more complicated.

If you want different frequencies (within limits), just choose a different number of qubits to use! You can also vary which basis element the input state is.

$\endgroup$
13
  • $\begingroup$ Hi, thanks for your answer. Correct me if I am wrong, but when you apply a QFT, aren't the entry of $\psi$ the coefficient associated with the amplitude of each frequency? I am looking for something a bit different. I'll expand the question with more context $\endgroup$
    – Enrico
    Commented May 17, 2021 at 15:00
  • $\begingroup$ Is it really the probabilities you're after rather than the amplitudes? $\endgroup$
    – DaftWullie
    Commented May 17, 2021 at 15:03
  • $\begingroup$ Sorry If I haven't edited the question yet but I'm trying to understand how to write it down. First of all, I am working in the framework of variational algorithms and not binary calculus like HHL etc. In these algorithms, the way you encode a vector is in the probabilities associated with each output. There is a certain probability you get the 0 vector as an output, and this is the first entry of the vector I am looking for and so on for the others. I'll add this edit to the question and as soon as I can expand even further $\endgroup$
    – Enrico
    Commented May 17, 2021 at 15:20
  • $\begingroup$ I've updated it, you might want to check if it's now more clear $\endgroup$
    – Enrico
    Commented May 17, 2021 at 15:58
  • $\begingroup$ Yes, this is exactly what my answer covers (incidentally, the $\psi_k$ are probability amplitudes, not probabilities). $\endgroup$
    – DaftWullie
    Commented May 18, 2021 at 6:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.