Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Potential energy surfaces

VeloxChem enables the exploration of potential energy surfaces through efficient geometry optimizations and transition‑state searches, using the geomeTRIC module as a robust engine that provides stable structure updates for molecular systems.

Ground state optimization

Python script

import veloxchem as vlx

molecule = vlx.Molecule.read_name("water")
basis = vlx.MolecularBasis.read(molecule, "def2-svp")

scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = "b3lyp"
results = scf_drv.compute(molecule, basis)

opt_drv = vlx.OptimizationDriver(scf_drv)
opt_results = opt_drv.compute(molecule, basis, results)

Text file

Please refer to the keyword list for a complete set of options. Dispersion can be activated in the @method settings section by using the keyword dispersion.

@jobs
task: optimize
@end

@method settings
xcfun: b3lyp
basis: def2-svp
dispersion: yes # use dft-d4 correction
@end

@molecule
charge: 0
multiplicity: 1
xyz:
...
@end
Figure: Optimization of the molecular structure in the ground state, S_0.

Figure: Optimization of the molecular structure in the ground state, S0_0.

Excited state optimization

Python script

import veloxchem as vlx

molecule = vlx.Molecule.read_smiles("F[H]")
basis = vlx.MolecularBasis.read(molecule, 'def2-svp')

scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = 'b3lyp'
scf_results = scf_drv.compute(molecule, basis)

rsp_drv = vlx.LinearResponseEigenSolver()
rsp_drv.nstates = 2
rsp_results = rsp_drv.compute(molecule, basis, scf_results)

grad_drv = vlx.TddftGradientDriver(scf_drv)
grad_drv.state_deriv_index = 1

opt_drv = vlx.OptimizationDriver(grad_drv)
opt_results = opt_drv.compute(molecule, basis, scf_drv, rsp_drv, rsp_results)

Text file

To optimize an excited state, you need to use the task optimize and to specify which state you want to optimize with the state_deriv_index: keyword in the @gradient section.

@jobs
task: optimize
@end

@response
property: absorption
nstates: 2
@end

@gradient
state_deriv_index: 1
@end

@method settings
xcfun: b3lyp
basis: def2-svp
@end

@molecule
charge: 0
multiplicity: 1
xyz:
...
@end
Figure: Optimization of the molecular structure in the excited state, S_1.

Figure: Optimization of the molecular structure in the excited state, S1_1.

Constrained optimization

Internal coordinates (distances, angles, dihedrals) can be constrained during the molecular structure optimization with use of either the set, freeze, or scan options.

Set or freeze internal coordinate

set will aim at converging an internal coordinate to a desired value while freeze will keep it at its initial value.

Python script

import veloxchem as vlx

molecule = vlx.Molecule.read_xyz_string("""4
Hydrogen peroxide
O  -0.65564532 -0.06106286 -0.03621403
O   0.65564532  0.06106286 -0.03621403
H  -0.97628735  0.65082652  0.57474201
H   0.97628735 -0.65082652  0.57474201
""")

basis = vlx.MolecularBasis.read(molecule, "def2-svp")

scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = "b3lyp"
scf_results = scf_drv.compute(molecule, basis)

opt_drv = vlx.OptimizationDriver(scf_drv)
opt_drv.constraints = ["set dihedral 3 1 2 4 90.0", "freeze distance 1 2"]
opt_results = opt_drv.compute(molecule, basis, results)
Loading...

Text file

@jobs
task: optimize
@end

@method settings
xcfun: b3lyp
basis: def2-svp
@end

@optimize
set dihedral 1 3 4 2 90.0
freeze distance 3 4
@end

@molecule
charge: 0
multiplicity: 1
xyz:
...
@end
Figure: Constrained optimization of the molecular structure in the ground state, S_0.

Figure: Constrained optimization of the molecular structure in the ground state, S0_0.

Scan coordinate

The scan directive will perform a relaxed scan of an internal coordinate from an initial to a final value in a given number of steps.

scan distance 6 1 1.4 1.5 9
scan angle    6 1 2 100 110 9
scan dihedral 6 1 2 3 0 360 19

Python script

import veloxchem as vlx

molecule = vlx.Molecule.read_xyz_string("""4
Hydrogen peroxide
O  -0.65564532 -0.06106286 -0.03621403
O   0.65564532  0.06106286 -0.03621403
H  -0.97628735  0.65082652  0.57474201
H   0.97628735 -0.65082652  0.57474201
""")
basis = vlx.MolecularBasis.read(molecule, "def2-svp")

scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = "b3lyp"
scf_results = scf_drv.compute(molecule, basis)

opt_drv = vlx.OptimizationDriver(scf_drv)
opt_drv.constraints = ["scan dihedral 3 1 2 4 0 180 7"]
opt_results = opt_drv.compute(molecule, basis, scf_results)
<Figure size 600x400 with 1 Axes>

Text file

@jobs
task: optimize
@end

@method settings
xcfun: b3lyp
basis: def2-svp
@end

@optimize
scan dihedral 1 3 4 2 180 0 9
@end

@molecule
charge: 0
multiplicity: 1
xyz:
...
@end
Figure: Relaxed scan of dihedral angle in the ground state, S_0.

Figure: Relaxed scan of dihedral angle in the ground state, S0_0.