Molecular properties

Structure optimization

One of the most commonly calculated properties in theoretical chemistry is the molecular structure. It is quite common to use structures calculated at a cheaper level of theory, typically DFT, as a starting point since ground state energies are relatively insensitive to the geometry. However, in some cases, especially when strong correlation is significant, one may want to use MCSCF structures instead.

The workflow here is very similar to that of VeloxChem, namely first defining the Gradient Driver, and then give it to the optimizer, which itself is based on GeomeTRIC. The MCSCF gradient driver will automatically choose analytical gradients if available for the specific type of MCSCF calculation performed, numerical gradients otherwise.

Note

Currently, derivative integrals are not available and all gradients are therefore numerical. This should change very soon.

Let’s illustrate this on a simple O\(_2\) molecule. First, we compute one MCSCF with the \(\pi\) orbitals in the active space.

import veloxchem as vlx
import multipsi as mtp

O2_xyz="""2

O 0.0 0.0 -0.6
O 0.0 0.0  0.6
"""
molecule=vlx.Molecule.from_xyz_string(O2_xyz)
molecule.set_multiplicity(1)
basis = vlx.MolecularBasis.read(molecule,"cc-pvdz")

scfdrv = vlx.ScfUnrestrictedDriver()
scfdrv.compute(molecule, basis)
uhf_orbs = scfdrv.natural_orbitals()

space=mtp.OrbSpace(molecule,uhf_orbs)
space.cas(6,4)
mcscfdrv=mtp.McscfDriver()
mc_results = mcscfdrv.compute(molecule,basis,space)
* Warning * Environment variable OMP_NUM_THREADS not set.
* Warning * Setting OMP_NUM_THREADS to 8.
* Info * Reading basis set from file: /opt/anaconda3/envs/vlxenv/lib/python3.9/site-packages/veloxchem/basis/CC-PVDZ      
                                                                                                                          
                                              Molecular Basis (Atomic Basis)                                              
                                             ================================                                             
                                                                                                                          
                               Basis: CC-PVDZ                                                                             
                                                                                                                          
                               Atom Contracted GTOs           Primitive GTOs                                              
                                                                                                                          
                                O   (3S,2P,1D)                (17S,4P,1D)                                                 
                                                                                                                          
                               Contracted Basis Functions : 28                                                            
                               Primitive Basis Functions  : 68                                                            
                                                                                                                          
                                                                                                                          
                                            Self Consistent Field Driver Setup                                            
                                           ====================================                                           
                                                                                                                          
                   Wave Function Model             : Spin-Unrestricted 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 Scheme            : Cauchy Schwarz + Density                                             
                   ERI Screening Mode              : Dynamic                                                              
                   ERI Screening Threshold         : 1.0e-12                                                              
                   Linear Dependence Threshold     : 1.0e-06                                                              
                                                                                                                          
* Info * Nuclear repulsion energy: 28.2227845815 a.u.                                                                     
                                                                                                                          
* Info * Overlap matrix computed in 0.00 sec.                                                                             
                                                                                                                          
* Info * Kinetic energy matrix computed in 0.00 sec.                                                                      
                                                                                                                          
* Info * Nuclear potential matrix computed in 0.00 sec.                                                                   
                                                                                                                          
* Info * Orthogonalization matrix computed in 0.00 sec.                                                                   
                                                                                                                          
* Info * SAD initial guess computed in 0.00 sec.                                                                          
                                                                                                                          
* Info * Starting Reduced Basis SCF calculation...                                                                        
* Info * ...done. SCF energy in reduced basis set: -149.476779742205 a.u. Time: 0.04 sec.                                 
                                                                                                                          
* Info * Overlap matrix computed in 0.00 sec.                                                                             
                                                                                                                          
* Info * Kinetic energy matrix computed in 0.00 sec.                                                                      
                                                                                                                          
* Info * Nuclear potential matrix computed in 0.00 sec.                                                                   
                                                                                                                          
* Info * Orthogonalization matrix computed in 0.00 sec.                                                                   
                                                                                                                          
                                                                                                                          
               Iter. | Hartree-Fock Energy | Energy Change | Gradient Norm | Max. Gradient | Density Change               
               --------------------------------------------------------------------------------------------               
                  1      -149.542125579048    0.0000000000      0.13766387      0.02707071      0.00000000                
                  2      -149.544062025428   -0.0019364464      0.03694035      0.00577703      0.04278216                
                  3      -149.544206427497   -0.0001444021      0.00793470      0.00101573      0.01143915                
                  4      -149.544214388681   -0.0000079612      0.00166969      0.00028871      0.00263638                
                  5      -149.544214746984   -0.0000003583      0.00010855      0.00001729      0.00054642                
                  6      -149.544214748590   -0.0000000016      0.00000796      0.00000116      0.00003713                
                  7      -149.544214748599   -0.0000000000      0.00000081      0.00000012      0.00000307                
                                                                                                                          
               *** SCF converged in 7 iterations. Time: 0.39 sec.                                                         
                                                                                                                          
               Spin-Unrestricted Hartree-Fock:                                                                            
               -------------------------------                                                                            
               Total Energy                       :     -149.5442147486 a.u.                                              
               Electronic Energy                  :     -177.7669993301 a.u.                                              
               Nuclear Repulsion Energy           :       28.2227845815 a.u.                                              
               ------------------------------------                                                                       
               Gradient Norm                      :        0.0000008141 a.u.                                              
                                                                                                                          
                                                                                                                          
               Ground State Information                                                                                   
               ------------------------                                                                                   
               Charge of Molecule            :  0.0                                                                       
               Magnetic Quantum Number (M_S) :  0.0                                                                       
               Expectation value of S**2     :  0.0000                                                                    
                                                                                                                          
                                                                                                                          
                                             Spin Unrestricted Alpha Orbitals                                             
                                             --------------------------------                                             
                                                                                                                          
               Molecular Orbital No.   4:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -1.09891 a.u.                                                                  
               (   1 O   2s  :    -0.36) (   1 O   3s  :    -0.45) (   2 O   2s  :     0.36)                              
               (   2 O   3s  :     0.45)                                                                                  
                                                                                                                          
               Molecular Orbital No.   5:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -0.76819 a.u.                                                                  
               (   1 O   1p-1:     0.46) (   1 O   2p-1:     0.26) (   2 O   1p-1:     0.46)                              
               (   2 O   2p-1:     0.26)                                                                                  
                                                                                                                          
               Molecular Orbital No.   6:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -0.73566 a.u.                                                                  
               (   1 O   3s  :    -0.27) (   1 O   1p0 :     0.47) (   1 O   2p0 :     0.24)                              
               (   2 O   3s  :    -0.27) (   2 O   1p0 :    -0.47) (   2 O   2p0 :    -0.24)                              
                                                                                                                          
               Molecular Orbital No.   7:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -0.65086 a.u.                                                                  
               (   1 O   1p+1:     0.42) (   1 O   2p+1:     0.30) (   2 O   1p+1:     0.42)                              
               (   2 O   2p+1:     0.30)                                                                                  
                                                                                                                          
               Molecular Orbital No.   8:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -0.46179 a.u.                                                                  
               (   1 O   1p-1:    -0.53) (   1 O   2p-1:    -0.41) (   2 O   1p-1:     0.53)                              
               (   2 O   2p-1:     0.41)                                                                                  
                                                                                                                          
               Molecular Orbital No.   9:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.03549 a.u.                                                                  
               (   1 O   1p+1:    -0.46) (   1 O   2p+1:    -0.50) (   2 O   1p+1:     0.46)                              
               (   2 O   2p+1:     0.50)                                                                                  
                                                                                                                          
               Molecular Orbital No.  10:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.47034 a.u.                                                                  
               (   1 O   2s  :     0.19) (   1 O   3s  :     1.28) (   1 O   1p0 :     0.41)                              
               (   1 O   2p0 :     1.22) (   2 O   2s  :    -0.19) (   2 O   3s  :    -1.28)                              
               (   2 O   1p0 :     0.41) (   2 O   2p0 :     1.22)                                                        
                                                                                                                          
               Molecular Orbital No.  11:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.07886 a.u.                                                                  
               (   1 O   3s  :     1.00) (   1 O   1p0 :    -0.70) (   1 O   2p0 :     1.33)                              
               (   2 O   3s  :    -1.00) (   2 O   1p0 :    -0.70) (   2 O   2p0 :     1.33)                              
                                                                                                                          
               Molecular Orbital No.  12:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.09748 a.u.                                                                  
               (   1 O   1p-1:     0.66) (   1 O   2p-1:    -0.63) (   2 O   1p-1:     0.66)                              
               (   2 O   2p-1:    -0.63)                                                                                  
                                                                                                                          
               Molecular Orbital No.  13:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.11959 a.u.                                                                  
               (   1 O   1p+1:    -0.69) (   1 O   2p+1:     0.61) (   2 O   1p+1:    -0.69)                              
               (   2 O   2p+1:     0.61)                                                                                  
                                                                                                                          
                                             Spin Unrestricted Beta Orbitals                                              
                                             -------------------------------                                              
                                                                                                                          
               Molecular Orbital No.   4:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -1.09891 a.u.                                                                  
               (   1 O   2s  :    -0.36) (   1 O   3s  :    -0.45) (   2 O   2s  :     0.36)                              
               (   2 O   3s  :     0.45)                                                                                  
                                                                                                                          
               Molecular Orbital No.   5:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -0.76819 a.u.                                                                  
               (   1 O   1p-1:     0.46) (   1 O   2p-1:     0.26) (   2 O   1p-1:     0.46)                              
               (   2 O   2p-1:     0.26)                                                                                  
                                                                                                                          
               Molecular Orbital No.   6:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -0.73566 a.u.                                                                  
               (   1 O   3s  :    -0.27) (   1 O   1p0 :     0.47) (   1 O   2p0 :     0.24)                              
               (   2 O   3s  :    -0.27) (   2 O   1p0 :    -0.47) (   2 O   2p0 :    -0.24)                              
                                                                                                                          
               Molecular Orbital No.   7:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -0.65086 a.u.                                                                  
               (   1 O   1p+1:     0.42) (   1 O   2p+1:     0.30) (   2 O   1p+1:     0.42)                              
               (   2 O   2p+1:     0.30)                                                                                  
                                                                                                                          
               Molecular Orbital No.   8:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.000 Energy:   -0.46179 a.u.                                                                  
               (   1 O   1p-1:    -0.53) (   1 O   2p-1:    -0.41) (   2 O   1p-1:     0.53)                              
               (   2 O   2p-1:     0.41)                                                                                  
                                                                                                                          
               Molecular Orbital No.   9:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.03549 a.u.                                                                  
               (   1 O   1p+1:    -0.46) (   1 O   2p+1:    -0.50) (   2 O   1p+1:     0.46)                              
               (   2 O   2p+1:     0.50)                                                                                  
                                                                                                                          
               Molecular Orbital No.  10:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.47034 a.u.                                                                  
               (   1 O   2s  :     0.19) (   1 O   3s  :     1.28) (   1 O   1p0 :     0.41)                              
               (   1 O   2p0 :     1.22) (   2 O   2s  :    -0.19) (   2 O   3s  :    -1.28)                              
               (   2 O   1p0 :     0.41) (   2 O   2p0 :     1.22)                                                        
                                                                                                                          
               Molecular Orbital No.  11:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.07886 a.u.                                                                  
               (   1 O   3s  :     1.00) (   1 O   1p0 :    -0.70) (   1 O   2p0 :     1.33)                              
               (   2 O   3s  :    -1.00) (   2 O   1p0 :    -0.70) (   2 O   2p0 :     1.33)                              
                                                                                                                          
               Molecular Orbital No.  12:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.09748 a.u.                                                                  
               (   1 O   1p-1:     0.66) (   1 O   2p-1:    -0.63) (   2 O   1p-1:     0.66)                              
               (   2 O   2p-1:    -0.63)                                                                                  
                                                                                                                          
               Molecular Orbital No.  13:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.11959 a.u.                                                                  
               (   1 O   1p+1:    -0.69) (   1 O   2p+1:     0.61) (   2 O   1p+1:    -0.69)                              
               (   2 O   2p+1:     0.61)                                                                                  
                                                                                                                          
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-specific calculation
          Max. iterations         : 50
          BFGS window             : 5
          Convergence thresholds:
            - Energy change       : 1e-08
            - Gradient norm       : 0.0001
                                                                                                                          
          Integrals in memory
                                                                                                                          
          Active space definition:
          ------------------------
Number of inactive (occupied) orbitals: 5
Number of active orbitals:              4
Number of virtual orbitals:             19

    This is a CASSCF wavefunction: CAS(6,4)

          CI expansion:
          -------------
Number of determinants:      10


                                                                                                                          
        MCSCF Iterations
        ----------------
                                                                                                                          
     Iter. | Average Energy | E. Change | Grad. Norm | CI Iter. |   Time
     ---------------------------------------------------------------------
        1     -149.545104086     0.0e+00      4.9e-03          1   0:00:00
        2     -149.549494546    -4.4e-03      1.6e-02          1   0:00:00
        3     -149.555989175    -6.5e-03      2.2e-02          1   0:00:00
        4     -149.558351119    -2.4e-03      5.1e-02          1   0:00:00
        5     -149.562987409    -4.6e-03      5.6e-02          1   0:00:00
        6     -149.563733027    -7.5e-04      5.3e-02          1   0:00:00
        7     -149.566448460    -2.7e-03      4.0e-02          1   0:00:00
        8     -149.568952607    -2.5e-03      3.0e-02          1   0:00:00
        9     -149.570347496    -1.4e-03      2.8e-02          1   0:00:00
       10     -149.570966631    -6.2e-04      3.1e-02          1   0:00:00
       11     -149.571431768    -4.7e-04      2.0e-02          1   0:00:00
       12     -149.571664380    -2.3e-04      2.5e-02          1   0:00:00
       13     -149.571590634     7.4e-05      3.5e-02          1   0:00:00
       14     -149.571896297    -3.1e-04      3.1e-02          1   0:00:00
       15     -149.572226269    -3.3e-04      2.4e-02          1   0:00:00
       16     -149.572613427    -3.9e-04      2.1e-02          1   0:00:00
       17     -149.573085583    -4.7e-04      3.5e-02          1   0:00:00
       18     -149.573927161    -8.4e-04      5.1e-02          1   0:00:00
       19     -149.574760541    -8.3e-04      7.6e-02          1   0:00:00
       20     -149.575480930    -7.2e-04      9.8e-02          1   0:00:00
       21     -149.576520363    -1.0e-03      1.1e-01          1   0:00:00
       22     -149.577399459    -8.8e-04      1.3e-01          1   0:00:00
       23     -149.579447509    -2.0e-03      1.4e-01          1   0:00:00
       24     -149.580960459    -1.5e-03      1.6e-01          1   0:00:00
       25     -149.588382976    -7.4e-03      1.4e-01          1   0:00:00
       26     -149.593986466    -5.6e-03      1.0e-01          1   0:00:00
       27     -149.601153894    -7.2e-03      1.2e-01          1   0:00:00
       28     -149.605912738    -4.8e-03      1.3e-01          1   0:00:00
       29     -149.599407507     6.5e-03      2.7e-01          1   0:00:00
       30     -149.604795999    -5.4e-03      1.5e-01          1   0:00:00
       31     -149.608288112    -3.5e-03      7.9e-02          1   0:00:00
       32     -149.608563516    -2.8e-04      6.1e-02          1   0:00:00
       33     -149.608526073     3.7e-05      1.1e-01          1   0:00:00
       34     -149.609100782    -5.7e-04      5.8e-02          1   0:00:00
       35     -149.609298212    -2.0e-04      4.5e-02          1   0:00:00
       36     -149.609608387    -3.1e-04      4.2e-02          1   0:00:00
       37     -149.611205124    -1.6e-03      2.9e-02          1   0:00:00
       38     -149.612226408    -1.0e-03      1.5e-02          1   0:00:00
       39     -149.613008091    -7.8e-04      1.2e-02          1   0:00:00
       40     -149.613245060    -2.4e-04      6.0e-03          1   0:00:00
       41     -149.613379336    -1.3e-04      1.0e-02          1   0:00:00
       42     -149.613428720    -4.9e-05      2.8e-03          1   0:00:00
       43     -149.613443997    -1.5e-05      1.1e-03          1   0:00:00
       44     -149.613450804    -6.8e-06      1.3e-03          1   0:00:00
       45     -149.613453395    -2.6e-06      7.4e-04          1   0:00:00
       46     -149.613456098    -2.7e-06      5.7e-04          1   0:00:00
       47     -149.613458468    -2.4e-06      1.0e-03          1   0:00:00
       48     -149.613460218    -1.7e-06      9.0e-04          1   0:00:00
       49     -149.613461068    -8.5e-07      3.9e-04          1   0:00:00
       50     -149.613461221    -1.5e-07      1.4e-04          1   0:00:00
                                                                                                                          
** Convergence not reached after 50 iterations
                                                                                                                          
WARNING! Your active orbitals may have changed significantly
Min_overlap = 0.028175644943359588
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -149.6134612214384
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99871 1.99617 1.84335 0.16176
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.   4:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.75839 a.u.                                                                  
               (   1 O   1p-1:     0.46) (   1 O   2p-1:     0.27) (   2 O   1p-1:     0.46)                              
               (   2 O   2p-1:     0.27)                                                                                  
                                                                                                                          
               Molecular Orbital No.   5:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.45010 a.u.                                                                  
               (   1 O   1p-1:     0.52) (   1 O   2p-1:     0.41) (   2 O   1p-1:    -0.52)                              
               (   2 O   2p-1:    -0.41)                                                                                  
                                                                                                                          
               Molecular Orbital No.   6:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.999 Energy:   -0.97638 a.u.                                                                  
               (   1 O   2s  :     0.26) (   1 O   3s  :     0.37) (   1 O   1p0 :    -0.32)                              
               (   1 O   2p0 :    -0.19) (   2 O   2s  :     0.26) (   2 O   3s  :     0.37)                              
               (   2 O   1p0 :     0.32) (   2 O   2p0 :     0.19)                                                        
                                                                                                                          
               Molecular Orbital No.   7:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.996 Energy:   -1.09566 a.u.                                                                  
               (   1 O   2s  :     0.36) (   1 O   3s  :     0.46) (   2 O   2s  :    -0.36)                              
               (   2 O   3s  :    -0.46)                                                                                  
                                                                                                                          
               Molecular Orbital No.   8:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.843 Energy:   -0.61733 a.u.                                                                  
               (   1 O   1p+1:     0.44) (   1 O   2p+1:     0.28) (   2 O   1p+1:     0.44)                              
               (   2 O   2p+1:     0.28)                                                                                  
                                                                                                                          
               Molecular Orbital No.   9:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.162 Energy:    0.04985 a.u.                                                                  
               (   1 O   1p+1:     0.59) (   1 O   2p+1:     0.31) (   2 O   1p+1:    -0.59)                              
               (   2 O   2p+1:    -0.30)                                                                                  
                                                                                                                          
               Molecular Orbital No.  10:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.47714 a.u.                                                                  
               (   1 O   2s  :     0.18) (   1 O   3s  :     1.29) (   1 O   1p0 :     0.40)                              
               (   1 O   2p0 :     1.23) (   2 O   2s  :    -0.18) (   2 O   3s  :    -1.29)                              
               (   2 O   1p0 :     0.40) (   2 O   2p0 :     1.23)                                                        
                                                                                                                          
               Molecular Orbital No.  11:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.08965 a.u.                                                                  
               (   1 O   3s  :    -1.00) (   1 O   1p0 :     0.71) (   1 O   2p0 :    -1.32)                              
               (   2 O   3s  :     1.00) (   2 O   1p0 :     0.71) (   2 O   2p0 :    -1.32)                              
                                                                                                                          
               Molecular Orbital No.  12:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.10519 a.u.                                                                  
               (   1 O   1p-1:     0.67) (   1 O   2p-1:    -0.63) (   2 O   1p-1:     0.67)                              
               (   2 O   2p-1:    -0.63)                                                                                  
                                                                                                                          
               Molecular Orbital No.  13:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.11946 a.u.                                                                  
               (   1 O   1p+1:    -0.68) (   1 O   2p+1:     0.62) (   2 O   1p+1:    -0.68)                              
               (   2 O   2p+1:     0.62)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:00

Now, we optimize the molecule.

GradDrv=mtp.McscfGradientDriver(mcscfdrv)
opt_drv = vlx.OptimizationDriver(GradDrv)
casscf_opt_geom = opt_drv.compute(molecule, basis, space)
                                                                                                                          
                                                Optimization Driver Setup                                                 
                                               ===========================                                                
                                                                                                                          
                                     Coordinate System       :    TRIC                                                    
                                     Constraints             :    No                                                      
                                     Max. Number of Steps    :    300                                                     
                                     Transition State        :    No                                                      
                                     Hessian                 :    never                                                   
                                                                                                                          
* Info * Computing energy and gradient...                                                                                 
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-specific calculation
          Max. iterations         : 50
          BFGS window             : 5
          Convergence thresholds:
            - Energy change       : 1e-08
            - Gradient norm       : 0.0001
                                                                                                                          
          Integrals in memory
                                                                                                                          
          Active space definition:
          ------------------------
Number of inactive (occupied) orbitals: 5
Number of active orbitals:              4
Number of virtual orbitals:             19

    This is a CASSCF wavefunction: CAS(6,4)

          CI expansion:
          -------------
Number of determinants:      10


                                                                                                                          
        MCSCF Iterations
        ----------------
                                                                                                                          
     Iter. | Average Energy | E. Change | Grad. Norm | CI Iter. |   Time
     ---------------------------------------------------------------------
        1     -149.613461221     0.0e+00      1.4e-04          1   0:00:00
        2     -149.613461238    -1.6e-08      7.4e-05          1   0:00:00
        3     -149.613461246    -8.6e-09      2.6e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 3 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -149.61346124611669
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99871 1.99617 1.84335 0.16177
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.   4:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.75839 a.u.                                                                  
               (   1 O   1p-1:    -0.46) (   1 O   2p-1:    -0.27) (   2 O   1p-1:    -0.46)                              
               (   2 O   2p-1:    -0.27)                                                                                  
                                                                                                                          
               Molecular Orbital No.   5:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.45010 a.u.                                                                  
               (   1 O   1p-1:    -0.52) (   1 O   2p-1:    -0.41) (   2 O   1p-1:     0.52)                              
               (   2 O   2p-1:     0.41)                                                                                  
                                                                                                                          
               Molecular Orbital No.   6:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.999 Energy:   -0.97412 a.u.                                                                  
               (   1 O   2s  :     0.26) (   1 O   3s  :     0.37) (   1 O   1p0 :    -0.32)                              
               (   1 O   2p0 :    -0.19) (   2 O   2s  :     0.26) (   2 O   3s  :     0.37)                              
               (   2 O   1p0 :     0.32) (   2 O   2p0 :     0.19)                                                        
                                                                                                                          
               Molecular Orbital No.   7:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.996 Energy:   -1.09567 a.u.                                                                  
               (   1 O   2s  :     0.36) (   1 O   3s  :     0.46) (   2 O   2s  :    -0.36)                              
               (   2 O   3s  :    -0.46)                                                                                  
                                                                                                                          
               Molecular Orbital No.   8:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.843 Energy:   -0.61732 a.u.                                                                  
               (   1 O   1p+1:    -0.44) (   1 O   2p+1:    -0.28) (   2 O   1p+1:    -0.44)                              
               (   2 O   2p+1:    -0.28)                                                                                  
                                                                                                                          
               Molecular Orbital No.   9:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.162 Energy:    0.04984 a.u.                                                                  
               (   1 O   1p+1:     0.59) (   1 O   2p+1:     0.30) (   2 O   1p+1:    -0.59)                              
               (   2 O   2p+1:    -0.31)                                                                                  
                                                                                                                          
               Molecular Orbital No.  10:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.47714 a.u.                                                                  
               (   1 O   2s  :     0.18) (   1 O   3s  :     1.29) (   1 O   1p0 :     0.40)                              
               (   1 O   2p0 :     1.23) (   2 O   2s  :    -0.18) (   2 O   3s  :    -1.29)                              
               (   2 O   1p0 :     0.40) (   2 O   2p0 :     1.23)                                                        
                                                                                                                          
               Molecular Orbital No.  11:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.08965 a.u.                                                                  
               (   1 O   3s  :     1.00) (   1 O   1p0 :    -0.71) (   1 O   2p0 :     1.32)                              
               (   2 O   3s  :    -1.00) (   2 O   1p0 :    -0.71) (   2 O   2p0 :     1.32)                              
                                                                                                                          
               Molecular Orbital No.  12:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.10519 a.u.                                                                  
               (   1 O   1p-1:    -0.67) (   1 O   2p-1:     0.63) (   2 O   1p-1:    -0.67)                              
               (   2 O   2p-1:     0.63)                                                                                  
                                                                                                                          
               Molecular Orbital No.  13:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.11946 a.u.                                                                  
               (   1 O   1p+1:    -0.68) (   1 O   2p+1:     0.62) (   2 O   1p+1:    -0.68)                              
               (   2 O   2p+1:     0.62)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:00
* Info *   Energy   : -149.6134612461 a.u.                                                                                
* Info *   Gradient : 1.499819e-03 a.u. (RMS)                                                                             
* Info *              1.499860e-03 a.u. (Max)                                                                             
* Info *   Time     : 1.83 sec                                                                                            
                                                                                                                          
* Info * Computing energy and gradient...                                                                                 
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-specific calculation
          Max. iterations         : 50
          BFGS window             : 5
          Convergence thresholds:
            - Energy change       : 1e-08
            - Gradient norm       : 0.0001
                                                                                                                          
          Integrals in memory
                                                                                                                          
          Active space definition:
          ------------------------
Number of inactive (occupied) orbitals: 5
Number of active orbitals:              4
Number of virtual orbitals:             19

    This is a CASSCF wavefunction: CAS(6,4)

          CI expansion:
          -------------
Number of determinants:      10


                                                                                                                          
        MCSCF Iterations
        ----------------
                                                                                                                          
     Iter. | Average Energy | E. Change | Grad. Norm | CI Iter. |   Time
     ---------------------------------------------------------------------
        1     -149.613462031     0.0e+00      2.0e-03          1   0:00:00
        2     -149.613462530    -5.0e-07      5.6e-04          1   0:00:00
        3     -149.613462575    -4.6e-08      1.2e-04          1   0:00:00
        4     -149.613462577    -1.3e-09      2.8e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 4 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -149.61346257675027
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99871 1.99617 1.84385 0.16127
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.   4:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.75869 a.u.                                                                  
               (   1 O   1p-1:    -0.46) (   1 O   2p-1:    -0.27) (   2 O   1p-1:    -0.46)                              
               (   2 O   2p-1:    -0.27)                                                                                  
                                                                                                                          
               Molecular Orbital No.   5:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.44982 a.u.                                                                  
               (   1 O   1p-1:     0.52) (   1 O   2p-1:     0.41) (   2 O   1p-1:    -0.52)                              
               (   2 O   2p-1:    -0.41)                                                                                  
                                                                                                                          
               Molecular Orbital No.   6:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.999 Energy:   -0.97418 a.u.                                                                  
               (   1 O   2s  :     0.26) (   1 O   3s  :     0.37) (   1 O   1p0 :    -0.32)                              
               (   1 O   2p0 :    -0.19) (   2 O   2s  :     0.26) (   2 O   3s  :     0.37)                              
               (   2 O   1p0 :     0.32) (   2 O   2p0 :     0.19)                                                        
                                                                                                                          
               Molecular Orbital No.   7:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.996 Energy:   -1.09543 a.u.                                                                  
               (   1 O   2s  :     0.36) (   1 O   3s  :     0.46) (   2 O   2s  :    -0.36)                              
               (   2 O   3s  :    -0.46)                                                                                  
                                                                                                                          
               Molecular Orbital No.   8:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.844 Energy:   -0.61778 a.u.                                                                  
               (   1 O   1p+1:    -0.44) (   1 O   2p+1:    -0.28) (   2 O   1p+1:    -0.44)                              
               (   2 O   2p+1:    -0.28)                                                                                  
                                                                                                                          
               Molecular Orbital No.   9:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.161 Energy:    0.05037 a.u.                                                                  
               (   1 O   1p+1:     0.59) (   1 O   2p+1:     0.30) (   2 O   1p+1:    -0.59)                              
               (   2 O   2p+1:    -0.30)                                                                                  
                                                                                                                          
               Molecular Orbital No.  10:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.47807 a.u.                                                                  
               (   1 O   2s  :     0.18) (   1 O   3s  :     1.29) (   1 O   1p0 :     0.40)                              
               (   1 O   2p0 :     1.24) (   2 O   2s  :    -0.18) (   2 O   3s  :    -1.29)                              
               (   2 O   1p0 :     0.40) (   2 O   2p0 :     1.24)                                                        
                                                                                                                          
               Molecular Orbital No.  11:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.08993 a.u.                                                                  
               (   1 O   3s  :     1.00) (   1 O   1p0 :    -0.71) (   1 O   2p0 :     1.32)                              
               (   2 O   3s  :    -1.00) (   2 O   1p0 :    -0.71) (   2 O   2p0 :     1.32)                              
                                                                                                                          
               Molecular Orbital No.  12:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.10515 a.u.                                                                  
               (   1 O   1p-1:     0.67) (   1 O   2p-1:    -0.63) (   2 O   1p-1:     0.67)                              
               (   2 O   2p-1:    -0.63)                                                                                  
                                                                                                                          
               Molecular Orbital No.  13:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.11938 a.u.                                                                  
               (   1 O   1p+1:    -0.68) (   1 O   2p+1:     0.62) (   2 O   1p+1:    -0.68)                              
               (   2 O   2p+1:     0.62)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:00
* Info *   Energy   : -149.6134625768 a.u.                                                                                
* Info *   Gradient : 3.545852e-04 a.u. (RMS)                                                                             
* Info *              3.546282e-04 a.u. (Max)                                                                             
* Info *   Time     : 1.82 sec                                                                                            
                                                                                                                          
* Info * Computing energy and gradient...                                                                                 
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-specific calculation
          Max. iterations         : 50
          BFGS window             : 5
          Convergence thresholds:
            - Energy change       : 1e-08
            - Gradient norm       : 0.0001
                                                                                                                          
          Integrals in memory
                                                                                                                          
          Active space definition:
          ------------------------
Number of inactive (occupied) orbitals: 5
Number of active orbitals:              4
Number of virtual orbitals:             19

    This is a CASSCF wavefunction: CAS(6,4)

          CI expansion:
          -------------
Number of determinants:      10


                                                                                                                          
        MCSCF Iterations
        ----------------
                                                                                                                          
     Iter. | Average Energy | E. Change | Grad. Norm | CI Iter. |   Time
     ---------------------------------------------------------------------
        1     -149.613462602     0.0e+00      6.4e-04          1   0:00:00
        2     -149.613462651    -4.9e-08      1.8e-04          1   0:00:00
        3     -149.613462655    -4.4e-09      4.1e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 3 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -149.61346265521195
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99871 1.99617 1.84400 0.16112
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.   4:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.75878 a.u.                                                                  
               (   1 O   1p-1:    -0.46) (   1 O   2p-1:    -0.27) (   2 O   1p-1:    -0.46)                              
               (   2 O   2p-1:    -0.27)                                                                                  
                                                                                                                          
               Molecular Orbital No.   5:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.44973 a.u.                                                                  
               (   1 O   1p-1:     0.52) (   1 O   2p-1:     0.41) (   2 O   1p-1:    -0.52)                              
               (   2 O   2p-1:    -0.41)                                                                                  
                                                                                                                          
               Molecular Orbital No.   6:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.999 Energy:   -0.97437 a.u.                                                                  
               (   1 O   2s  :     0.26) (   1 O   3s  :     0.37) (   1 O   1p0 :    -0.32)                              
               (   1 O   2p0 :    -0.19) (   2 O   2s  :     0.26) (   2 O   3s  :     0.37)                              
               (   2 O   1p0 :     0.32) (   2 O   2p0 :     0.19)                                                        
                                                                                                                          
               Molecular Orbital No.   7:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.996 Energy:   -1.09535 a.u.                                                                  
               (   1 O   2s  :     0.36) (   1 O   3s  :     0.46) (   2 O   2s  :    -0.36)                              
               (   2 O   3s  :    -0.46)                                                                                  
                                                                                                                          
               Molecular Orbital No.   8:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.844 Energy:   -0.61792 a.u.                                                                  
               (   1 O   1p+1:    -0.44) (   1 O   2p+1:    -0.28) (   2 O   1p+1:    -0.44)                              
               (   2 O   2p+1:    -0.28)                                                                                  
                                                                                                                          
               Molecular Orbital No.   9:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.161 Energy:    0.05053 a.u.                                                                  
               (   1 O   1p+1:    -0.59) (   1 O   2p+1:    -0.30) (   2 O   1p+1:     0.59)                              
               (   2 O   2p+1:     0.30)                                                                                  
                                                                                                                          
               Molecular Orbital No.  10:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.47836 a.u.                                                                  
               (   1 O   2s  :     0.18) (   1 O   3s  :     1.29) (   1 O   1p0 :     0.40)                              
               (   1 O   2p0 :     1.24) (   2 O   2s  :    -0.18) (   2 O   3s  :    -1.29)                              
               (   2 O   1p0 :     0.40) (   2 O   2p0 :     1.24)                                                        
                                                                                                                          
               Molecular Orbital No.  11:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.09001 a.u.                                                                  
               (   1 O   3s  :    -1.00) (   1 O   1p0 :     0.71) (   1 O   2p0 :    -1.32)                              
               (   2 O   3s  :     1.00) (   2 O   1p0 :     0.71) (   2 O   2p0 :    -1.32)                              
                                                                                                                          
               Molecular Orbital No.  12:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.10514 a.u.                                                                  
               (   1 O   1p-1:    -0.67) (   1 O   2p-1:     0.63) (   2 O   1p-1:    -0.67)                              
               (   2 O   2p-1:     0.63)                                                                                  
                                                                                                                          
               Molecular Orbital No.  13:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.11936 a.u.                                                                  
               (   1 O   1p+1:     0.68) (   1 O   2p+1:    -0.62) (   2 O   1p+1:     0.68)                              
               (   2 O   2p+1:    -0.62)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:00
* Info *   Energy   : -149.6134626552 a.u.                                                                                
* Info *   Gradient : 1.508663e-06 a.u. (RMS)                                                                             
* Info *              1.582280e-06 a.u. (Max)                                                                             
* Info *   Time     : 1.87 sec                                                                                            
                                                                                                                          
* Info * Saving file: veloxchem_opt_2023-07-03T17.04.02_optim.xyz                                                         
* Info * Saving file: veloxchem_opt_2023-07-03T17.04.02.log                                                               
                                                                                                                          
* Info * Geometry optimization completed.                                                                                 
                                                                                                                          
                                              Molecular Geometry (Angstroms)                                              
                                             ================================                                             
                                                                                                                          
                          Atom         Coordinate X          Coordinate Y          Coordinate Z                           
                                                                                                                          
                           O          -0.000017631365       -0.000009782820       -0.599502140009                         
                           O           0.000026914578       -0.000005229729        0.599506273241                         
                                                                                                                          
                                                                                                                          
                                             Summary of Geometry Optimization                                             
                                            ==================================                                            
                                                                                                                          
                  Opt.Step       Energy (a.u.)       Energy Change (a.u.)       Displacement (RMS, Max)                   
                  -------------------------------------------------------------------------------------                   
                      0        -149.613461246117        0.000000000000         0.000e+00      0.000e+00                   
                      1        -149.613462576750       -0.000001330634         3.786e-04      3.786e-04                   
                      2        -149.613462655212       -0.000000078462         1.172e-04      1.172e-04                   
                                                                                                                          
                                                                                                                          
                                              Statistical Deviation between                                               
                                         Optimized Geometry and Initial Geometry                                          
                                        =========================================                                         
                                                                                                                          
                               Internal Coord.        RMS deviation         Max. deviation                                
                               -----------------------------------------------------------                                
                                  Bonds               0.001 Angstrom        0.001 Angstrom                                
                                                                                                                          
                                     *** Time spent in Optimization Driver: 5.55 sec                                      
                                                                                                                          

We can now use this new geometry in subsequent calculations.

molecule=casscf_opt_geom
mc_results = mcscfdrv.compute(molecule,basis,space)
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-specific calculation
          Max. iterations         : 50
          BFGS window             : 5
          Convergence thresholds:
            - Energy change       : 1e-08
            - Gradient norm       : 0.0001
                                                                                                                          
          Integrals in memory
                                                                                                                          
          Active space definition:
          ------------------------
Number of inactive (occupied) orbitals: 5
Number of active orbitals:              4
Number of virtual orbitals:             19

    This is a CASSCF wavefunction: CAS(6,4)

          CI expansion:
          -------------
Number of determinants:      10


                                                                                                                          
        MCSCF Iterations
        ----------------
                                                                                                                          
     Iter. | Average Energy | E. Change | Grad. Norm | CI Iter. |   Time
     ---------------------------------------------------------------------
        1     -149.613462655     0.0e+00      1.8e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 1 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -149.6134626553096
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99871 1.99617 1.84400 0.16112
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.   4:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.75878 a.u.                                                                  
               (   1 O   1p-1:    -0.46) (   1 O   2p-1:    -0.27) (   2 O   1p-1:    -0.46)                              
               (   2 O   2p-1:    -0.27)                                                                                  
                                                                                                                          
               Molecular Orbital No.   5:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.44973 a.u.                                                                  
               (   1 O   1p-1:     0.52) (   1 O   2p-1:     0.41) (   2 O   1p-1:    -0.52)                              
               (   2 O   2p-1:    -0.41)                                                                                  
                                                                                                                          
               Molecular Orbital No.   6:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.999 Energy:   -0.97448 a.u.                                                                  
               (   1 O   2s  :    -0.26) (   1 O   3s  :    -0.37) (   1 O   1p0 :     0.32)                              
               (   1 O   2p0 :     0.19) (   2 O   2s  :    -0.26) (   2 O   3s  :    -0.37)                              
               (   2 O   1p0 :    -0.32) (   2 O   2p0 :    -0.19)                                                        
                                                                                                                          
               Molecular Orbital No.   7:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.996 Energy:   -1.09535 a.u.                                                                  
               (   1 O   2s  :    -0.36) (   1 O   3s  :    -0.46) (   2 O   2s  :     0.36)                              
               (   2 O   3s  :     0.46)                                                                                  
                                                                                                                          
               Molecular Orbital No.   8:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.844 Energy:   -0.61792 a.u.                                                                  
               (   1 O   1p+1:     0.44) (   1 O   2p+1:     0.28) (   2 O   1p+1:     0.44)                              
               (   2 O   2p+1:     0.28)                                                                                  
                                                                                                                          
               Molecular Orbital No.   9:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.161 Energy:    0.05053 a.u.                                                                  
               (   1 O   1p+1:     0.59) (   1 O   2p+1:     0.30) (   2 O   1p+1:    -0.59)                              
               (   2 O   2p+1:    -0.30)                                                                                  
                                                                                                                          
               Molecular Orbital No.  10:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.47836 a.u.                                                                  
               (   1 O   2s  :     0.18) (   1 O   3s  :     1.29) (   1 O   1p0 :     0.40)                              
               (   1 O   2p0 :     1.24) (   2 O   2s  :    -0.18) (   2 O   3s  :    -1.29)                              
               (   2 O   1p0 :     0.40) (   2 O   2p0 :     1.24)                                                        
                                                                                                                          
               Molecular Orbital No.  11:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.09001 a.u.                                                                  
               (   1 O   3s  :     1.00) (   1 O   1p0 :    -0.71) (   1 O   2p0 :     1.32)                              
               (   2 O   3s  :    -1.00) (   2 O   1p0 :    -0.71) (   2 O   2p0 :     1.32)                              
                                                                                                                          
               Molecular Orbital No.  12:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.10514 a.u.                                                                  
               (   1 O   1p-1:     0.67) (   1 O   2p-1:    -0.63) (   2 O   1p-1:     0.67)                              
               (   2 O   2p-1:    -0.63)                                                                                  
                                                                                                                          
               Molecular Orbital No.  13:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    1.11936 a.u.                                                                  
               (   1 O   1p+1:    -0.68) (   1 O   2p+1:     0.62) (   2 O   1p+1:    -0.68)                              
               (   2 O   2p+1:     0.62)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:00

If your MCSCF calculation is a state-averaged, you should extend the parameters of the compute function with the number of states in the state-averaging and the index (starting from 0) of the state you wish to optimize:

casscf_opt_geom = opt_drv.compute(molecule, basis, space, nstates, istate)

Spectroscopy

State-averaging

MCSCF is commonly used to simulate spectroscopy and photochemistry. There are several ways to compute excited state properties from a MCSCF calculation. As discussed in the previous section, one way is to use state-averaging:

Let’s go back to our furan calculation. First we compute a SA-CASSCF with 5 states:

furan_xyz="""9

 C     -0.86213    -0.90784     0.00007
 H     -1.63433    -1.64264    -0.00003
 C      0.50727    -0.90524     0.00007
 C      0.92057     0.47886    -0.00003
 C     -0.22323     1.23186    -0.00003
 O     -1.35123     0.40376    -0.00013
 H      1.17117    -1.74724     0.00017
 H      1.93767     0.81866     0.00007
 H     -0.46573     2.26986    -0.00013
"""

molecule = vlx.Molecule.from_xyz_string(furan_xyz)
basis = vlx.MolecularBasis.read(molecule,"def2-sv(p)")

#We use a previously stored h5 file for the active space
space=mtp.OrbSpace(molecule,"furan-cas.h5")
mcscfdrv=mtp.McscfDriver()
mc_results = mcscfdrv.compute(molecule,basis,space, 5) #state-averaged with 5 states
* Info * Reading basis set from file: /opt/anaconda3/envs/vlxenv/lib/python3.9/site-packages/veloxchem/basis/DEF2-SV_P_   
                                                                                                                          
                                              Molecular Basis (Atomic Basis)                                              
                                             ================================                                             
                                                                                                                          
                               Basis: DEF2-SV(P)                                                                          
                                                                                                                          
                               Atom Contracted GTOs           Primitive GTOs                                              
                                                                                                                          
                                O   (3S,2P,1D)                (7S,4P,1D)                                                  
                                H   (2S)                      (4S)                                                        
                                C   (3S,2P,1D)                (7S,4P,1D)                                                  
                                                                                                                          
                               Contracted Basis Functions : 78                                                            
                               Primitive Basis Functions  : 136                                                           
                                                                                                                          
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-averaged calculation
            Number of states      : 5
            Equal-weights 
          Max. iterations         : 50
          BFGS window             : 5
          Convergence thresholds:
            - Energy change       : 1e-08
            - Gradient norm       : 0.0001
                                                                                                                          
          Integrals in memory
                                                                                                                          
          Active space definition:
          ------------------------
Number of inactive (occupied) orbitals: 15
Number of active orbitals:              5
Number of virtual orbitals:             58

    This is a CASSCF wavefunction: CAS(6,5)

          CI expansion:
          -------------
Number of determinants:      55


                                                                                                                          
        MCSCF Iterations
        ----------------
                                                                                                                          
     Iter. | Average Energy | E. Change | Grad. Norm | CI Iter. |   Time
     ---------------------------------------------------------------------
        1     -228.211383987     0.0e+00      1.6e-01          1   0:00:00
        2     -228.223997559    -1.3e-02      8.1e-02          1   0:00:00
        3     -228.226393803    -2.4e-03      1.8e-02          1   0:00:00
        4     -228.226480980    -8.7e-05      4.4e-03          1   0:00:00
        5     -228.226488145    -7.2e-06      7.9e-04          1   0:00:00
        6     -228.226488311    -1.7e-07      1.9e-04          1   0:00:00
        7     -228.226488323    -1.1e-08      4.7e-05          1   0:00:00
        8     -228.226488324    -8.9e-10      1.5e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 8 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -228.48133300321194
- S^2   : -0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99277 1.94494 1.90452 0.09562 0.06215
                                                                                                                          
* State 2
- Energy: -228.23632225186427
- S^2   : -0.00  (multiplicity = 1.0 )
- Natural orbitals
1.98998 1.43257 1.34064 0.74092 0.49589
                                                                                                                          
* State 3
- Energy: -228.17659654400288
- S^2   : -0.00  (multiplicity = 1.0 )
- Natural orbitals
1.97827 1.94567 1.03236 0.97318 0.07053
                                                                                                                          
* State 4
- Energy: -228.12869622259274
- S^2   : 12.00  (multiplicity = 7.0 )
- Natural orbitals
2.00000 1.00000 1.00000 1.00000 1.00000
                                                                                                                          
* State 5
- Energy: -228.1094935964193
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.95161 1.39436 1.25216 1.09983 0.30204
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.  14:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.56530 a.u.                                                                  
               (   3 C   1p-1:     0.26) (   4 C   1p+1:    -0.22) (   4 C   1p-1:    -0.16)                              
               (   6 O   1p+1:    -0.43) (   6 O   2p+1:    -0.32) (   7 H   1s  :    -0.19)                              
               (   8 H   1s  :    -0.19)                                                                                  
                                                                                                                          
               Molecular Orbital No.  15:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.54782 a.u.                                                                  
               (   1 C   1p+1:    -0.25) (   2 H   1s  :     0.16) (   3 C   1p+1:     0.21)                              
               (   3 C   1p-1:     0.27) (   4 C   1p-1:    -0.34) (   4 C   2p-1:    -0.16)                              
               (   5 C   1p+1:    -0.22) (   6 O   1p+1:     0.22) (   6 O   2p+1:     0.17)                              
               (   9 H   1s  :     0.16)                                                                                  
                                                                                                                          
               Molecular Orbital No.  16:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.939 Energy:   -0.59865 a.u.                                                                  
               (   1 C   1p0 :    -0.19) (   5 C   1p0 :    -0.19) (   6 O   1p0 :    -0.51)                              
               (   6 O   2p0 :    -0.36)                                                                                  
                                                                                                                          
               Molecular Orbital No.  17:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.566 Energy:   -0.34141 a.u.                                                                  
               (   3 C   1p0 :    -0.35) (   3 C   2p0 :    -0.26) (   4 C   1p0 :    -0.35)                              
               (   4 C   2p0 :    -0.26) (   6 O   1p0 :     0.30) (   6 O   2p0 :     0.25)                              
                                                                                                                          
               Molecular Orbital No.  18:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.296 Energy:   -0.23339 a.u.                                                                  
               (   1 C   1p0 :     0.37) (   1 C   2p0 :     0.29) (   3 C   1p0 :     0.23)                              
               (   3 C   2p0 :     0.19) (   4 C   1p0 :    -0.23) (   4 C   2p0 :    -0.19)                              
               (   5 C   1p0 :    -0.37) (   5 C   2p0 :    -0.29)                                                        
                                                                                                                          
               Molecular Orbital No.  19:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.803 Energy:    0.04710 a.u.                                                                  
               (   1 C   1p0 :    -0.40) (   1 C   2p0 :    -0.47) (   3 C   1p0 :     0.17)                              
               (   3 C   2p0 :     0.28) (   4 C   1p0 :     0.17) (   4 C   2p0 :     0.28)                              
               (   5 C   1p0 :    -0.40) (   5 C   2p0 :    -0.47) (   6 O   1p0 :     0.31)                              
               (   6 O   2p0 :     0.37)                                                                                  
                                                                                                                          
               Molecular Orbital No.  20:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.396 Energy:    0.18364 a.u.                                                                  
               (   1 C   1p0 :    -0.29) (   1 C   2p0 :    -0.38) (   3 C   1p0 :     0.43)                              
               (   3 C   2p0 :     0.61) (   4 C   1p0 :    -0.43) (   4 C   2p0 :    -0.61)                              
               (   5 C   1p0 :     0.29) (   5 C   2p0 :     0.38)                                                        
                                                                                                                          
               Molecular Orbital No.  21:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.20635 a.u.                                                                  
               (   1 C   3s  :     0.65) (   1 C   2p+1:    -0.30) (   1 C   2p-1:    -0.24)                              
               (   2 H   2s  :    -0.98) (   3 C   3s  :     0.97) (   3 C   2p+1:     0.29)                              
               (   3 C   2p-1:    -0.39) (   4 C   3s  :     0.97) (   4 C   2p+1:     0.46)                              
               (   4 C   2p-1:     0.17) (   5 C   3s  :     0.65) (   5 C   2p-1:     0.36)                              
               (   7 H   2s  :    -1.31) (   8 H   2s  :    -1.31) (   9 H   2s  :    -0.98)                              
                                                                                                                          
               Molecular Orbital No.  22:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23239 a.u.                                                                  
               (   1 C   3s  :     0.74) (   1 C   2p+1:    -0.86) (   1 C   2p-1:    -0.80)                              
               (   2 H   2s  :    -1.90) (   3 C   3s  :     1.09) (   3 C   2p-1:     0.24)                              
               (   4 C   3s  :    -1.10) (   4 C   2p-1:     0.20) (   5 C   3s  :    -0.73)                              
               (   5 C   1p-1:    -0.16) (   5 C   2p+1:     0.28) (   5 C   2p-1:    -1.14)                              
               (   7 H   2s  :    -0.34) (   8 H   2s  :     0.35) (   9 H   2s  :     1.89)                              
                                                                                                                          
               Molecular Orbital No.  23:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23464 a.u.                                                                  
               (   1 C   3s  :     0.95) (   1 C   2p+1:    -0.61) (   1 C   2p-1:    -0.55)                              
               (   2 H   2s  :    -1.56) (   3 C   3s  :    -0.61) (   3 C   2p+1:    -0.33)                              
               (   3 C   2p-1:     0.60) (   4 C   3s  :    -0.60) (   4 C   2p+1:    -0.60)                              
               (   4 C   2p-1:    -0.32) (   5 C   3s  :     0.96) (   5 C   2p+1:    -0.21)                              
               (   5 C   2p-1:     0.81) (   7 H   2s  :     1.13) (   8 H   2s  :     1.13)                              
               (   9 H   2s  :    -1.57)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:01

Now we can compute the transition properties using the InterState module. This module requires the dictionary returned by the MCSCF.

#Compute oscillator strengths
SI=mtp.InterState()
Prop_dict=SI.compute(molecule,basis, mc_results)
                                                                                                                          
List of oscillator strengths greather than 1e-10
                                                                                                                          
  From     to       Energy (eV)    Oscillator strength (length and velocity)
     1       2        6.66708         3.935228e-03    2.925456e-03
     1       3        8.29230         2.426600e-01    1.672872e-01
     1       5       10.11827         5.706685e-01    4.028088e-01
                                                                                                                          
List of rotatory strengths greater than 1e-10
                                                                                                                          
  From     to       Energy (eV)    Rot. strength (a.u. and 10^-40 cgs)
     1       2        6.66708         8.842626e-08        0.000042
     1       3        8.29230        -5.376861e-06       -0.002535
     1       5       10.11827        -1.256445e-05       -0.005923

The function returns a dictionary with the most important values.

print(Prop_dict["energies"])
print(Prop_dict["oscillator_strengths"])
[0.24501075 0.30473646 0.35263678 0.37183941]
[3.93522815e-03 2.42660014e-01 2.18197505e-24 5.70668499e-01]

By default InterState computes properties from the first state to all others, but this can be changed by providing the list of “initial” and “final” states as arguments.

Prop_dict=SI.compute(molecule,basis,mc_results, from_states=[0,1], to_states='all' )
                                                                                                                          
List of oscillator strengths greather than 1e-10
                                                                                                                          
  From     to       Energy (eV)    Oscillator strength (length and velocity)
     1       2        6.66708         3.935228e-03    2.925456e-03
     1       3        8.29230         2.426600e-01    1.672872e-01
     1       5       10.11827         5.706685e-01    4.028088e-01
     2       3        1.62522         2.610885e-02    2.178061e-02
     2       5        3.45118         1.364278e-03    1.798930e-04
                                                                                                                          
List of rotatory strengths greater than 1e-10
                                                                                                                          
  From     to       Energy (eV)    Rot. strength (a.u. and 10^-40 cgs)
     1       2        6.66708         8.842626e-08        0.000042
     1       3        8.29230        -5.376861e-06       -0.002535
     1       5       10.11827        -1.256445e-05       -0.005923
     2       1       -6.66708        -8.842626e-08       -0.000042
     2       3        1.62522         1.447843e-05        0.006826
     2       5        3.45118        -1.053302e-07       -0.000050

Linear response

Another way to compute excited state properties at the MCSCF level is using linear response. This multiconfigurational linear response (MCLR) requires first a MCSCF calculation of the ground state and then the use of the Mclr_EigenSolver module:

mcscfdrv=mtp.McscfDriver()
mc_results = mcscfdrv.compute(molecule,basis,space) #only ground state!

mcrpa = mtp.Mclr_EigenSolver()
Prop_dict = mcrpa.compute(molecule, basis, mcscfdrv, n_states = 5)
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-specific calculation
          Max. iterations         : 50
          BFGS window             : 5
          Convergence thresholds:
            - Energy change       : 1e-08
            - Gradient norm       : 0.0001
                                                                                                                          
          Integrals in memory
                                                                                                                          
          Active space definition:
          ------------------------
Number of inactive (occupied) orbitals: 15
Number of active orbitals:              5
Number of virtual orbitals:             58

    This is a CASSCF wavefunction: CAS(6,5)

          CI expansion:
          -------------
Number of determinants:      55


                                                                                                                          
        MCSCF Iterations
        ----------------
                                                                                                                          
     Iter. | Average Energy | E. Change | Grad. Norm | CI Iter. |   Time
     ---------------------------------------------------------------------
        1     -228.481333003     0.0e+00      1.0e-01          1   0:00:00
        2     -228.487054041    -5.7e-03      4.6e-02          1   0:00:00
        3     -228.487922618    -8.7e-04      1.8e-02          1   0:00:00
        4     -228.488009745    -8.7e-05      3.9e-03          1   0:00:00
        5     -228.488013864    -4.1e-06      8.0e-04          1   0:00:00
        6     -228.488014067    -2.0e-07      1.8e-04          1   0:00:00
        7     -228.488014076    -8.7e-09      5.1e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 7 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -228.48801407603136
- S^2   : -0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99451 1.94212 1.90287 0.09708 0.06342
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.  14:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.55816 a.u.                                                                  
               (   3 C   1p-1:     0.32) (   4 C   1p+1:    -0.19) (   4 C   1p-1:    -0.26)                              
               (   6 O   1p+1:    -0.35) (   6 O   2p+1:    -0.26) (   7 H   1s  :    -0.20)                              
               (   8 H   1s  :    -0.20)                                                                                  
                                                                                                                          
               Molecular Orbital No.  15:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.54203 a.u.                                                                  
               (   1 C   1p+1:     0.25) (   3 C   1p+1:    -0.23) (   3 C   1p-1:    -0.18)                              
               (   4 C   1p-1:     0.27) (   5 C   1p+1:     0.24) (   6 O   1p+1:    -0.34)                              
               (   6 O   2p+1:    -0.27)                                                                                  
                                                                                                                          
               Molecular Orbital No.  16:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.995 Energy:   -0.58222 a.u.                                                                  
               (   6 O   1p0 :     0.59) (   6 O   2p0 :     0.43)                                                        
                                                                                                                          
               Molecular Orbital No.  17:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.942 Energy:   -0.41897 a.u.                                                                  
               (   1 C   1p0 :    -0.19) (   3 C   1p0 :    -0.34) (   3 C   2p0 :    -0.23)                              
               (   4 C   1p0 :    -0.34) (   4 C   2p0 :    -0.23) (   5 C   1p0 :    -0.19)                              
               (   6 O   2p0 :     0.15)                                                                                  
                                                                                                                          
               Molecular Orbital No.  18:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.903 Energy:   -0.30937 a.u.                                                                  
               (   1 C   1p0 :     0.36) (   1 C   2p0 :     0.28) (   3 C   1p0 :     0.24)                              
               (   3 C   2p0 :     0.20) (   4 C   1p0 :    -0.24) (   4 C   2p0 :    -0.20)                              
               (   5 C   1p0 :    -0.36) (   5 C   2p0 :    -0.28)                                                        
                                                                                                                          
               Molecular Orbital No.  19:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.097 Energy:    0.18407 a.u.                                                                  
               (   1 C   1p0 :    -0.48) (   1 C   2p0 :    -0.30) (   3 C   1p0 :     0.30)                              
               (   3 C   2p0 :     0.18) (   4 C   1p0 :     0.30) (   4 C   2p0 :     0.18)                              
               (   5 C   1p0 :    -0.48) (   5 C   2p0 :    -0.30) (   6 O   1p0 :     0.28)                              
               (   6 O   2p0 :     0.27)                                                                                  
                                                                                                                          
               Molecular Orbital No.  20:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.063 Energy:    0.28637 a.u.                                                                  
               (   1 C   1p0 :    -0.36) (   1 C   2p0 :    -0.24) (   3 C   1p0 :     0.51)                              
               (   3 C   2p0 :     0.39) (   4 C   1p0 :    -0.51) (   4 C   2p0 :    -0.39)                              
               (   5 C   1p0 :     0.36) (   5 C   2p0 :     0.24)                                                        
                                                                                                                          
               Molecular Orbital No.  21:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.20569 a.u.                                                                  
               (   1 C   3s  :     0.62) (   1 C   2p+1:    -0.28) (   1 C   2p-1:    -0.21)                              
               (   2 H   2s  :    -0.93) (   3 C   3s  :     0.99) (   3 C   2p+1:     0.30)                              
               (   3 C   2p-1:    -0.41) (   4 C   3s  :     0.99) (   4 C   2p+1:     0.48)                              
               (   4 C   2p-1:     0.18) (   5 C   3s  :     0.62) (   5 C   2p-1:     0.33)                              
               (   7 H   2s  :    -1.35) (   8 H   2s  :    -1.35) (   9 H   2s  :    -0.93)                              
                                                                                                                          
               Molecular Orbital No.  22:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23274 a.u.                                                                  
               (   1 C   3s  :    -0.75) (   1 C   2p+1:     0.85) (   1 C   2p-1:     0.79)                              
               (   2 H   2s  :     1.89) (   3 C   3s  :    -1.12) (   3 C   2p-1:    -0.22)                              
               (   4 C   3s  :     1.13) (   4 C   2p-1:    -0.19) (   5 C   3s  :     0.74)                              
               (   5 C   1p-1:     0.16) (   5 C   2p+1:    -0.28) (   5 C   2p-1:     1.12)                              
               (   7 H   2s  :     0.40) (   8 H   2s  :    -0.41) (   9 H   2s  :    -1.87)                              
                                                                                                                          
               Molecular Orbital No.  23:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23429 a.u.                                                                  
               (   1 C   3s  :     0.96) (   1 C   2p+1:    -0.62) (   1 C   2p-1:    -0.58)                              
               (   2 H   2s  :    -1.58) (   3 C   3s  :    -0.57) (   3 C   2p+1:    -0.32)                              
               (   3 C   2p-1:     0.59) (   4 C   3s  :    -0.57) (   4 C   2p+1:    -0.59)                              
               (   4 C   2p-1:    -0.32) (   5 C   3s  :     0.96) (   5 C   2p+1:    -0.21)                              
               (   5 C   2p-1:     0.83) (   7 H   2s  :     1.10) (   8 H   2s  :     1.10)                              
               (   9 H   2s  :    -1.60)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:01
                                                                                                                          
                          Multi-Configurational Linear response Eigenvalue Solver
                         =========================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          Number of states        : 5
                                                                                                                          
          Max. iterations         : 50
          Residual norm threshold : 1e-08
                                                                                                                          
          Integrals in memory
          Trial vector settings:
            - Linear dependence threshold :1e-10
            - Min. trial vectors          :20
            - Max. trial vectors          :60
                                                                                                                          
          CI parameters:      54
          Orbital parameters: 1235
                                                                                                                          
                                                                                                                          
Initialization time: 00:00:00
                                                                                                                          
                                                                                                                          
        MC-RPA Iterations
        -----------------
                                                                                                                          
     Iter. | Average Energy | Grad. Norm | Converged | CI+Orb vec. | Time
     -----------------------------------------------------------------------
        1       0.354473745      8.6e-02      1/  5     5 +   5      0:00:00    
        2       0.322905104      2.5e-03      1/  5     5 +  13      0:00:00    
        3       0.318950137      5.4e-02      0/  5     5 +  21      0:00:00    
        4       0.307132284      3.5e-03      0/  5     9 +  27      0:00:00    
        5       0.306280016      1.0e-03      0/  5     9 +  37      0:00:00    
        6       0.305224566      6.2e-04      0/  5    15 +  41      0:00:00    
        7       0.305063289      3.9e-04      0/  5    15 +  51      0:00:00    
        8       0.304861693      8.4e-05      0/  5    21 +  55      0:00:00    
        9       0.304826594      2.5e-05      0/  5    23 +  63      0:00:00    
       10       0.304822607      4.2e-06      0/  5    27 +  26      0:00:00    Orb subspace collapsed 
       11       0.304821650      1.8e-06      1/  5    27 +  36      0:00:00    
       12       0.304820525      4.1e-07      3/  5    31 +  40      0:00:00    
       13       0.304820181      2.6e-07      3/  5    31 +  44      0:00:00    
       14       0.304819993      8.9e-08      3/  5    33 +  46      0:00:00    
       15       0.304819945      2.3e-08      4/  5    33 +  50      0:00:00    
       16       0.304819930      1.6e-08      4/  5    33 +  52      0:00:00    
       17       0.304819919      1.0e-08      4/  5    33 +  54      0:00:00    
       18       0.304819913      9.4e-09      5/  5    33 +  56      0:00:00    
                                                                                                                          
** Convergence reached in 18 iterations
                                                                                                                          
                                                                                                                          
                                                                                                                          
                                                 Oscillator strength (au)
 Transition   Energy (Ha)    Energy (eV)    Velocity gauge     Length gauge 
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
          1     0.2423283      6.59409          0.0007390        0.0017307
          2     0.2712909      7.38220          0.0970218        0.1191411
          3     0.3257755      8.86480          0.3250027        0.3709655
          4     0.3306552      8.99759          0.0000000        0.0000000
          5     0.3540496      9.63418          0.0097054        0.0071585
                                                                                                                          
                                                                                                                          
                                                 Rotatory strength (cgs)
 Transition   Energy (Ha)    Energy (eV)    Velocity gauge     Length gauge 
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
          1     0.2423283      6.59409          0.0000294        0.0000525
          2     0.2712909      7.38220         -0.0055848       -0.0060698
          3     0.3257755      8.86480         -0.0225520       -0.0240950
          4     0.3306552      8.99759          0.0210917        0.0223028
          5     0.3540496      9.63418         -0.0016074       -0.0013716
                                                                                                                          
Total MC-RPA time: 00:00:07

Again, the Prop_dict dictionary gives us access to the most important values. It is also possible to get an analysis of the dominant excitation character using the command:

mcrpa.get_excitation_character()
                                                                                                                          
    Excitation characters
    ---------------------
                                                                                                                          
* State 1
- Exc. energy: 0.24232834425547345
 Electrons     Excitation
 0.344    :   17  ->   19
 0.260    :   18  ->   20
 CI weight: 0.971  Orb weight: 0.029
                                                                                                                          
* State 2
- Exc. energy: 0.2712909003242779
 Electrons     Excitation
 0.906    :   18  ->   19
 CI weight: 0.928  Orb weight: 0.072
                                                                                                                          
* State 3
- Exc. energy: 0.3257754793900232
 Electrons     Excitation
 0.303    :   18  ->   20
 0.264    :   17  ->   19
 0.241    :   16  ->   19
 CI weight: 0.924  Orb weight: 0.076
                                                                                                                          
* State 4
- Exc. energy: 0.3306552491416529
 Electrons     Excitation
 0.794    :   18  ->   21
 CI weight: 0.000  Orb weight: 1.000
                                                                                                                          
* State 5
- Exc. energy: 0.35404959269264924
 Electrons     Excitation
 0.638    :   18  ->   22
 0.214    :   17  ->   21
 CI weight: 0.000  Orb weight: 1.000
                                                                                                                          

In this analysis, we can see one of the most attractive feature of linear response compared to state-averaging: linear response also includes excitation from or to non-active orbitals. In this example, state 4 and 5 include excitations from the \(\pi\) orbitals to some higher lying \(\sigma\) orbitals. This feature is particularily useful for molecules with heteroatom lone pairs which do not contribute to the correlation in the active space (and are often difficult to keep in it) but often contribute to some of the lowest-lying excitations.

Another advantage of linear response is that unlike state-averaging, the excitation energies does not depend on the number of calculated states (except when the code accidentally converges to a higher solution, in which case increasing the number of states tends to ensure we get actually the lowest ones). Overall, in most cases, linear response provides more accurate excitation energies than state-averaging.

Note that the Tamm-Dancoff approximation is also available (using the property “mcrpa.tda = True”) which gives a slightly faster but less accurate calculation.