Mymetal - work log

He knows most who speaks least.

大智若愚

Updated time: 03/28 2025.

About Mymetal

Please read this page first, here are the install methods using python supported by some dependent packages.

It’s a package for DFT calculations specially of thin metal film supported or not.

Focus on some functions

The initial reason of constructing this package is better understanding the DFT or VASP, and how to generate the irreducible K-points.

To solve this question, we need to …

  • convert from real space to momentum / reciprocal space (has been done using Matlab)

  • generate reducible K-points (has been done using Matlab)

  • identify the symmetry of model
  • generate irreducible K-points

And then, I should use python to execute postprocess for output file.

Based on the below reason, the main function is (although not be fully developed):

  • preprocess

    • film

      • generate film
      • unixial / bixial stretch film
      • add hydroxylated atoms: OH, H, any molecular
      • construct the heterostructure
    • universal

      • convert model : primitive cell <<==>> conventional cell
  • postprocess: grep something from OUTCAR

Some fixing error and unfilled code

fixing error please see another blog Mymetal/error.

  • for filter the strain matrix, the bottom layer didn’t be considered

unfilled code

root/create_package.py generate the structure of package
build/extrfilm.py
universal/printafter.py

Work logs

03/28 2025.

  • 用ovito渲染图片render.py
  • 新建了general.py,结构更加合理
  • 实现了colorbar的精确绘制my_plot_colorbar()

02/28 2025.

  • 进一步修复了general_font()无法修改已生成图像中线条/legend/grid的bug
  • 新增general_add_vlines_hlines()使得添加辅助线更方便
  • 修复了general_modify_ploted_figure()函数对没有line label但是有legend的二次绘制,并与没有legend没有label的band plot区分开来

02/26 2025.

  • general_modify_ploted_figure() 完善了对其他包已绘制的图形进行自定义修改,使得和我自己画的图一致
  • 改进了my_plot()使得模块化组成
  • oldplotdos.py 中针对 Total dos, partial dos, Idos 的自定义绘制,丰富了我对DOS的理解

11/28 2024.

  • plot.py my_plot() my_plot_breakaxes() my_plot_energy_components() my_plot_dos()

11/06 2024.

  • 完善了 finprim.py/check_direction() ,新添了对 a0 对齐于 x 方向,右手坐标系,a3 方向朝上。并添加判断条件,防止除以 0.

  • 创建了 vasp_utils repository, 用于工作流构建和批量后处理.

10/21 2024.

  • 修复了my_write_vasp() 函数对于Cartesian坐标系输出的错误,需要除以lattice factor.(原版的ASE是默认为1).而 direct 的输出是没有问题的,因为在读入时,Direct 坐标乘以cell(lattice factor * cell_original), Cartesian 坐标乘以 lattice factor.

10/09 2024.

  • 完善了拉伸薄膜的stretch.py中关于三维拉伸 list 的应用,扩展了针对 a1, a2, a3 轴的拉伸 - 现在可用于固定体积的拉伸(bulk/film)。
  • stretch.py中添加了关于拉伸前后盒子尺寸的变化,以及如何改变以实现体积恒定。
  • 另外generate_film方法无法对HCP结构生成 cubic 形状,这不影响切面。

09/21 2024.

  • Take the ase/build/supercell.py/get_deviation_from_optimal_cell_shape() find_optimal_cell_shape() function to find_cubic.py

09/20 2024.

  • Add the docstring on the strtch.py

09/19 2024.

  • add functions build/film/hydroxyl/passivate_surface_custom , more general according to the coordination number, integrate the ASE/add_adsorbate function for molecular or other Atoms object.
  • Attach the example of this function.
  • Next:
    • maybe we can control the rotational angle of the molecular, but I think it’s not important.

06/06 2024.

  • add universal/index to transform 3-index to 4-index, reverse is also.
  • to use dxa analysis of ovito package, we need update ovito from 3.9.6 to 3.10.6
  • add universal/plot plot.py, but it didn’t be filled

05/17 2024.

  • fix error about strain matrix mismatch that only considering the mismatch of top layer.
  • change the add_hydroxylated function to more stable, (use Ase/add_adsorbate function) , and every_change tag to get the more complicated model.

04/23 2024.

  • fix the error of hetbuilder command line tool (the weight parameter doesn’t work)

  • using hetbuilder python API to generate the heterostructures and plot.

  • filter the results according to lattice constant mismatch or strain matrix mismatch (more stable and strict). Those two criterion only same when on cubic cell.
  • add the doc file (10%, not full)
  • integrate the function to calulation of continuum mechanics (deformation matrix, strain, von-mises strain, principle strain ...).

before 03/30 2024.

  • add functions (hydroxylated / stretch/ post) and text them, success! Congratulations!
  • Next:
    • add function to [`plot the FBZ`](http://staff.ustc.edu.cn/~zqj/posts/howto-plot-brillouin-zone/)
    • search for the heterostructure contained film and substrate
    • compared `add_hydroxylated function` and [`add_adsorbate`](https://wiki.fysik.dtu.dk/ase/tutorials/db/db.html) function, maybe we can combine them to achieve the goal that adsorb the molecular to substrate. Now we only could adsorb H atom to them.

04/02 2024.

  • Please add the Pymatgen package

Please indicate the source when reprinting. Please verify the citation sources in the article and point out any errors or unclear expressions.