mindquantum.algorithm.library.qft

View Source On Gitee
mindquantum.algorithm.library.qft(qubits)[source]

Quantum fourier transform (QFT).

The function of the quantum Fourier transform is similar to that of the classical Fourier transform.

Note

Please refer to Nielsen, M., & Chuang, I. (2010) for more information.

Parameters

qubits (list[int]) – Qubits you want to apply quantum fourier transform.

Examples

>>> from mindquantum.algorithm.library import qft
>>> print(qft([0, 1]).get_qs(ket=True))
1/2¦00⟩
1/2¦01⟩
1/2¦10⟩
1/2¦11⟩
Returns

Circuit, circuit that can do fourier transform.