CastepReader.Orbitals
— ModuleModule for electronic Enum types
CastepReader.CastepBin.deduplicate_keys
— MethodDeduplicate keys by appending a suffix
CastepReader.CastepBin.gototag
— MethodSeek to a tag and be read to read in the data following it
CastepReader.CastepBin.locate_tags
— MethodScan the binary file for tags
CastepReader.CastepBin.read_castep_check
— MethodREAD RAW data from CASTEP binary file
Expect everyting to be in the atomic units Atoms are indexed by (species, index in specie)
CastepReader.CastepBin.read_cell!
— Methodread_cell!(output, f::FortranFile, tags::Dict{String,Int})
Read in the unit cell information. Note that the data is taken from the second set which stores the current cell, e.g. consistent with the wavefunction data stored.
CastepReader.CastepBin.read_charge_density!
— MethodRead the charge density section from the binary file
NOTE: only support linear spin-polarisation for now
CastepReader.CastepBin.read_eigenvalue_and_occ!
— MethodRead eigenvalues and occupations
CastepReader.CastepBin.read_forces!
— MethodRead the forces
CastepReader.CastepBin.read_parameters_electronic!
— Methodread_parameters_electronic(output, f::FortranFile, tags::Dict{String, Int})
Read the data store after BEGIN_ELECTRONIC
header. These are internal parameters used by CASTEP. There are duplicated entries in the same section as some of the field are written as different types for backward compatibility.
CastepReader.CastepBin.record_tag!
— Methodrecord_tag!(out::Dict{String,Int}, rec;offset::Int)
Record the positions of eligible records
CastepReader.CastepBin.skiptag
— MethodSkip to the next tag
CastepReader.CastepBin.update_wavefunction!
— MethodRead the grid properties but update the plane wave coefficients as given
CastepReader.CastepBin.update_wavefunction!
— Methodupdate_wavefunction(fname, coeffs::AbstractArray{T, 5}) where {T}
Update the wavefunction (coefficients) stored in the check file. The coefficients array passed should be modified based on that was originally read from the file.
- NOTE this function will overwrite target file.
CastepReader.CastepBin.update_wavefunction
— Methodupdate_wavefunction(src, dst, coeffs::AbstractArray{T, 5}) where {T}
Update the wavefunction (coefficients) stored in the check file. The coefficients array passed should be modified based on that was originally read from the file.
CastepReader.CastepBin.write_wavefunction_complex!
— MethodWrite the wavefunction coefficients back to the file
CastepReader.CastepBin.@readtag
— MacroMacro for compact representation of how data should read from the binary file
For example, the following definition:
@readtag f outdict tags begin
CELL_VERSION_NUMBER
VERSION_NUMBER::Float64
skip
X::(Float64, :B)
end
expands into to:
if "CELL_VERSION_NUMBER" in keys(tags)
gototag("CELL_VERSION_NUMBER", f, tags)
output[:VERSION_NUMBER] = read(f, Float64)
skiptag(f)
output[:X] = read(f, outdict[:B])
end
Note that tags that are not present will simply be skipped.
CastepReader.Bohr2Ang
— ConstantFactor to convert Bohr to Å
CastepReader.Ha2eV
— ConstantFactor to convert Hatree to eV
CastepReader.CastepInFile
— TypeType for CASTEP input file
CastepReader.ChargeDensity
— TypeChargeDensity(density)
Construction from a density array.
CastepReader.ChargeDensity
— MethodChargeDensity(ngx, ngy, ngz)
Construction an empty ChargeDensity.
CastepReader.WaveFunction
— TypeType for storing a wavefunction
CastepReader.WaveFunction
— MethodWaveFunction(data_dict::Dict)
Construct the WaveFunction from a Dict of read data from castep_bin/check file
AbstractFFTs.fft!
— MethodFFTW.fft!(wavef::WaveFunction)
In place FFT to transfer the wavefunction to the frequency space
The in-place transformation is apply slice by slice
AbstractFFTs.fft
— Methodfft(wavef::WaveFunction)
FFT to transfer the wavefunction to the frequency space
AbstractFFTs.ifft!
— MethodIn place FFT to transfer the wavefunction to the real space
The in-place transformation is apply slice by slice
AbstractFFTs.ifft
— Methodfft(wavef::WaveFunction)
FFT to transfer the wavefunction to the frequency space
Base.getindex
— MethodAllow access fields by c[:xx] notation
CastepReader.CastepBin.update_wavefunction
— FunctionUpdate wavefunction of an existing file
CastepReader.CastepBin.update_wavefunction!
— FunctionUpdate wavefunction of an existing file
CastepReader.Chgcar.write_chgcar
— MethodCastepReader.chargedensity
— Methodchargedensity(wavef::WaveFunction, kidx, bidx, sidx)
Construct charge density for given kpoints, band, and spin indices
CastepReader.chargedensity
— Methodchargedensity(wavef::WaveFunction, ib, ik, is)
Get the charge density for a single slice of band, kpoint, spin channel
CastepReader.chargedensity
— Methodchargedensity(wavef::WaveFunction)
Compute charge density from the wavefunction
Note that the density does not include the augmentation charges involved in ultrasoft pseudopotentials
CastepReader.clean_cell_lines
— MethodClean lines by removing new line symbols and comments
CastepReader.coeff_to_recip
— Methodcoeff_to_recip(coeff_array, nwaves_at_kp, grid_coords, ngx, ngy, ngz)
Convert planewave coefficients in the reduced representation to grids
CastepReader.coeff_to_recip
— Methodcoeff_to_recip(coeff_array, data_dict::Dict)
Convert plane wave coefficients to a reciprocal space grid.
CastepReader.coord_to_indices
— MethodConvert G-vector coordinates (unit of reciprocal lattice basis) to 1-based grid indices
CastepReader.copy_density
— MethodCopy density from a temporary array in to the spin channel
CastepReader.copy_density
— MethodCopy density from a temporary array in to the spin channel
CastepReader.filename
— MethodName of the file
CastepReader.fine_grid_interpolate
— MethodInterpolate charge density from c1
into c2
with a finner grid
CastepReader.m_channel_mask
— MethodGet an masking for the m channels inferred from the repeated appearance of l channels
CASTEP does not write the m channel labels explicity, but they can be inferred from repeated l channels. This assumes that l channels of the same atom is written consecutively, which seem to be the case.
CastepReader.pdos_index_by_site
— MethodReorder the PDOS information
Return a dictionary which can be used as
output = pdos_index_by_site(pdos_data)
idx = output[1][Orbitals.s] # Index of the s orbital in the pdos_data.weights
weights = pdos_data.pdos_weights[idx, :, :, :] # Slice the weight array to obtain the weigths for this site/am combination
CastepReader.read_bands_castep_raw
— MethodRead the bands file
The bands file contains the eigenvalues of the
Arguments
- reorder: If true, recover the orignial kpoint orders as defined in the cell file. Note that the
order of kpoint in other quantities, such as the optical matrix, are the same as they appear in the bands file rather than following the internal "counter".
CastepReader.read_bands_header
— MethodRead the header for the bands file
CastepReader.read_cell_castep
— MethodRead in CASTEP's cell/param files
CastepReader.read_cst_ome
— MethodRead the cst_ome file with given number of bands, kpoints, and spins
CastepReader.read_cst_ome
— Methodread_cst_ome(seed;)
Read the <seed>.cst_ome
file, requires <seed>.bands
file to be present.
CastepReader.read_lattice
— MethodRead out the lattice from the input file
CastepReader.read_om_castep
— Methodread_om_castep(ome_file, nb, nk, ns;endian="big-endian", legacy_format=false)
Read optical matrix element for CASTEP
CastepReader.read_om_castep
— Methodread_om_castep(seed; endian="big-endian", legacy_format=false)
Read optical matrix element given a CASTEP seed name.
CastepReader.read_ome_bin
— MethodRead the ome_bin file
CastepReader.read_ome_bin
— Methodread_ome_bin(seed; legacy_format=false)
Read the <seed>.ome_bin
file, requires <seed>.bands
file to be present.
CastepReader.read_pdos_bin
— Methodread_pdos_bin(fname::AbstractString)
Read the pdos_bin
file.
CastepReader.read_pdos_bin
— Methodread_pdos_bin(f::FortranFile)
Read the pdos_bin
file.
Args:
legacy_format
: Read from file with legacy format, e.g. without the version number and header.
CastepReader.read_symm_disp
— MethodRead in the symmetry operations
Returns matrix of the rotations and that for the displacements
CastepReader.recip_to_coeff
— MethodConvert full grid representation back to reciprocal coefficients The original specifications of the wave function needs to be reused
CastepReader.stem
— MethodPart of the file exclude the suffix
CastepReader.suffix
— MethodSuffix of the file
CastepReader.wavefunction
— MethodLoad wavefunction using data read from the checkpoint file.
Returns the reciprocal representation on the grids. Needs to be FFTed to get to the real space representation.
CastepReader.weighted_density_by_bands
— MethodComputed weighted density from some given weights by bands
CastepReader.Chgcar.ffloat
— MethodEnumerate fortran float where a leading zero is written
CastepReader.Chgcar.write_chgcar
— MethodWrite out a CHGCAR file with
CastepReader.Chgcar.write_data
— MethodWrite the volumetric data block of the CHGCAR file