PSCF v1.3.2
AmCompressor

The AmCompressor classes used by both the pscf_pc and pscf_pg programs each implement a Anderson mixing compressor algorithm. Two closely analogous classes named Pscf::Rpc::AmCompressor and Pscf::Rpg::AmCompressor implement this algorithm for the pscf_pc CPU program and the pscf_pg GPU-accelerated program, respectively. These two classes implement the same step algorithm and use the same parameter file format, as documented below.

Step Algorithm

A general discussion of compressor algorithms for PS-FTS is given here. The implementation of the AM mixing algorithm used in PSCF is discussed in the article: "Improved algorithm for identifying partial saddle-points in polymer field theoretic simulations", K. Chen and D.C. Morse, J. Chem. Phys. 162 , 243901 (2025). ,

Parameter File

The only required parameter for this algorithm is the error threshhold "epsilon". A minimal parameter file block could thus look something like this:

AmCompressor{
epsilon 1.0E-4
}

The full parameter file format, including all optional parameters, is shown below:

AmCompressor{
epsilon float
maxItr* int (100 by default)
maxHist int (50 by default)
verbose int (0 by default)
errorType* string ("norm", "rms", "max", or "relNorm". "rms" by default)
lambda* real (1.0 by default)
useLambdaRamp* bool (true by default)
r* real (0.9 by default)
}

Meanings of all parameters are explained in the general discussion of Anderson mixing algorithms, and more briefly summarized below:

Label Description
epsilon error tolerance (Required)
maxItr*
maximum number of iterations to attempt before declaring failure (100 by default)
maxHist*
maximum number of previous states to retain in history (50 by default)
verbose* verbosity level 0, 1, or 2. Lower values are less verbose. (0 by default)
errorType* Identifer for the choice of a definition for the scalar error . Meaning of the allowed values are "norm", "rms" "max", and "relNorm", are discussed here. ("rms" by default)
lambda* Mixing parameter \( \lambda \) in a standard mixing correction step for an Anderson mixing algorithm. (1.0 by default)
useLambdaRamp* If true, use slow ramp-up of mixing parameter, as discussed here. (true by default)
r* Ratio \( r \) used in formula for ramp factor \( \alpha \) that multiplies the mixing parameter, as discussed here. (0.9 by default, only valid if useLambdaRamp is true)

Residual definition

The residual vector for the AmCompressor is defined in real space, as an array in which each element is associated with one node of a regular computational grid. The value \( R({\bf r}) \) of the residual element associated with a grid point located at position \( {\bf r} \) is given by

\[ R({\bf r}) = -1 + \sum_{i=1}^{N_{\rm m}} \phi_{i}({\bf r}) \]

where \( \phi_{i}({\bf r}) \) is the volume fraction of monomer type \( i \) at that grid point, and \( N_{\rm m} \) is the number of monomer types, also known as nMonomer.