wavecar_rs

Crates.iowavecar_rs
lib.rswavecar_rs
version0.1.0
sourcesrc
created_at2020-08-24 14:34:41.231122
updated_at2020-08-24 14:34:41.231122
descriptionA lib to manipulate VASP's WAVECAR
homepagehttps://github.com/Ionizing/wavecar_rs
repositoryhttps://github.com/Ionizing/Wavecar_rs
max_upload_size
id280147
size81,956
Ionizing (Ionizing)

documentation

README

wavecar_rs

Rust

A crate to manipulate wavefunction from VASP WAVECAR.

Example

use wavecar_rs::*;
use vaspchg_rs::ChgType;
use vasp_poscar::Poscar;

fn main() -> io::Result<()> {
    let mut wavecar = Wavecar::from_file("WAVECAR")?;
    // if your calculation is done via vasp5.2.x or lower in parallel
    // you need to set the wavecar type
    // wavecar.set_wavecar_type(WavecarType::GammaHalf(GammaHalfDirection::Z));

    let poscar = Poscar::from_path("POSCAR").unwrap();
    wavecar.get_wavefunction_in_realspace_default_grid(0, 0, 5)
        .unwrap()
        .apply_phase(&[0.5f64, 0.5, 0.5])
        .into_vesta_obj(&poscar)
        .write_file("wfc_xx.vasp", ChgType::Parchg)
        .unwrap();
    Ok(())
}

Features

  • Get the meta information of WAVECAR;

  • Transform wavefunction from k-spake into real-space;

  • Save the wavefunction as CHGCAR format to visualize the spatial distribution;

  • Apply phase on the wavefunction to get full bloch waves;

Acknowledgement

Commit count: 48

cargo fmt