MCSCF

The core functionality of MultiPsi is multiconfigurational methods, with multiconfigurational self-consistent field (MCSCF) as its cornerstone.

CASSCF

The most commonly used form of MCSCF nowadays is the complete active space self-consistent field (CASSCF), which is a form of MCSCF where the configurations are generated from a full CI expansion within an active space consisting of a few orbitals. Because of the factorial growth of full CI with the number of active orbitals, the active space should usually be limited to less than 20 electrons in 20 orbitals, with the current record being a CAS(22,22) on the triplet state of hydrogenase. However, this large calculation was only possible on a large cluster using the entire distributed memory available.

To define a CASSCF, we simply need to define our OrbSpace as a full CI expansion (see previous chapters) and provide it to our MCSCF module. For example, we can start with a simple Hartree-Fock, here for furan:

import veloxchem as vlx
import multipsi as mtp
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)")

scfdrv = vlx.ScfRestrictedDriver()
scfdrv.compute(molecule, basis)
* 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/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                                                           
                                                                                                                          
                                                                                                                          
                                            Self Consistent Field Driver Setup                                            
                                           ====================================                                           
                                                                                                                          
                   Wave Function Model             : Spin-Restricted Hartree-Fock                                         
                   Initial Guess Model             : Superposition of Atomic Densities                                    
                   Convergence Accelerator         : Two Level Direct Inversion of Iterative Subspace                     
                   Max. Number of Iterations       : 50                                                                   
                   Max. Number of Error Vectors    : 10                                                                   
                   Convergence Threshold           : 1.0e-06                                                              
                   ERI Screening Scheme            : Cauchy Schwarz + Density                                             
                   ERI Screening Mode              : Dynamic                                                              
                   ERI Screening Threshold         : 1.0e-12                                                              
                   Linear Dependence Threshold     : 1.0e-06                                                              
                                                                                                                          
* Info * Nuclear repulsion energy: 158.8888494994 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: -228.337309732541 a.u. Time: 0.19 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      -228.430357327904    0.0000000000      0.16297779      0.01240917      0.00000000                
                  2      -228.433229998567   -0.0028726707      0.05564260      0.00546548      0.06351427                
                  3      -228.433553776745   -0.0003237782      0.00841002      0.00075289      0.01658680                
                  4      -228.433566986232   -0.0000132095      0.00299022      0.00026049      0.00498463                
                  5      -228.433568460937   -0.0000014747      0.00114921      0.00013437      0.00167819                
                  6      -228.433568710661   -0.0000002497      0.00030252      0.00003062      0.00054130                
                  7      -228.433568755136   -0.0000000445      0.00007367      0.00000963      0.00033342                
                  8      -228.433568757937   -0.0000000028      0.00002138      0.00000334      0.00008594                
                  9      -228.433568758029   -0.0000000001      0.00001803      0.00000167      0.00001459                
                 10      -228.433568758067   -0.0000000000      0.00000165      0.00000018      0.00000641                
                 11      -228.433568758068   -0.0000000000      0.00000042      0.00000005      0.00000142                
                                                                                                                          
               *** SCF converged in 11 iterations. Time: 1.34 sec.                                                        
                                                                                                                          
               Spin-Restricted Hartree-Fock:                                                                              
               -----------------------------                                                                              
               Total Energy                       :     -228.4335687581 a.u.                                              
               Electronic Energy                  :     -387.3224182575 a.u.                                              
               Nuclear Repulsion Energy           :      158.8888494994 a.u.                                              
               ------------------------------------                                                                       
               Gradient Norm                      :        0.0000004225 a.u.                                              
                                                                                                                          
                                                                                                                          
               Ground State Information                                                                                   
               ------------------------                                                                                   
               Charge of Molecule            :  0.0                                                                       
               Multiplicity (2S+1)           :  1.0                                                                       
               Magnetic Quantum Number (M_S) :  0.0                                                                       
                                                                                                                          
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.  14:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.58794 a.u.                                                                  
               (   1 C   1p+1:     0.25) (   3 C   1p+1:    -0.27) (   4 C   1p+1:     0.30)                              
               (   5 C   1p+1:    -0.18) (   5 C   1p-1:     0.18) (   7 H   1s  :    -0.25)                              
               (   8 H   1s  :     0.25)                                                                                  
                                                                                                                          
               Molecular Orbital No.  15:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.56268 a.u.                                                                  
               (   3 C   1p-1:    -0.31) (   4 C   1p+1:     0.20) (   4 C   1p-1:     0.24)                              
               (   6 O   1p+1:     0.37) (   6 O   2p+1:     0.27) (   7 H   1s  :     0.20)                              
               (   8 H   1s  :     0.20)                                                                                  
                                                                                                                          
               Molecular Orbital No.  16:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.54763 a.u.                                                                  
               (   1 C   1p+1:     0.25) (   3 C   1p+1:    -0.23) (   3 C   1p-1:    -0.20)                              
               (   4 C   1p-1:     0.29) (   5 C   1p+1:     0.24) (   6 O   1p+1:    -0.32)                              
               (   6 O   2p+1:    -0.24)                                                                                  
                                                                                                                          
               Molecular Orbital No.  17:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.39987 a.u.                                                                  
               (   3 C   1p0 :     0.32) (   3 C   2p0 :     0.24) (   4 C   1p0 :     0.32)                              
               (   4 C   2p0 :     0.24) (   6 O   1p0 :    -0.34) (   6 O   2p0 :    -0.30)                              
                                                                                                                          
               Molecular Orbital No.  18:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.32333 a.u.                                                                  
               (   1 C   1p0 :     0.35) (   1 C   2p0 :     0.29) (   3 C   1p0 :     0.23)                              
               (   3 C   2p0 :     0.21) (   4 C   1p0 :    -0.23) (   4 C   2p0 :    -0.21)                              
               (   5 C   1p0 :    -0.35) (   5 C   2p0 :    -0.29)                                                        
                                                                                                                          
               Molecular Orbital No.  19:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.14744 a.u.                                                                  
               (   1 C   1p0 :     0.32) (   1 C   2p0 :     0.56) (   3 C   1p0 :    -0.18)                              
               (   3 C   2p0 :    -0.35) (   4 C   1p0 :    -0.18) (   4 C   2p0 :    -0.35)                              
               (   5 C   1p0 :     0.32) (   5 C   2p0 :     0.56) (   6 O   1p0 :    -0.27)                              
               (   6 O   2p0 :    -0.39)                                                                                  
                                                                                                                          
               Molecular Orbital No.  20:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.20445 a.u.                                                                  
               (   1 C   3s  :     0.65) (   1 C   2p+1:    -0.30) (   1 C   2p-1:    -0.23)                              
               (   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.  21:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.22624 a.u.                                                                  
               (   1 C   1p0 :     0.22) (   1 C   2p0 :     0.54) (   3 C   1p0 :    -0.32)                              
               (   3 C   2p0 :    -0.83) (   4 C   1p0 :     0.32) (   4 C   2p0 :     0.83)                              
               (   5 C   1p0 :    -0.22) (   5 C   2p0 :    -0.54)                                                        
                                                                                                                          
               Molecular Orbital No.  22:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23036 a.u.                                                                  
               (   1 C   3s  :    -0.73) (   1 C   2p+1:     0.85) (   1 C   2p-1:     0.79)                              
               (   2 H   2s  :     1.89) (   3 C   3s  :    -1.11) (   3 C   2p-1:    -0.24)                              
               (   4 C   3s  :     1.11) (   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.13)                              
               (   7 H   2s  :     0.36) (   8 H   2s  :    -0.36) (   9 H   2s  :    -1.89)                              
                                                                                                                          
               Molecular Orbital No.  23:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23249 a.u.                                                                  
               (   1 C   3s  :    -0.93) (   1 C   2p+1:     0.62) (   1 C   2p-1:     0.57)                              
               (   2 H   2s  :     1.56) (   3 C   3s  :     0.60) (   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.93) (   5 C   2p+1:     0.20)                              
               (   5 C   2p-1:    -0.81) (   7 H   2s  :    -1.14) (   8 H   2s  :    -1.14)                              
               (   9 H   2s  :     1.56)                                                                                  
                                                                                                                          
{'eri_thresh': 1e-12,
 'qq_type': 'QQ_DEN',
 'scf_energy': -228.43356875806765,
 'restart': False,
 'S': array([[ 1.00000000e+00,  3.25564690e-01,  1.51774112e-01, ...,
          1.09822484e-05, -4.79099937e-05, -5.92753260e-03],
        [ 3.25564690e-01,  1.00000000e+00,  7.98485318e-01, ...,
          5.61003234e-03, -2.07953847e-02, -7.84962485e-02],
        [ 1.51774112e-01,  7.98485318e-01,  1.00000000e+00, ...,
          1.05910707e-02, -3.68454368e-02, -2.47128848e-02],
        ...,
        [ 1.09822484e-05,  5.61003234e-03,  1.05910707e-02, ...,
          1.00000000e+00, -2.22174673e-01,  8.14229655e-03],
        [-4.79099937e-05, -2.07953847e-02, -3.68454368e-02, ...,
         -2.22174673e-01,  1.00000000e+00, -1.52596610e-01],
        [-5.92753260e-03, -7.84962485e-02, -2.47128848e-02, ...,
          8.14229655e-03, -1.52596610e-01,  1.00000000e+00]]),
 'C_alpha': array([[ 1.70117872e-05, -6.89337262e-01,  7.11799388e-01, ...,
          5.09471515e-02,  5.06393247e-02,  5.98916657e-02],
        [ 9.36021869e-04, -2.44031816e-02,  2.48381397e-02, ...,
         -3.30293980e-01, -2.40544870e-01, -2.76537990e-01],
        [ 7.83068316e-03,  1.63519652e-02, -7.89058504e-03, ...,
         -2.01230017e-01, -3.06001205e-01, -9.00124808e-01],
        ...,
        [-6.69702392e-05, -1.51470045e-04, -2.18442172e-04, ...,
          7.12707229e-02, -1.76690253e-01,  2.15089118e-01],
        [-3.93287951e-04,  6.90086137e-05, -1.53340953e-04, ...,
          3.06144909e-01, -4.45779462e-01,  1.66174013e-01],
        [ 1.93657393e-05, -5.60884859e-04,  1.96043382e-04, ...,
          3.97714070e-01, -6.91995502e-01, -6.18814020e-01]]),
 'C_beta': array([[ 1.70117872e-05, -6.89337262e-01,  7.11799388e-01, ...,
          5.09471515e-02,  5.06393247e-02,  5.98916657e-02],
        [ 9.36021869e-04, -2.44031816e-02,  2.48381397e-02, ...,
         -3.30293980e-01, -2.40544870e-01, -2.76537990e-01],
        [ 7.83068316e-03,  1.63519652e-02, -7.89058504e-03, ...,
         -2.01230017e-01, -3.06001205e-01, -9.00124808e-01],
        ...,
        [-6.69702392e-05, -1.51470045e-04, -2.18442172e-04, ...,
          7.12707229e-02, -1.76690253e-01,  2.15089118e-01],
        [-3.93287951e-04,  6.90086137e-05, -1.53340953e-04, ...,
          3.06144909e-01, -4.45779462e-01,  1.66174013e-01],
        [ 1.93657393e-05, -5.60884859e-04,  1.96043382e-04, ...,
          3.97714070e-01, -6.91995502e-01, -6.18814020e-01]]),
 'E_alpha': array([-20.61242555, -11.29473329, -11.29468449, -11.23822031,
        -11.23739841,  -1.41581317,  -1.07132926,  -0.98893087,
         -0.79737622,  -0.78126841,  -0.73571853,  -0.61769465,
         -0.60451637,  -0.58793568,  -0.56267761,  -0.5476327 ,
         -0.39986542,  -0.32332632,   0.14743687,   0.20444647,
          0.22623625,   0.23036322,   0.23249127,   0.24569344,
          0.32130896,   0.3564276 ,   0.43732398,   0.50538714,
          0.51841628,   0.56475105,   0.60438243,   0.61448956,
          0.68867641,   0.72874818,   0.73467969,   0.74655225,
          0.77086459,   0.77789922,   0.84880956,   0.88821844,
          0.9203908 ,   0.93213478,   0.9827532 ,   0.9967022 ,
          1.00661704,   1.08982903,   1.22397569,   1.23241796,
          1.30163742,   1.33523968,   1.46583925,   1.6284403 ,
          1.66545628,   1.72732446,   1.72772966,   1.76806288,
          1.86806258,   2.01730674,   2.03290298,   2.10211944,
          2.2275852 ,   2.25099964,   2.33021025,   2.3751115 ,
          2.40609181,   2.48787665,   2.555081  ,   2.57018657,
          2.69378971,   2.81647081,   2.99785191,   3.1463763 ,
          3.21785889,   3.28608567,   3.29518504,   3.42394482,
          3.60932592,   3.90419989]),
 'E_beta': array([-20.61242555, -11.29473329, -11.29468449, -11.23822031,
        -11.23739841,  -1.41581317,  -1.07132926,  -0.98893087,
         -0.79737622,  -0.78126841,  -0.73571853,  -0.61769465,
         -0.60451637,  -0.58793568,  -0.56267761,  -0.5476327 ,
         -0.39986542,  -0.32332632,   0.14743687,   0.20444647,
          0.22623625,   0.23036322,   0.23249127,   0.24569344,
          0.32130896,   0.3564276 ,   0.43732398,   0.50538714,
          0.51841628,   0.56475105,   0.60438243,   0.61448956,
          0.68867641,   0.72874818,   0.73467969,   0.74655225,
          0.77086459,   0.77789922,   0.84880956,   0.88821844,
          0.9203908 ,   0.93213478,   0.9827532 ,   0.9967022 ,
          1.00661704,   1.08982903,   1.22397569,   1.23241796,
          1.30163742,   1.33523968,   1.46583925,   1.6284403 ,
          1.66545628,   1.72732446,   1.72772966,   1.76806288,
          1.86806258,   2.01730674,   2.03290298,   2.10211944,
          2.2275852 ,   2.25099964,   2.33021025,   2.3751115 ,
          2.40609181,   2.48787665,   2.555081  ,   2.57018657,
          2.69378971,   2.81647081,   2.99785191,   3.1463763 ,
          3.21785889,   3.28608567,   3.29518504,   3.42394482,
          3.60932592,   3.90419989]),
 'D_alpha': array([[ 1.04643687e+00, -9.75798909e-02, -6.63237382e-02, ...,
         -4.88586253e-04,  1.70937101e-03,  2.14583918e-03],
        [-9.75798909e-02,  2.72563883e-01,  1.02338686e-01, ...,
          1.12454996e-03, -3.98536200e-03, -3.32723335e-03],
        [-6.63237382e-02,  1.02338686e-01,  6.08255726e-02, ...,
          2.07206124e-03,  9.96139359e-04, -1.92392327e-03],
        ...,
        [-4.88586253e-04,  1.12454996e-03,  2.07206124e-03, ...,
          9.56306299e-04,  6.72710568e-04,  2.70172438e-04],
        [ 1.70937101e-03, -3.98536200e-03,  9.96139359e-04, ...,
          6.72710568e-04,  1.46351644e-03,  2.70940086e-04],
        [ 2.14583918e-03, -3.32723335e-03, -1.92392327e-03, ...,
          2.70172438e-04,  2.70940086e-04,  5.50702591e-04]]),
 'D_beta': array([[ 1.04643687e+00, -9.75798909e-02, -6.63237382e-02, ...,
         -4.88586253e-04,  1.70937101e-03,  2.14583918e-03],
        [-9.75798909e-02,  2.72563883e-01,  1.02338686e-01, ...,
          1.12454996e-03, -3.98536200e-03, -3.32723335e-03],
        [-6.63237382e-02,  1.02338686e-01,  6.08255726e-02, ...,
          2.07206124e-03,  9.96139359e-04, -1.92392327e-03],
        ...,
        [-4.88586253e-04,  1.12454996e-03,  2.07206124e-03, ...,
          9.56306299e-04,  6.72710568e-04,  2.70172438e-04],
        [ 1.70937101e-03, -3.98536200e-03,  9.96139359e-04, ...,
          6.72710568e-04,  1.46351644e-03,  2.70940086e-04],
        [ 2.14583918e-03, -3.32723335e-03, -1.92392327e-03, ...,
          2.70172438e-04,  2.70940086e-04,  5.50702591e-04]]),
 'F_alpha': array([[-1.12897548e+01, -3.87938354e+00, -1.84161949e+00, ...,
         -2.04530329e-04,  1.11045796e-03,  8.45769664e-02],
        [-3.87938354e+00, -2.02893102e+00, -1.46647412e+00, ...,
         -3.61334980e-03,  4.81030706e-02,  8.75452069e-02],
        [-1.84161949e+00, -1.46647412e+00, -1.22212758e+00, ...,
          1.79614369e-02,  1.03944714e-02,  5.86641023e-02],
        ...,
        [-2.04530329e-04, -3.61334980e-03,  1.79614369e-02, ...,
          1.69771477e+00, -1.41160788e-01, -4.16833216e-02],
        [ 1.11045796e-03,  4.81030706e-02,  1.03944714e-02, ...,
         -1.41160788e-01,  1.69345381e+00, -2.11484295e-02],
        [ 8.45769664e-02,  8.75452069e-02,  5.86641023e-02, ...,
         -4.16833216e-02, -2.11484295e-02,  2.81041706e+00]]),
 'F_beta': array([[-1.12897548e+01, -3.87938354e+00, -1.84161949e+00, ...,
         -2.04530329e-04,  1.11045796e-03,  8.45769664e-02],
        [-3.87938354e+00, -2.02893102e+00, -1.46647412e+00, ...,
         -3.61334980e-03,  4.81030706e-02,  8.75452069e-02],
        [-1.84161949e+00, -1.46647412e+00, -1.22212758e+00, ...,
          1.79614369e-02,  1.03944714e-02,  5.86641023e-02],
        ...,
        [-2.04530329e-04, -3.61334980e-03,  1.79614369e-02, ...,
          1.69771477e+00, -1.41160788e-01, -4.16833216e-02],
        [ 1.11045796e-03,  4.81030706e-02,  1.03944714e-02, ...,
         -1.41160788e-01,  1.69345381e+00, -2.11484295e-02],
        [ 8.45769664e-02,  8.75452069e-02,  5.86641023e-02, ...,
         -4.16833216e-02, -2.11484295e-02,  2.81041706e+00]]),
 'C': array([[ 1.70117872e-05, -6.89337262e-01,  7.11799388e-01, ...,
          5.09471515e-02,  5.06393247e-02,  5.98916657e-02],
        [ 9.36021869e-04, -2.44031816e-02,  2.48381397e-02, ...,
         -3.30293980e-01, -2.40544870e-01, -2.76537990e-01],
        [ 7.83068316e-03,  1.63519652e-02, -7.89058504e-03, ...,
         -2.01230017e-01, -3.06001205e-01, -9.00124808e-01],
        ...,
        [-6.69702392e-05, -1.51470045e-04, -2.18442172e-04, ...,
          7.12707229e-02, -1.76690253e-01,  2.15089118e-01],
        [-3.93287951e-04,  6.90086137e-05, -1.53340953e-04, ...,
          3.06144909e-01, -4.45779462e-01,  1.66174013e-01],
        [ 1.93657393e-05, -5.60884859e-04,  1.96043382e-04, ...,
          3.97714070e-01, -6.91995502e-01, -6.18814020e-01]]),
 'E': array([-20.61242555, -11.29473329, -11.29468449, -11.23822031,
        -11.23739841,  -1.41581317,  -1.07132926,  -0.98893087,
         -0.79737622,  -0.78126841,  -0.73571853,  -0.61769465,
         -0.60451637,  -0.58793568,  -0.56267761,  -0.5476327 ,
         -0.39986542,  -0.32332632,   0.14743687,   0.20444647,
          0.22623625,   0.23036322,   0.23249127,   0.24569344,
          0.32130896,   0.3564276 ,   0.43732398,   0.50538714,
          0.51841628,   0.56475105,   0.60438243,   0.61448956,
          0.68867641,   0.72874818,   0.73467969,   0.74655225,
          0.77086459,   0.77789922,   0.84880956,   0.88821844,
          0.9203908 ,   0.93213478,   0.9827532 ,   0.9967022 ,
          1.00661704,   1.08982903,   1.22397569,   1.23241796,
          1.30163742,   1.33523968,   1.46583925,   1.6284403 ,
          1.66545628,   1.72732446,   1.72772966,   1.76806288,
          1.86806258,   2.01730674,   2.03290298,   2.10211944,
          2.2275852 ,   2.25099964,   2.33021025,   2.3751115 ,
          2.40609181,   2.48787665,   2.555081  ,   2.57018657,
          2.69378971,   2.81647081,   2.99785191,   3.1463763 ,
          3.21785889,   3.28608567,   3.29518504,   3.42394482,
          3.60932592,   3.90419989]),
 'D': (array([[ 1.04643687e+00, -9.75798909e-02, -6.63237382e-02, ...,
          -4.88586253e-04,  1.70937101e-03,  2.14583918e-03],
         [-9.75798909e-02,  2.72563883e-01,  1.02338686e-01, ...,
           1.12454996e-03, -3.98536200e-03, -3.32723335e-03],
         [-6.63237382e-02,  1.02338686e-01,  6.08255726e-02, ...,
           2.07206124e-03,  9.96139359e-04, -1.92392327e-03],
         ...,
         [-4.88586253e-04,  1.12454996e-03,  2.07206124e-03, ...,
           9.56306299e-04,  6.72710568e-04,  2.70172438e-04],
         [ 1.70937101e-03, -3.98536200e-03,  9.96139359e-04, ...,
           6.72710568e-04,  1.46351644e-03,  2.70940086e-04],
         [ 2.14583918e-03, -3.32723335e-03, -1.92392327e-03, ...,
           2.70172438e-04,  2.70940086e-04,  5.50702591e-04]]),
  array([[ 1.04643687e+00, -9.75798909e-02, -6.63237382e-02, ...,
          -4.88586253e-04,  1.70937101e-03,  2.14583918e-03],
         [-9.75798909e-02,  2.72563883e-01,  1.02338686e-01, ...,
           1.12454996e-03, -3.98536200e-03, -3.32723335e-03],
         [-6.63237382e-02,  1.02338686e-01,  6.08255726e-02, ...,
           2.07206124e-03,  9.96139359e-04, -1.92392327e-03],
         ...,
         [-4.88586253e-04,  1.12454996e-03,  2.07206124e-03, ...,
           9.56306299e-04,  6.72710568e-04,  2.70172438e-04],
         [ 1.70937101e-03, -3.98536200e-03,  9.96139359e-04, ...,
           6.72710568e-04,  1.46351644e-03,  2.70940086e-04],
         [ 2.14583918e-03, -3.32723335e-03, -1.92392327e-03, ...,
           2.70172438e-04,  2.70940086e-04,  5.50702591e-04]])),
 'F': (array([[-1.12897548e+01, -3.87938354e+00, -1.84161949e+00, ...,
          -2.04530329e-04,  1.11045796e-03,  8.45769664e-02],
         [-3.87938354e+00, -2.02893102e+00, -1.46647412e+00, ...,
          -3.61334980e-03,  4.81030706e-02,  8.75452069e-02],
         [-1.84161949e+00, -1.46647412e+00, -1.22212758e+00, ...,
           1.79614369e-02,  1.03944714e-02,  5.86641023e-02],
         ...,
         [-2.04530329e-04, -3.61334980e-03,  1.79614369e-02, ...,
           1.69771477e+00, -1.41160788e-01, -4.16833216e-02],
         [ 1.11045796e-03,  4.81030706e-02,  1.03944714e-02, ...,
          -1.41160788e-01,  1.69345381e+00, -2.11484295e-02],
         [ 8.45769664e-02,  8.75452069e-02,  5.86641023e-02, ...,
          -4.16833216e-02, -2.11484295e-02,  2.81041706e+00]]),
  array([[-1.12897548e+01, -3.87938354e+00, -1.84161949e+00, ...,
          -2.04530329e-04,  1.11045796e-03,  8.45769664e-02],
         [-3.87938354e+00, -2.02893102e+00, -1.46647412e+00, ...,
          -3.61334980e-03,  4.81030706e-02,  8.75452069e-02],
         [-1.84161949e+00, -1.46647412e+00, -1.22212758e+00, ...,
           1.79614369e-02,  1.03944714e-02,  5.86641023e-02],
         ...,
         [-2.04530329e-04, -3.61334980e-03,  1.79614369e-02, ...,
           1.69771477e+00, -1.41160788e-01, -4.16833216e-02],
         [ 1.11045796e-03,  4.81030706e-02,  1.03944714e-02, ...,
          -1.41160788e-01,  1.69345381e+00, -2.11484295e-02],
         [ 8.45769664e-02,  8.75452069e-02,  5.86641023e-02, ...,
          -4.16833216e-02, -2.11484295e-02,  2.81041706e+00]]))}

In this example, we will choose all \(\pi\) orbitals (so 5 orbitals total with 6 electrons). The most convenient way to select those orbitals is to use the MultiPsi Orbital Viewer, scroll through the list and click “Active” when we find our desired orbital.

orbviewer=mtp.OrbitalViewer()
orbviewer.plot(molecule,basis,scfdrv.mol_orbs)

We find that the orbitals we want are the number 12, 17, 18, 19 and 21. We can save the resulting orbitals in the file “furan-cas.h5” to use as our starting orbitals.

space=mtp.OrbSpace(molecule,"furan-cas.h5")
mcscfdrv=mtp.McscfDriver()
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: 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.473029265     0.0e+00      5.0e-02          1   0:00:00
        2     -228.486533870    -1.4e-02      3.8e-02          1   0:00:00
        3     -228.487831306    -1.3e-03      1.5e-02          1   0:00:00
        4     -228.488000819    -1.7e-04      5.5e-03          1   0:00:00
        5     -228.488013713    -1.3e-05      9.3e-04          1   0:00:00
        6     -228.488014060    -3.5e-07      3.3e-04          1   0:00:00
        7     -228.488014076    -1.6e-08      5.0e-05          1   0:00:00
        8     -228.488014077    -5.7e-10      1.1e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 8 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -228.4880140766497
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99451 1.94212 1.90287 0.09707 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.41896 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.28638 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
{'orbital_space': <multipsi.OrbSpace.OrbSpace at 0x17d87bb50>,
 'converged': True,
 'n_iterations': 8,
 'energies': array([-228.48801408]),
 'ci_vectors': [<multipsi.CIVector.CIVector at 0x17d87b880>]}

If the orbitals had changed significantly, we would have had a warning. Still it is good to visualize the final orbitals to check the active space is what we wanted.

orbviewer=mtp.OrbitalViewer()
orbviewer.plot(molecule,basis,space)

It is always recommended to inspect the orbitals after your calculations, as the optimisation may sometimes swap our active orbitals, especially if their occupations are close to 2 or 0.

State-specific and state-averaged CASSCF

When one is interested in more than just the ground state, for example in spectroscopy or photochemistry, we can specify this in the mcscf driver:

nstates = 3
mcscfdrv.compute(molecule,basis,space, nstates)
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-averaged calculation
            Number of states      : 3
            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.278941035     0.0e+00      1.3e-01          1   0:00:00
        2     -228.296679526    -1.8e-02      5.9e-02          1   0:00:00
        3     -228.298696656    -2.0e-03      2.1e-02          1   0:00:00
        4     -228.298795466    -9.9e-05      5.2e-03          1   0:00:00
        5     -228.298804959    -9.5e-06      1.1e-03          1   0:00:00
        6     -228.298805381    -4.2e-07      2.5e-04          1   0:00:00
        7     -228.298805417    -3.6e-08      7.2e-05          1   0:00:00
        8     -228.298805419    -2.7e-09      2.2e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 8 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -228.4818932419722
- S^2   : -0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99296 1.94507 1.90727 0.09336 0.06134
                                                                                                                          
* State 2
- Energy: -228.23493686013154
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99023 1.43277 1.34328 0.74246 0.49127
                                                                                                                          
* State 3
- Energy: -228.17958615571817
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.97962 1.95162 1.02709 0.97835 0.06332
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.  14:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.56289 a.u.                                                                  
               (   3 C   1p-1:    -0.30) (   4 C   1p+1:     0.21) (   4 C   1p-1:     0.22)                              
               (   6 O   1p+1:     0.39) (   6 O   2p+1:     0.29) (   7 H   1s  :     0.20)                              
               (   8 H   1s  :     0.20)                                                                                  
                                                                                                                          
               Molecular Orbital No.  15:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.54801 a.u.                                                                  
               (   1 C   1p+1:     0.25) (   2 H   1s  :    -0.15) (   3 C   1p+1:    -0.22)                              
               (   3 C   1p-1:    -0.22) (   4 C   1p-1:     0.31) (   5 C   1p+1:     0.23)                              
               (   6 O   1p+1:    -0.29) (   6 O   2p+1:    -0.22) (   9 H   1s  :    -0.15)                              
                                                                                                                          
               Molecular Orbital No.  16:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.975 Energy:   -0.60137 a.u.                                                                  
               (   1 C   1p0 :    -0.18) (   5 C   1p0 :    -0.18) (   6 O   1p0 :    -0.54)                              
               (   6 O   2p0 :    -0.38)                                                                                  
                                                                                                                          
               Molecular Orbital No.  17:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.762 Energy:   -0.37259 a.u.                                                                  
               (   3 C   1p0 :    -0.36) (   3 C   2p0 :    -0.26) (   4 C   1p0 :    -0.36)                              
               (   4 C   2p0 :    -0.26) (   6 O   1p0 :     0.23) (   6 O   2p0 :     0.20)                              
                                                                                                                          
               Molecular Orbital No.  18:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.412 Energy:   -0.24794 a.u.                                                                  
               (   1 C   1p0 :     0.37) (   1 C   2p0 :     0.30) (   3 C   1p0 :     0.22)                              
               (   3 C   2p0 :     0.18) (   4 C   1p0 :    -0.22) (   4 C   2p0 :    -0.18)                              
               (   5 C   1p0 :    -0.37) (   5 C   2p0 :    -0.30)                                                        
                                                                                                                          
               Molecular Orbital No.  19:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.632 Energy:    0.06909 a.u.                                                                  
               (   1 C   1p0 :     0.38) (   1 C   2p0 :     0.48) (   3 C   1p0 :    -0.18)                              
               (   3 C   2p0 :    -0.28) (   4 C   1p0 :    -0.18) (   4 C   2p0 :    -0.28)                              
               (   5 C   1p0 :     0.38) (   5 C   2p0 :     0.48) (   6 O   1p0 :    -0.33)                              
               (   6 O   2p0 :    -0.37)                                                                                  
                                                                                                                          
               Molecular Orbital No.  20:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.220 Energy:    0.21208 a.u.                                                                  
               (   1 C   1p0 :     0.28) (   1 C   2p0 :     0.38) (   3 C   1p0 :    -0.45)                              
               (   3 C   2p0 :    -0.58) (   4 C   1p0 :     0.45) (   4 C   2p0 :     0.58)                              
               (   5 C   1p0 :    -0.28) (   5 C   2p0 :    -0.38)                                                        
                                                                                                                          
               Molecular Orbital No.  21:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.20516 a.u.                                                                  
               (   1 C   3s  :    -0.63) (   1 C   2p+1:     0.29) (   1 C   2p-1:     0.23)                              
               (   2 H   2s  :     0.95) (   3 C   3s  :    -0.98) (   3 C   2p+1:    -0.30)                              
               (   3 C   2p-1:     0.40) (   4 C   3s  :    -0.98) (   4 C   2p+1:    -0.47)                              
               (   4 C   2p-1:    -0.17) (   5 C   3s  :    -0.64) (   5 C   2p-1:    -0.35)                              
               (   7 H   2s  :     1.33) (   8 H   2s  :     1.33) (   9 H   2s  :     0.95)                              
                                                                                                                          
               Molecular Orbital No.  22:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23176 a.u.                                                                  
               (   1 C   3s  :     0.74) (   1 C   2p+1:    -0.85) (   1 C   2p-1:    -0.79)                              
               (   2 H   2s  :    -1.88) (   3 C   3s  :     1.11) (   3 C   2p-1:     0.21)                              
               (   4 C   3s  :    -1.10) (   4 C   2p-1:     0.19) (   5 C   3s  :    -0.75)                              
               (   5 C   1p-1:    -0.16) (   5 C   2p+1:     0.28) (   5 C   2p-1:    -1.13)                              
               (   7 H   2s  :    -0.39) (   8 H   2s  :     0.38) (   9 H   2s  :     1.89)                              
                                                                                                                          
               Molecular Orbital No.  23:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23380 a.u.                                                                  
               (   1 C   3s  :     0.96) (   1 C   2p+1:    -0.62) (   1 C   2p-1:    -0.57)                              
               (   2 H   2s  :    -1.58) (   3 C   3s  :    -0.58) (   3 C   2p+1:    -0.32)                              
               (   3 C   2p-1:     0.59) (   4 C   3s  :    -0.59) (   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.81) (   7 H   2s  :     1.11) (   8 H   2s  :     1.11)                              
               (   9 H   2s  :    -1.57)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:01
{'orbital_space': <multipsi.OrbSpace.OrbSpace at 0x17d87bb50>,
 'converged': True,
 'n_iterations': 8,
 'energies': array([-228.48189324, -228.23493686, -228.17958616]),
 'ci_vectors': [<multipsi.CIVector.CIVector at 0x17d840fd0>,
  <multipsi.CIVector.CIVector at 0x10cf6ecd0>,
  <multipsi.CIVector.CIVector at 0x17d840a30>]}

By default, the program then uses a state-averaged optimisation. This means the orbitals are found to minimize the average of all the selected states (here 3). By doing so, we obtain a compromise and all states are treated at a similar accuracy, favouring energy cancellation in the energy differences (i.e. excitation energies). On the other hand, the orbitals are not optimal for any specific state, and here we can see for example that the ground state energy is slightly higher than the one found in the previous section.

Alternatively, one can decide to optimize the orbitals for a specific state, or biasing the average for a specific state. For this, we use the state-average optimizer but with custom weights instead of the default equal weights:

# no weight on the first and third state, full weight on the second
mcscfdrv.compute(molecule,basis,space, nstates , [0,1,0]) 
                                                                                                                          
                          Multi-Configurational Self-Consistent Field Driver
                         ====================================================
                                                                                                                          
        ╭────────────────────────────────────╮
        │          Driver settings           │
        ╰────────────────────────────────────╯
          State-specific calculation
            Number of states      : 3
            State of interest     : 2
          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.234936860     0.0e+00      1.1e-01          1   0:00:00
        2     -228.239446480    -4.5e-03      3.8e-02          1   0:00:00
        3     -228.240111316    -6.6e-04      1.1e-02          1   0:00:00
        4     -228.240166877    -5.6e-05      4.0e-03          1   0:00:00
        5     -228.240174438    -7.6e-06      9.4e-04          1   0:00:00
        6     -228.240174649    -2.1e-07      2.7e-04          1   0:00:00
        7     -228.240174664    -1.5e-08      3.9e-05          1   0:00:00
        8     -228.240174665    -5.6e-10      1.1e-05          1   0:00:00
                                                                                                                          
** Convergence reached in 8 iterations
                                                                                                                          
        Final results
        -------------
                                                                                                                          
                                                                                                                          
* State 1
- Energy: -228.4791783545574
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99448 1.94016 1.89395 0.10619 0.06522
                                                                                                                          
* State 2
- Energy: -228.2401746646519
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.99260 1.43909 1.31021 0.75252 0.50558
                                                                                                                          
* State 3
- Energy: -228.16190451234334
- S^2   : 0.00  (multiplicity = 1.0 )
- Natural orbitals
1.97985 1.95222 1.02838 0.97599 0.06357
                                                                                                                          
                                                 Spin Restricted Orbitals                                                 
                                                 ------------------------                                                 
                                                                                                                          
               Molecular Orbital No.  14:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.56225 a.u.                                                                  
               (   3 C   1p-1:     0.35) (   4 C   1p+1:    -0.16) (   4 C   1p-1:    -0.31)                              
               (   6 O   1p+1:    -0.28) (   6 O   2p+1:    -0.20) (   7 H   1s  :    -0.19)                              
               (   8 H   1s  :    -0.19)                                                                                  
                                                                                                                          
               Molecular Orbital No.  15:                                                                                 
               --------------------------                                                                                 
               Occupation: 2.000 Energy:   -0.54175 a.u.                                                                  
               (   1 C   1p+1:     0.23) (   3 C   1p+1:    -0.22) (   4 C   1p-1:     0.21)                              
               (   5 C   1p+1:     0.23) (   6 O   1p+1:    -0.41) (   6 O   2p+1:    -0.31)                              
                                                                                                                          
               Molecular Orbital No.  16:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.993 Energy:   -0.59244 a.u.                                                                  
               (   6 O   1p0 :     0.56) (   6 O   2p0 :     0.42)                                                        
                                                                                                                          
               Molecular Orbital No.  17:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.439 Energy:   -0.31165 a.u.                                                                  
               (   3 C   1p0 :    -0.40) (   3 C   2p0 :    -0.31) (   4 C   1p0 :    -0.40)                              
               (   4 C   2p0 :    -0.31) (   6 O   1p0 :     0.15)                                                        
                                                                                                                          
               Molecular Orbital No.  18:                                                                                 
               --------------------------                                                                                 
               Occupation: 1.310 Energy:   -0.21315 a.u.                                                                  
               (   1 C   1p0 :     0.43) (   1 C   2p0 :     0.36) (   5 C   1p0 :    -0.43)                              
               (   5 C   2p0 :    -0.36)                                                                                  
                                                                                                                          
               Molecular Orbital No.  19:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.753 Energy:    0.03827 a.u.                                                                  
               (   1 C   1p0 :     0.46) (   1 C   2p0 :     0.43) (   3 C   2p0 :    -0.21)                              
               (   4 C   2p0 :    -0.21) (   5 C   1p0 :     0.46) (   5 C   2p0 :     0.43)                              
               (   6 O   1p0 :    -0.30) (   6 O   2p0 :    -0.37)                                                        
                                                                                                                          
               Molecular Orbital No.  20:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.506 Energy:    0.15207 a.u.                                                                  
               (   1 C   1p0 :     0.18) (   1 C   2p0 :     0.34) (   3 C   1p0 :    -0.48)                              
               (   3 C   2p0 :    -0.63) (   4 C   1p0 :     0.48) (   4 C   2p0 :     0.63)                              
               (   5 C   1p0 :    -0.18) (   5 C   2p0 :    -0.34)                                                        
                                                                                                                          
               Molecular Orbital No.  21:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.20391 a.u.                                                                  
               (   1 C   3s  :    -0.51) (   1 C   2p+1:     0.21) (   1 C   2p-1:     0.15)                              
               (   2 H   2s  :     0.74) (   3 C   3s  :    -1.05) (   3 C   2p+1:    -0.34)                              
               (   3 C   2p-1:     0.47) (   4 C   3s  :    -1.05) (   4 C   2p+1:    -0.54)                              
               (   4 C   2p-1:    -0.21) (   5 C   3s  :    -0.51) (   5 C   2p-1:    -0.24)                              
               (   7 H   2s  :     1.46) (   8 H   2s  :     1.46) (   9 H   2s  :     0.74)                              
                                                                                                                          
               Molecular Orbital No.  22:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23646 a.u.                                                                  
               (   1 C   3s  :     0.84) (   1 C   2p+1:    -0.73) (   1 C   2p-1:    -0.64)                              
               (   2 H   2s  :    -1.71) (   3 C   3s  :     1.16) (   3 C   2p+1:     0.28)                              
               (   4 C   3s  :    -1.17) (   4 C   2p+1:    -0.28) (   5 C   3s  :    -0.83)                              
               (   5 C   2p+1:     0.26) (   5 C   2p-1:    -0.93) (   7 H   2s  :    -0.89)                              
               (   8 H   2s  :     0.89) (   9 H   2s  :     1.69)                                                        
                                                                                                                          
               Molecular Orbital No.  23:                                                                                 
               --------------------------                                                                                 
               Occupation: 0.000 Energy:    0.23718 a.u.                                                                  
               (   1 C   3s  :     1.05) (   1 C   2p+1:    -0.64) (   1 C   2p-1:    -0.60)                              
               (   2 H   2s  :    -1.68) (   3 C   3s  :    -0.47) (   3 C   2p+1:    -0.27)                              
               (   3 C   2p-1:     0.54) (   4 C   3s  :    -0.46) (   4 C   2p+1:    -0.52)                              
               (   4 C   2p-1:    -0.30) (   5 C   3s  :     1.06) (   5 C   2p+1:    -0.21)                              
               (   5 C   2p-1:     0.86) (   7 H   2s  :     0.94) (   8 H   2s  :     0.93)                              
               (   9 H   2s  :    -1.70)                                                                                  
                                                                                                                          
                                                                                                                          
Total MCSCF time: 00:00:01
{'orbital_space': <multipsi.OrbSpace.OrbSpace at 0x17d87bb50>,
 'converged': True,
 'n_iterations': 8,
 'energies': array([-228.47917835, -228.24017466, -228.16190451]),
 'ci_vectors': [<multipsi.CIVector.CIVector at 0x17d87b7f0>,
  <multipsi.CIVector.CIVector at 0x17d8a4490>,
  <multipsi.CIVector.CIVector at 0x17d87bf70>]}

Here we selected 0 weights on all states except the second one, and as expected, that state is now lower in energy than in the state-averaged case.

Computing each state this way (called the state-specific optimization) provides the best description of each state but suffers from 2 major issues. First, it is not always easy to optimize excited states this way, as the order of the states may change depending on the orbitals and it is thus difficult to truly follow a specific state. Additionally, the orthonormality of the states wavefunction is not enforced, and thus the excited states may appear lower in energy than they should be. For simplicity, for excited states, we recommend using state-averaging or linear response described in a subsequent section.