I'm doing a QEC job, and I want to apply an error like $U_{err}(\theta) = \prod_j e^{-i\frac{\theta_j}{2}P_j} = \prod_j (I\cos(\frac{\theta_j}{2}) - iP_j\sin(\frac{\theta_j}{2}))$, where $\theta_j$ is some given value, and $P_j$ is some Pauli operator. I know that only when $\theta_j = 0$ or $\theta_j = \pm \pi/2$, then $U_err$ is Clifford. I just want to have a function like
def error(Theta, Pauli):
error_circuit = stim.Circuit()
TODO!!!
return error_circuit
to help me to get $U_{err}$, but I don't know how.