|||
#!perl
#
# Purpose: This script builds a 'correct' methane molecule from scratch
use strict;
use warnings;
use MaterialsScript qw(:all);
#Utility function to create an atom of a specific type in a doc
# Optionally creates a bond to that atom
sub CreateAtom {
# Bond information ($bondTo, $bondType) is optional
my ($doc, $element, $pos, $bondTo, $bondType) = @_;
my $newAtom = $doc->CreateAtom($element, $pos);
# Only build the bond if the bond information is present
if($bondTo && $bondType) {
$doc->CreateBond($newAtom, $bondTo, $bondType);
}
return $newAtom;
}
my $doc = Documents->New("Methane.xsd");
#To demonstrate Forcite Minimization put the H atoms in a planar cross
my $centralC = CreateAtom($doc, "C", Point(X => 1, Y => 1, Z => 1));
CreateAtom($doc, "H", Point(X => 1, Y => 0, Z => 1), $centralC, "Single");
CreateAtom($doc, "H", Point(X => 2, Y => 1, Z => 1), $centralC, "Single");
CreateAtom($doc, "H", Point(X => 1, Y => 2, Z => 1), $centralC, "Single");
CreateAtom($doc, "H", Point(X => 0, Y => 1, Z => 1), $centralC, "Single");
#Minimize the structure
Modules->Forcite->GeometryOptimization->Run($doc);
$doc->Save;
Computes the single point energy of a structure using the CASTEP server.
Applies toCASTEP module
A task object
Using the CASTEP Energy taskRefer to the top-level CASTEP documentation for more details about CASTEP calculations and their settings.
ConfigurationUse ChangeSettings on the CASTEP module, or pass the settings into the Run function. The Energy settings are applicable to all CASTEP tasks. The following settings are specific to the Energy task and fall into 12 categories:
Setting | Default | Values | Description |
---|---|---|---|
Basic settings | |||
TheoryLevel | GGA | LDA GGA HF HF-LDA sX sX-LDA PBE0 B3LYP | The exchange-correlation functional theory level. |
NonLocalFunctional | PBE | PBE RPBE PW91 WC PBESOL | The GGA density functional to use. |
LocalFunctional | CA-PZ | CA-PZ | The LDA density functional to use. |
SpinPolarized | No | No Yes | If "Yes" different wavefunctions for different spins will be used. If "No" the same orbitals for alpha and beta spins are used. |
UseFormalSpin | Yes | No Yes | If "Yes" the initial value for the number of unpaired electrons for each atom will be taken from the formal spin specified for each atom. |
UseLDAU | No | No Yes | If "Yes" the LDA+U formalism will be used. |
UseDFTD | No | No Yes | If "Yes" the DFT-D correction will be used. |
DFTDMethod | TS | OBS TS Grimme | The preferred DFT-D correction method to use (if the method is not supported by the exchange-correlation functional default method for the functional will be used). |
UseCoreHoles | No | No Yes | If "Yes" core holes will be included in the calculation. |
Charge | 0 | −9999 to 9999 | The total charge on the unit cell. |
Quality | Medium | Express Coarse Medium Fine Ultra-fine | The overall quality of the calculation. This should be the first setting modified as changing the quality will modify all quality dependent settings. |
UseInsulatorDerivation | No | No Yes | Use coarser setting for insulators. |
SCFMinimizationAlgorithm | Density Mixing | Density Mixing All Bands/EDFT | The electronic minimization method to be used for the SCF calculation. |
UseBasisCorrection | Smart | Smart Always Never | The finite basis set correction used in the evaluation of energy and stress. If "Smart" the correction is only applied when stress is required. |
Smearing | 0.1 | 0.01 to 10.0 | The electronic broadening width to use in a variable occupancy calculation. |
Pseudopotentials | Ultrasoft | Ultrasoft Norm-conserving On the fly | The type of pseudopotential to be used. "Ultrasoft" is preferred, "Norm-conserving" may be computationally expensive, and "On the fly" is required for calculation of NMR properties. |
InitialSpin | 0 | −9999 to 9999 | The initial value for the number of unpaired electrons in a spin-polarized calculation. This starting value will be subsequently optimized during the calculation. |
OptimizeTotalSpin | Yes | No Yes | If "Yes" the total spin will be varied for the current SCF state with variable occupancy. |
FixOccupancy | Yes | No Yes | If "Yes" the electronic occupation numbers will be fixed during electronic minimization. Only the lowest occupied states will be included in the calculation. |
DensityMixingScheme | Pulay | Linear Kerker Pulay Broyden | The method used for mixing the input densities and output densities from the current iteration to obtain the input density for the next iteration in the solution for the SCF. |
EmptyBands | 20 | 0 to 9999 | The number of additional bands to be included in an electronic minimization as a percentage of the number of occupied bands. |
AdjustSymmetry | No | No Yes | If "Yes" the symmetry of the system will be increased or decreased automatically according to the type of calculation. |
K-mesh setup | |||
KPointOverallQuality | Medium | Gamma Coarse Medium Fine | Quality of k-point grid, combined with derivation rules. |
KPointDerivation | Quality | Quality Separation Gamma ustomGrid | How the k-point grid is derived. |
KPointQuality | Medium | Coarse Medium Fine | Quality of k-point grid. |
KPointSeparation | 0.05 | 0.001 to 10.0 | k-point separation (1/Å). |
OriginA | 0.0 | −0.5 to 0.5 | k-point grid offset along a-axis. |
OriginC | 0.0 | −0.5 to 0.5 | k-point grid offset along c-axis. |
OriginB | 0.0 | −0.5 to 0.5 | k-point grid offset along b-axis. |
ParameterA | 4 | 1 to 50 | k-point grid parameter along a-axis. |
ParameterB | 4 | 1 to 50 | k-point grid parameter along b-axis. |
ParameterC | 4 | 1 to 50 | k-point grid parameter along c-axis. |
Detailed electronic settings | |||
EnergyCutoffQuality | Medium | Coarse Medium Fine Ultra-fine | The precision used for the plane wave basis set. |
UseCustomEnergyCutoff | No | No Yes | If "Yes" a custom value for the EnergyCutoff can be used. |
EnergyCutoff | 250.0 | 10.0 to 99999.0 | A custom value for the plane-wave energy cutoff for wavefunction basis. Only available when UseCustomEnergyCutoff => "Yes". |
MaximumSCFCycles | 100 | 1 to 9999 | The maximum number of SCF cycles. |
EnergyTolerancesScope | Atom | Atom Cell | If "Atom" energy convergence tolerances are used per atom, otherwise the energy convergence tolerances per cell are used. |
SCFConvergence | 2.0E-6 | >1.0E-14 | The SCF convergence tolerance per atom, used only if EnergyTolerancesScope => "Atom". |
SCFConvergencePerCell | 0.0001 | >1.0E-14 | The SCF convergence tolerance per cell, used only EnergyTolerancesScope => "Cell". |
ElectronicConvergenceWindow | 3 | 2 to 5 | Convergence tolerance window for SCF. |
PseudopotentialRepresentation | Reciprocal Space | Reciprocal Space Real Space | The representation of pseudopotentials. |
RealSpaceTransformEnergy | 250.0 | 10.0 to 99999.0 | The energy cutoff for real-space transformation of pseudopotentials. |
UseCustomRealSpaceTransformEnergy | No | No Yes | If "Yes" a value for the cutoff of the real space transformation energy can be specified by RealSpaceTransformEnergy. |
RealSpaceQuality | Medium | Coarse Medium Fine | The tolerance for the transformation. |
FFTQuality | Standard | Standard Fine Precise | The quality of the FFT grid. |
FFTFineGrid | 1.0 | ≤4.0 | The quality of the augmented FFT grid. |
BasisSetCorrectionMode | Automatic | Automatic Manual | The method for calculating the finite basis set correction. |
NumBasisPoints | 3 | 2 to 9 | The number of energy points to use in evaluating the energy derivative required for the finite basis set correction. A converged SCF energy will be evaluated at each point. |
BasisSetEnergyDerivative | 0.0 | ≤0.0 | The value of the energy derivative required for the finite basis set correction when BasisSetCorrectionMode => "Manual". |
TotalSpinOptimizationDelay | 6 | 1 to 99 | The number of SCF iterations for which the total electronic spin will remain fixed before being allowed to vary. |
ImposeRealSpaceTransformTolerance | Yes | No Yes | If "Yes" the real space pseudopotential transformation will have the quality set by RealSpaceQuality imposed. |
DIISHistory | 20 | 1 to 50 | The number of previous iterations to be considered in the DIIS for the Pulay or Broyden density mixing method. Only used when DensityMixingScheme => "Broyden" or "Pulay". |
DensityMixingAmplitude | 0.5 | 0.001 to 1.0 | The amplitude of the output density to mix with the input density to obtain input for the next iteration. |
DensityMixingCutoff | 1.5 | 0.01 to 100.0 | Density mixing is reduced for Fourier coefficients at reciprocal lattice vectors less than this value. |
SpinMixingCutoff | 1.5 | 0.01 to 100.0 | Spin mixing is reduced for Fourier coefficients at reciprocal lattice vectors less than about this value. Only used when DensityMixingScheme => "Broyden", "Kerker", or "Pulay". |
SpinMixingAmplitude | 2.0 | 0.001 to 10.0 | The amplitude of the output spin density to mix with the input spin density to obtain input for the next iteration. Only used when SpinPolarized => "Yes". |
RuntimeOptimization | Default | Default Memory Speed | The strategy used to balance memory use and speed during the calculation. |
General property calculations | |||
CalculateCharge | None | None Mulliken Hirshfeld | Calculate and assign Mulliken or Hirshfeld atomic charges. |
CalculateSpin | None | None Mulliken Hirshfeld | Calculate and assign Mulliken or Hirshfeld spins. |
CalculateBondOrder | None | None Mulliken | Calculate and assign Mulliken bond orders. |
CalculateStress | No | No Yes | Calculates the stress tensor. |
BondPopulationCutoff | 3.0 | >0.01 | The maximum interatomic distance, in Å, to be considered in the bond population calculations. |
General K-mesh setup for property calculations | |||
PropertiesKPointQuality | Medium | Coarse Medium Fine | Quality of k(q)-point grid to be used for all properties calculations requested (BandStructure, PhononDispersion, DOS, CalculatePhononDOS, Optics, CoreLevelSpectrum). |
PropertiesKPointSeparation | 0.05 | 0.001 to 10.0 | k(q)-point separation (1/Å) to be used for all properties calculations requested (BandStructure, PhononDispersion, DOS, CalculatePhononDOS, Optics, CoreLevelSpectrum). |
Phonon calculation properties | |||
CalculatePolarizability | None | None Crystal Molecule Linear | Calculate Polarizability. |
CalculatePhononDOS | None | None Full Partial | Calculate and plot phonon Full/Partial DOS. |
CalculatePhononDispersion | None | None Dispersion DispersionAndDos | Calculate and plot phonon dispersion. |
CalculateThermodynamics | None | None Full | Calculate and plot thermodynamic properties with the Debye temperature. |
PolarizabilityConvergence | 1.0E-5 | >1.0E-9 | The convergence criterion, in Å3, for the second-order response to the electric fields during a polarizability run. |
PhononMethod | Linear response | Linear response Finite displacement | The technique to be used to calculate phonon frequencies. |
PhononRcut | 5.0 | 0.0 to 100.0 | The real space cutoff radius, in Å, for dynamical matrix calculations. |
PhononUseInterpolation | Yes | No Yes | If "Yes" the real space dynamical matrix will be calculated using the Monkhorst-Pack mesh defined by the separation parameter. |
PhononInterpolationSpacing | 0.05 | 0.01 to 10.0 | The q-point separation parameter, in Å-1, which represents the average distance between Monkhorst-Pack mesh q-points used in the real space dynamical matrix calculations. |
PhononDOSCalcLOTO | Yes | No Yes | If "Yes" a non-analytical correction to the dynamical matrix will be applied. The LO-TO phonon frequency splitting at the G-point will be calculated for phonon DOS calculations. |
PhononDOSConvergence | 1.0E-5 | >1.0E-9 | The convergence criterion, in eV Å-2, for the electronic eigenvalues during a phonon DOS run. |
PhononDispCalcLOTO | Yes | No Yes | If "Yes" a non-analytical correction to the dynamical matrix will be applied. The LO-TO phonon frequency splitting at the G-point will be calculated for phonon dispersion calculations. |
PhononDispConvergence | 1.0E-5 | >1.0E-9 | The convergence criterion, in eV Å-2, for the electronic eigenvalues during a phonon dispersion run. |
ImportHessian | No | No Yes | Imports the Hessian (Dynamical matrix for G-point). |
PhononDOSNormalization | 1 | 1 3N | The normalization style for phonon DOS. |
PhononDOSInterpolationBroadening | 0.05 | 0.001 to 100 | The instrumental broadening effects (in THz). |
PhononDOSIntegrationMethod | Smearing | Smearing Interpolation | The preferred method for DOS generation. |
PhononDOSSmearingWidth | 0.1 | 0.001 to 100 | The width of Gaussian smearing (in THz). |
PhononDOSInterpolationAccuracy | Coarse | Coarse Medium Fine | The required interpolation accuracy. |
PhononUnits | THz | meV THz cm-1 | The frequency units to be used for the phonon dispersion graph. |
PhononDispersionLineStyle | Line | Points Line | The line style for phonon dispersion graphs. |
StartTemperature | 5.0 | >0.1 | The lower limit for the temperature scale for plotting thermodynamics. |
EndTemperature | 1000.0 | >0.1 | The upper limit for the temperature scale for plotting thermodynamics. |
DOS and band structure properties | |||
CalculateBandStructure | None | None Dispersion DispersionAndDos | Calculate and plot dispersion. |
BandStructureNumExtraBands | 12 | 0 to 999 | The number of additional bands to use in eigenvalue calculation. |
BandStructureEnergyTolerance | 1.0E-5 | >1.0E-8 | The convergence criterion for electronic eigenvalues during the band structure calculation. |
BandStructureUseNewXC | No | No Yes | If "Yes" a different exchange-correlation functional is used for the band structure calculation. |
BandStructureTheoryLevel | GGA | LDA GGA HF HF-LDA sX sX-LDA PBE0 B3LYP | The exchange-correlation functional theory level to use for the band structure calculation. |
BandStructureLocalFunctional | CA-PZ | CA-PZ | The LDA density functional to use for the band structure calculation. |
BandStructureNonLocalFunctional | PBE | PBE RPBE PW91 WC PBESOL | The GGA density functional to use for the band structure calculation. |
BandStructureLineStyle | Line | Points Line | The line style for band graphs. |
CalculateDOS | None | None Full Partial | Calculate and plot Full/Partial DOS. |
DOSNumExtraBands | 12 | 0 to 999 | The number of additional bands to use in eigenvalue calculation. |
DOSEnergyTolerance | 1.0E-5 | >1.0E-8 | The convergence criterion for electronic eigenvalues during the DOS calculation. |
DOSUseNewXC | No | No Yes | If "Yes" a different exchange-correlation functional is used for the band structure calculation. |
DOSTheoryLevel | GGA | LDA GGA HF HF-LDA sX sX-LDA PBE0 B3LYP | The exchange-correlation functional theory level to use for the DOS calculation. |
DOSLocalFunctional | CA-PZ | CA-PZ | The LDA density functional to use for the DOS calculation. |
DOSNonLocalFunctional | PBE | PBE RPBE PW91 WC PBESOL | The GGA density functional to use for the DOS calculation. |
DOSInterpolationBroadening | 0.05 | 0.0 to 100 | The instrumental broadening effects (in eV). |
DOSPreferredIntegrationMethod | Smearing | Smearing Interpolation | The preferred method for DOS generation. |
DOSSpinDisplay | Total | Total Alpha Beta Alpha and Beta Spin Total and Spin | The type of DOS to plot. |
DOSorTOS | DOS | DOS Integrated DOS | Whether to plot DOS or Integrated DOS (Number of States). |
DOSSmearingWidth | 0.2 | 0.005 to 100 | The width of Gaussian smearing (in eV). |
DOSInterpolationAccuracy | Coarse | Coarse Medium Fine | The required interpolation accuracy. |
PartialS | Yes | No Yes | If "Yes" includes the S angular momentum term of the partial DOS. |
PartialP | Yes | No Yes | If "Yes" includes the P angular momentum term of the partial DOS. |
PartialD | Yes | No Yes | If "Yes" includes the D angular momentum term of the partial DOS. |
PartialF | Yes | No Yes | If "Yes" includes the F angular momentum term of the partial DOS. |
PartialSum | Yes | No Yes | If "Yes" includes the sum of angular momentum terms of the partial DOS. |
NMR properties | |||
CalculateNMR | None | None Crystal Molecule | Calculate and assign NMR shielding and electric field gradients. |
NMRCalculation | Shielding and EFG | Shielding EFG Shielding and EFG | The type of NMR properties calculated. |
NMRMaxSteps | 250 | 1 to 999 | The maximum number of conjugate gradient steps taken for each electronic band in the electronic minimizer during an NMR calculation. |
Optical properties | |||
CalculateOptics | None | None Full | Calculate and plot various optical properties. |
OpticsNumExtraBands | 12 | 1 to 999 | The number of additional bands to use in eigenvalue calculation. |
OpticalEnergyTolerance | 1.0E-5 | >1.0E-8 | The convergence criterion for electronic eigenvalues during the optical properties calculation. |
OpticsUseNewXC | No | No Yes | If "Yes" a different exchange-correlation functional is used for the optical properties calculation. |
OpticsTheoryLevel | GGA | LDA GGA HF HF-LDA sX sX-LDA PBE0 B3LYP | The exchange-correlation functional theory level to use for the optical properties calculation. |
OpticsNonLocalFunctional | PBE | PBE RPBE PW91 WC PBESOL | The GGA density functional to use for the optical properties calculation. |
OpticsLocalFunctional | CA-PZ | CA-PZ | The LDA density functional to use for the optical properties calculation. |
ScissorsOperator | 0.0 | >0.0 | The scissors operator to be used in plotting the band structure for insulators. |
OpticsSmearing | 0.5 | >0.0001 | The Gaussian broadening to be used for calculating the dielectric function. |
OpticsGeometry | Polarized | Polarized Unpolarized Polycrystalline | the type of optical properties calculation. |
PlasmaFrequency | 0.0 | >0.0 | The Omg plasma value required to calculate the Drude term. |
DrudeDamping | 0.05 | 0.0001 to 10 | The lifetime broadening value required to calculate the Drude term. |
OpticsUnits | eV | eV nm cm-1 | The frequency units used for the display of optical properties. |
Polarization1 | 1.0 | First coordinate of the polarization (or incident direction) vector. | |
Polarization2 | 0.0 | Second coordinate of the polarization (or incident direction) vector. | |
Polarization3 | 0.0 | Third coordinate of the polarization (or incident direction) vector. | |
Core Level Spectroscopy properties | |||
CalculateCoreLevelSpectrum | None | None Absorption Emission | Calculate and plot core level spectra of the chosen type. |
EELSEmax | 25 | 0.0 to 100.0 | The energy limit above the Fermi level for which core level spectra will be calculated. |
EELSEnergyTolerance | 1.0E-5 | >1.0E-8 | The convergence criterion for electronic eigenvalues during the core level spectra calculation. |
EELSSpectrum | 1s | 1s 2s ... 4d | The core level. |
EELSUseSpinOrbit | Yes | No Yes | If "Yes" spin-orbit splitting for the core level is added to the spectrum. |
EELSBroadening | 0.2 | 0.02 to 10.0 | The Gaussian broadening from the instrument to be used. |
EELSUseLifetime | Yes | No Yes | If "Yes" lifetime broadening effects will be taken into account. |
EELSCalculation | Unpolarized | Polarized Unpolarized | The polarization of the incident radiation for the core level spectroscopy calculation. |
EELSPolarization1 | 1.0 | The direction of the polarization of the incident radiation in fractional (lattice) coordinates. Only available when EELSCalculation => "Polarized". | |
EELSPolarization2 | 0.0 | The direction of the polarization of the incident radiation in fractional (lattice) coordinates. Only available when EELSCalculation => "Polarized". | |
EELSPolarization3 | 0.0 | The direction of the polarization of the incident radiation in fractional (lattice) coordinates. Only available when EELSCalculation => "Polarized". | |
Raman properties | |||
CalculateRaman | None | None Activity Intensity | Calculate and plot Raman intensity. |
RamanUnits | cm-1 | meV THz cm-1 | The units for the X axis of the spectrum. |
RamanSmearing | 10.0 | 0.1 to 100.0 | The Gaussian broadening to be used in cm-1. |
RamanWaveLength | 514.5 | 0.001 to 1000000. | The incident light wavelength in nm when CalculateRaman => "Intensity". |
RamanTemperature | 10.0 | 0.1 to 10000.0 | The temperature in K when CalculateRaman => "Activity". |
RamanInverseEnergy | No | No Yes | If "Yes" the values on the X axis (energy) will decrease from right to left. |
RamanInverseIntensity | No | No Yes | If "Yes" the values on the Y axis (intensity) will decrease from bottom to top. |
Import fields | |||
CalculateChargeDensity | None | None Field FieldAndIsosurface | Calculate Charge Density and import results. |
CalculateSpinDensity | None | None Field FieldAndIsosurface | Calculate Spin Density and import results. |
CalculateDensityDifference | None | None Field FieldAndIsosurface | Calculate Density Difference and import results. |
CalculatePotential | None | None Field FieldAndIsosurface | Calculate Potential and import results. |
CalculateSTMprofile | None | None Field FieldAndIsosurface | Calculate STM profile and import results. |
CalculateELF | None | None Field FieldAndIsosurface | Calculate ELF and import results. |
Import Fermi Surface | |||
ImportFermiSurface | No | No Yes | If "Yes" all the sheets of Fermi surface will be imported in the document. |
The calculation is started using the Run function on this task.
ExamplesThe following example shows how to run an Energy calculation on the document NaCl.xsd with coarse quality.
my $doc = $Documents{"NaCl.xsd"}; my $outputData = Modules->CASTEP->Energy->Run($doc, Settings(Quality => "Coarse" ) ); See alsoRun
Modules collection
CASTEP module
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-9-15 23:20
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社