TransWikia.com

How to represent a sine function in the statevector $|psirangle = sin(kx)$

Quantum Computing Asked on August 6, 2021

Is there a quantum circuit that encodes the statevector so that the coefficients of the statevector $|psirangle$ 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…0rangle$, $|00…1rangle$,…,$|11…1rangle$ 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_1rangle otimes … otimes |q_nrangle$, we encode vectors as
begin{equation}
|psirangle=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(2pi 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.

One Answer

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

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 $|1rangle$ 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.

Correct answer by DaftWullie on August 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP