# qml.StatePrep() no attribute error

**URL:** <https://discuss.pennylane.ai/t/qml-stateprep-no-attribute-error/4675>\
**Category:** PennyLane Help\
**Created:** [May 31, 2024, 1:54pm UTC](https://discuss.pennylane.ai/t/qml-stateprep-no-attribute-error/4675 "2024-05-31T13:54:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sleepingcat4](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sleepingcat4/32/2410_2.png) [@sleepingcat4](https://discuss.pennylane.ai/u/sleepingcat4)\
**Post date:** [May 31, 2024, 1:54pm UTC](https://discuss.pennylane.ai/t/qml-stateprep-no-attribute-error/4675/1 "2024-05-31T13:54:06Z")

</div>

I have asked on PennyLane discord #code-911 and was redirected here. I was following this tutorial

> **[Quantum Teleportation | PennyLane Demos](https://pennylane.ai/qml/demos/tutorial_teleportation/)**
>
> Transmit arbitrary quantum states using quantum teleportation

I attempted to translate Qiskit Quantum teleportation code into Pennylane to practice my Pennylane knowledge and become comfortable. I encountered an weird error that ```qml.StatePrep`` was not a pennylane attribute.

I checked on PennyLane docs and StatePrep was a valid API endpoint. Even VS Code suggests StatePrep and does not produce and show any errors. Only Python runtime catches this error.

PennyLane team-member: Ivana asked what wires=“S” mean. I had the same question. Since I thought we define qubits in Pennylane through numerical value (0, 1, 2, 3). I don’t have experience defining qubits in variables.

I will appreciate if someone can help me out.

---

<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:** [June 3, 2024, 9:05am UTC](https://discuss.pennylane.ai/t/qml-stateprep-no-attribute-error/4675/2 "2024-06-03T09:05:52Z")

</div>

Hi @sleepingcat4 , thanks for posting on the forum!  
Could you please add the missing information so our team can help? 🙂

We need the minimal version of your code that runs and reproduces the error, as well as the error output. You should also add the output of `qml.about()`, so we know which version you’re using etc. Otherwise all we can do is guess (as I tried guessing on Discord), which may or may not help you… 😅

Thanks!
