Quantum Computing Asked on August 20, 2021
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!
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.
Answered by Lena on August 20, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP