Repository: Qiskit/qiskit

Issue:
latex circuit drawer needs a consistent visualization of cu1, crz, rzz 
<!-- ⚠️ If you do not respect this template, your issue will be closed -->
<!-- ⚠️ Make sure to browse the opened and closed issues to confirm this idea does not exist. -->

### What is the expected enhancement?
Let's make sure the text, mpl and latex drawer have a consistent representation for these.

There are some bugs, for example the `latex` doesn't draw rzz at all.

And there are some inconsistencies, for example `mpl` draws rzz as a line and `text` draws it as a box.

After discussions with @jaygambetta, let's do it like this:

```
circuit.cu1(0.8, q[0], q[1])
circuit.crz(0.7, q[0], q[1])
circuit.rzz(0.6, q[0], q[1])
```

```

q0_0: |0>─■─────────■──────■────
          │0.8 ┌────┴────┐ │zz(0.6)
q0_1: |0>─■────┤ Rz(0.7) ├─■────
               └─────────┘
q0_2: |0>───────────────────────

 c0_0: 0 ═══════════════════════

 c0_1: 0 ═══════════════════════
```

This just signifies that the 1st and 3rd gates are symmetric gates.





Discussion:
https://github.com/Qiskit/qiskit-terra/pull/1960 fixes the text drawer.
At this point, this issue only affects the latex drawer. Renaming.
@1ucian0 I am going to try to deep on this issue . OK?
Sure! Let me know if you need any pointers!

On Fri, Aug 2, 2019, 3:08 PM Elisa Martin <notifications@github.com> wrote:

> @1ucian0 <https://github.com/1ucian0> I am going to try to deep on this
> issue . OK?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/Qiskit/qiskit-terra/issues/1957?email_source=notifications&email_token=AAF3FZLCEDP7MHWCXIJTNVTQCSA2ZA5CNFSM4G5H4D4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3OTEAA#issuecomment-517812736>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAF3FZKV7MXJP3ZYTCA4R3TQCSA2ZANCNFSM4G5H4D4A>
> .
>

any progress @ElisaGarijo ? Let me know!

Resolving patch:
diff --git a/qiskit/visualization/latex.py b/qiskit/visualization/latex.py
--- a/qiskit/visualization/latex.py
+++ b/qiskit/visualization/latex.py
@@ -548,6 +548,17 @@ def _build_latex_array(self, aliases=None):
                                     (pi_check(op.op.params[0], output='latex'),
                                      pi_check(op.op.params[1], output='latex'),
                                      pi_check(op.op.params[2], output='latex'))
+                            elif nm == "rzz":
+                                self._latex[pos_1][column] = "\\ctrl{" + str(
+                                    pos_2 - pos_1) + "}"
+                                self._latex[pos_2][column] = "\\control \\qw"
+                                # Based on the \cds command of the qcircuit package
+                                self._latex[min(pos_1, pos_2)][column + 1] = \
+                                    "*+<0em,0em>{\\hphantom{zz()}} \\POS [0,0].[%d,0]=" \
+                                    "\"e\",!C *{zz(%s)};\"e\"+ R \\qw" %\
+                                    (max(pos_1, pos_2), pi_check(op.op.params[0], output='latex'))
+                                self._latex[max(pos_1, pos_2)][column + 1] = "\\qw"
+                                num_cols_used = 2
                         else:
                             temp = [pos_1, pos_2]
                             temp.sort(key=int)
@@ -593,6 +604,17 @@ def _build_latex_array(self, aliases=None):
                                      (pi_check(op.op.params[0], output='latex'),
                                       pi_check(op.op.params[1], output='latex'),
                                       pi_check(op.op.params[2], output='latex')))
+                            elif nm == "rzz":
+                                self._latex[pos_1][column] = "\\ctrl{" + str(
+                                    pos_2 - pos_1) + "}"
+                                self._latex[pos_2][column] = "\\control \\qw"
+                                # Based on the \cds command of the qcircuit package
+                                self._latex[min(pos_1, pos_2)][column + 1] = \
+                                    "*+<0em,0em>{\\hphantom{zz()}} \\POS [0,0].[%d,0]=" \
+                                    "\"e\",!C *{zz(%s)};\"e\"+ R \\qw" %\
+                                    (max(pos_1, pos_2), pi_check(op.op.params[0], output='latex'))
+                                self._latex[max(pos_1, pos_2)][column + 1] = "\\qw"
+                                num_cols_used = 2
                             else:
                                 start_pos = min([pos_1, pos_2])
                                 stop_pos = max([pos_1, pos_2])


Test patch: