About amplitude embedding

i took a look at Amplitude embedding method in Pennylane. On some devices, AmplitudeEmbedding must be the first operation in the quantum node. my question is that in which devices amplitude embedding can be the second and third, … operations?

Hey @sassan_moradi! The AmplitudeEmbedding template is designed to be a state preparation at the start of the circuit. I’m not aware of any device that supports this partway through a circuit. However, the MottonenStatePreparation template works by defining a circuit that performs the transformation

U |0> = |psi>

Since it defines a subcircuit, it can be used at any point within a larger circuit. However, note that the action of MottonenStatePreparation partway through a circuit will not be to reset the state to |psi>. Instead, it will apply the unitary - only U|0> will prepare |psi>, for example U|1> might prepare something else.

many thanks for your clarification, Tom.

No problem @sassan_moradi!