# How do I get an anatz function under control?

**URL:** https://discuss.pennylane.ai/t/how-do-i-get-an-anatz-function-under-control/3538
**Category:** PennyLane Help
**Created:** [October 11, 2023, 11:35am UTC](https://discuss.pennylane.ai/t/how-do-i-get-an-anatz-function-under-control/3538 "2023-10-11T11:35:48Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Ivana\_at\_Xanadu](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/ivana_at_xanadu/32/1852_2.png) [@Ivana\_at\_Xanadu](https://discuss.pennylane.ai/u/Ivana_at_Xanadu)
#### Post date: [October 11, 2023, 12:06pm UTC](https://discuss.pennylane.ai/t/how-do-i-get-an-anatz-function-under-control/3538/2 "2023-10-11T12:06:05Z")

</div>

Hi @RX1 , please stop tagging people in your threads. We do have other things to do sometimes. 😃

As I suggested in your other thread (see here: [How can I use qml.select to make an overall selection of ansatz functions?](https://discuss.pennylane.ai/t/how-can-i-use-qml-select-to-make-an-overall-selection-of-ansatz-functions/3537/)), you can do this very easily if you define your ansatz function (with the 3 different options) as an operator, and then use `Controlled`, as you’re already trying to do ([qml.ops.op\_math.Controlled — PennyLane 0.32.0 documentation](https://docs.pennylane.ai/en/stable/code/api/pennylane.ops.op_math.Controlled.html)).  
So long as your ansatz is an operator, this should work just fine. You can see the full instructions here: [Adding new operators — PennyLane 0.32.0 documentation](https://docs.pennylane.ai/en/stable/development/adding_operators.html)

Best of luck! 🙂

---

_[View the full topic](https://discuss.pennylane.ai/t/how-do-i-get-an-anatz-function-under-control/3538)._
