Use this file to discover all available pages before exploring further.
View on GitHub
Open this notebook in GitHub to run it yourself
A potential energy curve gives the ground energy of an assembly of atoms as a function of the distances between them.The global minima of the curve indicates the binding energy and internuclear distance for the stable molecule. Therefore, such a curve can be powerful tool in computational chemistry for predicting the molecular structure and spectrum.This tutorial demonstrates how to use the Classiq chemistry package to create a molecule’s potential energy curve. It compares the result with the Hartree-Fock approximation method and the FCI (Full Configuration Interaction) energy.
Define the range of internuclear distances for the model to simulate, and choose the number of sampling points in this range, which determines the graph’s resolution.
import numpy as np# define the sampling paramsnum1 = 5 # how many sampling points - determines your resolutionstart1 = 0.20 # what is your sampling start distancestop1 = 1 # what is your sampling end distancenum2 = 7 # how many sampling points - determines your resolutionstart2 = 1.4 # what is your sampling start distancestop2 = 3.5 # what is your sampling end distance# prepare x,y vectorsdistance = np.append(np.linspace(start1, stop1, num1), np.linspace(start2, stop2, num2))VQE_energy = []HF_energy = []exact_energy = []print(distance)
This graph presents the ground state for the H2 molecule as a function of the distance between the two hydrogen atoms.Note that both the HF solution and Classiq VQE present decent results around the global minima.For further distances, Classiq VQE stays close to the exact solution while the HF solution gradually deviates.The source of this lack of correspondence is with the lack of flexible correlations within the HF model, which is enabled within the VQE scope.You can explore more curves, creating graphs for different molecules (even n-dimensional or larger atom assemblies) in a similar fashion.