You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/advanced/input_files/input-main.md
+70-39Lines changed: 70 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1530,27 +1530,45 @@ These variables are used to control the geometry relaxation.
1530
1530
### relax_method
1531
1531
1532
1532
-**Type**: Vector of string
1533
-
-**Description**: The methods to do geometry optimization.
1534
-
the first element:
1535
-
- cg: using the conjugate gradient (CG) algorithm. Note that there are two implementations of the conjugate gradient (CG) method, see [relax_new](#relax_new).
1536
-
- bfgs : using the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm.
1537
-
- lbfgs: using the Limited-memory Broyden–Fletcher–Goldfarb–Shanno (LBFGS) algorithm.
1538
-
- cg_bfgs: using the CG method for the initial steps, and switching to BFGS method when the force convergence is smaller than [relax_cg_thr](#relax_cg_thr).
1539
-
- sd: using the steepest descent (SD) algorithm.
1540
-
- fire: the Fast Inertial Relaxation Engine method (FIRE), a kind of molecular-dynamics-based relaxation algorithm, is implemented in the molecular dynamics (MD) module. The algorithm can be used by setting [calculation](#calculation) to `md` and [md_type](#md_type) to `fire`. Also ionic velocities should be set in this case. See [fire](../md.md#fire) for more details.
1541
-
1542
-
the second element:
1543
-
when the first element is bfgs, if the second parameter is 1, it indicates the use of the new BFGS algorithm; if the second parameter is not 1, it indicates the use of the old BFGS algorithm.
1544
-
-**Default**: cg 1
1545
-
-**Note**:In the 3.10-LTS version, the type of this parameter is std::string. It can be set to "cg","bfgs","cg_bfgs","bfgs_trad","lbfgs","sd","fire".
1533
+
-**Description**: The methods to do geometry optimization. The available algorithms depend on the [relax_new](#relax_new) setting.
1534
+
1535
+
**First element** (algorithm selection):
1536
+
-`cg`: Conjugate gradient (CG) algorithm. Available for both `relax_new = True` (default, simultaneous optimization) and `relax_new = False` (nested optimization). See [relax_new](#relax_new) for implementation details.
1537
+
-`bfgs`: Broyden–Fletcher–Goldfarb–Shanno (BFGS) quasi-Newton algorithm. **Only available when `relax_new = False`**.
1538
+
-`lbfgs`: Limited-memory BFGS algorithm, suitable for large systems. **Only available when `relax_new = False`**.
1539
+
-`cg_bfgs`: Mixed method starting with CG and switching to BFGS when force convergence reaches [relax_cg_thr](#relax_cg_thr). **Only available when `relax_new = False`**.
1540
+
-`sd`: Steepest descent algorithm. **Only available when `relax_new = False`**. Not recommended for production use.
1541
+
-`fire`: Fast Inertial Relaxation Engine method, a molecular-dynamics-based relaxation algorithm. Use by setting [calculation](#calculation) to `md` and [md_type](#md_type) to `fire`. Ionic velocities must be set in STRU file. See [fire](../md.md#fire) for details.
1542
+
1543
+
**Second element** (BFGS variant, only when first element is `bfgs`):
1544
+
-`1`: Traditional BFGS that updates the Hessian matrix B and then inverts it.
1545
+
-`2` or omitted: Default BFGS that directly updates the inverse Hessian (recommended).
1546
+
1547
+
-**Default**: `cg 1`
1548
+
-**Note**: In the 3.10-LTS version, the type of this parameter is std::string. It can be set to "cg", "bfgs", "cg_bfgs", "bfgs_trad", "lbfgs", "sd", "fire".
1546
1549
1547
1550
### relax_new
1548
1551
1549
1552
-**Type**: Boolean
1550
-
-**Description**: At around the end of 2022 we made a new implementation of the Conjugate Gradient (CG) method for `relax` and `cell-relax` calculations. But the old implementation was also kept.
1551
-
- True: use the new implementation of CG method for `relax` and `cell-relax` calculations.
1552
-
- False: use the old implementation of CG method for `relax` and `cell-relax` calculations.
1553
+
-**Description**: Controls which implementation of geometry relaxation to use. At the end of 2022, a new implementation of the Conjugate Gradient (CG) method was introduced for `relax` and `cell-relax` calculations, while the old implementation was kept for backward compatibility.
1554
+
1555
+
-**True** (default): Use the new CG implementation with the following features:
1556
+
- Simultaneous optimization of ionic positions and cell parameters (for `cell-relax`)
1557
+
- Line search algorithm for step size determination
1558
+
- Only CG algorithm is available (`relax_method` must be `cg`)
- Limited cell constraints: only `fixed_axes = "volume"` is supported
1568
+
- Traditional approach with separate ionic and cell optimization steps
1569
+
1553
1570
-**Default**: True
1571
+
-**Recommendation**: Use `relax_new = True` (default) for most cases, especially for `cell-relax` calculations. Use `relax_new = False` only if you need BFGS/LBFGS algorithms or for reproducing old results.
1554
1572
1555
1573
### relax_scale_force
1556
1574
@@ -1568,7 +1586,8 @@ These variables are used to control the geometry relaxation.
1568
1586
### relax_cg_thr
1569
1587
1570
1588
-**Type**: Real
1571
-
-**Description**: When move-method is set to `cg_bfgs`, a mixed algorithm of conjugate gradient (CG) method and Broyden–Fletcher–Goldfarb–Shanno (BFGS) method is used. The ions first move according to CG method, then switched to BFGS method when the maximum of force on atoms is reduced below the CG force threshold, which is set by this parameter.
1589
+
-**Availability**: Only used when `relax_new = False` and `relax_method = cg_bfgs`
1590
+
-**Description**: When `relax_method` is set to `cg_bfgs`, a mixed algorithm of conjugate gradient (CG) and Broyden–Fletcher–Goldfarb–Shanno (BFGS) is used. The ions first move according to the CG method, then switch to the BFGS method when the maximum force on atoms is reduced below this threshold.
1572
1591
-**Default**: 0.5
1573
1592
-**Unit**: eV/Angstrom
1574
1593
@@ -1604,33 +1623,38 @@ These variables are used to control the geometry relaxation.
1604
1623
### relax_bfgs_w1
1605
1624
1606
1625
-**Type**: Real
1607
-
-**Description**: Controls the Wolfe condition for Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. You can look into the paper Phys.Chem.Chem.Phys.,2000,2,2177 for more information.
1626
+
-**Availability**: Only used when `relax_new = False` and `relax_method` is `bfgs` or `cg_bfgs`
1627
+
-**Description**: Controls the Wolfe condition for the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. This parameter sets the sufficient decrease condition (c1 in Wolfe conditions). For more information, see Phys. Chem. Chem. Phys., 2000, 2, 2177.
1608
1628
-**Default**: 0.01
1609
1629
1610
1630
### relax_bfgs_w2
1611
1631
1612
1632
-**Type**: Real
1613
-
-**Description**: Controls the Wolfe condition for Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. You can look into the paper Phys.Chem.Chem.Phys.,2000,2,2177 for more information.
1633
+
-**Availability**: Only used when `relax_new = False` and `relax_method` is `bfgs` or `cg_bfgs`
1634
+
-**Description**: Controls the Wolfe condition for the Broyden–Fletcher–Goldfarb–Shanno (BFGS) algorithm used in geometry relaxation. This parameter sets the curvature condition (c2 in Wolfe conditions). For more information, see Phys. Chem. Chem. Phys., 2000, 2, 2177.
1614
1635
-**Default**: 0.5
1615
1636
1616
1637
### relax_bfgs_rmax
1617
1638
1618
1639
-**Type**: Real
1619
-
-**Description**: For geometry optimization. It stands for the maximal movement of all the atoms. The sum of the movements from all atoms can be increased during the optimization steps. However, it can not be larger than `relax_bfgs_rmax`.
1620
-
-**Unit**: Bohr
1640
+
-**Availability**: Only used when `relax_new = False` and `relax_method` is `bfgs` or `cg_bfgs`
1641
+
-**Description**: Maximum allowed total displacement of all atoms during geometry optimization. The sum of atomic displacements can increase during optimization steps but cannot exceed this value.
1621
1642
-**Default**: 0.8
1643
+
-**Unit**: Bohr
1622
1644
1623
1645
### relax_bfgs_rmin
1624
1646
1625
1647
-**Type**: Real
1626
-
-**Description**: In old bfgs algorithm, it indicates the minimal movement of all the atoms. When the movement of all the atoms is smaller than relax_bfgs_rmin Bohr, and the force convergence is still not achieved, the calculation will break down. In the current default bfgs algorithm, this parameter is not used.
1648
+
-**Availability**: Only used when `relax_new = False` and `relax_method = bfgs 1` (traditional BFGS)
1649
+
-**Description**: Minimum allowed total displacement of all atoms. When the total atomic displacement falls below this value and force convergence is not achieved, the calculation will terminate. **Note**: This parameter is not used in the default BFGS algorithm (`relax_method = bfgs 2` or `bfgs`).
1627
1650
-**Default**: 1e-5
1628
1651
-**Unit**: Bohr
1629
1652
1630
1653
### relax_bfgs_init
1631
1654
1632
1655
-**Type**: Real
1633
-
-**Description**: For geometry optimization. It stands for the sum of initial movements of all of the atoms.
1656
+
-**Availability**: Only used when `relax_new = False` and `relax_method` is `bfgs` or `cg_bfgs`
1657
+
-**Description**: Initial total displacement of all atoms in the first BFGS step. This sets the scale for the initial movement.
1634
1658
-**Default**: 0.5
1635
1659
-**Unit**: Bohr
1636
1660
@@ -1659,31 +1683,38 @@ These variables are used to control the geometry relaxation.
1659
1683
### fixed_axes
1660
1684
1661
1685
-**Type**: String
1662
-
-**Availability**: Only used when `calculation` set to `cell-relax`
1663
-
-**Description**: Axes that are fixed during cell relaxation. Possible choices are:
1664
-
- None**: default; all of the axes can relax
1665
-
- volume**: relaxation with fixed volume
1666
-
- shape**: fix shape but change volume (i.e. only lattice constant changes)
1667
-
- a: fix a axis during relaxation
1668
-
- b: fix b axis during relaxation
1669
-
- c: fix c axis during relaxation
1670
-
- ab: fix both a and b axes during relaxation
1671
-
- ac: fix both a and c axes during relaxation
1672
-
- bc: fix both b and c axes during relaxation
1673
-
1674
-
> Note : fixed_axes = "shape" and "volume" are only available for [relax_new](#relax_new) = True
1686
+
-**Availability**: Only used when `calculation` is set to `cell-relax`
1687
+
-**Description**: Specifies which cell degrees of freedom are fixed during variable-cell relaxation. The available options depend on the [relax_new](#relax_new) setting:
1688
+
1689
+
**When `relax_new = True` (default)**, all options are available:
1690
+
-`None`: Default; all cell parameters can relax freely
1691
+
-`volume`: Relaxation with fixed volume (allows shape changes)
1692
+
-`shape`: Fix shape but allow volume changes (hydrostatic pressure only)
1693
+
-`a`: Fix the a-axis lattice vector during relaxation
1694
+
-`b`: Fix the b-axis lattice vector during relaxation
1695
+
-`c`: Fix the c-axis lattice vector during relaxation
1696
+
-`ab`: Fix both a and b axes during relaxation
1697
+
-`ac`: Fix both a and c axes during relaxation
1698
+
-`bc`: Fix both b and c axes during relaxation
1699
+
1700
+
**When `relax_new = False`**, all options are now available:
1701
+
-`None`: Default; all cell parameters can relax freely
1702
+
-`volume`: Relaxation with fixed volume (allows shape changes). Volume is preserved by rescaling the lattice after each update.
1703
+
-`shape`: Fix shape but allow volume changes (hydrostatic pressure only). Stress tensor is replaced with isotropic pressure.
1704
+
-`a`, `b`, `c`, `ab`, `ac`, `bc`: Fix specific lattice vectors. Gradients for fixed vectors are set to zero.
1675
1705
1676
1706
-**Default**: None
1707
+
-**Note**: For VASP users, see the [ISIF correspondence table](../opt.md#fixing-cell-parameters) in the geometry optimization documentation. Both implementations now support all constraint types.
1677
1708
1678
1709
### fixed_ibrav
1679
1710
1680
1711
-**Type**: Boolean
1681
-
-**Availability**: Must be used along with [relax_new](#relax_new) set to True, and a specific [latname](#latname) must be provided
1712
+
-**Availability**: Can be used with both `relax_new = True` and `relax_new = False`. A specific [latname](#latname) must be provided.
1682
1713
-**Description**:
1683
-
- True: the lattice type will be preserved during relaxation
1714
+
- True: the lattice type will be preserved during relaxation. The lattice vectors are reconstructed to match the specified Bravais lattice type after each update.
1684
1715
- False: No restrictions are exerted during relaxation in terms of lattice type
1685
1716
1686
-
> Note: it is possible to use `fixed_ibrav` with `fixed_axes`, but please make sure you know what you are doing. For example, if we are doing relaxation of a simple cubic lattice (`latname` = "sc"), and we use `fixed_ibrav` along with `fixed_axes` = "volume", then the cell is never allowed to move and as a result, the relaxation never converges.
1717
+
> Note: it is possible to use `fixed_ibrav` with `fixed_axes`, but please make sure you know what you are doing. For example, if we are doing relaxation of a simple cubic lattice (`latname` = "sc"), and we use `fixed_ibrav` along with `fixed_axes` = "volume", then the cell is never allowed to move and as a result, the relaxation never converges. When both are used, `fixed_ibrav` is applied first, then `fixed_axes = "volume"` rescaling is applied.
0 commit comments