Error in construction QNode

Hello! If applicable, put your complete code example down below. Make sure that your code:

  • is 100% self-contained — someone can copy-paste exactly what is here and run it to
    reproduce the behaviour you are observing
  • includes comments
# Put code here
import pennylane as qml
from pennylane import numpy as np
dev1 = qml.device("lightning.qubit", wires=1)
@qml.qnode(dev1, interface="autograd")
def circuit(params):
    qml.RX(params[0], wires=0)
    qml.RY(params[1], wires=0)
    return qml.expval(qml.PauliZ(0))
print(circuit([0.54, 0.12]))

If you want help with diagnosing an error, please put the full error message below:

Put full error message here

/Users/hamedgholipour/anaconda3/envs/QML/lib/python3.9/site-packages/pennylane_lightning/lightning_qubit/lightning_qubit.py:822: UserWarning: Pre-compiled binaries for lightning.qubit are not available. Falling back to using the Python-based default.qubit implementation. To manually compile from source, follow the instructions at https://pennylane-lightning.readthedocs.io/en/latest/installation.html.
  warn(
Traceback (most recent call last):
  File "/Users/hamedgholipour/PycharmProjects/qml/Test 2.py", line 3, in <module>
    dev1 = qml.device("lightning.qubit", wires=1)
  File "/Users/hamedgholipour/PycharmProjects/qml/pennylane/__init__.py", line 347, in device
    dev = plugin_device_class(*args, **options)
  File "/Users/hamedgholipour/anaconda3/envs/QML/lib/python3.9/site-packages/pennylane_lightning/lightning_qubit/lightning_qubit.py", line 829, in __init__
    super().__init__(wires, c_dtype=c_dtype, **kwargs)
  File "/Users/hamedgholipour/anaconda3/envs/QML/lib/python3.9/site-packages/pennylane_lightning/core/lightning_base.py", line 405, in __init__
    super().__init__(wires, r_dtype=r_dtype, c_dtype=c_dtype, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'r_dtype'

Process finished with exit code 1
And, finally, make sure to include the versions of your packages. Specifically, show us the output of `qml.about()`.

Hello @Hamed_Gholipour, I ran your code with lightning.qubit in Colab and received 0.8515405859048367. Is there anything locally you could update to not receive the errors?

Thanks Kevin for your response. I will check it.

1 Like

Kevin, it was solved. The problem was with my software.

I’m glad you could solve it @Hamed_Gholipour ! What was the issue in your software?

By the way, we have a very small survey for PennyLane v0.33, and it would be awesome if you’d give us some feedback and tell us about your needs. Thank you! :grin:

Dear Catalina, Many thanks for your follow-up. My issue was the Anaconda is not compatible with Phycharm or PennyLane. I don’t exactly know. But my solution is I just install Python 3.9 on my Mac and PhyCharm separately. And then install PennyLane on the Terminal of Phycharm. Fortunately, it works.:slight_smile:

Regarding the PennyLane survey, it is a great experience for persons working on Quantum to see what is going on in the real world. Thank you so much for creating it.

1 Like

Thank you for describing the issue and the solution @Hamed_Gholipour !

Anaconda works for me with PennyLane so the issue may be related to something in your system or your local environment. Is there any additional information that you can share so that we can try to investigate this issue? Thanks!

And thank you for your kind words! We appreciate them a lot :smiley:.

Thank you so much Catalina. No, there is no more information to share.

You’re welcome. it is my pleasure to contact you!:slight_smile: