This can be done using the 'Aer' component of Qiskit. The properties information can be turned into a noise model using
from qiskit.providers.aer import noise
properties = device.properties()
noise_model = noise.device.basic_device_noise_model(properties)
basis_gates = noise_model.basis_gates
This can then be supplied to the execute()
method, as is normally used to run jobs. Here is a full working example of a simulation using the noise model from the Tenerife device, for a circuit that creates a Bell pair.
from qiskit import QuantumRegister, ClassicalRegister
from qiskit import QuantumCircuit, execute, Aer, IBMQ
from qiskit.providers.aer import noise
# Choose a real device to simulate
IBMQ.load_accounts()
device = IBMQ.get_backend('ibmq_5_tenerife')
properties = device.properties()
coupling_map = device.configuration().coupling_map
# Generate an Aer noise model for device
noise_model = noise.device.basic_device_noise_model(properties)
basis_gates = noise_model.basis_gates
# Generate a quantum circuit
q = QuantumRegister(2)
c = ClassicalRegister(2)
qc = QuantumCircuit(q, c)
qc.h(q[0])
qc.cx(q[0], q[1])
qc.measure(q, c)
# Perform noisy simulation
backend = Aer.get_backend('qasm_simulator')
job_sim = execute(qc, backend,
coupling_map=coupling_map,
noise_model=noise_model,
basis_gates=basis_gates)
sim_result = job_sim.result()
print(sim_result.get_counts(qc))
The result I got when running this was {'00': 409, '11': 411, '10': 94, '01': 110}
, which shows that the expected results of '00'
and '11'
are indeed dominant, but '01'
and '10'
also appear due to the simulated noise.