# Hybrid Network not differentiating

**URL:** <https://discuss.pennylane.ai/t/hybrid-network-not-differentiating/1079>\
**Category:** PennyLane Help\
**Created:** [June 1, 2021, 9:44am UTC](https://discuss.pennylane.ai/t/hybrid-network-not-differentiating/1079 "2021-06-01T09:44:59Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![theodor](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/theodor/32/178_2.png) [@theodor](https://discuss.pennylane.ai/u/theodor)\
**Post date:** [June 30, 2021, 4:18pm UTC](https://discuss.pennylane.ai/t/hybrid-network-not-differentiating/1079/29 "2021-06-30T16:18:46Z")

</div>

Hi @Daniel63656,

> Are the changes already incorporated into pennyLane?

The fix should be in the latest release (v0.16.0). You can find it in the second entry under Bug fixes in the [release notes](https://pennylane.readthedocs.io/en/stable/development/release_notes.html).

* * *

The three state preparations are very similar indeed.

- `QubitStateVector` might be supported natively on a quantum device, and if there’s no need to differentiate it, it’s much quicker to simply use that one instead of decomposing it using the Möttönen state preparation.

- `AmplitudeEmbedding` is a template that basically applies a `QubitStateVector` operation after doing some preprocessing, such as padding of the state and normalizing it.

- `MottonenStatePreparation` uses a method to prepare a specific state according to [this paper](https://arxiv.org/pdf/quant-ph/0407010.pdf) from Möttönen, et al. which usually can work if the device in question does not have native support for a direct state preparation operation, but it will likely not be as fast.

> I am also pretty confused, because here [Differentiation with AmplitudeEmbedding](http://discuss.pennylane.ai/t/differentiation-with-amplitudeembedding/638) the same problem seemingly got solved by making inputs a keyword argument, which doesn’t work for me at all

The syntax for marking differentiable inputs or not has changed, and should be done with a `requires_grad` flag when declared, for NumPy and Torch, or declaring the input as a `tf.constant` for Tensorflow. You can read more about that on the [interfaces page](https://pennylane.readthedocs.io/en/stable/introduction/interfaces.html) in the documentation.

I hope this clears some things up!

---

_[View the full topic](https://discuss.pennylane.ai/t/hybrid-network-not-differentiating/1079)._
