diff --git a/qiskit/visualization/state_visualization.py b/qiskit/visualization/state_visualization.py index 26d3c792986c..4621bdc67d5a 100644 --- a/qiskit/visualization/state_visualization.py +++ b/qiskit/visualization/state_visualization.py @@ -1512,7 +1512,7 @@ def _paulivec_data(state): Raises: VisualizationError: if input is not an N-qubit state. """ - rho = SparsePauliOp.from_operator(DensityMatrix(state)) + rho = SparsePauliOp.from_operator(DensityMatrix(state)).sort() if rho.num_qubits is None: raise VisualizationError("Input is not a multi-qubit quantum state.") return rho.paulis.to_labels(), np.real(rho.coeffs * 2**rho.num_qubits)