#chemistry #castep #table #element #periodic #properties #database

castep-periodic-table

Periodic-table-like database for relevant usage in CASTEP

11 unstable releases (4 breaking)

0.5.2 Dec 10, 2024
0.5.1 Jun 20, 2024
0.4.0 May 21, 2024
0.3.2 Apr 25, 2024
0.1.0 Nov 4, 2022

#93 in Science

Download history 4/week @ 2024-09-14 59/week @ 2024-09-21 8/week @ 2024-09-28 28/week @ 2024-10-12 6/week @ 2024-10-19 32/week @ 2024-11-02 2/week @ 2024-11-09 6/week @ 2024-11-16 10/week @ 2024-11-23 7/week @ 2024-11-30 164/week @ 2024-12-07 21/week @ 2024-12-14 3/week @ 2024-12-21

188 downloads per month
Used in 12 crates (10 directly)

MIT license

60KB
2K SLoC

castep-periodic-table

A periodic table for use in CASTEP, written in rust.

Properties

Example Element:

Element {
    symbol: "C",
    atomic_number: 6_u8,
    lcao: 2_u8,
    mass: 12.0109996796,
    potential: "C_00PBE.usp",
    spin: 0_u8,
}

Usage

extern crate castep_periodic_table as cpt;
use cpt::element::Element;
use cpt::data::ELEMENT_TABLE;
// Lookup element "Co" by symbol
let cobalt: &Element = ELEMENT_TABLE.get_by_symbol("Co").unwrap();
// Lookup element by atomic_number
let oxygen = ELEMENT_TABLE.get_by_atomic_number(8_u8).unwrap();
// Get fields
let lcao_cobalt: u8 = cobalt.lcao();
let mass_cobalt: f64 = cobalt.mass();
let spin: u8 = cobalt.spin();
let potential: &str = cobalt.potential();
// Iterator
// ELEMENT_TABLE.iter()...

Maintainance

Currently the crate only include C, H, O, transition metals and Lanthanides due to personal interest. It can be updated by modifying the element_table.yaml and generate a new data.rs with the provided method in ElementYamlTable.

Dependencies

~1.8–2.6MB
~55K SLoC