Add bcc as a target_shape of find_optimal_cell_shape

Summary

The present MR suggests to add the bcc option for the target_shape argument of find_optimal_cell_shape.

@kavanase, @SianK, as you have worked on the code via !3404 (merged) and !3616 (merged), if you are interested in, may I ask you to have a look, when convenient?

Details

The present ASE implements sc and fcc as options for target_shape argument of find_optimal_cell_shape. Actually, there is another possible cubic (thus near isotropic) expansion, bcc. This gives a shorter defect distances per volume than fcc but longer than sc (see below). Having bcc should provide another flexibility for users, so I would suggest having this option in ASE.

periodic-ws-3d.svg

Taking this opportunity, the code and the tests are slightly refactored. Also, docstrings are also updated, particularly because the methodology written was outdated.

The code should be fully backward compatible.

The defect tutorial (https://docs.ase-lib.org/examples_generated/03-tutorials/defects.html) should also be updated, which may be done in a separate MR.

Performance

The supercells generated with target_shape=bcc are compared with those generated with doped (minimum distances). Interestingly, when the cell shape is optimized in terms of lattice vector lengths (score_key='length', present default), bcc often gives even closer values to doped compared with fcc.

vs_doped_length.svg

When we do score_key='metric' and consider cell angles into account, fcc gets again the best among {'sc', 'bcc', 'fcc'}. It can sometimes give a better agreement with doped compared with score_key='length'.

vs_doped_metric.svg

Note

While not directly relevant to the present MR, I also compare the present ASE values from those stored in doped, which may be obtained with ASE 2.23.0, in order to avoid future potential confusion.

In !3404 (merged), the optimality measure has been updated to be rotationally invariant, by comparing the lattice vector lengths individually. Likely with this change, more optimal supercell shapes are found in ASE, giving closer values to doped, as demonstrated in the figure below (filled circles: new ASE, open squares: old ASE stored in doped).

vs_old_ase.svg

The codes to reproduce the figures are as follows (based on doped/docs/JOSS/JOSS_plots.ipynb).

1.calc.ipynb

2.vs_doped.ipynb

3.vs_old_ase.ipynb

AI Disclosure

Discussed with AI while implemented by hand.

Checklist: x (done) or ~ (irrelevant)

Merge request reports

Loading
Loading