# How can I implement a circuit that simulates white noise on $n$ qubits?

I want to test an error model of the convex form $$t \times \text{ideal_state} + (1-t)\times \text{noisy_circuit}.$$ In terms of density matrices, this would look like $$t\rho_{\text{idealState}}+(1-t)\times\text{Identity}.$$ However, I can only implement circuits on the simulator where I want to test and no density matrices.

• For $n$ qubits, are you wanting to implement this noise on a per-qubit basis, or a global basis? – DaftWullie Sep 24 '20 at 6:30
• Is this helpful? – tsgeorgios Sep 24 '20 at 7:41
• Yes, the depolarizing error is exactly what I want. Only question for me remains, how do I apply it to a state which is represented not as a density matrix but as a circuit? Is there something like a get_densitymatrix() attribute in the qasm simulator similar to the get_statevector() atribute? – sycramore Sep 28 '20 at 17:31
• Differently stated, I prepare a circuit for a graph state. I want to apply the depolarizing noise channel to the density matrix of the circuit and then later apply gates and measurements to the resulting state. In the depolarizing_error function in Qiskit Aer I lack the possibility of giving the density matrix as an input and I don't know how to obtain the density matrix from my circuit. – sycramore Sep 28 '20 at 17:40
• I could imagine that converting the circuit first to a statevector and then passing it to (qiskit.org/documentation/stubs/…) might work. That way I should be able to construct the entire channel by hand but there must be a better way than this? – sycramore Sep 28 '20 at 17:47