# Quantum Fourier Transform

**URL:** <https://discuss.pennylane.ai/t/quantum-fourier-transform/664>\
**Category:** PennyLane Help\
**Created:** [November 8, 2020, 5:10am UTC](https://discuss.pennylane.ai/t/quantum-fourier-transform/664 "2020-11-08T05:10:10Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![antalszava](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/antalszava/32/171_2.png) [@antalszava](https://discuss.pennylane.ai/u/antalszava)\
**Post date:** [November 10, 2020, 2:52pm UTC](https://discuss.pennylane.ai/t/quantum-fourier-transform/664/18 "2020-11-10T14:52:05Z")

</div>

Hi @gidu,

> Also, please how can I extract the probabilities for the different bases?

`qml.probs` returns probabilities of computational bases states. If you’d like to extract probabilities of states in another basis, then one approach is to apply rotations to the circuit followed by using `qml.probs`. The needed rotations can be obtained for an observable by calling the `diagonalizing_gates` method:

```python
print(qml.Hadamard(wires=[0]).diagonalizing_gates())

[RY(-0.7853981633974483, wires=[0])]

```

[This forum thread](http://discuss.pennylane.ai/t/use-of-pauliz-gate/522/3) shares more details on how we obtain these rotations.

* * *

The code snippet seems to be using PennyLane well indeed. One thing to note, is that for `n>3`, `qft` would still only extract `qml.probs(wires=[0, 1, 2])` (might be worth parametrizing the `wires` based on the value of `n`).

---

_[View the full topic](https://discuss.pennylane.ai/t/quantum-fourier-transform/664)._
