I'm pretty new in Qiskit and quantum circuits. I'm using Qiskit to implement a quantum circuit and I followed this tutorial to implement a QFT. The way this QFT was built, it applies QFT in the first $n$ qubits, but what I need is to apply the QFT in the last $n$ qubits. Is there any way to do this?
In general, to build a Quantum Fourier Transform on an arbitrary number of qubits, you can use the QFT class already implemented in Qiskit. In particular, to apply it to the last two qubits of your circuit, you can convert the QFT object to a gate and then append it passing the qubits indices.
from qiskit import QuantumCircuit from qiskit.circuit.library import QFT qc = QuantumCircuit(3) qft = QFT(num_qubits=2).to_gate() qc.append(qft, qargs=[1, 2]) qc.decompose(reps=2).draw('mpl')