Repository: Qiskit/qiskit

Issue:
seaborn library requirement breaks Terra
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues -->

### Information

- **Qiskit Terra version**: 0.11.0
- **Python version**:  3.6.7
- **Operating system**: Ubuntu 16.04.6 LTS

### What is the current behavior?

Aqua travis is failing due to missing library "seaborn":

ile "/tmp/qiskit-terra-master/qiskit/execute.py", line 24, in <module>

    from qiskit.compiler import transpile, assemble

  File "/tmp/qiskit-terra-master/qiskit/compiler/__init__.py", line 35, in <module>

    from .transpile import transpile

  File "/tmp/qiskit-terra-master/qiskit/compiler/transpile.py", line 19, in <module>

    from qiskit.transpiler import Layout, CouplingMap

  File "/tmp/qiskit-terra-master/qiskit/transpiler/__init__.py", line 69, in <module>

    from .passmanager import PassManager

  File "/tmp/qiskit-terra-master/qiskit/transpiler/passmanager.py", line 19, in <module>

    from qiskit.visualization import pass_manager_drawer

  File "/tmp/qiskit-terra-master/qiskit/visualization/__init__.py", line 107, in <module>

    from .gate_map import plot_gate_map, plot_circuit_layout, plot_error_map

  File "/tmp/qiskit-terra-master/qiskit/visualization/gate_map.py", line 24, in <module>

    import seaborn as sns

ModuleNotFoundError: No module named 'seaborn'



### Steps to reproduce the problem

Just add the statement: "from qiskit.execute import execute"

### What is the expected behavior?

Seaborn should not be required since it is part of optional visualization feature


### Suggested solutions
Do not throw exception if seaborn is not present.




Discussion:
It is imported in the has matplotlib block, and listed as part of the same visualization extras package. 
The recent gate_map.py change seems to hinge on a single flag as to whether matplotlib is installed and if set assumes it can import seaborn. So if a system has matplotlib installed, but not seaborn, as they installed matplotlib but not via the Terra visualization option on pip install, which gets other stuff including seaborn, then things fail as reported. So if they have matplotlib but do not even use Terra visualization this would end up forcing such a user to install seaborn too. 
Yeah I think we need to revisit the optional import blocks in gate map this same thing actually has been blocking the benchmarking runs at https://qiskit.github.io/qiskit the benchmark runs have all been failing with a seaborn import error since #3508 merged and no updates have been pushed.

Resolving patch:
diff --git a/qiskit/visualization/gate_map.py b/qiskit/visualization/gate_map.py
--- a/qiskit/visualization/gate_map.py
+++ b/qiskit/visualization/gate_map.py
@@ -21,7 +21,6 @@
 from .exceptions import VisualizationError
 
 if HAS_MATPLOTLIB:
-    import seaborn as sns
     import matplotlib
     from matplotlib import get_backend
     import matplotlib.pyplot as plt  # pylint: disable=import-error
@@ -375,6 +374,7 @@ def plot_error_map(backend, figsize=(12, 9), show_title=True):
 
     Raises:
         VisualizationError: Input is not IBMQ backend.
+        ImportError: If seaborn is not installed
 
     Example:
         .. jupyter-execute::
@@ -395,6 +395,11 @@ def plot_error_map(backend, figsize=(12, 9), show_title=True):
             backend = provider.get_backend('ibmq_vigo')
             plot_error_map(backend)
     """
+    try:
+        import seaborn as sns
+    except ImportError:
+        raise ImportError('Must have seaborn installed to use plot_error_map')
+
     color_map = sns.cubehelix_palette(reverse=True, as_cmap=True)
 
     props = backend.properties().to_dict()


Test patch: