Skip to content

Commit

Permalink
Fix order-dependent test
Browse files Browse the repository at this point in the history
  • Loading branch information
jakelishman committed Jan 13, 2024
1 parent 3d477f6 commit f0a95f1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qiskit/visualization/state_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit f0a95f1

Please sign in to comment.