If one has two qubits in arbitrary stats and wishes to apply a controlled version of some global phase gate $P(\varphi) = \begin{pmatrix} e^{i\varphi} & 0 \\ 0 & e^{i\varphi} \end{pmatrix}$ one should obtain:
$$ \left| \psi_0 \right\rangle \left| \psi_1 \right\rangle = \left(c_{00} \left| 0 \right\rangle + c_{01} \left| 1 \right\rangle \right)\left(c_{10} \left| 0 \right\rangle + c_{11} \left| 1 \right\rangle \right) \xrightarrow{\text{CP} }$$
$$ \xrightarrow{\text{CP}} c_{00} \left| 0 \right\rangle \left(c_{10} \left| 0 \right\rangle + c_{11} \left| 1 \right\rangle \right) + c_{01} \left| 1 \right\rangle \left(c_{10} e^{i\varphi} \left| 0 \right\rangle + c_{11} e^{i\varphi} \left| 1 \right\rangle \right), $$
This example shows that in contrast to global phase gate $P$ which doesn't produce any measurable changes in a qubit state, the controlled version of it ($CP$) makes measurable changes in the state of a system of qubits. So it is ok if $P$ is ignored, but it is not ok if $CP$ is ignored (what is happening in the presented code).
Here is a code where I use qiskit.aqua.operators.common.evolution_instruction
method, where because of (how I understand) ignoring the global phase gate, the $CP$ gate wasn't obtained (the print(qc.qasm())
command shows no gate is added to the circuit):
import numpy as np
from qiskit import *
from qiskit.aqua.operators import WeightedPauliOperator
from qiskit.aqua.operators.common import evolution_instruction
phase = np.pi
pauli_dict = {'paulis': [{"coeff": {"imag": 0.0, "real": phase}, "label": "I"}]}
identity = WeightedPauliOperator.from_dict(pauli_dict)
pauli_list = identity.reorder_paulis()
instruction = evolution_instruction(pauli_list, evo_time=1, num_time_slices=1, controlled=True)
q = QuantumRegister(2)
qc_temp = QuantumCircuit(q)
qc_temp.append(instruction, q)
qc = qc_temp.decompose()
print(qc.qasm())
Possible consequences: when I tried to implement IPEA algorithm for $H = \begin{pmatrix} E_1 & 0 \\ 0 & E_2 \end{pmatrix}$ Hamiltonian I was estimating $E_2 - E_1$ instead of estimating $E_2$ eigenvalue. This problem was reported here. Problems may arise also for other quantum algos that use PEA as a subroutine (like HHL algo).
Is this a problem/bug? Are there alternatives to qiskit evolution_instruction method
that don't ignore phase gates (or Pauli I operator)?