Quantum Computing, Quantum Physics, Programming, Physics, Science.
Which outputs: q_0: ──■─────────────────────────■── ┌─┴─┐ ┌─┴─┐ q_1: ┤ X ├──■───────────────■──┤ X ├ └───┘┌─┴─┐┌─────────┐┌─┴─┐└───┘ q_2: ─────┤ X ├┤ Rz(-2π) ├┤ X ├───── └───┘└─────────┘└───┘ Now, we can expand this so we can simulate any Pauli string. def sim_pauli(arr, t, qc, qubits): """ Append