Repository: Qiskit/qiskit

Issue:
`qiskit.tools.visualization_state_visualization` module fails to import
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Informations

- **Qiskit Terra version**: latest master
- **Python version**: any
- **Operating system**: any

### What is the current behavior?

Since #1166 merged the api changed for the pauli_singles() function. However the `qiskit.tools.visualization_state_visualization` module still uses the old function and imports the function directly here: https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/tools/visualization/_state_visualization.py#L23


### Steps to reproduce the problem

import qiskit.tools.visualization_state_visualization

### What is the expected behavior?

You can import the module and use all the functions in it.

### Suggested solutions

Update the use of `pauli_singles` to the new api post #1166 



Discussion:
There is another place in visualization that uses the old `pauli_singles()` function, https://github.com/Qiskit/qiskit-terra/blob/master/qiskit/tools/visualization/interactive/_iplot_blochsphere.py#L16

Resolving patch:
diff --git a/qiskit/tools/visualization/_state_visualization.py b/qiskit/tools/visualization/_state_visualization.py
--- a/qiskit/tools/visualization/_state_visualization.py
+++ b/qiskit/tools/visualization/_state_visualization.py
@@ -20,7 +20,7 @@
 from mpl_toolkits.mplot3d import proj3d
 from scipy import linalg
 
-from qiskit.tools.qi.pauli import pauli_group, pauli_singles
+from qiskit.tools.qi.pauli import pauli_group, Pauli
 from qiskit.tools.visualization import VisualizationError
 from qiskit.tools.visualization._bloch import Bloch
 
@@ -392,9 +392,10 @@ def plot_state(quantum_state, method='city', filename=None):
                 filename_parts[-2] += '-%d' % i
                 filename = '.'.join(filename_parts)
                 print(filename)
+            pauli_singles = [Pauli.pauli_single(num, i, 'X'), Pauli.pauli_single(num, i, 'Y'),
+                             Pauli.pauli_single(num, i, 'Z')]
             bloch_state = list(
-                map(lambda x: np.real(np.trace(np.dot(x.to_matrix(), rho))),
-                    pauli_singles(i, num)))
+                map(lambda x: np.real(np.trace(np.dot(x.to_matrix(), rho))), pauli_singles))
             plot_bloch_vector(bloch_state, "qubit " + str(i), filename=filename)
     elif method == "wigner":
         plot_wigner_function(rho, filename=filename)
diff --git a/qiskit/tools/visualization/interactive/_iplot_blochsphere.py b/qiskit/tools/visualization/interactive/_iplot_blochsphere.py
--- a/qiskit/tools/visualization/interactive/_iplot_blochsphere.py
+++ b/qiskit/tools/visualization/interactive/_iplot_blochsphere.py
@@ -13,7 +13,7 @@
 import time
 import re
 import numpy as np
-from qiskit.tools.qi.pauli import pauli_singles
+from qiskit.tools.qi.pauli import Pauli
 if ('ipykernel' in sys.modules) and ('spyder' not in sys.modules):
     try:
         from IPython.core.display import display, HTML
@@ -82,8 +82,10 @@ def iplot_blochsphere(rho, options=None):
 
     bloch_data = []
     for i in range(num):
+        pauli_singles = [Pauli.pauli_single(num, i, 'X'), Pauli.pauli_single(num, i, 'Y'),
+                         Pauli.pauli_single(num, i, 'Z')]
         bloch_state = list(map(lambda x: np.real(np.trace(np.dot(x.to_matrix(), rho))),
-                               pauli_singles(i, num)))
+                               pauli_singles))
         bloch_data.append(bloch_state)
 
     div_number = str(time.time())


Test patch: