-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingmod: algorithmsRelated to the Algorithms moduleRelated to the Algorithms module
Description
Environment
- Qiskit Terra version: 0.20.1
- Python version: 3.7
- Operating system: Windows 10
What is happening?
- full naive solution vector: [1.14135909 0.32179095]
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
- infinite loop running this code:
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))
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
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
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingmod: algorithmsRelated to the Algorithms moduleRelated to the Algorithms module