Repository: quantumlib/Cirq

Issue:
cirq.PauliInteractionGate's __repr__ output is not valid python
It returns things like "+X", which don't parse when you've imported cirq.


Discussion:
Will 
```
def __repr__(self):
        return 'cirq.PauliInteractionGate(cirq.{}, {!s}, cirq.{}, {!s})'.format(
            self.pauli0,self.invert0, self.pauli1, self.invert1)
```
Do the trick?

Resolving patch:
diff --git a/cirq/ops/pauli_interaction_gate.py b/cirq/ops/pauli_interaction_gate.py
--- a/cirq/ops/pauli_interaction_gate.py
+++ b/cirq/ops/pauli_interaction_gate.py
@@ -23,8 +23,8 @@
 
 
 pauli_eigen_map = {
-    Pauli.X: (np.array([[0.5,  0.5 ], [0.5,   0.5]]),
-              np.array([[0.5, -0.5 ], [-0.5,  0.5]])),
+    Pauli.X: (np.array([[0.5,  0.5], [0.5,   0.5]]),
+              np.array([[0.5, -0.5], [-0.5,  0.5]])),
     Pauli.Y: (np.array([[0.5, -0.5j], [0.5j,  0.5]]),
               np.array([[0.5,  0.5j], [-0.5j, 0.5]])),
     Pauli.Z: (np.diag([1, 0]),
@@ -107,9 +107,9 @@ def default_decompose(self, qubits: Sequence[raw_types.QubitId]
                           ) -> op_tree.OP_TREE:
         q0, q1 = qubits
         right_gate0 = SingleQubitCliffordGate.from_single_map(
-                                    z_to=(self.pauli0, self.invert0))
+            z_to=(self.pauli0, self.invert0))
         right_gate1 = SingleQubitCliffordGate.from_single_map(
-                                    z_to=(self.pauli1, self.invert1))
+            z_to=(self.pauli1, self.invert1))
         left_gate0 = right_gate0.inverse()
         left_gate1 = right_gate1.inverse()
         yield left_gate0(q0)
@@ -131,9 +131,10 @@ def text_diagram_info(self, args: gate_features.TextDiagramInfoArgs
             exponent=self._exponent)
 
     def __repr__(self):
-        return 'cirq.PauliInteractionGate({}{!s}, {}{!s})'.format(
-               '+-'[self.invert0], self.pauli0, '+-'[self.invert1], self.pauli1)
+        return 'cirq.PauliInteractionGate(cirq.{}, {!s}, cirq.{}, {!s})'.format(
+            self.pauli0, self.invert0, self.pauli1, self.invert1)
 
 
 PauliInteractionGate.CZ = PauliInteractionGate(Pauli.Z, False, Pauli.Z, False)
-PauliInteractionGate.CNOT = PauliInteractionGate(Pauli.Z, False, Pauli.X, False)
+PauliInteractionGate.CNOT = PauliInteractionGate(
+    Pauli.Z, False, Pauli.X, False)


Test patch:
diff --git a/cirq/ops/pauli_interaction_gate_test.py b/cirq/ops/pauli_interaction_gate_test.py
--- a/cirq/ops/pauli_interaction_gate_test.py
+++ b/cirq/ops/pauli_interaction_gate_test.py
@@ -136,22 +136,22 @@ def test_text_diagrams():
 
 @pytest.mark.parametrize('gate,gate_repr', (
     (cirq.PauliInteractionGate(cirq.Pauli.X, False, cirq.Pauli.X, False),
-     'cirq.PauliInteractionGate(+X, +X)'),
+     'cirq.PauliInteractionGate(cirq.X, False, cirq.X, False)'),
     (cirq.PauliInteractionGate(cirq.Pauli.X, True,  cirq.Pauli.X, False),
-     'cirq.PauliInteractionGate(-X, +X)'),
+     'cirq.PauliInteractionGate(cirq.X, True, cirq.X, False)'),
     (cirq.PauliInteractionGate(cirq.Pauli.X, False, cirq.Pauli.X, True ),
-     'cirq.PauliInteractionGate(+X, -X)'),
+     'cirq.PauliInteractionGate(cirq.X, False, cirq.X, True)'),
     (cirq.PauliInteractionGate(cirq.Pauli.X, True,  cirq.Pauli.X, True ),
-     'cirq.PauliInteractionGate(-X, -X)'),
+     'cirq.PauliInteractionGate(cirq.X, True, cirq.X, True)'),
     (cirq.PauliInteractionGate(cirq.Pauli.X, False, cirq.Pauli.Y, False),
-     'cirq.PauliInteractionGate(+X, +Y)'),
+     'cirq.PauliInteractionGate(cirq.X, False, cirq.Y, False)'),
     (cirq.PauliInteractionGate(cirq.Pauli.Y, False, cirq.Pauli.Z, False),
-     'cirq.PauliInteractionGate(+Y, +Z)'),
+     'cirq.PauliInteractionGate(cirq.Y, False, cirq.Z, False)'),
     (cirq.PauliInteractionGate(cirq.Pauli.Z, False, cirq.Pauli.Y, False),
-     'cirq.PauliInteractionGate(+Z, +Y)'),
+     'cirq.PauliInteractionGate(cirq.Z, False, cirq.Y, False)'),
     (cirq.PauliInteractionGate(cirq.Pauli.Y, True,  cirq.Pauli.Z, True ),
-     'cirq.PauliInteractionGate(-Y, -Z)'),
+     'cirq.PauliInteractionGate(cirq.Y, True, cirq.Z, True)'),
     (cirq.PauliInteractionGate(cirq.Pauli.Z, True,  cirq.Pauli.Y, True ),
-     'cirq.PauliInteractionGate(-Z, -Y)')))
+     'cirq.PauliInteractionGate(cirq.Z, True, cirq.Y, True)')))
 def test_repr(gate, gate_repr):
     assert repr(gate) == gate_repr