0

I have the following code

x = [1, -4, 5, -2] # Data points
N = len(x)  # Number of samples
n = np.arange(N)  # Current sample
k = n.reshape((N, 1))  # Current frequency
e = np.exp(-2j * np.pi * k * n / N)  # Exponential part
DFT = np.dot(e, x)

How can I make this Classical Fourier Transform into the Quantum version, either via python or qiskit?

Steve Bermeo
  • 37
  • 1
  • 7

1 Answers1

0

Ok, so I think you should first read about the quantum Fourier transform and see what it does, as the Quantum Fourier Transform is not a quantum algorithm for calculating the Fourier transform but rather a way to transform from one state basis to another called the Fourier basis, it does not convert a finite sequence of equally-spaced samples of a function into a same-length sequence of equally-spaced samples as the DFT does

That being said, if you simply want to implement the QFT then you can find examples here

https://qiskit.org/textbook/ch-algorithms/quantum-fourier-transform.html

as well as some intuition of what the transform does and how to use it. I don't know if the data points you have are those for a reason, but you may want to change them to use them in qiskit for strings of 0s and 1s or convert them to binary and use quite a few qubits