Learning Home Catalog Composer
Learning
Home Catalog Composer
Tutorials

Compute dissociation PES curve for Li2S (20Q) and FeP-NO (44Q), with Qunova HiVQE

Usage estimate (NOTE: This is an estimate only. Your runtime may vary.)

  • Li2S: 5 minutes QPU time on ibm_marrakesh
  • FeP-NO: 5 minutes QPU time on ibm_marrakesh

Background

Accurately calculating chemical reaction energies is crucial for scientific advancements in materials science, chemical engineering, drug discovery, and other fields. Among various chemical systems, the Li-S system has garnered significant interest for understanding and developing new battery compositions. This tutorial provides hands-on experience in calculating the Li-S bond dissociation potential energy surface (PES) of a Li2SLi_2S system by removing one lithium atom using HiVQE calculations. The results can be compared with reference calculations (CASCI) as well as classical methods like Hartree-Fock (HF) for a 20-qubit problem.

Requirements

Install the following dependencies to run the code in this tutorial.

Copy to clipboard

No output produced

Setup

To run this tutorial, import qunova/hivqe-chemistry function via QiskitFunctionCatalog. You need an IBM Quantum® Premium Plan account with a license from Qunova to run this function.

Copy to clipboard

No output produced

Part 1: Li2S (20Q)

Step 1: Map classical inputs to a quantum problem

Define Li2SLi_2S geometries in dictionary format for different bond distance of Li-S to calculate PES curve. These geometries are optimized using B3LYP/631g calculations.

Copy to clipboard

Output:

{'1.51': 'S -1.239044 0.671232 -0.030374; Li -1.506327 0.432403 -1.498949; Li -0.899996 0.973348 1.826768',
 '1.91': 'S -1.215858 0.692272 0.099232; Li -1.553305 0.390283 -1.758043; Li -0.876205 0.994426 1.956257',
 '2.40': 'S -1.741432 0.680397 0.346702; Li -0.529307 0.488006 -1.729343; Li -1.284307 0.989409 2.177209',
 '3.10': 'S -2.347450 0.657089 0.566194; Li -0.199353 0.527517 -1.665148; Li -1.008243 0.973206 1.893522',
 '3.80': 'S -2.707255 0.674298 0.909161; Li 0.079218 0.552012 -1.671656; Li -0.927010 0.931502 1.557063',
 '4.50': 'S -2.913363 0.709175 1.276987; Li 0.368656 0.559989 -1.798088; Li -1.010340 0.888647 1.315670'}

HiVQE calculations will be performed with the options defined below. Using sto3g basis for Li2SLi_2S, there are 19 spatial orbitals with 22 electrons. To run (10o,10e) case with HiVQE calculation, you can define 10 active orbitals and six frozen orbitals. At each iteration, 100 shots will be used to sample electron configuration generated by the ExcitationPreserving quantum circuit (epa) with circular entanglement and two repetitions (reps). The maximum number of iteration is set to be 30 to ensure termination of iteration with energy convergence.

Copy to clipboard

No output produced

Step 2 and 3: Optimize problem for quantum hardware execution and execute using the HiVQE Chemistry function

Set up the for loop to run HiVQE calculations with geometries with options defined below. Jobs are submitted in the for loop. In this tutorial, you will submit six geometries and retrieve results when they are all completed. In the main function run, you need to define the max_states and max_expansion_states to control the maximum size of the subspace matrix and to control how many states can be generated using classical CI expansion methods per iteration. The function job ids will be stored in the dictionary with each geometry label to further track and process the ouptut.

Copy to clipboard

Output:

{'1.51': 'de3b8818-c9db-4fa3-a3c2-d51551c2dfaf', '1.91': '55d9467a-fc85-49a8-9bc6-8f6990e421e5', '2.40': '415112b3-69ff-4d53-8b10-cb4e3be68c9e', '3.10': 'ef67b600-3887-4225-b872-e354dfdf8454', '3.80': 'b16d3502-a9e4-4560-9775-852e9d07e70f', '4.50': '0c0bffc7-af77-4a56-a656-2a2610c991d6'}

Let's check whether all jobs are still running or completed.

Copy to clipboard

Output:

1.51 de3b8818-c9db-4fa3-a3c2-d51551c2dfaf DONE
1.91 55d9467a-fc85-49a8-9bc6-8f6990e421e5 DONE
2.40 415112b3-69ff-4d53-8b10-cb4e3be68c9e DONE
3.10 ef67b600-3887-4225-b872-e354dfdf8454 DONE
3.80 b16d3502-a9e4-4560-9775-852e9d07e70f DONE
4.50 0c0bffc7-af77-4a56-a656-2a2610c991d6 DONE
Completed 6 job, Running or Queued 0 job

Once all jobs are completed, let's retrieve all calculation results.

Copy to clipboard

Output:

All jobs are completed
1.51 -407.8944801731773
1.91 -407.9800570932916
2.40 -407.9372992999806
3.10 -407.86278336000134
3.80 -407.83092972296157
4.50 -407.82971011225766

Copy to clipboard

Output:

{'1.51': -407.8944801731773,
 '1.91': -407.9800570932916,
 '2.40': -407.9372992999806,
 '3.10': -407.86278336000134,
 '3.80': -407.83092972296157,
 '4.50': -407.82971011225766}

The entire QPU runtime used in the job can be tracked by logging in to quantum.ibm.com and viewing submitted jobs with the qunova-chemistry-hivqe tag.

Step 4: Post-process and compare with classical methods

Classical reference calculation (CASCI) can be conducted for (10o,10e) to validate HiVQE results.

Copy to clipboard

No output produced

Copy to clipboard

Output:

d=1.3  RHF Energy:   -407.7137006, CASCI Energy:   -407.7193917
d=1.4  RHF Energy:   -407.8183196, CASCI Energy:   -407.8245211
d=1.5  RHF Energy:   -407.8878013, CASCI Energy:   -407.8944802
d=1.6  RHF Energy:   -407.9315356, CASCI Energy:   -407.9385663
d=1.7  RHF Energy:   -407.9569034, CASCI Energy:   -407.9641258
d=1.8  RHF Energy:   -407.9693681, CASCI Energy:   -407.9766313
d=1.9  RHF Energy:   -407.9728592, CASCI Energy:   -407.9800572
d=2.0  RHF Energy:   -407.9701684, CASCI Energy:   -407.9772549
d=2.1  RHF Energy:   -407.9632701, CASCI Energy:   -407.9702381
d=2.2  RHF Energy:   -407.9535584, CASCI Energy:   -407.9604007
d=2.3  RHF Energy:   -407.9420173, CASCI Energy:   -407.9487043
d=2.3  RHF Energy:   -407.9420156, CASCI Energy:   -407.9487024
d=2.4  RHF Energy:   -407.9297216, CASCI Energy:   -407.9372993
d=2.5  RHF Energy:      -407.9172, CASCI Energy:   -407.9261859
d=2.6  RHF Energy:   -407.9061139, CASCI Energy:    -407.915961
d=2.7  RHF Energy:   -407.8937118, CASCI Energy:    -407.904259
d=2.8  RHF Energy:   -407.8816389, CASCI Energy:   -407.8928292
d=2.9  RHF Energy:   -407.8700448, CASCI Energy:   -407.8819574
d=3.0  RHF Energy:    -407.859054, CASCI Energy:   -407.8719092
d=3.1  RHF Energy:   -407.8487619, CASCI Energy:   -407.8628304
d=3.2  RHF Energy:   -407.8392304, CASCI Energy:   -407.8548482
d=3.3  RHF Energy:   -407.8304842, CASCI Energy:   -407.8480217
d=3.4  RHF Energy:   -407.8225124, CASCI Energy:   -407.8423743
d=3.5  RHF Energy:   -407.8152758, CASCI Energy:   -407.8378892
d=3.6  RHF Energy:   -407.8087161, CASCI Energy:   -407.8345331
d=3.7  RHF Energy:    -407.802764, CASCI Energy:   -407.8322563
d=3.8  RHF Energy:   -407.7973458, CASCI Energy:     -407.83093
d=3.9  RHF Energy:   -407.7923883, CASCI Energy:   -407.8303555
d=4.0  RHF Energy:   -407.7878216, CASCI Energy:     -407.83025
d=4.1  RHF Energy:    -407.783582, CASCI Energy:   -407.8303243
d=4.2  RHF Energy:   -407.7796124, CASCI Energy:   -407.8303791
d=4.3  RHF Energy:   -407.7758633, CASCI Energy:   -407.8302885
d=4.4  RHF Energy:   -407.7722923, CASCI Energy:   -407.8300614
d=4.5  RHF Energy:   -407.7688641, CASCI Energy:    -407.829711

Plotting the dissociation curve for Li_2S

Let's plot and compare HiVQE results with HF and CASCI. You can observe that all HiVQE calculations are well-matched with the classical reference result (CASCI).

Copy to clipboard

Output:

Part 2: FeP-NO (44Q)

Step 1: Map classical inputs to a quantum problem

Define the options for HiVQE calculations

Copy to clipboard

No output produced

Define FeP-NO geometries in dictionary format for different bond distances of Fe-N to calculate PES curve.

Copy to clipboard

Output:

{'5.0': '\nFe     9.918629    31.289202     1.717339\nN     10.542914    31.832173    -0.080685\nN     11.795572    31.199413     2.341831\nN      9.294593    30.741247     3.513929\nN      8.042689    31.359481     1.087282\nC      9.775254    32.111817    -1.200449\nC     10.600219    32.479101    -2.319680\nC     11.891090    32.425876    -1.887580\nC     11.847694    32.024341    -0.507342\nC     12.945734    31.464689     1.611366\nC     14.116395    31.289997     2.423572\nC     13.685777    30.915122     3.663719\nC     12.252381    30.861042     3.608186\nC     10.062170    30.463021     4.634102\nC      9.236749    30.104333     5.755782\nC      7.945687    30.161198     5.324720\nC      7.989641    30.552269     3.941498\nC      6.892881    31.087489     1.815829\nC      5.722676    31.253502     1.001149\nC      6.153153    31.631057    -0.238233\nC      7.586010    31.695401    -0.179773\nC      8.390724    32.047572    -1.247553\nH      7.903308    32.291586    -2.187969\nC     12.973334    31.849872     0.283741\nH     13.944682    32.031190    -0.169145\nC     11.447158    30.518591     4.678739\nH     11.934423    30.277429     5.619969\nC      6.864795    30.711643     3.146118\nH      5.893357    30.532078     3.599511\nH     12.800139    32.636412    -2.439296\nH     10.224017    32.743662    -3.301293\nH     15.131785    31.441247     2.076257\nH     14.273933    30.694315     4.546802\nH      9.612512    29.848040     6.739754\nH      7.036117    29.960530     5.879248\nH      4.707408    31.099933     1.347803\nH      5.564992    31.851940    -1.121294\nN      9.666041    36.091609     3.085945\nO      9.598728    37.226756     3.411299\n'}
Copy to clipboard

Output:

{'5.0': '\nFe     9.918629    31.289202     1.717339\nN     10.542914    31.832173    -0.080685\nN     11.795572    31.199413     2.341831\nN      9.294593    30.741247     3.513929\nN      8.042689    31.359481     1.087282\nC      9.775254    32.111817    -1.200449\nC     10.600219    32.479101    -2.319680\nC     11.891090    32.425876    -1.887580\nC     11.847694    32.024341    -0.507342\nC     12.945734    31.464689     1.611366\nC     14.116395    31.289997     2.423572\nC     13.685777    30.915122     3.663719\nC     12.252381    30.861042     3.608186\nC     10.062170    30.463021     4.634102\nC      9.236749    30.104333     5.755782\nC      7.945687    30.161198     5.324720\nC      7.989641    30.552269     3.941498\nC      6.892881    31.087489     1.815829\nC      5.722676    31.253502     1.001149\nC      6.153153    31.631057    -0.238233\nC      7.586010    31.695401    -0.179773\nC      8.390724    32.047572    -1.247553\nH      7.903308    32.291586    -2.187969\nC     12.973334    31.849872     0.283741\nH     13.944682    32.031190    -0.169145\nC     11.447158    30.518591     4.678739\nH     11.934423    30.277429     5.619969\nC      6.864795    30.711643     3.146118\nH      5.893357    30.532078     3.599511\nH     12.800139    32.636412    -2.439296\nH     10.224017    32.743662    -3.301293\nH     15.131785    31.441247     2.076257\nH     14.273933    30.694315     4.546802\nH      9.612512    29.848040     6.739754\nH      7.036117    29.960530     5.879248\nH      4.707408    31.099933     1.347803\nH      5.564992    31.851940    -1.121294\nN      9.666041    36.091609     3.085945\nO      9.598728    37.226756     3.411299\n'}

Step 2 and 3: Optimize problem for quantum hardware execution and execute using the HiVQE Chemistry function

Based on the setup of HiVQE and geometries, obtain results sequentially.

Submit d(Fe-N) = 1.75 A˚\AA calculation.

Copy to clipboard

No output produced

Track the job and retrieve the result for d(Fe-N) = 1.75 A˚\AA calculation.

Copy to clipboard

No output produced

Submit d(Fe-N) = 2.00 A˚\AA calculation.

Copy to clipboard

No output produced

Track the job and retrieve the result for d(Fe-N) = 2.00 A˚\AA calculation.

Copy to clipboard

No output produced

Submit d(Fe-N) = 5.00 A˚\AA calculation.

Copy to clipboard

No output produced

Track the job and retrieve the result for d(Fe-N) = 5.00 A˚\AA calculation.

Copy to clipboard

No output produced

Copy to clipboard

No output produced

Step 4: Post-process and compare with classical methods

Classical reference calculation (CASCI-DMRG, maxM=800) results are provided for (22o,22e) to validate HiVQE results.

Copy to clipboard

No output produced

Copy to clipboard

Output:

Tutorial Survey

SurveyTutorial Survey

Please take one minute to provide feedback on this tutorial. Your insights will help us improve our content offerings and user experience.

Was this page helpful?