Fail to inititial quantum device with noise_model

When I load noise_model to inititial quantum device, it went wrong. Following are the code and error messages.

from qiskit.providers.aer.noise.device import basic_device_noise_model
noise_model = basic_device_readout_errors
dev = qml.device(‘qiskit.aer’, wires= n_w, noise_model=noise_model)

AttributeError: ‘function’ object has no attribute ‘basis_gates’

Any help with this would be greatly appreciated!

Thanks!

Hey @float!

basic_device_readout_errors is a function, so somewhere in the definition of your device is basic_device_readout_errors.basis_gates, which is not an attribute to the function.

It might be a good idea to check out our documentation on using the Aer device with PennyLane. Let me know if that helps!

Problem is solved, thank you!

Awesome! Glad to hear :smiley: