We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
So the statement "It should not come as a surprise that naive_hhl_solution is exact because all the default methods used are exact" is false
from qiskit import transpile
num_qubits = list(range(1,5)) a = 1 b = -1/3
i=1
naive_depths = [] tridi_depths = [] for nb in num_qubits: matrix = diags([b, a, b], [-1, 0, 1], shape=(2nb, 2nb)).toarray() vector = np.array([1] + [0]*(2**nb -1))
naive_hhl_solution = HHL().solve(matrix, vector) tridi_matrix = TridiagonalToeplitz(nb, a, b) tridi_solution = HHL().solve(tridi_matrix, vector) naive_qc = transpile(naive_hhl_solution.state,basis_gates=['id', 'rz', 'sx', 'x', 'cx']) tridi_qc = transpile(tridi_solution.state,basis_gates=['id', 'rz', 'sx', 'x', 'cx']) naive_depths.append(naive_qc.depth()) tridi_depths.append(tridi_qc.depth()) i +=1
You can run the example shownat https://learn.qiskit.org/course/ch-applications/solving-linear-systems-of-equations-using-hhl-and-its-qiskit-implementation
???
No response
The text was updated successfully, but these errors were encountered:
algorithms
Successfully merging a pull request may close this issue.
Environment
What is happening?
full tridi solution vector: [-1.17282534 -0.17530181]
classical state: [1.125 0.375]
So the statement "It should not come as a surprise that naive_hhl_solution is exact because all the default methods used are exact" is false
from qiskit import transpile
num_qubits = list(range(1,5))
a = 1
b = -1/3
i=1
calculate the circuit depths for different number of qubits to compare the use of resources
naive_depths = []
tridi_depths = []
for nb in num_qubits:
matrix = diags([b, a, b], [-1, 0, 1], shape=(2nb, 2nb)).toarray()
vector = np.array([1] + [0]*(2**nb -1))
How can we reproduce the issue?
You can run the example shownat https://learn.qiskit.org/course/ch-applications/solving-linear-systems-of-equations-using-hhl-and-its-qiskit-implementation
What should happen?
???
Any suggestions?
No response
The text was updated successfully, but these errors were encountered: