2
$\begingroup$

I tried to follow the HHL tutorial. Since the 8x8 problem is not realistically simulable (I stopped after a few minutes), I tried to make it run on another backend, starting on the easiest example:

params = {
    'problem': {
        'name': 'linear_system'
    },
    'algorithm': {
        'name': 'HHL'
    },
    'eigs': {
        'expansion_mode': 'suzuki',
        'expansion_order': 2,
        'name': 'EigsQPE',
        'num_ancillae': 3,
        'num_time_slices': 50
    },
    'reciprocal': {
        'name': 'Lookup'
    }
}
provider = IBMQ.get_provider(hub='ibm-q')
backend = provider.get_backend('ibmq_16_melbourne')

matrix = [[1, 0], [0, 2]]
vector = [1, 4]
params['input'] = {
    'name': 'LinearSystemInput',
    'matrix': matrix,
    'vector': vector
}

result = run_algorithm(params, backend = backend)
print("solution ", np.round(result['solution'], 5))

If I use

run_algorithm(params, backend = BasicAer.get_backend('qasm_simulator'))

It take a bit of time (30 seconds) but it works. However with 'ibmq_16_melbourne', it runs without any sign of ever stopping (close to an hour now). It doesn't seem to be queud or something, because it consume 20% of my processor and the quantum-computing.ibm.com page says I have no result pending. I tried to restart everything already. Can you help me and guess what is happening ? Thank you very much

Edit 1:

I've observed that the circuit generated by Aqua to use HHL on a diagonal matrix of size 2 has a depth of 29 000 . So it explains why the simulation is taking so damn long. This is much much bigger than what it should be. The tutorial (which i was running) says the the depth of the generated circut is 129. (I was running the exact same code). I suppose there was some change in the library after the tutorial was done. So my guess is there is some bug in HHL that makes it create a lagrely oversized circuit.

$\endgroup$
  • $\begingroup$ I've observed that the circuit generated by Aqua to use HHL on a diagonal matrix of size 2 has a depth of 29 000 . So it explains why the simulation is taking so damn long. This is much much bigger than what it should be. The tutorial (which i was running) says the the depth of the generated circut is 129. (I was running the exact same code). I suppose there was some change in the library after the tutorial was done. So my guess is there is some bug in HHL that makes it create a lagrely oversized circuit. $\endgroup$ – Serwyn Sep 30 at 14:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.