Version v2.0.0 of thirdorder has been released and can be obtained from the Downloads section.
It is a complete rewrite of the code. thirdorder is now a standard Python package, and its workflow asks for far fewer DFT calculations while giving third-order force constants of the same accuracy. The full list of changes is in the annotation of the v2.0.0 tag in the repository; the main ones are described below.
Fewer calculations: in earlier versions, every class of equivalent atom triplets was determined from its own set of displaced supercells. However, a calculation with two displaced atoms a and b yields the force constants of all triplets (a, b, k) at once, so it can serve many classes. thirdorder v2.0.0 shares these displacement pairs between classes, prefers the ones that are cheaper and useful to more classes, and removes the redundant ones at the end. Pairs that displace one atom twice along the same direction need two calculations plus one undisplaced calculation shared by all of them. Previously each such pair needed four, two of which repeated the undisplaced supercell. For InAs in a 4x4x4 supercell up to third neighbours, thirdorder now asks for 57 calculations instead of 144; for Si in a 3x3x3 supercell, 23 instead of 76; for GaN in a 3x3x2 supercell, 85 instead of 208. Tested against an analytic model potential whose third derivatives are computed by brute force, the new version reaches the same accuracy as v1.1.4 with 2.3 to 2.8 times fewer calculations.
Bug fixes: the acoustic sum rule was not enforced as accurately as intended. The iterative solver that computes the correction stopped at its default tolerance without checking for convergence, which left violations of 4e-5 to 1e-4 of the largest force constant. The correction is now computed with a direct method, with an iterative fallback only for very large problems, and the result is checked: the sum rule now holds to better than 1e-10. In addition, when several periodic images of an atom are equally close (typically at half the supercell), all of them are now written to FORCE_CONSTANTS_3RD, each with an equal share of the force constants. Previously the code kept only one of them, chosen by rounding.
Robustness: the independent force constants of each class are now fitted by least squares to all the components measured for its members. reap prints the residual of this fit, which shows how well the forces respect the symmetry of the crystal. The symmetry analysis relies on standard linear algebra (singular value decompositions and a pivoted Gram-Schmidt selection) instead of Gaussian elimination with an absolute tolerance. sow now writes a manifest, 3RD.manifest.json, recording the unit cell, the parameters and every calculation. reap reads its parameters from it, so the supercell size and cutoff no longer have to be repeated. With VASP, reap also matches each vasprun.xml to its calculation through the atomic positions, so the outputs can be listed in any order.
Performance: thirdorder itself, excluding the DFT calculations, is faster in most cases. For InAs in a 5x5x5 supercell up to seventh neighbours, the whole pipeline takes 0.95 s instead of 2.60 s. For a triclinic structure with 216 atoms in the supercell, it takes 0.16 s and 103 MiB instead of 2.79 s and 926 MiB. In the largest case tested, with 512 atoms and 4544 independent force constants, it takes 4.9 s instead of 6.4 s, but needs 767 MiB instead of 632 MiB; most of that cost comes from properly converging the sum-rule correction.
Testing: the VASP, Quantum ESPRESSO and CASTEP interfaces are tested end to end against the model potential, together with tests of the sum rule, of the exact recovery of symmetric force constants, and regression tests.
Compatibility: the supercells generated by sow in the 1.x series cannot be processed by reap in v2.0.0, so calculations started with an older version should be finished with it. thirdorder now requires Python 3.12 or later. It is installed with pip or uv, which provide the commands thirdorder-vasp, thirdorder-espresso and thirdorder-castep. The Quantum ESPRESSO unit-cell file and the CASTEP seed name must now be given before the action (sow or reap). With all interfaces, the first numbered supercell file may be the undisplaced supercell; it must be computed like the others. The format of FORCE_CONSTANTS_3RD is unchanged.
The latest release of the 1.x series, v1.1.4, will remain available from the Downloads section, and any older release can of course be obtained from the git repository.