Repository: Qiskit/qiskit

Issue:
mpl drawer has inconsistent use of hyphens and math minus signs
<!-- ⚠️ 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**: master
- **Python version**: 3.8
- **Operating system**: Ubuntu 18.04

### What is the current behavior?

The mpl drawer changes leading hyphens in parameters to the math mode minus sign, which is similar in width to the + and about twice the width of a hyphen. There are other places, such as e notation and the imaginary part of complex numbers, where a minus is intended, but a hyphen is used. Note below.

### Steps to reproduce the problem
```
from qiskit import QuantumCircuit
qc = QuantumCircuit(1)
qc.u1(complex(-1.0, -1.0), 0)
qc.u1(-1e-7, 0)
qc.draw('mpl')
```
![image](https://user-images.githubusercontent.com/16268251/89229758-e6126f80-d596-11ea-8824-e4946b7b6eea.png)
Also note that pi_check returns +- for the imaginary part instead of just -.

### What is the expected behavior?



### Suggested solutions
For all parameter expressions in the mpl drawer, convert hyphens to minus signs. Since all parameters go through pi_check, this could be done at the pi_check level.




Discussion:
Hi, can I work on this?
Sure. I believe this can all be done at the bottom of the pi_check function. The +- issue affects all drawers, but the hyphen/minus sign is only for the 'mpl' version.
Great! I will start with your suggestion.
Hi @enavarro51, I think I figured out where the format making this inconsistency. But I want to double check if you want to change all minus signs to be longer as in mathematical mode, which is defined in latex like this $-$, or you want all to be shorter as indicated in the below picture? 
![Screen Shot 2020-08-04 at 2 39 36 AM](https://user-images.githubusercontent.com/69056626/89261299-d416e800-d5fb-11ea-9a7c-87c96bb495e7.png)

Secondly, do you think I should keep the +- that the pi_check.py return?

The +- should be replaced with -, as in your first U1 above, again for all calls to pi_check. And we want the $-$ for the mpl drawer.
Is this issue solved?
Hi, I'm working on it. 

Resolving patch:
diff --git a/qiskit/circuit/tools/pi_check.py b/qiskit/circuit/tools/pi_check.py
--- a/qiskit/circuit/tools/pi_check.py
+++ b/qiskit/circuit/tools/pi_check.py
@@ -135,8 +135,15 @@ def normalize(single_inpt):
     complex_inpt = complex(inpt)
     real, imag = map(normalize, [complex_inpt.real, complex_inpt.imag])
 
+    jstr = '\\jmath' if output == 'latex' else 'j'
     if real == '0' and imag != '0':
-        return imag + 'j'
-    elif real != 0 and imag != '0':
-        return '{}+{}j'.format(real, imag)
-    return real
+        str_out = imag + jstr
+    elif real != '0' and imag != '0':
+        op_str = '+'
+        # Remove + if imag negative except for latex fractions
+        if complex_inpt.imag < 0 and (output != 'latex' or '\\frac' not in imag):
+            op_str = ''
+        str_out = '{}{}{}{}'.format(real, op_str, imag, jstr)
+    else:
+        str_out = real
+    return str_out
diff --git a/qiskit/visualization/matplotlib.py b/qiskit/visualization/matplotlib.py
--- a/qiskit/visualization/matplotlib.py
+++ b/qiskit/visualization/matplotlib.py
@@ -300,11 +300,7 @@ def param_parse(self, v):
                 param_parts[i] = pi_check(e, output='mpl', ndigits=3)
             except TypeError:
                 param_parts[i] = str(e)
-
-            if param_parts[i].startswith('-'):
-                param_parts[i] = '$-$' + param_parts[i][1:]
-
-        param_parts = ', '.join(param_parts)
+        param_parts = ', '.join(param_parts).replace('-', '$-$')
         return param_parts
 
     def _get_gate_ctrl_text(self, op):


Test patch:
diff --git a/test/python/circuit/test_tools.py b/test/python/circuit/test_tools.py
--- a/test/python/circuit/test_tools.py
+++ b/test/python/circuit/test_tools.py
@@ -15,6 +15,7 @@
 
 from test import combine
 from ddt import ddt
+from numpy import pi
 from qiskit.test import QiskitTestCase
 from qiskit.circuit.tools.pi_check import pi_check
 
@@ -29,7 +30,14 @@ class TestPiCheck(QiskitTestCase):
                    (2.99, '2.99'),
                    (2.999999999999999, '3'),
                    (0.99, '0.99'),
-                   (0.999999999999999, '1')])
+                   (0.999999999999999, '1'),
+                   (6*pi/5+1j*3*pi/7, '6pi/5+3pi/7j'),
+                   (-6*pi/5+1j*3*pi/7, '-6pi/5+3pi/7j'),
+                   (6*pi/5-1j*3*pi/7, '6pi/5-3pi/7j'),
+                   (-6*pi/5-1j*3*pi/7, '-6pi/5-3pi/7j'),
+                   (-382578.0+.0234567j, '-3.8258e+05+0.023457j'),
+                   (-382578.0-.0234567j, '-3.8258e+05-0.023457j'),
+                   ])
     def test_default(self, case):
         """Default pi_check({case[0]})='{case[1]}'"""
         input_number = case[0]