3
$\begingroup$

I am trying to calculate the ground state energy of some simple molecules using 'MolecularGroundStateEnergy' tools in qiskit. When I run the calculations for very small molecules (e.g. H2, HeH+) the jobs appear in the queue very quickly and the calculations work independent of which backend I select. However, running the same code with slightly larger molecules (e.g. LiH, BeH2 and water) the jupyter notebook runs indefinitely and the jobs do not show in the IMBQ queue.

Note: I have run successful calculations for all these molecules using the state-vector simulator with no issues.

Here is the function i use to calculate energy via VQE given a molecule (created from PySCF driver):

def calc_vqe_energy(molecule):
  driver = molecule

  energy = MolecularGroundStateEnergy(driver = driver, 
                                      transformation=TransformationType('full'), 
                                      qubit_mapping=QubitMappingType('parity'), 
                                      two_qubit_reduction=True, 
                                      freeze_core=False, 
                                      z2symmetry_reduction='auto')
    
  solver = energy.get_default_solver(quantum_instance)
    
  #calculate energy using the above solver 
  calc = energy.compute_energy(solver)
  return calc

this is set up to run using the quantum instance:

IBMQ.save_account(token)
IBMQ.load_account()
provider = IBMQ.get_provider(hub='ibm-q')
backend = provider.get_backend("ibmq_qasm_simulator")
coupling_map = backend.configuration().coupling_map
quantum_instance = QuantumInstance(backend=backend, shots=1000,
                                   coupling_map=coupling_map,
                                   measurement_error_mitigation_cls=CompleteMeasFitter,
                                   cals_matrix_refresh_period=30, skip_qobj_validation=False)

Thanks for the help!

$\endgroup$
3
  • 1
    $\begingroup$ It takes more time for larger molecules. Also there is really no queue for the online simulator unless it is being heavily used. The cloud can spin up as many simulatorS as needed. $\endgroup$ Jul 20, 2020 at 12:56
  • $\begingroup$ Thank you for your response! It makes sense that it should take longer, however, my notebook has been running for an entire day and nothing has appeared on my pending job list/queue. Surely on the simulator it should at least register the job? Do you also happen to know how long you can run jupyters for on the IBMQ notebooks? Thanks for your help. $\endgroup$
    – Joshua
    Jul 20, 2020 at 16:02
  • $\begingroup$ Yes you should see the jobs in the results pane on the left. If not then there is a different issue popping up. $\endgroup$ Jul 20, 2020 at 17:18

1 Answer 1

0
$\begingroup$

As it is said in the comment of your question, a good reason for this may be that for larger molecules it will have to take more time to solve the problem.
If you want to see your job status or monitor it, you can try to use the method job.status() (see details here) or try the job monitor, you can see if it fails or if it runs with those.

$\endgroup$
3
  • $\begingroup$ Thanks for the response! I did think about this, however, I'm unsure how to use job monitor given that I have no identifier for the job to begin with. Is there a way to tell if a job has been created? Thanks. $\endgroup$
    – Joshua
    Jul 20, 2020 at 16:06
  • $\begingroup$ @Joshua you can do several things: you can access all the jobs from a backend using jobs = provider.backends.jobs(backend_name='ibmq_qasm_simulator', limit=0) but it will give you something quite heavy. A better way to access a job is through the IBM Quantum Experience site. You can access all the job_id of every job you launched, along with their status. Then you can access the job from the backend in qiskit by running jobtest=backend.retrieve_job('job_id'). Try this and tell me if it gives you what you need! :) $\endgroup$
    – Lena
    Jul 21, 2020 at 13:44
  • $\begingroup$ Sadly, this has not worked as I do not have a job_id. I think the issue may be that the jobs are not being created? After they're submitted they are not showing on IBMQ. $\endgroup$
    – Joshua
    Jul 21, 2020 at 15:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.