Pennylane-qiskit error

Hi,

I am trying to experiment on pennylane-qiskit. But it gives me error. I have posted the code and error. Please help.

Code:
import pennylane as qml

dev = qml.device(‘qiskit.ibmq’, wires=2, backend=‘ibmq_16_melbourne’)

@qml.qnode(dev)
def circuit(x, y, z):
qml.RZ(z, wires=[0])
qml.RY(y, wires=[0])
qml.RX(x, wires=[0])
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(wires=1))

circuit(0.2, 0.1, 0.3)

Error:

File “/usr/local/lib/python3.6/dist-packages/pennylane_qiskit/qiskit_device.py”, line 231, in run
self._current_job = self.backend.run(qobj, backend_options=self.kwargs)

TypeError: run() got an unexpected keyword argument ‘backend_options’

Hi @avinash_ch!

We’ve just released a new version of the Qiskit plugin, as well as a new version of PennyLane.

Could you try updating your installations, and see if that fixes the issue?

pip install pennylane pennylane-qiskit -U

If not, then we will troubleshoot through the issue :slightly_smiling_face:

Ok @josh.

I will try updating.

Thanks for the response.

Dear @josh,

I have tried the same updating both pennylane and pennylane-qiskit.

It is giving the same error.

File “/usr/local/lib/python3.6/dist-packages/PennyLane_qiskit-0.6.0.dev0-py3.6.egg/pennylane_qiskit/qiskit_device.py”, line 231, in run
self._current_job = self.backend.run(qobj, backend_options=self.kwargs)

TypeError: run() got an unexpected keyword argument 'backend_options’

Please look into this.

Thanks in advance.

Thanks @avinash_ch, I’ll have a look into this!

@avinash_ch, I’ve found the bug, and made a pull request to fix it:

Once it has been merged in, I will release a new version of the plugin.
In the meantime, you can install the fixed version of the plugin here:

pip install git+https://github.com/XanaduAI/pennylane-qiskit.git@fix_ibmq_backend_options

Hi @avinash_ch; PennyLane-Qiskit has now been updated, so you can simply do

pip install pennylane-qiskit --upgrade

to get the version with the bugfix!

Thank you @josh for your prompt response. it is working now.

I will continue experimenting.

1 Like