  In the Bloch sphere picture, one finds the coefficients for expanding a
single-qubit density operator in terms of the identity and Pauli matrices. A
generalization to $n$ qubits via tensor products represents a density operator
by a real vector of length $4^n$, conceptually similar to a statevector. Here,
we study this approach for the purpose of quantum circuit simulation, including
noise processes. The tensor structure leads to computationally efficient
algorithms for applying circuit gates and performing few-qubit quantum
operations. In view of variational circuit optimization, we study
``backpropagation'' through a quantum circuit and gradient computation based on
this representation, and generalize our analysis to the Lindblad equation for
modeling the (non-unitary) time evolution of a density operator.
