Repository: Qiskit/qiskit

Issue:
ccz drawing inconsistency
A cz gate is being draw like this:
```
qr = QuantumRegister(2, 'q')
circuit = QuantumCircuit(qr)
circuit.append(ZGate().control(1), [qr[0], qr[1]])
circuit.draw()
```
```  
q_0: |0>─■─
         │ 
q_1: |0>─■─     
```

![image](https://user-images.githubusercontent.com/766693/76632131-15a5da00-6519-11ea-8794-55f1b26bdbaa.png)

![image](https://user-images.githubusercontent.com/766693/76632458-a4b2f200-6519-11ea-88a5-db932e93d465.png)

A ccz gate is being draw like this:
```
qr = QuantumRegister(3, 'q')
circuit = QuantumCircuit(qr)
circuit.append(ZGate().control(2), [qr[0], qr[1], qr[2]])
circuit.draw('text')
```
```
             
q_0: |0>──■──
          │  
q_1: |0>──■──
        ┌─┴─┐
q_2: |0>┤ Z ├
        └───┘
```
![image](https://user-images.githubusercontent.com/766693/76632604-d75cea80-6519-11ea-98ea-397ae4a6e1e6.png)

![image](https://user-images.githubusercontent.com/766693/76632631-e04dbc00-6519-11ea-9945-cc77ce114c47.png)

I thinks they all should be something like this:
```
             
q_0: |0>──■──
          │  
q_1: |0>──■──
          │  
q_2: |0>──■──
```


Discussion:

Resolving patch:
diff --git a/qiskit/visualization/latex.py b/qiskit/visualization/latex.py
--- a/qiskit/visualization/latex.py
+++ b/qiskit/visualization/latex.py
@@ -373,7 +373,7 @@ def _build_latex_array(self, aliases=None):
                     if_value = format(op.condition[1],
                                       'b').zfill(self.cregs[if_reg])[::-1]
                 if isinstance(op.op, ControlledGate) and op.name not in [
-                        'ccx', 'cx', 'cz', 'cu1', 'ccz', 'cu3', 'crz',
+                        'ccx', 'cx', 'cz', 'cu1', 'cu3', 'crz',
                         'cswap']:
                     qarglist = op.qargs
                     name = generate_latex_label(
@@ -407,7 +407,10 @@ def _build_latex_array(self, aliases=None):
                         for index, pos in enumerate(ctrl_pos):
                             self._latex[pos][column] = "\\ctrl{" + str(
                                 pos_array[index + 1] - pos_array[index]) + "}"
-                        self._latex[pos_array[-1]][column] = "\\gate{%s}" % name
+                        if name == 'Z':
+                            self._latex[pos_array[-1]][column] = "\\control\\qw"
+                        else:
+                            self._latex[pos_array[-1]][column] = "\\gate{%s}" % name
                     else:
                         pos_start = min(pos_qargs)
                         pos_stop = max(pos_qargs)
diff --git a/qiskit/visualization/matplotlib.py b/qiskit/visualization/matplotlib.py
--- a/qiskit/visualization/matplotlib.py
+++ b/qiskit/visualization/matplotlib.py
@@ -841,7 +841,7 @@ def _draw_ops(self, verbose=False):
                     self._custom_multiqubit_gate(q_xy, wide=_iswide,
                                                  text="Unitary")
                 elif isinstance(op.op, ControlledGate) and op.name not in [
-                        'ccx', 'cx', 'cz', 'cu1', 'ccz', 'cu3', 'crz',
+                        'ccx', 'cx', 'cz', 'cu1', 'cu3', 'crz',
                         'cswap']:
                     disp = op.op.base_gate.name
                     num_ctrl_qubits = op.op.num_ctrl_qubits
@@ -852,7 +852,10 @@ def _draw_ops(self, verbose=False):
                                          ec=self._style.dispcol['multi'])
                     # add qubit-qubit wiring
                     self._line(qreg_b, qreg_t, lc=self._style.dispcol['multi'])
-                    if num_qargs == 1:
+                    if disp == 'z':
+                        self._ctrl_qubit(q_xy[i+1], fc=self._style.dispcol['multi'],
+                                         ec=self._style.dispcol['multi'])
+                    elif num_qargs == 1:
                         self._gate(q_xy[-1], wide=_iswide, text=disp)
                     else:
                         self._custom_multiqubit_gate(
@@ -900,9 +903,12 @@ def _draw_ops(self, verbose=False):
                             self._ctrl_qubit(q_xy[0],
                                              fc=color,
                                              ec=color)
+                            self._ctrl_qubit(q_xy[1],
+                                             fc=color,
+                                             ec=color)
                         else:
                             self._ctrl_qubit(q_xy[0])
-                        self._gate(q_xy[1], wide=_iswide, text=disp, fc=color)
+                            self._ctrl_qubit(q_xy[1])
                         # add qubit-qubit wiring
                         if self._style.name != 'bw':
                             self._line(qreg_b, qreg_t,
diff --git a/qiskit/visualization/text.py b/qiskit/visualization/text.py
--- a/qiskit/visualization/text.py
+++ b/qiskit/visualization/text.py
@@ -952,7 +952,9 @@ def add_connected_gate(instruction, gates, layer, current_cons):
                     gates.append(Bullet(conditional=conditional))
                 else:
                     gates.append(OpenBullet(conditional=conditional))
-            if len(rest) > 1:
+            if instruction.op.base_gate.name == 'z':
+                gates.append(Bullet(conditional=conditional))
+            elif len(rest) > 1:
                 top_connect = '┴' if controlled_top else None
                 bot_connect = '┬' if controlled_bot else None
                 indexes = layer.set_qu_multibox(rest, label,


Test patch:
diff --git a/test/python/visualization/test_circuit_text_drawer.py b/test/python/visualization/test_circuit_text_drawer.py
--- a/test/python/visualization/test_circuit_text_drawer.py
+++ b/test/python/visualization/test_circuit_text_drawer.py
@@ -1900,16 +1900,50 @@ def test_ch_bot(self):
 
     def test_cz_bot(self):
         """Open controlled Z (bottom)"""
-        expected = '\n'.join(["             ",
-                              "q_0: |0>──o──",
-                              "        ┌─┴─┐",
-                              "q_1: |0>┤ Z ├",
-                              "        └───┘"])
+        expected = '\n'.join(["           ",
+                              "q_0: |0>─o─",
+                              "         │ ",
+                              "q_1: |0>─■─",
+                              "           "])
         qr = QuantumRegister(2, 'q')
         circuit = QuantumCircuit(qr)
         circuit.append(ZGate().control(1, ctrl_state=0), [qr[0], qr[1]])
         self.assertEqual(str(_text_circuit_drawer(circuit)), expected)
 
+    def test_ccz_bot(self):
+        """Closed-Open controlled Z (bottom)"""
+        expected = '\n'.join(["           ",
+                              "q_0: |0>─■─",
+                              "         │ ",
+                              "q_1: |0>─o─",
+                              "         │ ",
+                              "q_2: |0>─■─",
+                              "           "])
+        qr = QuantumRegister(3, 'q')
+        circuit = QuantumCircuit(qr)
+        circuit.append(ZGate().control(2, ctrl_state='01'), [qr[0], qr[1], qr[2]])
+        self.assertEqual(str(_text_circuit_drawer(circuit)), expected)
+
+    def test_cccz_conditional(self):
+        """Closed-Open controlled Z (with conditional)"""
+        expected = '\n'.join(["               ",
+                              "q_0: |0>───■───",
+                              "           │   ",
+                              "q_1: |0>───o───",
+                              "           │   ",
+                              "q_2: |0>───■───",
+                              "           │   ",
+                              "q_3: |0>───■───",
+                              "        ┌──┴──┐",
+                              " c_0: 0 ╡ = 1 ╞",
+                              "        └─────┘"])
+        qr = QuantumRegister(4, 'q')
+        cr = ClassicalRegister(1, 'c')
+        circuit = QuantumCircuit(qr, cr)
+        circuit.append(ZGate().control(3, ctrl_state='101').c_if(cr, 1),
+                       [qr[0], qr[1], qr[2], qr[3]])
+        self.assertEqual(str(_text_circuit_drawer(circuit)), expected)
+
     def test_cch_bot(self):
         """Controlled CH (bottom)"""
         expected = '\n'.join(["             ",