Usage

oncvpsp-tools implements the contents of oncvpsp.x input and output files as Python dataclasses. These are documented below

class ONCVPSPInput(atom, reference_configuration, lmax, optimization, local_potential, vkb_projectors, model_core_charge, log_derivative_analysis, output_grid, test_configurations)[source]

Class for the contents of an ONCVPSP input file.

The ONCVPSPInput class is a dataclass that helps a user interact with input files for oncvpsp.x.

Typically, a user will create an ONCVPSPInput object from an input file using the from_file() method, as follows

from oncvpsp_tools import ONCVPSPInput
inp = ONCVPSPInput.from_file("path/to/input.in")

ONCVPSPInput objects – being a dataclass – have the same attributes as the input parameters (listed below). Use these to interact with the contents of the input file.

Parameters:
  • atom (ONCVPSPAtom) – The atom block of the input file

  • reference_configuration (ONCVPSPList[ONCVPSPConfigurationSubshell]) – The reference configuration block of the input file

  • lmax (int) – The lmax block of the input file

  • optimization (ONCVPSPList[ONCVPSPOptimizationChannel]) – The optimization block of the input file

  • local_potential (ONCVPSPLocalPotential) – The local potential block of the input file

  • vkb_projectors (ONCVPSPList[ONCVPSPVKBProjector]) – The VKB projectors block of the input file

  • model_core_charge (ONCVPSPModelCoreCharge) – The model core charge block of the input file

  • log_derivative_analysis (ONCVPSPLogDerivativeAnalysis) – The log derivative analysis block of the input file

  • output_grid (ONCVPSPOutputGrid) – The output grid block of the input file

  • test_configurations (ONCVPSPList[ONCVPSPList[ONCVPSPConfigurationSubshell]]) – The test configurations block of the input file

classmethod from_file(filename)[source]

Create an ONCVPSPInput object from an ONCVPSP input file.

classmethod from_str(txt)[source]

Create an ONCVPSPInput object from a string.

to_str()[source]

Return the text representation of the ONCVPSP input file.

Return type:

str

to_file(filename)[source]

Write the ONCVPSP input file to disk.

run(oncvpsp_command='oncvpso.x')[source]

Run the ONCVPSP executable and return the output.

class ONCVPSPOutput(content, input, semilocal_ion_pseudopotentials, local_pseudopotential, charge_densities, wavefunctions, arctan_log_derivatives, projectors, energy_error)[source]

Class for the contents of an oncvpsp.x output file.

The ONCVPSPOutput class is a dataclass that helps a user interact with output files from oncvpsp.x. Typically, a user will not create a ONCVPSPOutput object directly, but rather use the class method from_file() as follows:

from oncvpsp_tools import ONCVPSPOutput
output = ONCVPSPOutput.from_file("path/to/output")

ONCVPSPOutput objects – being a dataclass – have the same attributes as the input parameters (listed below). Use these to interact with the contents of the output file. For example, to plot the semilocal ion pseudopotentials:

output.semilocal_ion_pseudopotentials.plot()
Parameters:
  • content (str) – the entire content of the output file

  • input (ONCVPSPInput) – the input file used to generate the output

  • semilocal_ion_pseudopotentials (ONCVPSPOutputDataList) – the semilocal ion pseudopotentials

  • local_pseudopotential (ONCVPSPOutputData) – the local pseudopotential

  • charge_densities (ONCVPSPOutputDataList) – the charge densities

  • wavefunctions (ONCVPSPOutputDataList) – the pseudoatomic wavefunctions

  • arctan_log_derivatives (ONCVPSPOutputDataList) – the arctan log derivatives

  • projectors (ONCVPSPOutputDataList) – the projectors

  • energy_error (ONCVPSPOutputDataList) – the energy error

classmethod from_str(content)[source]

Create an ONCVPSPOutput object from a string.

classmethod from_file(filename)[source]

Create an ONCVPSPOutput object from an ONCVPSP output file.

to_str()[source]

Return the contents of the ONCVPSP output file.

Return type:

str

to_file(filename)[source]

Write the contents of the ONCVPSP output file to a file.

Return type:

None

to_upf()[source]

Return the UPF part of the ONCVPSP output file.

Return type:

str