# version question

**URL:** <https://discuss.pennylane.ai/t/version-question/7782>\
**Category:** PennyLane Challenges\
**Created:** [December 23, 2024, 8:44pm UTC](https://discuss.pennylane.ai/t/version-question/7782 "2024-12-23T20:44:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![w2534765383](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/w2534765383/32/3462_2.png) [@w2534765383](https://discuss.pennylane.ai/u/w2534765383)\
**Post date:** [December 23, 2024, 8:44pm UTC](https://discuss.pennylane.ai/t/version-question/7782/1 "2024-12-23T20:44:37Z")

</div>

model.params = opt.step(cost, approx=‘block-diag’)

**Here is the error message:** ：

ValueError: The objective function must be encoded as a single QNode for the natural gradient to be automatically computed. Otherwise, metric\_tensor\_fn must be explicitly provided to the optimizer.

---

<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 9, 2025, 9:20pm UTC](https://discuss.pennylane.ai/t/version-question/7782/2 "2025-01-09T21:20:46Z")

</div>

Hi @w2534765383, welcome to the Forum!

Is your question regarding any of the [PennyLane Coding Challenges](https://pennylane.ai/challenges)?  
Or are you having difficulty using a specific PennyLane function?

If it’s the former please indicate what challenge you’re trying. If it’s the latter please share a minimal reproducible example.

A _minimal reproducible example_ (or _minimal working example_) is the simplest version of the code that reproduces the problem. It should be self-contained, including all necessary imports, data, functions, etc., so that we can copy-paste the code and reproduce the problem. However it shouldn’t contain any unnecessary data, functions, etc. (for example gates and functions that can be removed to simplify the code). If you’re not sure what this means then please make sure to check out [this video](https://www.youtube.com/watch?v=snmOfreSPeY).
