# P.2.2 - Error: 'tensor' object is not callable

**URL:** <https://discuss.pennylane.ai/t/p-2-2-error-tensor-object-is-not-callable/3812>\
**Category:** Codebook\
**Created:** [December 14, 2023, 6:30pm UTC](https://discuss.pennylane.ai/t/p-2-2-error-tensor-object-is-not-callable/3812 "2023-12-14T18:30:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qimi](https://avatars.discourse-cdn.com/v4/letter/q/cab0a1/32.png) [@Qimi](https://discuss.pennylane.ai/u/Qimi)\
**Post date:** [December 14, 2023, 6:30pm UTC](https://discuss.pennylane.ai/t/p-2-2-error-tensor-object-is-not-callable/3812/1 "2023-12-14T18:30:50Z")

</div>

![Screenshot from 2023-12-14 19-27-03](https://canada1.discourse-cdn.com/flex012/uploads/pennylane/original/2X/d/dbe61cab9a5c59a2438961c9f769e76893cade93.png)

I’m constantly getting the error that the tensor object is not callable. Could someone point out what I am doing wrong?

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [December 15, 2023, 11:25pm UTC](https://discuss.pennylane.ai/t/p-2-2-error-tensor-object-is-not-callable/3812/2 "2023-12-15T23:25:12Z")

</div>

Hey @Qimi and welcome to the forum! 🙂

I’m not sure what’s happening here. I tried the same solution and it’s working for me:

```auto
estimation_wires = [0, 1, 2]
target_wires = [3]

def apply_controlled_powers_of_U(unitary):
    """ 
    Args: 
        unitary (array [complex]): A unitary matrix

    Returns:
        None
    """
    #for k in estimation_wires:
    for i in range(len(estimation_wires)):
        U = U_power_2k(unitary, len(estimation_wires)-i-1)
        qml.ctrl(qml.QubitUnitary, control=estimation_wires[i])(U, wires=target_wires)

```

Can you put `print(qml.about())` above the function and show me what it says?

---

<div class="post-metadata">

**Author:** ![Qimi](https://avatars.discourse-cdn.com/v4/letter/q/cab0a1/32.png) [@Qimi](https://discuss.pennylane.ai/u/Qimi)\
**Post date:** [December 17, 2023, 12:04pm UTC](https://discuss.pennylane.ai/t/p-2-2-error-tensor-object-is-not-callable/3812/3 "2023-12-17T12:04:00Z")

</div>

Thank you @isaacdevlugt for having a look at my solution. It is really strange, I just tried again and now it is working.

For completeness, my output of qml.about() is:

```auto
Name: PennyLane
Version: 0.31.0
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: https://github.com/PennyLaneAI/pennylane
Author: 
Author-email: 
License: Apache License 2.0
Location: /var/lang/lib/python3.10/site-packages
Requires: appdirs, autograd, autoray, cachetools, networkx, numpy, pennylane-lightning, requests, rustworkx, scipy, semantic-version, toml
Required-by: PennyLane-Lightning

Platform info: Linux-4.14.255-328-268.540.amzn2.x86_64-x86_64-with-glibc2.26
Python version: 3.10.12
Numpy version: 1.23.5
Scipy version: 1.10.0
Installed devices:
- default.gaussian (PennyLane-0.31.0)
- default.mixed (PennyLane-0.31.0)
- default.qubit (PennyLane-0.31.0)
- default.qubit.autograd (PennyLane-0.31.0)
- default.qubit.jax (PennyLane-0.31.0)
- default.qubit.tf (PennyLane-0.31.0)
- default.qubit.torch (PennyLane-0.31.0)
- default.qutrit (PennyLane-0.31.0)
- null.qubit (PennyLane-0.31.0)
- lightning.qubit (PennyLane-Lightning-0.31.0)
None

```

---

<div class="post-metadata">

**Author:** ![isaacdevlugt](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/isaacdevlugt/32/1159_2.png) [@isaacdevlugt](https://discuss.pennylane.ai/u/isaacdevlugt)\
**Post date:** [December 18, 2023, 5:20pm UTC](https://discuss.pennylane.ai/t/p-2-2-error-tensor-object-is-not-callable/3812/4 "2023-12-18T17:20:11Z")

</div>

Strange! Okay… well, glad it’s working for you now. Let us know if you have any more issues 🙂
