The following Python function was used to get digital results from linear system, the dimension of matrix and vector is 2:
def get_solution_vector(solution):
"""Extracts and normalizes simulated state vector
from LinearSolverResult."""
solution_vector = Statevector(solution.state).data[16:18].real
norm = solution.euclidean_norm
return norm * solution_vector / np.linalg.norm(solution_vector)
How can I get the results from quantum computational results like the above-mentioned function? I am green-hand at HHL.
LI JIAN