Skip to content

Commit

Permalink
Update mcscf docstring (issue pyscf#2119)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunqm committed Mar 8, 2024
1 parent 855f2d1 commit baa71fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
24 changes: 5 additions & 19 deletions pyscf/mcscf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,42 +81,28 @@
Converge threshold. Default is 1e-7
conv_tol_grad : float
Converge threshold for CI gradients and orbital rotation gradients.
Default is 1e-4
If not specified, it is set to sqrt(conv_tol).
max_stepsize : float
The step size for orbital rotation. Small step size is prefered.
Default is 0.03.
Default is 0.02.
(NOTE although the default step size is small enough for many systems,
it happens that the orbital optimizor crosses the barriar of local
minimum and converge to the neighbour solution, e.g. the CAS(4,4) for
C2H4 in the test files. In these systems, adjusting max_stepsize,
max_ci_stepsize and max_cycle_micro, max_cycle_micro_inner and
ah_start_tol may be helpful)
max_ci_stepsize and max_cycle_micro and ah_start_tol may be helpful)
>>> mc = mcscf.CASSCF(mf, 6, 6)
>>> mc.max_stepsize = .01
>>> mc.max_cycle_micro = 1
>>> mc.max_cycle_macro = 100
>>> mc.max_cycle_micro_inner = 1
>>> mc.ah_start_tol = 1e-6
max_ci_stepsize : float
The max size for approximate CI updates. The approximate updates are
used in 1-step algorithm, to estimate the change of CI wavefunction wrt
the orbital rotation. Small step size is prefered. Default is 0.01.
max_cycle_macro : int
Max number of macro iterations. Default is 50.
max_cycle_micro : int
Max number of micro iterations in each macro iteration. Depending on
systems, increasing this value might reduce the total macro
iterations. Generally, 2 - 3 steps should be enough. Default is 2.
max_cycle_micro_inner : int
Max number of steps for the orbital rotations allowed for the augmented
hessian solver. It can affect the actual size of orbital rotation.
Even with a small max_stepsize, a few max_cycle_micro_inner can
accumulate the rotation and leads to a significant change of the CAS
space. Depending on systems, increasing this value migh reduce the
total number of macro iterations. The value between 2 - 8 is preferred.
Default is 4.
iterations. Generally, 2 - 5 steps should be enough. Default is 4.
frozen : int or list
If integer is given, the inner-most orbitals are excluded from optimization.
Given the orbital indices (0-based) in a list, any doubly occupied core
Expand All @@ -131,7 +117,7 @@
Linear dependence threshold for AH solver. Default is 1e-16.
ah_start_tol : flat, for AH solver.
In AH solver, the orbital rotation is started without completely solving the AH problem.
This value is to control the start point. Default is 1e-4.
This value is to control the start point. Default is 2.5.
ah_start_cycle : int, for AH solver.
In AH solver, the orbital rotation is started without completely solving the AH problem.
This value is to control the start point. Default is 3.
Expand Down
10 changes: 5 additions & 5 deletions pyscf/mcscf/mc1step.py
Original file line number Diff line number Diff line change
Expand Up @@ -595,16 +595,16 @@ class CASSCF(casci.CASBase):
Converge threshold. Default is 1e-7
conv_tol_grad : float
Converge threshold for CI gradients and orbital rotation gradients.
Default is 1e-4
If not specified, it is set to sqrt(conv_tol).
max_stepsize : float
The step size for orbital rotation. Small step (0.005 - 0.05) is prefered.
Default is 0.03.
Default is 0.02.
max_cycle_macro : int
Max number of macro iterations. Default is 50.
max_cycle_micro : int
Max number of micro iterations in each macro iteration. Depending on
systems, increasing this value might reduce the total macro
iterations. Generally, 2 - 5 steps should be enough. Default is 3.
iterations. Generally, 2 - 5 steps should be enough. Default is 4.
small_rot_tol : float
Threshold for orbital rotation to be considered small. If the largest orbital
rotation is smaller than this value, the CI solver will restart from the
Expand All @@ -620,10 +620,10 @@ class CASSCF(casci.CASBase):
Linear dependence threshold for AH solver. Default is 1e-14.
ah_start_tol : flat, for AH solver.
In AH solver, the orbital rotation is started without completely solving the AH problem.
This value is to control the start point. Default is 0.2.
This value is to control the start point. Default is 2.5.
ah_start_cycle : int, for AH solver.
In AH solver, the orbital rotation is started without completely solving the AH problem.
This value is to control the start point. Default is 2.
This value is to control the start point. Default is 3.
``ah_conv_tol``, ``ah_max_cycle``, ``ah_lindep``, ``ah_start_tol`` and ``ah_start_cycle``
can affect the accuracy and performance of CASSCF solver. Lower
Expand Down

0 comments on commit baa71fa

Please sign in to comment.