I'm trying to implement the HHL algorithm for the matrix and vecor as follows: $ A = \begin{bmatrix} 11 & 5 & -1 & -1 \\ 5 & 11 & 1 & 1 \\ -1 & 1 & 11 & -5 \\ -1 & 1 & -5 & 11 \end{bmatrix} $ , $ B = \begin{bmatrix} 0 & 0 & 0 & 1 \end{bmatrix}^T $ such that the normalized output vector is the following: $ \begin{bmatrix} 0.045 & 0.045 & 0.1818 & 0.7272 \end{bmatrix}^T $.
The quantum circuit is the following:
where each e^(iApi/n) is buits as follows:
def get_gate(A, n):
pauli_op = PauliSumOp(SparsePauliOp.from_operator(A))
phi = Parameter('ϕ')
evolution_op = (phi * pauli_op).exp_i() # exp(-iϕA)
trotterized_op = PauliTrotterEvolution(trotter_mode=Suzuki(order=2, reps=1)).convert(evolution_op).bind_parameters({phi: np.pi/n})
#----control---------
gate = trotterized_op.to_circuit()
gate.name = f"e^(i*A*pi/{n})"
gate.label = f"e^(i*A*np.pi/{n})"
gate = gate.to_gate().control()
#---------------------
return gate
However, the output of the circuit is the following:
{'011': 1491, '000': 52, '010': 463, '001': 42}
what leads to the following output normilized X-vector:
0.72802734375 0.22607421875 0.025390625 0.021484375
having 2048 shots. I see that the first two numbers are almost correct, but the least two have a differnce almost in 2 times. I tried to change powers of the matrix eponentiations and change plus on minus, however this did not help. Is there any hint of how should I change the circuit?