Reputation: 21
I am doing basic coding for rotation of qubit as given in the Xanadu Pennylane tutorial. I have installed pennylane and tried running the code but I am getting TypeError.
I also tried with
dir(qml)
This gave me a list of built-in functions in qml where Device is already present.
Here goes the actual code:
from pennylane import numpy as np
import pennylane as qml
dev1 = qml.Device('default.qubit', wires=1)
All I am getting is the TypeError.
TypeError: Can't instantiate abstract class Device with abstract methods apply, author, expval, name, observables, operations, pennylane_requires, reset, short_name, version
Upvotes: 0
Views: 284
Reputation: 2032
I have not tried running this code myself, but looking at the qubit rotation tutorial and example, both of them use
dev1 = qml.device('default.qubit', wires=1)
(with device
starting with lowercase d
)
Upvotes: 1