I wish to be able to model a quantum computer with all the noise sources of an IBM quantum computer. For a given set of T1, T2, readout_errors, U2_errors and CNOT errors I want to know how to include all these errors. I can run a quantum circuit using the expected noise from a particular computer through the following code
backend = provider.get_backend('ibmqx2')
noise_model = NoiseModel.from_backend(backend)
# Get coupling map from backend
coupling_map = backend.configuration().coupling_map
# Get basis gates from noise model
basis_gates = noise_model.basis_gates
This runs my code with the noise from ibmqx2. I then try to implement each noise source. For example if the single qubit U2 error rate is er1, I implement this as follows:
error_1 = noise.depolarizing_error(er1, 1)
noise_model.add_quantum_error(error_1, ['u1', 'u2', 'u3','h'],[0])
I implement the two qubit and readout errors in the same way. Is this correct? Also how do I implement the errors associated with the T1 and T2 values? I am asking because my current model when I add each noise source myself does not match when I simply import the noise model. I wish to reconcile this.