Repository: Qiskit/qiskit

Issue:
Opflow adjoint of Hermitian PauliSumOp
<!-- ⚠️ 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.16.0 
- **Python version**: 3.7.3
- **Operating system**: macOS Catalina 10.15.1

### What is the current behavior?

If you create a Hermitian operator including a term with an odd number of `Y` terms as a PauliSumOp and convert it into a measurement StateFn it flips a sign where it should not. See code below.

### Steps to reproduce the problem

`test = SummedOp([(Z ^ Z), (Y ^ I)]).reduce()`
`test = ~StateFn(test)`
`test.primitive.to_pauli_op()`

gives

`SummedOp([PauliOp(Pauli('ZZ'), coeff=1.0), PauliOp(Pauli('YI'), coeff=-1.0)], coeff=1.0, abelian=False)`


The following  cases are handled correctly
for 
`test = PauliOp(Pauli('YI'), coeff=1.0)`

gives
`PauliOp(Pauli('YI'), coeff=1.0)`

and for
`test =  SummedOp([(Z ^ X), (Y ^ I)])`

gives
`SummedOp([PauliOp(Pauli('YI'), coeff=1.0), PauliOp(Pauli('ZX'), coeff=1.0)], coeff=1.0, abelian=False)`

### What is the expected behavior?

It seems like the adjoint operator `~` does not implement the correct complex transpose on a PauliSumOp.

### Suggested solutions

The error seems to be somewhere in the `PauliSumOp`.

Opflow adjoint of Hermitian PauliSumOp
<!-- ⚠️ 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.16.0 
- **Python version**: 3.7.3
- **Operating system**: macOS Catalina 10.15.1

### What is the current behavior?

If you create a Hermitian operator including a term with an odd number of `Y` terms as a PauliSumOp and convert it into a measurement StateFn it flips a sign where it should not. See code below.

### Steps to reproduce the problem

`test = SummedOp([(Z ^ Z), (Y ^ I)]).reduce()`
`test = ~StateFn(test)`
`test.primitive.to_pauli_op()`

gives

`SummedOp([PauliOp(Pauli('ZZ'), coeff=1.0), PauliOp(Pauli('YI'), coeff=-1.0)], coeff=1.0, abelian=False)`


The following  cases are handled correctly
for 
`test = PauliOp(Pauli('YI'), coeff=1.0)`

gives
`PauliOp(Pauli('YI'), coeff=1.0)`

and for
`test =  SummedOp([(Z ^ X), (Y ^ I)])`

gives
`SummedOp([PauliOp(Pauli('YI'), coeff=1.0), PauliOp(Pauli('ZX'), coeff=1.0)], coeff=1.0, abelian=False)`

### What is the expected behavior?

It seems like the adjoint operator `~` does not implement the correct complex transpose on a PauliSumOp.

### Suggested solutions

The error seems to be somewhere in the `PauliSumOp`.



Discussion:

Resolving patch:
diff --git a/qiskit/opflow/primitive_ops/pauli_sum_op.py b/qiskit/opflow/primitive_ops/pauli_sum_op.py
--- a/qiskit/opflow/primitive_ops/pauli_sum_op.py
+++ b/qiskit/opflow/primitive_ops/pauli_sum_op.py
@@ -132,7 +132,7 @@ def mul(self, scalar: Union[int, float, complex, ParameterExpression]) -> Operat
 
     def adjoint(self) -> OperatorBase:
         return PauliSumOp(
-            self.primitive.conjugate(), coeff=self.coeff.conjugate()  # type:ignore
+            self.primitive.adjoint(), coeff=self.coeff.conjugate()
         )
 
     def equals(self, other: OperatorBase) -> bool:


Test patch:
diff --git a/test/python/opflow/test_pauli_sum_op.py b/test/python/opflow/test_pauli_sum_op.py
--- a/test/python/opflow/test_pauli_sum_op.py
+++ b/test/python/opflow/test_pauli_sum_op.py
@@ -87,7 +87,7 @@ def test_mul(self):
     def test_adjoint(self):
         """ adjoint test """
         pauli_sum = PauliSumOp(SparsePauliOp(Pauli("XYZX"), coeffs=[2]), coeff=3)
-        expected = PauliSumOp(SparsePauliOp(Pauli("XYZX")), coeff=-6)
+        expected = PauliSumOp(SparsePauliOp(Pauli("XYZX")), coeff=6)
 
         self.assertEqual(pauli_sum.adjoint(), expected)
 
@@ -95,6 +95,18 @@ def test_adjoint(self):
         expected = PauliSumOp(SparsePauliOp(Pauli("XYZY")), coeff=-6j)
         self.assertEqual(pauli_sum.adjoint(), expected)
 
+        pauli_sum = PauliSumOp(SparsePauliOp(Pauli("X"), coeffs=[1]))
+        self.assertEqual(pauli_sum.adjoint(), pauli_sum)
+
+        pauli_sum = PauliSumOp(SparsePauliOp(Pauli("Y"), coeffs=[1]))
+        self.assertEqual(pauli_sum.adjoint(), pauli_sum)
+
+        pauli_sum = PauliSumOp(SparsePauliOp(Pauli("Z"), coeffs=[1]))
+        self.assertEqual(pauli_sum.adjoint(), pauli_sum)
+
+        pauli_sum = (Z ^ Z) + (Y ^ I)
+        self.assertEqual(pauli_sum.adjoint(), pauli_sum)
+
     def test_equals(self):
         """ equality test """