Setting thresholds for integral in CASSCF/RASSCF

Find answers or ask questions regarding Dalton calculations.
Please upload an output file showing the problem, if applicable.
(It is not necessary to upload input files, they can be found in the output file.)

Post Reply
ankit7540
Posts: 34
Joined: 05 Sep 2015, 10:49
First name(s): ANKIT
Last name(s): RAJ
Affiliation: National Chiao Tung University
Country: Taiwan, Province of China

Setting thresholds for integral in CASSCF/RASSCF

Post by ankit7540 » 25 Mar 2020, 10:18

Dear all,
I am running MCSCF calculations for finally obtaining good electronic wavefunctions for later response calculations. Convergence of the electronic wavefuction is slow and I am looking for ways to speed things up. I wonder if reducing the threshold for the integrals maybe a good way.

From the manual of DALTON,

Code: Select all

*SUPINT


.THRESH
READ (LUCMD,*) THRSUP
Threshold for the supermatrix integrals. Read one more line containing the threshold.
Default is the same as the threshold for discarding the two-electron integrals (see the
chapter describing the molecule input format, Ch. 26).
is one way to set the threshold. Next, in Ch 26 says that in the molecule input file we can define the threshold as

Code: Select all

Integrals (Real). Indicates the threshold for which integrals smaller than this will
be considered to be zero. If not specified, a threshold of 1.0D-15 will be used. A
threshold of 1.0D-15 will give integrals correct to approximately 1.0D-13.
My questions.
  • 1. Are both parameters need to defined during the calculation or one is enough.
  • 2. How to properly give input in the *.mol file.
Why I am eager to try this.
For O2 I received this output (full file attached), at the end of the electronic part of the calculation,

Code: Select all

 Magnitude of CI coefficients
 ============================
 ( Ranges are relative to norm of vector :  1.00E+00 )

  10- 1 to 10- 0         6    0.88051459E+00      0.8805145941
  10- 2 to 10- 1       152    0.87662190E-01      0.9681767840
  10- 3 to 10- 2      3156    0.27643054E-01      0.9958198378
  10- 4 to 10- 3     42066    0.37854091E-02      0.9996052469
  10- 5 to 10- 4    292457    0.38256489E-03      0.9999878118
  10- 6 to 10- 5    609481    0.12082055E-04      0.9999998939
  10- 7 to 10- 6    357798    0.10591637E-06      0.9999999998
  10- 8 to 10- 7     64140    0.23031285E-09      1.0000000000
  10- 9 to 10- 8      8060    0.26174301E-12      1.0000000000
  10-10 to 10- 9      4774    0.95959001E-15      1.0000000000
  10-11 to 10-10      4490    0.10694157E-16      1.0000000000
  Number of coefficients less than 10^-11 times norm is                   3198

  Total CPU  time used in SIRIUS :  15 hours 55 minutes 26 seconds
  Total wall time used in SIRIUS :   9 hours 24 minutes 15 seconds
Very small coefficients (<1e-9) maybe be neglected. That's my guess but I am seeking suggestions from the developers. Thank you.
Attachments
p_2core_r3_3exc_small_O2.out
RASSCF, O2
(201.18 KiB) Downloaded 5 times
Best regards.
Ankit

ankit7540
Posts: 34
Joined: 05 Sep 2015, 10:49
First name(s): ANKIT
Last name(s): RAJ
Affiliation: National Chiao Tung University
Country: Taiwan, Province of China

Re: Setting thresholds for integral in CASSCF/RASSCF

Post by ankit7540 » 25 Mar 2020, 11:54

Update 1 : After some testing,

Code: Select all

*SUPINT
.THRESH
does not significantly affect run times. Also it has no effect on the CI coefs.

Update 2: After some testing,

Code: Select all

.Integrals
in the *.mol files also does not significantly reduce run times.
Best regards.
Ankit

taylor
Posts: 558
Joined: 15 Oct 2013, 05:37
First name(s): Peter
Middle name(s): Robert
Last name(s): Taylor
Affiliation: Tianjin University
Country: China

Re: Setting thresholds for integral in CASSCF/RASSCF

Post by taylor » 25 Mar 2020, 18:15

It would of value to see exactly what calculation you are trying to run on O2 that converges slowly and that takes a very substantial amount of time (for a diatomic). It might be possible to improve on this.

I do not see that reducing integral accuracy (which is not a very good idea for reasons mentioned below) can improve convergence, and I do not see that it will reduce the computer time per iteration. In a given iteration the integrals over symmetry orbitals are transformed to the current MO basis, and then used to solve the MCSCF equations to obtain improved MOs and CI coefficients. Neglecting small integrals does not reduce the time required for modern symmetry-blocked integral transformations, and of course once the MO integrals are available the computer time required will be completely independent of any neglect of integrals in the symmetry orbital basis.

Why did I say reducing integral accuracy was not a very good idea above? If the accuracy is not reduced by much, it probably has little effect for the calculation of MCSCF energies and first-order properties. It may have a larger effect on higher-order/response properties. If the accuracy is significantly reduced, however, all sorts of problems may appear, including variational collapse because the electron repulsion contribution is not given correctly.

The number of configurations in your calculation is large but not exceptionally large. In half the computer time your calculation needs (for the MCSCF step from what you say) I can do three CASSCF second-order geometry optimization steps followed by a full vibrational calculation and analysis for a calculation with 2.3 million configurations! As I said at the outset, if you post your O2 calculation files (uploaded, not inline please!) we may be able to provide more assistance.

Best regards
Pete

ankit7540
Posts: 34
Joined: 05 Sep 2015, 10:49
First name(s): ANKIT
Last name(s): RAJ
Affiliation: National Chiao Tung University
Country: Taiwan, Province of China

Re: Setting thresholds for integral in CASSCF/RASSCF

Post by ankit7540 » 26 Mar 2020, 02:11

Hello Dr. Peter,
Thank you for your comments.
The full output file for O2 was uploaded with the original post. It is given here again.
Attachments
p_2core_r3_3exc_small_O2.out
O2, RASSCF output file
(201.18 KiB) Downloaded 3 times
Best regards.
Ankit

taylor
Posts: 558
Joined: 15 Oct 2013, 05:37
First name(s): Peter
Middle name(s): Robert
Last name(s): Taylor
Affiliation: Tianjin University
Country: China

Re: Setting thresholds for integral in CASSCF/RASSCF

Post by taylor » 27 Mar 2020, 09:56

The fact that there was an output file attached did not come up for me when I looked at the earlier posting, so I was not aware you'd posted it. Sorry about that because I could have replied sooner if I had seen it before!

The statistics presented after the RASSCF calculation converged explain the timing, and this section also (together with the final orbitals and occupation numbers) directly identifies the problem. The calculation is performing vast numbers of microiterations within each macroiteration, and much of this is anyway unproductive because most macroiterations end with some sort of linear dependence among the trial vectors. Convergence of the gradient norm is very slow, although we can see from the statistics that the energy hardly changes in most of the last macroiterations. This explains the timing.

The source of the problem is almost certainly your choice of active space. If you look at the occupation numbers (that they are RAS "pseudo" natural orbitals does not matter in this context) you will see that many of them are small (defined for our purposes here as less than 0.05) and some are very much smaller than this. A crude approximation to the MCSCF gradient and Hessian is given by differences between occupation numbers of the different orbital spaces. This means that the gradient with respect to rotations of (here) the RAS3 orbitals and the secondary orbitals is small, and also that the Hessian matrix elements, which give the curvature of the MCSCF energy with respect to the wave function parameters, will be small. The program is then trying to minimize an energy which is very "flat" with respect to varying the wave function parameters, and convergence will inevitably be very slow. As you see. Another pointer that there is something very unsatisfactory about this wave function choice is that the virial ratio -V/T (printed in each iteration) is about 2.3, when it should be very close to 2, say to within at least two decimal places.

One possibility (although I am doubtful that this is the case) is to start with a more physically plausible set of MOs. I would suggest doing HF before MCSCF, and simply doing a closed-shell calculation, occupation 3 1 1 0 2 0 0 0, so O22+. The nuclear attraction should produce MOs that are strongly localized in the valence region and which will be a much better starting guess. As I say, this may work, but I am not optimistic.

More realistically, I think you will have to reconsider your active space. How did you choose this in the first place? I notice for instance that the smallest occupation number corresponds to an orbital of deltau symmetry comprised almost entirely of f character, is this really what you had in mind? I would suggest that rather than trying an extended RASSCF space at the start, you instead construct a valence-shell CASSCF space (I would treat the 2s-derived sigmag and sigmau as inactive) and then run a CI calculation, obtaining natural orbitals, and looking at the occupation numbers to see what makes sense to include in a later RASSCF calculation. Orbitals with an occupation number less than about 0.01 are likely to give trouble in such a calculation, and I would probably look to retain only orbitals with an occupation number of 0.03 or larger, at least initially.

Best regards
Pete

hjaaj
Posts: 339
Joined: 27 Jun 2013, 18:44
First name(s): Hans Jørgen
Middle name(s): Aagaard
Last name(s): Jensen
Affiliation: Universith of Southern Denmark
Country: Denmark

Re: Setting thresholds for integral in CASSCF/RASSCF

Post by hjaaj » 27 Mar 2020, 17:11

Hi, I have analyzed your case and identified some problems. And I will provide some comments, and supplement what Pete has written.

note 1) In general I recommend to use MP2 guess for initial orbitals, they are much better than SCF orbitals. My recommended input for your O_2 MCSCF calculation would be (I have marked the lines changed compared to your input with "! changed":

Code: Select all

**WAVE FUNCTIONS
.HF   ! changed
.MP2 ! changed - see note 1
.MCSCF
*SCF INPUT
.DOUBLY
 3 1 1 0 2 0 0 0
.SINGLY
 0 0 0 0 0 1 1 0
*CONFIGURATION INPUT
.SYMMETRY
4
.SPIN MULTIPLICITY
3
.RAS1 SPACE
0 0 0 0 0 0 0 0
.RAS2 SPACE
2 1 1 0 2 1 1 0
.RAS3 SPACE
4 2 2 1 3 2 2 1 ! changed -- see note 2)
.INACTIVE ORBITALS
1 0 0 0 1 0 0 0
.ELECTRONS
12
.RAS1 HOLES
0 0
.RAS3 ELECTRONS
0 2  ! changed -- see note 3)
note 2) You have selected a bad RAS3 active space. Two problems, which are revealed if you look at the natural orbital occupations predicted by MP2: Two very weakly occupied orbitals are included in sym 4 and 8; only one component of the degenerate delta orbitals are included in RAS3. This means that the calculation will break linear symmetry, which is the cause of some of the initial convergence problems. Instead of a RAS3 space of " 4 2 2 2 2 2 2 2" you should have " 4 2 2 1 3 2 2 1".

note 3) with CI-SDT between RAS2 and RAS3 you get the extremely poor convergence of the RASSCF macro iterations which you have observed. With CI-SD you get fast convergence in a few minutes! The reason is basically that with CI-SDT your RASSCF wave function is so close to the CASSCF wave function that the orbital rotations between RAS2 and RAS3 are almost redundant. From mathematics we know that redundancy in the parameters will give very slow convergence - and near redundancy will give slow convergence, as observed for the CI-SDT.

And finally, the integral threshold you modified is not relevant at all for the number of macroiterations, which is what caused the long calculation time.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests