XtalsPyTools.jl

Xtals is a pure-Julia package, but we have also written some high-level tools with it that depend on Python packages. These additional methods are found in XtalsPyTools.jl.

Long-term, we would like refactor these tools to depend only on Julia packages, and fold them back in to Xtals.jl. Please open an issue or make a pull request if you know how this can be done at present!

Installation

To gain access to these tools, add the package in the REPL package manager:

pkg> add XtalsPyTools

The methods in this package require scipy and/or pymatgen to be installed. To configure these dependencies automatically in a Julia-managed environment, use the quick_setup.jl script:

julia quick_setup.jl

Advanced Bond Inference

In addition to the infer_bonds! function, there is the infer_geometry_based_bonds! function, which uses scipy to compute the Voronoi tesselation of the atoms in a crystal. Bonds will then only be inferred between atoms which occupy neighboring Voronoi cells.

Finding the Primitive Unit Cell

Many crystal structures found in databases are not the minimal representation, a.k.a. primitive unit cell. The primitive cell can be obtained easily by calling primitive_cell. This function requires the pymatgen python dependency.

XtalsPyTools.infer_geometry_based_bonds!Function
infer_geometry_based_bonds!(crystal, include_bonds_across_periodic_boundaries::Bool)

Infers bonds by first finding which atoms share a Voronoi face, and then bond the atoms if the distance between them is less than the sum of the covalent radius of the two atoms (plus a tolerance).

Arguments

  • crystal::Crystal: The crystal structure
  • include_bonds_across_periodic_boundaries::Bool: Whether to check across the periodic boundaries
  • r::Float: voronoi radius, Å
  • pad::Float: amount to pad covalent radii, Å
  • covalent_radii::Dict{Symbol,Float64}: See covalent_radii
XtalsPyTools.primitive_cellFunction
```prim = primitive_cell(xtal)```

Returns the minimal representation (primitive unit cell) of a crystal structure.