VeloxChem implements both implicit (CPCM and SMD) and explicit (polarizable embedding) solvation models.
Implicit solvation¶
Implicit solvation models describe the effect of a surrounding liquid environment by replacing the explicit solvent molecules with a continuous dielectric medium that interacts self‑consistently with the electronic structure of the solute. Tomasi et al. (2005)
A separation is made between equilibrium and non-equilibrium solvation. In the former case, the timescale is such that both nuclear and electronic relaxations take place in the environment, such as in molecular structure optimizations. In the latter case, only electrons are fully equilibrated with the time-dependent solute charge density, such as in UV/vis spectrum simulations.
CPCM¶
In the conductor‑like polarizable continuum model (CPCM), the solute is placed inside a cavity defined by its molecular surface, and the reaction field is obtained by solving surface‑charge equations that approximate the dielectric screening of a perfect conductor and are subsequently scaled to represent the desired solvent permittivity.
VeloxChem implements the CPCM model for:
SCF energies
gradients (structure optimizations)
linear response (UV/vis spectra and more)
Python script
import veloxchem as vlx
molecule = vlx.Molecule.read_name("ammonia")
basis = vlx.MolecularBasis.read(molecule, "def2-svp")
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.xcfun = "b3lyp"
scf_drv.solvation_model = "cpcm"
scf_results = scf_drv.compute(molecule, basis)
rsp_drv = vlx.LinearResponseEigenSolver()
rsp_drv.nstates = 10
rsp_results = rsp_drv.compute(molecule, basis, scf_results)
opt_drv = vlx.OptimizationDriver(scf_drv)
opt_results = opt_drv.compute(molecule, basis, scf_results)Reading ammonia from PubChem...
Reference: S. Kim, J. Chen, T. Cheng, A. Gindulyte, J. He, S. He, Q. Li, B. A. Shoemaker, P. A. Thiessen, B. Yu, L. Zaslavsky, J. Zhang, E. E. Bolton, Nucleic Acids Res., 2025, 53, D1516-D1525.
Please double-check the compound since names may refer to more than one record.
Self Consistent Field Driver Setup
====================================
Wave Function Model : Spin-Restricted Kohn-Sham
Initial Guess Model : Superposition of Atomic Densities
Convergence Accelerator : Two Level Direct Inversion of Iterative Subspace
Max. Number of Iterations : 50
Max. Number of Error Vectors : 10
Convergence Threshold : 1.0e-06
ERI Screening Threshold : 1.0e-12
Linear Dependence Threshold : 1.0e-06
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Solvation Model : C-PCM with ISWIG Discretization
C-PCM Dielectric Constant : 78.39
C-PCM Points per Hydrogen Sphere: 110
C-PCM Points per non-H Sphere : 194
* Info * Using the B3LYP functional.
P. J. Stephens, F. J. Devlin, C. F. Chabalowski, and M. J. Frisch., J. Phys. Chem. 98, 11623 (1994)
* Info * Using the Libxc library (v7.0.0).
S. Lehtola, C. Steigemann, M. J.T. Oliveira, and M. A.L. Marques., SoftwareX 7, 1–5 (2018)
* Info * Using the following algorithm for XC numerical integration.
J. Kussmann, H. Laqua and C. Ochsenfeld, J. Chem. Theory Comput. 2021, 17, 1512-1521
* Info * Using C-PCM with the ISWIG discretization method.
A. W. Lange, J. M. Herbert, J. Chem. Phys. 2010, 133, 244111.
* Info * Starting Reduced Basis SCF calculation...
* Info * ...done. SCF energy in reduced basis set: -56.117339689648 a.u. Time: 0.61 sec.
Iter. | Kohn-Sham Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -56.512718019413 0.0000000000 0.15024683 0.01923618 0.00000000
2 -56.513187663646 -0.0004696442 0.14072992 0.01518465 0.08566464
3 -56.515265028400 -0.0020773648 0.01967074 0.00247253 0.03878184
4 -56.515304434528 -0.0000394061 0.00101291 0.00012458 0.00497390
5 -56.515304574098 -0.0000001396 0.00007239 0.00000955 0.00052682
6 -56.515304575235 -0.0000000011 0.00000141 0.00000021 0.00007402
7 -56.515304575240 -0.0000000000 0.00000017 0.00000003 0.00000158
*** SCF converged in 7 iterations. Time: 1.12 sec.
Spin-Restricted Kohn-Sham:
--------------------------
Total Energy : -56.5153045752 a.u.
Electronic Energy : -68.0946670911 a.u.
Electrostatic Solvation Energy : -0.0080241935 a.u.
Nuclear Repulsion Energy : 11.5873867094 a.u.
------------------------------------
Gradient Norm : 0.0000001746 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
Linear Response EigenSolver Setup
===================================
Number of States : 10
Max. Number of Iterations : 150
Convergence Threshold : 1.0e-04
ERI Screening Threshold : 1.0e-12
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Solvation Model : C-PCM
C-PCM Points per Hydrogen Sphere: 110
C-PCM Points per non-H Sphere : 194
Non-Equilibrium solvation : True
C-PCM Dielectric Constant : 78.39
C-PCM Optical Dielectric Const. : 1.777849
* Info * Using the B3LYP functional.
P. J. Stephens, F. J. Devlin, C. F. Chabalowski, and M. J. Frisch., J. Phys. Chem. 98, 11623 (1994)
* Info * Using the Libxc library (v7.0.0).
S. Lehtola, C. Steigemann, M. J.T. Oliveira, and M. A.L. Marques., SoftwareX 7, 1–5 (2018)
* Info * Using the following algorithm for XC numerical integration.
J. Kussmann, H. Laqua and C. Ochsenfeld, J. Chem. Theory Comput. 2021, 17, 1512-1521
* Info * Using C-PCM with the ISWIG discretization method.
A. W. Lange, J. M. Herbert, J. Chem. Phys. 2010, 133, 244111.
* Info * 10 gerade trial vectors in reduced space
* Info * 10 ungerade trial vectors in reduced space
*** Iteration: 1 * Residuals (Max,Min): 6.98e-01 and 5.02e-02
* Info * 20 gerade trial vectors in reduced space
* Info * 20 ungerade trial vectors in reduced space
*** Iteration: 2 * Residuals (Max,Min): 5.60e-02 and 1.47e-03
* Info * 30 gerade trial vectors in reduced space
* Info * 30 ungerade trial vectors in reduced space
*** Iteration: 3 * Residuals (Max,Min): 5.00e-03 and 7.48e-05
* Info * 38 gerade trial vectors in reduced space
* Info * 39 ungerade trial vectors in reduced space
*** Iteration: 4 * Residuals (Max,Min): 2.56e-04 and 9.03e-06
* Info * 39 gerade trial vectors in reduced space
* Info * 40 ungerade trial vectors in reduced space
*** Iteration: 5 * Residuals (Max,Min): 7.48e-05 and 9.03e-06
*** Linear response converged in 5 iterations. Time: 3.94 sec
Electric Transition Dipole Moments (dipole length, a.u.)
--------------------------------------------------------
X Y Z
Excited State S1: 0.006699 0.451537 0.121792
Excited State S2: 0.120916 0.096456 -0.364188
Excited State S3: 0.376716 -0.036691 0.115343
Excited State S4: -0.876301 0.021026 -0.029558
Excited State S5: 0.034098 0.227716 -0.846390
Excited State S6: 0.000817 -0.000178 0.000614
Excited State S7: 0.713056 0.054971 -0.243205
Excited State S8: 0.249193 -0.189105 0.687501
Excited State S9: 0.008826 0.590134 0.159108
Excited State S10: 0.091740 0.084454 -0.318199
Electric Transition Dipole Moments (dipole velocity, a.u.)
----------------------------------------------------------
X Y Z
Excited State S1: 0.012256 0.825461 0.222631
Excited State S2: 0.127581 0.101790 -0.384266
Excited State S3: 0.397468 -0.038718 0.121701
Excited State S4: -0.944494 0.022661 -0.031865
Excited State S5: 0.036739 0.245429 -0.912226
Excited State S6: 0.000806 -0.000174 0.000603
Excited State S7: 0.700968 0.054040 -0.239075
Excited State S8: 0.244976 -0.185898 0.675839
Excited State S9: 0.009233 0.617273 0.166423
Excited State S10: 0.089735 0.082616 -0.311267
Magnetic Transition Dipole Moments (a.u.)
-----------------------------------------
X Y Z
Excited State S1: -0.292266 0.121285 -0.433602
Excited State S2: 0.207889 -0.229257 0.008292
Excited State S3: -0.063931 0.201771 0.272980
Excited State S4: -0.003032 -0.526685 -0.284785
Excited State S5: 0.125982 -0.800306 -0.210240
Excited State S6: -0.003700 -0.237585 -0.063852
Excited State S7: 0.069522 0.164998 0.241125
Excited State S8: -0.176698 0.865953 0.302237
Excited State S9: -0.490121 0.203386 -0.727176
Excited State S10: 0.299044 -0.387823 -0.016722
One-Photon Absorption
---------------------
Excited State S1: 0.26292051 a.u. 7.15443 eV Osc.Str. 0.0383
Excited State S2: 0.34304039 a.u. 9.33460 eV Osc.Str. 0.0358
Excited State S3: 0.34305162 a.u. 9.33491 eV Osc.Str. 0.0358
Excited State S4: 0.44766580 a.u. 12.18161 eV Osc.Str. 0.2296
Excited State S5: 0.44767563 a.u. 12.18187 eV Osc.Str. 0.2296
Excited State S6: 0.52122544 a.u. 14.18327 eV Osc.Str. 0.0000
Excited State S7: 0.52947427 a.u. 14.40773 eV Osc.Str. 0.2014
Excited State S8: 0.52947771 a.u. 14.40782 eV Osc.Str. 0.2014
Excited State S9: 0.58969004 a.u. 16.04628 eV Osc.Str. 0.1469
Excited State S10: 0.70887792 a.u. 19.28955 eV Osc.Str. 0.0552
Electronic Circular Dichroism
-----------------------------
Excited State S1: Rot.Str. 0.000000 a.u. 0.0002 [10**(-40) cgs]
Excited State S2: Rot.Str. 0.000000 a.u. 0.0002 [10**(-40) cgs]
Excited State S3: Rot.Str. -0.000001 a.u. -0.0003 [10**(-40) cgs]
Excited State S4: Rot.Str. 0.000003 a.u. 0.0015 [10**(-40) cgs]
Excited State S5: Rot.Str. -0.000003 a.u. -0.0015 [10**(-40) cgs]
Excited State S6: Rot.Str. -0.000000 a.u. -0.0001 [10**(-40) cgs]
Excited State S7: Rot.Str. 0.000002 a.u. 0.0010 [10**(-40) cgs]
Excited State S8: Rot.Str. -0.000002 a.u. -0.0011 [10**(-40) cgs]
Excited State S9: Rot.Str. 0.000000 a.u. 0.0001 [10**(-40) cgs]
Excited State S10: Rot.Str. -0.000001 a.u. -0.0004 [10**(-40) cgs]
Character of excitations:
Excited state 1
---------------
HOMO -> LUMO 0.9989
Excited state 2
---------------
HOMO -> LUMO+1 -0.9981
Excited state 3
---------------
HOMO -> LUMO+2 -0.9981
Excited state 4
---------------
HOMO-1 -> LUMO 0.9927
Excited state 5
---------------
HOMO-2 -> LUMO -0.9927
Excited state 6
---------------
HOMO-1 -> LUMO+1 0.7030
HOMO-2 -> LUMO+2 -0.7012
Excited state 7
---------------
HOMO-1 -> LUMO+2 0.5855
HOMO-2 -> LUMO+1 -0.5854
HOMO-2 -> LUMO+2 0.3943
HOMO-1 -> LUMO+1 0.3933
Excited state 8
---------------
HOMO-2 -> LUMO+2 0.5862
HOMO-1 -> LUMO+1 0.5847
HOMO-2 -> LUMO+1 0.3939
HOMO-1 -> LUMO+2 -0.3937
Excited state 9
---------------
HOMO-1 -> LUMO+2 0.6813
HOMO-2 -> LUMO+1 0.6813
Excited state 10
----------------
HOMO -> LUMO+3 -0.9911
Optimization Driver Setup
===========================
Coordinate System : TRIC
Constraints : No
Max. Number of Steps : 300
Transition State : No
IRC : No
Hessian : never
* Info * Using geomeTRIC for geometry optimization.
L.-P. Wang and C.C. Song, J. Chem. Phys. 2016, 144, 214108
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
N -2.127266000000 -0.865585000000 1.191693000000
H -2.738251000000 -0.283276000000 0.576531000000
H -2.458899000000 -0.717385000000 2.170911000000
H -1.167688000000 -0.457198000000 1.134758000000
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
N -0.000117300512 -0.008517644335 -0.002296177415
H -0.011536421114 0.006639374061 -0.012708771125
H -0.006291817643 -0.001514934649 0.017224751986
H 0.017943410103 0.003385091147 -0.002223750067
*** Time spent in gradient calculation: 0.68 sec ***
* Info * Energy : -56.5153045752 a.u.
* Info * Gradient : 1.653378e-02 a.u. (RMS)
* Info * 1.840335e-02 a.u. (Max)
* Info * Time : 2.17 sec
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
N -2.127642697737 -0.887061583442 1.185941491559
H -2.713736922895 -0.283926466806 0.606879187825
H -2.445414994164 -0.700829674004 2.138273662756
H -1.205219248746 -0.451282785713 1.142965734803
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
N 0.000036673480 0.002828294551 0.000766379432
H 0.001546326676 -0.001450354999 0.001567400711
H 0.000842800139 -0.000347135750 -0.002476673554
H -0.002426047747 -0.001001567858 0.000155550363
*** Time spent in gradient calculation: 0.29 sec ***
* Info * Energy : -56.5168489387 a.u.
* Info * Gradient : 2.711877e-03 a.u. (RMS)
* Info * 2.930517e-03 a.u. (Max)
* Info * Time : 1.43 sec
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
N -2.127657890286 -0.887616963792 1.185741000246
H -2.715722762984 -0.283403337374 0.604453258141
H -2.446517855904 -0.701775605285 2.141041872325
H -1.202105708773 -0.451417822234 1.142342050847
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
N 0.000006140708 0.000398640607 0.000108018151
H -0.000005543183 -0.000125981453 -0.000036720167
H -0.000003692088 -0.000125343626 -0.000027673339
H 0.000001994832 -0.000121594338 -0.000032575170
*** Time spent in gradient calculation: 0.32 sec ***
* Info * Energy : -56.5168724169 a.u.
* Info * Gradient : 2.346333e-04 a.u. (RMS)
* Info * 4.130617e-04 a.u. (Max)
* Info * Time : 1.50 sec
* Info * Computing energy and gradient...
SCF Gradient Driver Setup
===========================
Gradient Type : Analytical
Exchange-Correlation Functional : B3LYP
Molecular Grid Level : 4
Molecular Geometry (Angstroms)
--------------------------------
Atom Coordinate X Coordinate Y Coordinate Z
N -2.127677295557 -0.888694151854 1.185398686403
H -2.715463502423 -0.283440545644 0.604684468323
H -2.446378974938 -0.701703814870 2.140665481257
H -1.202437351220 -0.451497599213 1.142347305118
Analytical Gradient (Hartree/Bohr)
------------------------------------
Atom Gradient X Gradient Y Gradient Z
N 0.000002191099 0.000125428597 0.000035045172
H -0.000004237351 -0.000034796828 -0.000011914389
H -0.000002481450 -0.000034103057 -0.000003756737
H 0.000003404496 -0.000030909619 -0.000008354139
*** Time spent in gradient calculation: 0.24 sec ***
* Info * Energy : -56.5168729638 a.u.
* Info * Gradient : 7.168699e-05 a.u. (RMS)
* Info * 1.302509e-04 a.u. (Max)
* Info * Time : 1.05 sec
* Info * Geometry optimization completed.
Final Geometry (Angstroms)
============================
Atom Coordinate X Coordinate Y Coordinate Z
N -2.127677295557 -0.888694151854 1.185398686403
H -2.715463502423 -0.283440545644 0.604684468323
H -2.446378974938 -0.701703814870 2.140665481257
H -1.202437351220 -0.451497599213 1.142347305118
Summary of Geometry Optimization
==================================
Opt.Step Energy (a.u.) Energy Change (a.u.) Displacement (RMS, Max)
-------------------------------------------------------------------------------------
0 -56.515304575240 0.000000000000 0.000e+00 0.000e+00
1 -56.516848938743 -0.001544363503 3.553e-02 3.895e-02
2 -56.516872416929 -0.000023478186 2.737e-03 3.164e-03
3 -56.516872963792 -0.000000546863 5.706e-04 8.272e-04
Statistical Deviation between
Optimized Geometry and Initial Geometry
=========================================
Internal Coord. RMS deviation Max. deviation
-----------------------------------------------------------
Bonds 0.020 Angstrom 0.020 Angstrom
Angles 2.675 degree 2.675 degree
*** Time spent in Optimization Driver: 6.26 sec
* Info * Optimization results written to file: vlx_20260307_4656d1ab.h5
Text file
@jobs
task: scf
@end
@method settings
basis: def2-svp
xcfun: b3lyp
solvation model: cpcm
cpcm epsilon : 78.39
@end
@molecule
charge: 0
multiplicity: 1
xyz:
...
@endSMD¶
The solvation model based on density (SMD) combines a self‑consistent reaction‑field description of the electrostatic polarization with empirically parametrized terms for cavitation, dispersion, and solvent–solute interactions based on the solute’s electron density, enabling accurate free‑energy predictions across a wide range of solvents. For further details, see Marenich et al. (2009).
In Veloxchem, the electrostatic contribution is determined using the CPCM model.
Python script
import veloxchem as vlx
molecule = vlx.Molecule.read_name("methanol")
basis = vlx.MolecularBasis.read(molecule, "def2-svp")
scf_drv = vlx.ScfRestrictedDriver()
scf_drv.solvation_model = "smd"
scf_drv.smd_solvent = "water"
scf_results = scf_drv.compute(molecule, basis)Reading methanol from PubChem...
Reference: S. Kim, J. Chen, T. Cheng, A. Gindulyte, J. He, S. He, Q. Li, B. A. Shoemaker, P. A. Thiessen, B. Yu, L. Zaslavsky, J. Zhang, E. E. Bolton, Nucleic Acids Res., 2025, 53, D1516-D1525.
Please double-check the compound since names may refer to more than one record.
Self Consistent Field Driver Setup
====================================
Wave Function Model : Spin-Restricted Hartree-Fock
Initial Guess Model : Superposition of Atomic Densities
Convergence Accelerator : Two Level Direct Inversion of Iterative Subspace
Max. Number of Iterations : 50
Max. Number of Error Vectors : 10
Convergence Threshold : 1.0e-06
ERI Screening Threshold : 1.0e-12
Linear Dependence Threshold : 1.0e-06
Solvation Model : SMD
C-PCM Dielectric Constant : 78.355
C-PCM Points per Hydrogen Sphere: 110
C-PCM Points per non-H Sphere : 194
* Info * Using the SMD solvation model.
A. V. Marenich, C. J. Cramer, D. G. Truhlar, J. Phys. Chem. B, 2009, 113, 6378-6396.
* Info * Using C-PCM with the ISWIG discretization method.
A. W. Lange, J. M. Herbert, J. Chem. Phys. 2010, 133, 244111.
* Info * Starting Reduced Basis SCF calculation...
* Info * ...done. SCF energy in reduced basis set: -114.903255425992 a.u. Time: 0.91 sec.
Iter. | Hartree-Fock Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -114.961916642777 0.0000000000 0.11602781 0.01014808 0.00000000
2 -114.963369148940 -0.0014525062 0.02455942 0.00197338 0.03971934
3 -114.963433248364 -0.0000640994 0.00550944 0.00069305 0.00860649
4 -114.963438654537 -0.0000054062 0.00170200 0.00013333 0.00266958
5 -114.963439236346 -0.0000005818 0.00023663 0.00002385 0.00124713
6 -114.963439254814 -0.0000000185 0.00006531 0.00000599 0.00022792
7 -114.963439255630 -0.0000000008 0.00003712 0.00000349 0.00003723
8 -114.963439255793 -0.0000000002 0.00000470 0.00000048 0.00001329
9 -114.963439255847 -0.0000000001 0.00000087 0.00000009 0.00000319
*** SCF converged in 9 iterations. Time: 1.88 sec.
Spin-Restricted Hartree-Fock:
-----------------------------
Total Energy : -114.9634392558 a.u.
Electronic Energy : -155.2948915283 a.u.
SMD Solvation Energy : -0.0104447159 a.u
... ENP contribution : -0.0144129038 a.u.
... CDS contribution : 0.0039681879 a.u.
Nuclear Repulsion Energy : 40.3418969883 a.u.
------------------------------------
Gradient Norm : 0.0000008703 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
Text file
@jobs
task: scf
@end
@method settings
basis: def2-svp
xcfun: b3lyp
solvation model: smd
smd solvent : water
@end
@molecule
charge: 0
multiplicity: 1
xyz:
...
@endPolarizable embedding¶
An explicit representation of the environment is available with the polarizable embedding (PE) model. Molecules in the environment are represented by site charges and polarizabilities. VeloxChem supports the PE model for:
SCF energies
linear response (UV/vis spectra and more)
The PE model is invoked in input files by giving the name of the associated potential file.
potfile = """@environment
units: angstrom
xyz:
O 1.0991810000 2.2167050000 0.2791250000 water 1
H 2.2673500000 2.2529740000 0.6013580000 water 1
H 0.9984050000 2.8080510000 -0.5840690000 water 1
O -0.8223690000 0.2141140000 -2.3767710000 water 2
H -1.5990410000 0.8408210000 -2.6698860000 water 2
H -0.4683410000 0.4151750000 -1.5365150000 water 2
O 1.7377440000 -2.0168380000 -0.4861090000 water 3
H 2.0753880000 -2.2446490000 -1.3654140000 water 3
H 1.6636970000 -2.7516570000 0.0543720000 water 3
O -1.0758700000 -0.2692330000 2.5139440000 water 4
H -0.5822670000 -0.1887880000 1.5058600000 water 4
H -1.1632420000 0.7082890000 2.8568430000 water 4
@end
@charges
O -0.67444408 water
H 0.33722206 water
H 0.33722206 water
@end
@polarizabilities
O 5.73935090 0.00000000 0.00000000 5.73935090 0.00000000 5.73935090 water
H 2.30839051 0.00000000 0.00000000 2.30839051 0.00000000 2.30839051 water
H 2.30839051 0.00000000 0.00000000 2.30839051 0.00000000 2.30839051 water
@end"""
with open("solvent.pot", "w") as f:
f.write(potfile)import py3Dmol
viewer = py3Dmol.view(width=300, height=300, linked=False)
h2o_xyz = """3
water
O 0.0000000000 0.0000000000 0.0000000000
H 0.6891400000 0.8324710000 0.0000000000
H 0.7224340000 -0.8726890000 0.0000000000
"""
solvent_xyz = """12
water solvent
O 1.0991810000 2.2167050000 0.2791250000
H 2.2673500000 2.2529740000 0.6013580000
H 0.9984050000 2.8080510000 -0.5840690000
O -0.8223690000 0.2141140000 -2.3767710000
H -1.5990410000 0.8408210000 -2.6698860000
H -0.4683410000 0.4151750000 -1.5365150000
O 1.7377440000 -2.0168380000 -0.4861090000
H 2.0753880000 -2.2446490000 -1.3654140000
H 1.6636970000 -2.7516570000 0.0543720000
O -1.0758700000 -0.2692330000 2.5139440000
H -0.5822670000 -0.1887880000 1.5058600000
H -1.1632420000 0.7082890000 2.8568430000
"""
# Load as XYZ so the parser knows the format explicitly
viewer.addModel(h2o_xyz, 'xyz') # model 0: solute
viewer.addModel(solvent_xyz, 'xyz') # model 1: solvent
# Clear any default styling, then style per model
viewer.setStyle({}, {}) # reset
viewer.addStyle({'model': 0}, {'stick': {'radius': 0.25, 'colorscheme': 'Jmol'}})
viewer.addStyle({'model': 1}, {'stick': {'radius': 0.45, 'color': '#9bbcff'}})
# Outline and view settings
viewer.setViewStyle({"style": "outline", "color": "black", "width": 0.1})
# Rotate and focus on solute
viewer.rotate(45, "x")
viewer.zoomTo({'model': 0})
viewer.show()Python script
import veloxchem as vlx
solute_xyz = """3
water
O 0.0000000000 0.0000000000 0.0000000000
H 0.6891400000 0.8324710000 0.0000000000
H 0.7224340000 -0.8726890000 0.0000000000
"""
molecule = vlx.Molecule.read_xyz_string(solute_xyz)
basis = vlx.MolecularBasis.read(molecule, "def2-svp")
scf_drv = vlx.ScfRestrictedDriver()
# requires PyFraME until we get an internal PE module
#scf_drv.potfile = "solvent.pot"
scf_results = scf_drv.compute(molecule, basis)
Self Consistent Field Driver Setup
====================================
Wave Function Model : Spin-Restricted Hartree-Fock
Initial Guess Model : Superposition of Atomic Densities
Convergence Accelerator : Two Level Direct Inversion of Iterative Subspace
Max. Number of Iterations : 50
Max. Number of Error Vectors : 10
Convergence Threshold : 1.0e-06
ERI Screening Threshold : 1.0e-12
Linear Dependence Threshold : 1.0e-06
* Info * Starting Reduced Basis SCF calculation...
* Info * ...done. SCF energy in reduced basis set: -75.885582273177 a.u. Time: 0.03 sec.
Iter. | Hartree-Fock Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change
--------------------------------------------------------------------------------------------
1 -75.919051153145 0.0000000000 0.08186134 0.00881989 0.00000000
2 -75.919814303275 -0.0007631501 0.01612820 0.00233528 0.02229757
3 -75.919848604599 -0.0000343013 0.00341982 0.00049284 0.00425927
4 -75.919850510563 -0.0000019060 0.00249612 0.00039269 0.00153373
5 -75.919851105068 -0.0000005945 0.00021646 0.00003436 0.00057493
6 -75.919851118269 -0.0000000132 0.00003572 0.00000488 0.00012988
7 -75.919851118609 -0.0000000003 0.00000465 0.00000063 0.00002002
8 -75.919851118617 -0.0000000000 0.00000150 0.00000021 0.00000312
9 -75.919851118618 -0.0000000000 0.00000019 0.00000002 0.00000136
*** SCF converged in 9 iterations. Time: 0.15 sec.
Spin-Restricted Hartree-Fock:
-----------------------------
Total Energy : -75.9198511186 a.u.
Electronic Energy : -83.8841541433 a.u.
Nuclear Repulsion Energy : 7.9643030247 a.u.
------------------------------------
Gradient Norm : 0.0000001871 a.u.
Ground State Information
------------------------
Charge of Molecule : 0.0
Multiplicity (2S+1) : 1
Magnetic Quantum Number (M_S) : 0.0
Text file
@jobs
task: scf
@end
@method settings
basis: aug-cc-pvdz
potfile: solvent.pot
@end
@molecule
charge: 0
multiplicity: 1
xyz:
...
@endPotential file
The potential file named solvent.pot in this example takes the following form.
print(potfile)@environment
units: angstrom
xyz:
O 1.0991810000 2.2167050000 0.2791250000 water 1
H 2.2673500000 2.2529740000 0.6013580000 water 1
H 0.9984050000 2.8080510000 -0.5840690000 water 1
O -0.8223690000 0.2141140000 -2.3767710000 water 2
H -1.5990410000 0.8408210000 -2.6698860000 water 2
H -0.4683410000 0.4151750000 -1.5365150000 water 2
O 1.7377440000 -2.0168380000 -0.4861090000 water 3
H 2.0753880000 -2.2446490000 -1.3654140000 water 3
H 1.6636970000 -2.7516570000 0.0543720000 water 3
O -1.0758700000 -0.2692330000 2.5139440000 water 4
H -0.5822670000 -0.1887880000 1.5058600000 water 4
H -1.1632420000 0.7082890000 2.8568430000 water 4
@end
@charges
O -0.67444408 water
H 0.33722206 water
H 0.33722206 water
@end
@polarizabilities
O 5.73935090 0.00000000 0.00000000 5.73935090 0.00000000 5.73935090 water
H 2.30839051 0.00000000 0.00000000 2.30839051 0.00000000 2.30839051 water
H 2.30839051 0.00000000 0.00000000 2.30839051 0.00000000 2.30839051 water
@end
The polarizability components are listed in the order xx, xy, xz, yy, yz, zz.
- Tomasi, J., Mennucci, B., & Cammi, R. (2005). Quantum Mechanical Continuum Solvation Models. Chem. Rev., 105(8), 2999–3094. 10.1021/cr9904009
- Marenich, A. V., Cramer, C. J., & Truhlar, D. G. (2009). Universal Solvation Model Based on Solute Electron Density and on a Continuum Model of the Solvent Defined by the Bulk Dielectric Constant and Atomic Surface Tensions. J. Phys. Chem. B, 113(18), 6378–6396. 10.1021/jp810292n