# QFT: no qml.transforms.decompose

**URL:** <https://discuss.pennylane.ai/t/qft-no-qml-transforms-decompose/7894>\
**Category:** Demos\
**Created:** [January 25, 2025, 3:14am UTC](https://discuss.pennylane.ai/t/qft-no-qml-transforms-decompose/7894 "2025-01-25T03:14:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlowe](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/mlowe/32/2805_2.png) [@mlowe](https://discuss.pennylane.ai/u/mlowe)\
**Post date:** [January 25, 2025, 3:14am UTC](https://discuss.pennylane.ai/t/qft-no-qml-transforms-decompose/7894/1 "2025-01-25T03:14:01Z")

</div>

I am following the tutorial on QFT ([Intro to the Quantum Fourier Transform | PennyLane Demos](https://pennylane.ai/qml/demos/tutorial_qft)). There is a command to expand the circuit to see the operators:  
@partial(qml.transforms.decompose, max\_expansion=1)  
This line cannot run because “module ‘pennylane.transforms’ has no attribute ‘decompose’ .” Did you replace decompose with a different function?

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [January 28, 2025, 12:45am UTC](https://discuss.pennylane.ai/t/qft-no-qml-transforms-decompose/7894/2 "2025-01-28T00:45:14Z")

</div>

Hi @mlowe ,

It’s nice to see that you’re exploring QFT. It’s an important topic.  
We haven’t replaced `qml.transforms.decompose`, it’s actually still in the [documentation](https://docs.pennylane.ai/en/stable/code/api/pennylane.transforms.decompose.html).

I’m thinking you may not be using the latest PennyLane version. Are you using version v0.40? You can check by printing `qml.about()`.

---

<div class="post-metadata">

**Author:** ![mlowe](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/mlowe/32/2805_2.png) [@mlowe](https://discuss.pennylane.ai/u/mlowe)\
**Post date:** [January 28, 2025, 10:34am UTC](https://discuss.pennylane.ai/t/qft-no-qml-transforms-decompose/7894/3 "2025-01-28T10:34:19Z")

</div>

Hi Catalina,

I am using an older version of Pennylane (0.37.0). However even when I uninstall it and pip install Pennylane, I am not getting v0.40. How do I get the latest version?

Mary

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [January 29, 2025, 4:32pm UTC](https://discuss.pennylane.ai/t/qft-no-qml-transforms-decompose/7894/4 "2025-01-29T16:32:00Z")

</div>

Hi @mlowe ,

You should be able to do `python -m pip install pennylane --upgrade`.

If this doesn’t work I recommended that you create a new virtual environment to avoid any installation issues. (In fact it’s always a good practice.)

You can create a virtual environment with Conda and install PennyLane as follows:

1. Install Miniconda following the instructions [here](https://docs.anaconda.com/free/miniconda/#quick-command-line-install).
2. Open your terminal (mac) or command line (Windows).
3. Create a new Conda environment with: **conda create --name \<name\_of\_your\_environment\> python=3.11**
4. Activate the environment with: **conda activate \<name\_of\_your\_environment\>**
5. Install PennyLane with: **python -m pip install pennylane**
6. Install other useful packages with: **python -m pip install jupyter matplotlib**

Note that you will be installing 3 packages here: PennyLane, Jupyter, and Matplotlib. Also, note that where it says **\<name\_of\_your\_environment\>** you can choose any name that you want.

In some rare cases this may not work. If that’s the case you can create a virtual environment with venv. I can share some instructions for venv if needed.

Let me know if this works for you!
