From 5c4167151d1e751aa0c4a6314fc96c332ab6c054 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Tue, 3 Mar 2020 16:10:10 +0000 Subject: [PATCH 01/60] Add charge fitting Add automated charge fitting to defect charge density. Refactors charge model routines to be cleaner and agnostic of cell shape. --- .../gaussian_countercharge.py | 101 +++-- .../model_potential/model_potential.py | 58 ++- .../model_potential/utils.py | 367 +++++++++++++----- .../gaussian_countercharge/utils.py | 76 +++- .../formation_energy/formation_energy_qe.py | 91 ++++- 5 files changed, 542 insertions(+), 151 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 3472bf4..d00501d 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -13,9 +13,7 @@ from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain from .model_potential.model_potential import ModelPotentialWorkchain from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference -from aiida_defects.formation_energy.corrections.gaussian_countercharge.utils import get_total_correction, get_total_alignment - -from .utils import fit_energies, calc_correction +from .utils import get_total_correction, get_total_alignment, get_charge_model_fit, fit_energies, calc_correction class GaussianCounterChargeWorkchain(WorkChain): @@ -29,27 +27,46 @@ class GaussianCounterChargeWorkchain(WorkChain): @classmethod def define(cls, spec): super(GaussianCounterChargeWorkchain, cls).define(spec) - spec.input("v_host", valid_type=orm.ArrayData) - spec.input("v_defect_q0", valid_type=orm.ArrayData) - spec.input("v_defect_q", valid_type=orm.ArrayData) - spec.input("defect_charge", valid_type=orm.Float) + + spec.input("host_structure", + valid_type=orm.StructureData, + help="The structure of the host system") + spec.input("defect_charge", + valid_type=orm.Float, + help="The target defect charge state") spec.input("defect_site", - valid_type=orm.List, - help="Defect site position in crystal coordinates") - spec.input("host_structure", valid_type=orm.StructureData) + valid_type=orm.List, + help="Defect site position in crystal coordinates") spec.input("epsilon", - valid_type=orm.Float, - help="Dielectric constant for the host material") + valid_type=orm.Float, + help="Dielectric constant for the host material") spec.input("model_iterations_required", - valid_type=orm.Int, - default=orm.Int(3)) + valid_type=orm.Int, + default=orm.Int(3), + help="The number of model charge systems to compute. More may improve convergence.") spec.input("cutoff", - valid_type=orm.Float, - default=orm.Float(40.), - help="Plane wave cutoff for electrostatic model") + valid_type=orm.Float, + default=orm.Float(40.), + help="Plane wave cutoff for electrostatic model") + spec.input("v_host", + valid_type=orm.ArrayData, + help="The electrostatic potential of the host system") + spec.input("v_defect_q0", + valid_type=orm.ArrayData, + help="The electrostatic potential of the defect system in the 0 charge state") + spec.input("v_defect_q", + valid_type=orm.ArrayData, + help="The electrostatic potential of the defect system in the target charge state") + spec.input("rho_host", + valid_type=orm.ArrayData, + help="The charge density of the host system") + spec.input("rho_defect_q", + valid_type=orm.ArrayData, + help="The charge density of the defect system in the target charge state") spec.outline( cls.setup, + cls.fit_charge_model, while_(cls.should_run_model)( cls.compute_model_potential, ), @@ -69,24 +86,19 @@ def define(cls, spec): spec.output('electrostatic_correction', valid_type=orm.Float) # spec.output('isolated_energy', valid_type=orm.Float, required=True) # Not sure if anyone would use this # spec.output('model_correction_energies', valid_type=orm.Dict, required=True) # Again, not sure if useful - spec.exit_code( - 401, + spec.exit_code(401, 'ERROR_INVALID_INPUT_ARRAY', message='the input ArrayData object can only contain one array') - spec.exit_code( - 409, + spec.exit_code(409, 'ERROR_SUB_PROCESS_FAILED_ALIGNMENT', message='the electrostatic potentials could not be aligned') - spec.exit_code( - 413, + spec.exit_code(413, 'ERROR_SUB_PROCESS_FAILED_MODEL_POTENTIAL', message='The model electrostatic potential could not be computed') - spec.exit_code( - 410, + spec.exit_code(410, 'ERROR_SUB_PROCESS_FAILED_FINAL_SCF', message='the final scf PwBaseWorkChain sub process failed') - spec.exit_code( - 411, + spec.exit_code(411, 'ERROR_BAD_INPUT_ITERATIONS_REQUIRED', message='The required number of iterations must be at least 3') @@ -129,9 +141,23 @@ def setup(self): # Dict to store correction energies self.ctx.model_correction_energies = {} - return + + def fit_charge_model(self): + """ + Fit an anisotropic gaussian to the charge state electron density + """ + + fit = get_charge_model_fit( + self.inputs.rho_host, + self.inputs.rho_defect_q, + self.inputs.host_structure) + + self.ctx.fitted_params = orm.List(list=fit['fit']) + self.ctx.peak_charge = orm.Float(fit['peak_charge']) + + def should_run_model(self): """ Return whether a model workchain should be run, which is dependant on the number of model energies computed @@ -139,6 +165,7 @@ def should_run_model(self): """ return self.ctx.model_iteration < self.inputs.model_iterations_required + def compute_model_potential(self): """ Compute the potential for the system using a model charge distribution @@ -150,17 +177,20 @@ def compute_model_potential(self): scale_factor.value)) inputs = { + 'peak_charge': self.ctx.peak_charge, 'defect_charge': self.inputs.defect_charge, 'scale_factor': scale_factor, 'host_structure': self.inputs.host_structure, 'defect_site': self.inputs.defect_site, 'cutoff': self.inputs.cutoff, 'epsilon': self.inputs.epsilon, + 'gaussian_params' : self.ctx.fitted_params } workchain_future = self.submit(ModelPotentialWorkchain, **inputs) label = 'model_potential_scale_factor_{}'.format(scale_factor.value) self.to_context(**{label: workchain_future}) + def check_model_potential_workchains(self): """ Check if the model potential alignment workchains have finished correctly. @@ -179,10 +209,9 @@ def check_model_potential_workchains(self): else: if scale_factor == 1: self.ctx.v_model = model_workchain.outputs.model_potential - self.ctx.model_energies[str( - scale_factor)] = model_workchain.outputs.model_energy - self.ctx.model_structures[str( - scale_factor)] = model_workchain.outputs.model_structure + self.ctx.model_energies[str(scale_factor)] = model_workchain.outputs.model_energy + self.ctx.model_structures[str(scale_factor)] = model_workchain.outputs.model_structure + def compute_dft_difference_potential(self): """ @@ -192,6 +221,7 @@ def compute_dft_difference_potential(self): self.inputs.v_defect_q, self.inputs.v_defect_q0) self.out('v_dft_difference', self.ctx.v_defect_q_q0) + def submit_alignment_workchains(self): """ Align the electrostatic potential of the defective material in the q=0 charge @@ -211,13 +241,13 @@ def submit_alignment_workchains(self): inputs = { "first_potential": self.ctx.v_defect_q_q0, "second_potential": self.ctx.v_model, - "interpolate": - orm.Bool(True) # This will more or less always be required + "interpolate": orm.Bool(True) # This will more or less always be required } workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) label = 'workchain_alignment_dft_to_model' self.to_context(**{label: workchain_future}) + def check_alignment_workchains(self): """ Check if the potential alignment workchains have finished correctly. @@ -244,6 +274,7 @@ def check_alignment_workchains(self): else: self.ctx.alignment_dft_to_model = alignment_wc.outputs.alignment_required + def get_isolated_energy(self): """ Fit the calculated model energies and obtain an estimate for the isolated model energy @@ -265,6 +296,7 @@ def get_isolated_energy(self): self.report("The isolated model energy is {} eV".format( self.ctx.isolated_energy.value)) + def get_model_corrections(self): """ Get the energy corrections for each model size @@ -275,6 +307,7 @@ def get_model_corrections(self): self.ctx.model_correction_energies[scale_factor] = calc_correction( self.ctx.isolated_energy, model_energy) + def compute_correction(self): """ Compute the Gaussian Countercharge correction diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index 23551f7..591d164 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -25,16 +25,34 @@ class ModelPotentialWorkchain(WorkChain): @classmethod def define(cls, spec): super(ModelPotentialWorkchain, cls).define(spec) - spec.input('defect_charge', valid_type=orm.Float) - spec.input('scale_factor', valid_type=orm.Int) - spec.input('host_structure', valid_type=orm.StructureData) + spec.input('peak_charge', + valid_type=orm.Float, + help="Peak charge of the defect charge density distribution") + spec.input("defect_charge", + valid_type=orm.Float, + help="The target defect charge state") + spec.input('scale_factor', + valid_type=orm.Int, + help="Scale factor to apply when constructing the model system") + spec.input('host_structure', + valid_type=orm.StructureData, + help="The unscaled host structure") spec.input('defect_site', - valid_type=orm.List, - help="Defect site position in crystal coordinates") - spec.input('cutoff', valid_type=orm.Float, default=orm.Float(40.)) + valid_type=orm.List, + help="Defect site position in crystal coordinates") + spec.input('cutoff', + valid_type=orm.Float, + default=orm.Float(40.), + help="Energy cutoff for grids in Rydberg") spec.input('epsilon', - valid_type=orm.Float, - help="Dielectric constant of the host material") + valid_type=orm.Float, + help="Dielectric constant of the host material") + spec.input('gaussian_params', + valid_type=orm.List, + help="A length 9 list of parameters needed to construct the " + "gaussian charge distribution. The format required is " + "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + spec.outline( cls.setup, cls.get_model_structure, @@ -66,12 +84,13 @@ def get_model_structure(self): self.ctx.model_structure = create_model_structure( self.inputs.host_structure, self.inputs.scale_factor) # Get cell matricies - real_cell = get_cell_matrix(self.ctx.model_structure) - self.ctx.reciprocal_cell = get_reciprocal_cell(real_cell) + self.ctx.real_cell = get_cell_matrix(self.ctx.model_structure) + self.ctx.reciprocal_cell = get_reciprocal_cell(self.ctx.real_cell) self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) limits = np.array(self.ctx.model_structure.cell_lengths) / bohr_to_ang self.ctx.limits = orm.List(list=limits.tolist()) + def compute_model_charge(self): """ Compute the model charge distribution @@ -84,13 +103,16 @@ def compute_model_charge(self): self.ctx.grid_dimensions = get_reciprocal_grid( self.ctx.reciprocal_cell, self.inputs.cutoff.value) + self.ctx.cell_matrix = orm.ArrayData() + self.ctx.cell_matrix.set_array('cell_matrix', self.ctx.real_cell) + self.ctx.charge_model = get_charge_model( - charge=self.inputs.defect_charge, - dimensions=self.ctx.grid_dimensions, - limits=self.ctx.limits, - sigma=orm.Float( - 2.614), #TODO: Automated fitting/3-tuple of sigma values - defect_position=self.inputs.defect_site) + cell_matrix = self.ctx.cell_matrix, + peak_charge = self.inputs.peak_charge, + defect_charge = self.inputs.defect_charge, + dimensions = self.ctx.grid_dimensions, + gaussian_params = self.inputs.gaussian_params + ) def compute_model_potential(self): """ @@ -117,11 +139,11 @@ def compute_energy(self): self.inputs.scale_factor.value)) self.report("DEBUG: type {}".format(type(self.ctx.model_potential))) + self.ctx.model_energy = get_energy( potential=self.ctx.model_potential, charge_density=self.ctx.charge_model, - dimensions=self.ctx.grid_dimensions, - limits=self.ctx.limits) + cell_matrix=self.ctx.cell_matrix) self.report("Calculated model energy: {} eV".format( self.ctx.model_energy.value)) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py index 31cbef7..fa23cd6 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py @@ -9,10 +9,12 @@ import numpy as np from scipy.optimize import curve_fit +from scipy.stats import multivariate_normal + from aiida import orm from aiida.engine import calcfunction -from qe_tools.constants import hartree_to_ev +from qe_tools.constants import hartree_to_ev, bohr_to_ang @@ -43,7 +45,6 @@ def get_cell_matrix(structure): 3x3 cell matrix array in units of Bohr """ - from qe_tools.constants import bohr_to_ang cell_matrix = np.array(structure.cell) / bohr_to_ang # Angstrom to Bohr return cell_matrix @@ -63,9 +64,7 @@ def get_reciprocal_cell(cell_matrix): 3x3 cell matrix array in reciprocal units """ from numpy.linalg import inv - #reciprocal_cell = (inv(cell_matrix)).transpose() - reciprocal_cell = (2 * np.pi * inv(cell_matrix) - ).transpose() # Alternative definition (2pi) + reciprocal_cell = (2 * np.pi * inv(cell_matrix)).transpose() # Alternative definition (2pi) return reciprocal_cell @@ -93,7 +92,7 @@ def get_reciprocal_grid(cell_matrix, cutoff): G_max = 2.0 * np.sqrt(cutoff) # Ry # Get the number of G-vectors needed along each cell vector - # Note, casting to int alway rounds down so we add one + # Note, casting to int always rounds down so we add one grid_max = (G_max / np.linalg.norm(cell_matrix, axis=1)).astype(int) + 1 # For convenience later, ensure the grid is odd valued @@ -101,72 +100,171 @@ def get_reciprocal_grid(cell_matrix, cutoff): if grid_max[axis] % 2 == 0: grid_max[axis] += 1 - return orm.List(list=grid_max.tolist()) + return orm.List(list=grid_max.tolist()) + + +def get_xyz_coords(cell_matrix, dimensions): + """ + For a given array, generate an array of xyz coordinates in the cartesian basis + """ + + # Generate a grid of crystal coordinates + i = np.linspace(0., 1., dimensions[0]) + j = np.linspace(0., 1., dimensions[1]) + k = np.linspace(0., 1., dimensions[2]) + # Generate NxN arrays of crystal coords + iii, jjj, kkk = np.meshgrid(i, j, k, indexing='ij') + # Flatten this to a 3xNN array + ijk_array = np.array([iii.ravel(), jjj.ravel(), kkk.ravel()]) + # Change the crystal basis to a cartesian basis + xyz_array = np.dot(cell_matrix.T, ijk_array) + + return xyz_array + + +def generate_charge_model(cell_matrix, peak_charge): + """ + Return a function to compute a periodic gaussian on a grid. + The returned function can be used for fitting. + + Parameters + ---------- + cell_matrix: 3x3 array + Cell matrix of the real space cell + peak_charge: float + The peak charge density at the centre of the gaussian. + Used for scaling the result. + + Returns + ------- + compute_charge + A function that will compute a periodic gaussian on a grid + for a given cell and peak charge intensity + """ + + def compute_charge( + xyz_real, + x0, y0, z0, + sigma_x, sigma_y, sigma_z, + cov_xy, cov_xz, cov_yz): + """ + For a given system charge, create a model charge distribution using + an anisotropic periodic 3D gaussian. + The charge model for now is a Gaussian. + + NOTE: + The values for sigma and cov are not the values used in construction + of the Gaussian. After the covariance matrix is constructed, its + transpose is multiplied by itself (that is to construct a Gram matrix) + to ensure that it is positive-semidefinite. It is this matrix which is + the real covariance matrix. This transformation is to allow this + function to be used directly by the fitting algorithm without a danger + of crashing. + + Parameters + ---------- + xyz_real: 3xN array + Coordinates to compute the Gaussian for in cartesian coordinates. + x0, y0, z0: float + Center of the Gaussian in crystal coordinates. + sigma_x, sigma_y, sigma_z: float + Spread of the Gaussian (not the real values used, see note above). + cov_xy, cov_xz, cov_yz: float + Covariance values controlling the rotation of the Gaussian + (not the real values used, see note above). + + Returns + ------- + g + Values of the Gaussian computed at all of the desired coordinates and + scaled by the value of charge_integral. + + """ + + # Construct the pseudo-covariance matrix + V = np.array([[sigma_x, cov_xy, cov_xz],[cov_xy, sigma_y, cov_yz], [cov_xz, cov_yz, sigma_z]]) + # Construct the actual covariance matrix in a way that is always positive semi-definite + covar = np.dot(V.T, V) + + gauss_position = np.array([x0, y0, z0]) + + # Apply periodic boundary conditions + g = 0 + for ii in [-1, 0, 1]: + for jj in [-1, 0, 1]: + for kk in [-1, 0, 1]: + # Compute the periodic origin in crystal coordinates + origin_crystal = (gauss_position + np.array([ii, jj, kk])).reshape(3,1) + # Convert this to cartesian coordinates + origin_real = np.dot(cell_matrix.T, origin_crystal) + # Compute the Gaussian centred at this position + g = g + get_gaussian_3d(xyz_real.T, origin_real, covar) + + print("DEBUG: Integrated charge density (unscaled) = {}".format(get_integral(g, cell_matrix))) + + print("DEBUG: g.max() = {}".format(g.max())) + # Scale the result to match the peak charge density + g = g * (peak_charge / g.max()) + print("DEBUG: Peak Charge target = {}".format(peak_charge)) + print("DEBUG: Peak Charge scaled = {}".format(g.max())) + print("DEBUG: Integrated charge density (scaled) = {}".format(get_integral(g, cell_matrix))) + + return g + + return compute_charge @calcfunction -def get_charge_model(limits, - dimensions, - defect_position, - sigma=orm.Float(1.0), - charge=orm.Float(-1.0)): +def get_charge_model(cell_matrix, peak_charge, defect_charge, dimensions, gaussian_params): """ For a given system charge, create a model charge distribution. - The charge model for now is a Gaussian. - Grid = coord grid - TODO: Change of basis - """ - limits = limits.get_list() - dimensions = dimensions.get_list() - defect_position = defect_position.get_list() - sigma = sigma.value - charge = charge.value - print("DEBUG: Dimensions = {}".format(dimensions)) - print("DEBUG: Limits = {}".format(limits)) + Parameters + ---------- + cell_matrix: 3x3 array + Cell matrix of the real space cell. + peak_charge : float + The peak charge density at the centre of the gaussian. + defect_charge : float + Charge state of the defect + dimensions: 3x1 array-like + Dimensions of grid to compute charge on. + gaussian_params: list (length 6) + Parameters determining the distribution position and shape obtained + by the fitting procedure. + + Returns + ------- + model_charge_array + The grid with the charge data as an AiiDA ArrayData object - i = np.linspace(0, limits[0], dimensions[0]) - j = np.linspace(0, limits[1], dimensions[1]) - k = np.linspace(0, limits[2], dimensions[2]) - grid = np.meshgrid(i, j, k, indexing='ij') + """ + + cell_matrix = cell_matrix.get_array('cell_matrix') + peak_charge = peak_charge.value + defect_charge = defect_charge.value + dimensions = np.array(dimensions) + gaussian_params = gaussian_params.get_list() - # Get the gaussian at the defect position - g = get_gaussian_3d(grid, defect_position, sigma) + xyz_coords = get_xyz_coords(cell_matrix, dimensions) - # Get the offsets - offsets = np.zeros(3) - for axis in range(3): - # Capture the offset needed for an image - if defect_position[axis] > limits[axis] / 2.0: - offsets[axis] = -limits[axis] - else: - offsets[axis] = +limits[axis] - - # Apply periodic boundary conditions - g = 0 - for dim0 in range(2): - for dim1 in range(2): - for dim2 in range(2): - image_offset = [dim0, dim1, dim2] * offsets - g = g + get_gaussian_3d( - grid, defect_position + image_offset, sigma=sigma) - - # Scale the charge density to the desired charge - #int_charge_density = np.trapz(np.trapz(np.trapz(g, i), j), k) - int_charge_density = get_integral(g, dimensions, limits) - print( - "DEBUG: Integrated charge density (g) = {}".format(int_charge_density)) - - g = g / (int_charge_density / charge) + get_model = generate_charge_model(cell_matrix, peak_charge) + g = get_model(xyz_coords, *gaussian_params) - # Compensating jellium background - print("DEBUG: Integrated charge density (scaled_g) = {}".format( - get_integral(g, dimensions, limits))) + # Unflatten the array + g = g.reshape(dimensions) - #scaled_g = scaled_g - np.sum(scaled_g)/np.prod(scaled_g.shape) - print("DEBUG: Integrated charge density (jellium) = {}".format( - get_integral(g, dimensions, limits))) + print("DEBUG: fit params: {}".format(gaussian_params)) + # Rescale to defect charge + print("DEBUG: Integrated charge density target = {}".format(defect_charge)) + g = g * (defect_charge / get_integral(g, cell_matrix)) + print("DEBUG: Integrated charge density (scaled) = {}".format(get_integral(g, cell_matrix))) + + # Compensating jellium background + g = g - np.sum(g)/np.prod(g.shape) + print("DEBUG: Integrated charge density (jellium) = {}".format(get_integral(g, cell_matrix))) + # Pack the array model_charge_array = orm.ArrayData() model_charge_array.set_array('model_charge', g) @@ -174,29 +272,126 @@ def get_charge_model(limits, return model_charge_array -def get_gaussian_3d(grid, position, sigma): +# @calcfunction +# def get_charge_model_old(limits, +# dimensions, +# defect_position, +# sigma=orm.Float(1.0), +# charge=orm.Float(-1.0)): +# """ +# For a given system charge, create a model charge distribution. +# The charge model for now is a Gaussian. +# Grid = coord grid +# TODO: Change of basis +# """ +# limits = limits.get_list() +# dimensions = dimensions.get_list() +# defect_position = defect_position.get_list() +# sigma = sigma.value +# charge = charge.value + +# print("DEBUG: Dimensions = {}".format(dimensions)) +# print("DEBUG: Limits = {}".format(limits)) + +# i = np.linspace(0, limits[0], dimensions[0]) +# j = np.linspace(0, limits[1], dimensions[1]) +# k = np.linspace(0, limits[2], dimensions[2]) +# grid = np.meshgrid(i, j, k) + +# # Get the gaussian at the defect position +# g = get_gaussian_3d(grid, defect_position, sigma) + +# # Get the offsets +# offsets = np.zeros(3) +# for axis in range(3): +# # Capture the offset needed for an image +# if defect_position[axis] > limits[axis] / 2.0: +# offsets[axis] = -limits[axis] +# else: +# offsets[axis] = +limits[axis] + +# # Apply periodic boundary conditions +# g = 0 +# for dim0 in range(2): +# for dim1 in range(2): +# for dim2 in range(2): +# image_offset = [dim0, dim1, dim2] * offsets +# g = g + get_gaussian_3d( +# grid, defect_position + image_offset, sigma=sigma) + +# # Scale the charge density to the desired charge +# #int_charge_density = np.trapz(np.trapz(np.trapz(g, i), j), k) +# int_charge_density = get_integral(g, dimensions, limits) +# print( +# "DEBUG: Integrated charge density (g) = {}".format(int_charge_density)) + +# g = g / (int_charge_density / charge) + +# # Compensating jellium background +# print("DEBUG: Integrated charge density (scaled_g) = {}".format( +# get_integral(g, dimensions, limits))) + +# #scaled_g = scaled_g - np.sum(scaled_g)/np.prod(scaled_g.shape) +# print("DEBUG: Integrated charge density (jellium) = {}".format( +# get_integral(g, dimensions, limits))) + +# # Pack the array +# model_charge_array = orm.ArrayData() +# model_charge_array.set_array('model_charge', g) + +# return model_charge_array + +def get_gaussian_3d(grid, origin, covar): """ - Calculate 3D Gaussian on grid - NOTE: Minus sign at front give negative values of charge density throughout the cell + Compute anisotropic 3D Gaussian on grid + + Parameters + ---------- + grid: array + Array on which to compute gaussian + origin: array + Centre of gaussian + covar: 3x3 array + Covariance matrix of gaussian + + Returns + ------- + gaussian + anisotropic Gaussian on grid """ - x = grid[0] - position[0] - y = grid[1] - position[1] - z = grid[2] - position[2] - gaussian = -np.exp(-(x**2 + y**2 + z**2) / (2 * sigma**2)) / ( - (2.0 * np.pi)**1.5 * np.sqrt(sigma)) + origin = origin.ravel() + gaussian = multivariate_normal.pdf(grid, origin, covar) return gaussian -def get_integral(data, dimensions, limits): +# def get_gaussian_3d_old(grid, position, sigma): +# """ +# Calculate 3D Gaussian on grid +# NOTE: Minus sign at front give negative values of charge density throughout the cell +# """ +# x = grid[0] - position[0] +# y = grid[1] - position[1] +# z = grid[2] - position[2] + +# gaussian = -np.exp(-(x**2 + y**2 + z**2) / (2 * sigma**2)) / ( +# (2.0 * np.pi)**1.5 * np.sqrt(sigma)) + +# return gaussian + + +def get_integral(data, cell_matrix): """ - Get the integral of a uniformly spaced 3D data array + Get the integral of a uniformly spaced 3D data array by rectangular rule. + Works better than trapezoidal or Simpson's rule for sharpely peaked coarse grids. """ - limits = np.array(limits) - dimensions = np.array(dimensions) - volume_element = np.prod(limits / dimensions) - return np.sum(data) * volume_element + a = cell_matrix[0] + b = cell_matrix[1] + c = cell_matrix[2] + cell_vol = np.dot(np.cross(a, b), c) + element_volume = cell_vol / np.prod(data.shape) + return np.sum(data) * element_volume def get_fft(grid): @@ -245,15 +440,13 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): # (Note: Indexing is column major order, but the 4th dimension vectors remain ijk) dimensions = dimensions // 2 #floor division - ijk_array = np.mgrid[-dimensions[0]:dimensions[0] + - 1, -dimensions[1]:dimensions[1] + - 1, -dimensions[2]:dimensions[2] + 1].T + ijk_array = np.mgrid[ + -dimensions[0]:dimensions[0] + 1, + -dimensions[1]:dimensions[1] + 1, + -dimensions[2]:dimensions[2] + 1].T # Get G vectors - G_array = np.dot( - ijk_array, - (cell_matrix.T - )) # To do: check why we use a grid that goes way past the recip cell + G_array = np.dot(ijk_array, (cell_matrix.T)) # Calculate the square modulus G_sqmod_array = (np.linalg.norm(G_array, axis=3)**2).T @@ -278,17 +471,15 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): return V_model_array -def get_energy(potential, charge_density, dimensions, limits): +@calcfunction +def get_energy(potential, charge_density, cell_matrix): """ Calculate the total energy for a given model potential """ - + cell_matrix = cell_matrix.get_array('cell_matrix') potential = potential.get_array('model_potential') charge_density = charge_density.get_array('model_charge') - ii = np.linspace(0., limits[0], dimensions[0]) - jj = np.linspace(0., limits[1], dimensions[1]) - kk = np.linspace(0., limits[2], dimensions[2]) - - energy = np.real(0.5 * np.trapz(np.trapz(np.trapz(charge_density * potential, ii, axis=0), jj, axis=0), kk, axis=0)) * hartree_to_ev + energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix) * hartree_to_ev) return orm.Float(energy) + diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index 1f9c4e1..fe058fa 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -10,6 +10,9 @@ import numpy as np from aiida import orm from aiida.engine import calcfunction + +from qe_tools.constants import hartree_to_ev, bohr_to_ang + """ Utility functions for the gaussian countercharge workchain """ @@ -94,7 +97,7 @@ def fit_energies(dimensions_dict, energies_dict): AiiDA dictionary of the form: structure : energy """ - from scipy.optimize import curve_fit + from scipy.optimize import curve_fit def fitting_func(x, a, b, c): """ @@ -153,3 +156,74 @@ def calc_correction(isolated_energy, model_energy): correction_energy = isolated_energy - model_energy return orm.Float(correction_energy) + + +@calcfunction +def get_charge_model_fit(rho_host, rho_defect_q, host_structure): + """ + Fit the charge model to the defect data + + Parameters + ---------- + model_correction: orm.Float + The correction energy derived from the electrostatic model + total_alignment: orm.Float + The correction energy derived from the alignment of the DFT difference + potential and the model potential, and alignment of the defect potential + in the q=0 charge state and the potential of the pristine host structure + + Returns + ------- + total_correction + The calculated correction, including potential alignment + + """ + + from scipy.optimize import curve_fit + from .model_potential.utils import generate_charge_model, get_xyz_coords, get_cell_matrix + + # Get the cell matrix + cell_matrix = get_cell_matrix(host_structure) + + # Compute the difference in charge density between the host and defect systems + rho_defect_q_data = rho_defect_q.get_array(rho_defect_q.get_arraynames()[0]) + rho_host_data = rho_host.get_array(rho_host.get_arraynames()[0]) + + # Charge density from QE is in e/cubic-bohr, so convert if necessary + # TODO: Check if the CUBE file format is strictly Bohr or if this is a QE thing + #rho_diff = (rho_host_data - rho_defect_q_data)/(bohr_to_ang**3) + rho_diff = rho_host_data - rho_defect_q_data + + # Detect the centre of the charge in the data + max_pos_mat = np.array(np.unravel_index(rho_diff.argmax(), rho_diff.shape)) # matrix coords + max_pos_ijk = (max_pos_mat*1.)/(np.array(rho_diff.shape)-1) # Compute crystal coords + max_i = max_pos_ijk[0] + max_j = max_pos_ijk[1] + max_k = max_pos_ijk[2] + + # Generate cartesian coordinates for a grid of the same size as the charge data + xyz_coords = get_xyz_coords(cell_matrix, rho_diff.shape) + + # Set up some safe parameters for the fitting + guesses = [max_i, max_j, max_k, 1., 1., 1., 0., 0., 0.] + bounds = ( + [0., 0., 0., 0., 0., 0., 0., 0., 0.,], + [1., 1., 1., np.inf, np.inf, np.inf, np.inf, np.inf, np.inf]) + peak_charge = rho_diff.max() + + # Do the fitting + fit, covar_fit = curve_fit( + generate_charge_model(cell_matrix, peak_charge), + xyz_coords, + rho_diff.ravel(), + p0=guesses, + bounds=bounds) + + fitting_results = {} + + fitting_results['fit'] = fit.tolist() + fitting_results['peak_charge'] = peak_charge + + return orm.Dict(dict=fitting_results) + + diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index e1785f2..8142840 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -101,6 +101,8 @@ def define(cls, spec): cls.check_dft_calcs_gaussian_correction, cls.get_dft_potentials_gaussian_correction, cls.check_dft_potentials_gaussian_correction, + cls.get_dft_charge_density_gaussian_correction, + cls.check_dft_charge_density_gaussian_correction, if_(cls.host_unitcell_provided)( cls.prep_hostcell_calc_for_dfpt, cls.check_hostcell_calc_for_dfpt, @@ -329,26 +331,29 @@ def get_dft_potentials_gaussian_correction(self): pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder future = self.submit(pp_inputs) self.report( - 'Launching PP.x for host structure (PK={}) with charge {} (PK={})'. - format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_host': future}) + 'Launching PP.x for host structure (PK={}) with charge {} (PK={}) ' + 'to compute the electrostatic potential.' + .format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'pp_v_host': future}) pp_inputs.parent_folder = self.ctx[ 'calc_defect_q0'].outputs.remote_folder future = self.submit(pp_inputs) self.report( - 'Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + 'Launching PP.x for defect structure (PK={}) with charge {} (PK={}) ' + 'to compute the electrostatic potential.' .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_defect_q0': future}) + self.to_context(**{'pp_v_defect_q0': future}) pp_inputs.parent_folder = self.ctx[ 'calc_defect_q'].outputs.remote_folder future = self.submit(pp_inputs) self.report( - 'Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + 'Launching PP.x for defect structure (PK={}) with charge {} (PK={}) ' + 'to compute the electrostatic potential.' .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'pp_defect_q': future}) + self.to_context(**{'pp_v_defect_q': future}) def check_dft_potentials_gaussian_correction(self): """ @@ -357,7 +362,7 @@ def check_dft_potentials_gaussian_correction(self): """ # Host - host_pp = self.ctx['pp_host'] + host_pp = self.ctx['pp_v_host'] if host_pp.is_finished_ok: data_array = host_pp.outputs.output_data.get_array('data') v_data = orm.ArrayData() @@ -370,7 +375,7 @@ def check_dft_potentials_gaussian_correction(self): return self.exit_codes.ERROR_PP_CALCULATION_FAILED # Defect (q=0) - defect_q0_pp = self.ctx['pp_defect_q0'] + defect_q0_pp = self.ctx['pp_v_defect_q0'] if defect_q0_pp.is_finished_ok: data_array = host_pp.outputs.output_data.get_array('data') v_data = orm.ArrayData() @@ -383,7 +388,7 @@ def check_dft_potentials_gaussian_correction(self): return self.exit_codes.ERROR_PP_CALCULATION_FAILED # Defect (q=q) - defect_q_pp = self.ctx['pp_defect_q'] + defect_q_pp = self.ctx['pp_v_defect_q'] if defect_q_pp.is_finished_ok: data_array = host_pp.outputs.output_data.get_array('data') v_data = orm.ArrayData() @@ -395,3 +400,69 @@ def check_dft_potentials_gaussian_correction(self): .format(self.inputs.defect_charge.value, defect_q_pp.exit_status)) return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + + def get_dft_charge_density_gaussian_correction(self): + """ + Obtain the charge densities from the PWSCF calculations. + """ + + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(1) # Charge density + pp_inputs.plot_dimension = orm.Int(3) # 3D + + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + future = self.submit(pp_inputs) + self.report( + 'Launching PP.x for host structure (PK={}) with charge {} (PK={}) ' + 'to compute the charge density.' + .format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'pp_rho_host': future}) + + pp_inputs.parent_folder = self.ctx[ + 'calc_defect_q'].outputs.remote_folder + future = self.submit(pp_inputs) + self.report( + 'Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + 'to compute the charge density.' + .format(self.inputs.defect_structure.pk, + self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'pp_rho_defect_q': future}) + + + def check_dft_charge_density_gaussian_correction(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['pp_rho_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + rho_data = orm.ArrayData() + rho_data.set_array('data', data_array) + self.ctx.rho_host = rho_data + else: + self.report( + 'Post processing for the host structure has failed with status {}' + .format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=q) + defect_q_pp = self.ctx['pp_rho_defect_q'] + if defect_q_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + rho_data = orm.ArrayData() + rho_data.set_array('data', data_array) + self.ctx.rho_defect_q = rho_data + else: + self.report( + 'Post processing for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value, + defect_q_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED \ No newline at end of file From 4b209331f78dfb5ea35ac70cd66428bc16dc82bf Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Wed, 4 Mar 2020 14:56:51 +0000 Subject: [PATCH 02/60] Add checking of 'goodness' of charge density fit Checks if any fitting parameters exceed a specified threshold, with a strictness flag to control whether this should cause the workchain to exit or just print a warning. --- .../gaussian_countercharge.py | 53 +++++++++++++------ .../gaussian_countercharge/utils.py | 4 ++ .../formation_energy/formation_energy_base.py | 17 +++--- 3 files changed, 49 insertions(+), 25 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index d00501d..9092838 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -30,16 +30,16 @@ def define(cls, spec): spec.input("host_structure", valid_type=orm.StructureData, - help="The structure of the host system") + help="The structure of the host system.") spec.input("defect_charge", valid_type=orm.Float, - help="The target defect charge state") + help="The target defect charge state.") spec.input("defect_site", valid_type=orm.List, - help="Defect site position in crystal coordinates") + help="Defect site position in crystal coordinates.") spec.input("epsilon", valid_type=orm.Float, - help="Dielectric constant for the host material") + help="Dielectric constant for the host material.") spec.input("model_iterations_required", valid_type=orm.Int, default=orm.Int(3), @@ -47,22 +47,30 @@ def define(cls, spec): spec.input("cutoff", valid_type=orm.Float, default=orm.Float(40.), - help="Plane wave cutoff for electrostatic model") + help="Plane wave cutoff for electrostatic model.") spec.input("v_host", valid_type=orm.ArrayData, - help="The electrostatic potential of the host system") + help="The electrostatic potential of the host system.") spec.input("v_defect_q0", valid_type=orm.ArrayData, - help="The electrostatic potential of the defect system in the 0 charge state") + help="The electrostatic potential of the defect system in the 0 charge state.") spec.input("v_defect_q", valid_type=orm.ArrayData, - help="The electrostatic potential of the defect system in the target charge state") + help="The electrostatic potential of the defect system in the target charge state.") spec.input("rho_host", valid_type=orm.ArrayData, - help="The charge density of the host system") + help="The charge density of the host system.") spec.input("rho_defect_q", valid_type=orm.ArrayData, - help="The charge density of the defect system in the target charge state") + help="The charge density of the defect system in the target charge state.") + spec.input("charge_fit_tolerance", + valid_type=orm.Float, + help="Permissable error for any fitted charge model parameter.", + default=orm.Float(1.0e-3)) + spec.input("strict_fit", + valid_type=orm.Bool, + help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", + default=orm.Bool(True)) spec.outline( cls.setup, @@ -86,21 +94,24 @@ def define(cls, spec): spec.output('electrostatic_correction', valid_type=orm.Float) # spec.output('isolated_energy', valid_type=orm.Float, required=True) # Not sure if anyone would use this # spec.output('model_correction_energies', valid_type=orm.Dict, required=True) # Again, not sure if useful - spec.exit_code(401, + spec.exit_code(201, 'ERROR_INVALID_INPUT_ARRAY', message='the input ArrayData object can only contain one array') - spec.exit_code(409, + spec.exit_code(202, + 'ERROR_BAD_INPUT_ITERATIONS_REQUIRED', + message='The required number of iterations must be at least 3') + spec.exit_code(301, 'ERROR_SUB_PROCESS_FAILED_ALIGNMENT', message='the electrostatic potentials could not be aligned') - spec.exit_code(413, + spec.exit_code(302, 'ERROR_SUB_PROCESS_FAILED_MODEL_POTENTIAL', message='The model electrostatic potential could not be computed') - spec.exit_code(410, + spec.exit_code(303, 'ERROR_SUB_PROCESS_FAILED_FINAL_SCF', message='the final scf PwBaseWorkChain sub process failed') - spec.exit_code(411, - 'ERROR_BAD_INPUT_ITERATIONS_REQUIRED', - message='The required number of iterations must be at least 3') + spec.exit_code(304, + 'ERROR_BAD_CHARGE_FIT', + message='the mode fit to charge density is extremely poor') def setup(self): @@ -141,6 +152,7 @@ def setup(self): # Dict to store correction energies self.ctx.model_correction_energies = {} + return @@ -157,6 +169,13 @@ def fit_charge_model(self): self.ctx.fitted_params = orm.List(list=fit['fit']) self.ctx.peak_charge = orm.Float(fit['peak_charge']) + + for parameter in fit['error']: + if parameter > self.inputs.charge_fit_tolerance: + self.logger.warning("Charge fitting parameter worse than allowed tolerance") + if self.inputs.strict_fit: + return self.exit_codes.ERROR_BAD_CHARGE_FIT + def should_run_model(self): """ diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index fe058fa..b042943 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -219,10 +219,14 @@ def get_charge_model_fit(rho_host, rho_defect_q, host_structure): p0=guesses, bounds=bounds) + # Compute the one standard deviation errors from the 9x9 covariance array + fit_error = np.sqrt(np.diag(covar_fit)) + fitting_results = {} fitting_results['fit'] = fit.tolist() fitting_results['peak_charge'] = peak_charge + fitting_results['error'] = fit_error.tolist() return orm.Dict(dict=fitting_results) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 5f71dec..7297221 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -91,24 +91,25 @@ def define(cls, spec): ) # Error codes - spec.exit_code( 401, "ERROR_INVALID_CORRECTION", + spec.exit_code(201, "ERROR_INVALID_CORRECTION", message="The requested correction scheme is not recognised", ) - spec.exit_code(402, "ERROR_CORRECTION_WORKCHAIN_FAILED", + spec.exit_code(202, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly", + ) + spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", message="The correction scheme sub-workchain failed", ) - spec.exit_code(403, "ERROR_DFT_CALCULATION_FAILED", + spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", message="DFT calculation failed", ) - spec.exit_code(404, "ERROR_PP_CALCULATION_FAILED", + spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", message="A post-processing calculation failed", ) - spec.exit_code(405, "ERROR_DFPT_CALCULATION_FAILED", + spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", message="DFPT calculation failed" ) - spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", - message="Input parameter dictionary key cannot be set explicitly", - ) + spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", message="The requested method is not yet implemented", ) From 90a89d56f84972eab2182abcfff9c35285c6276e Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Tue, 7 Jul 2020 15:14:09 +0100 Subject: [PATCH 03/60] Add density weighted potential alignment scheme Adds alignment scheme based on the fitted charge density --- .../gaussian_countercharge.py | 41 +++- .../model_potential/model_potential.py | 6 +- .../gaussian_countercharge/utils.py | 4 +- .../formation_energy/formation_energy_base.py | 6 +- .../formation_energy/formation_energy_qe.py | 29 ++- .../density_weighted/density_weighted.py | 98 ++++++++ .../density_weighted/utils.py | 52 ++++ .../lany_zunger/lany_zunger.py | 16 +- .../potential_alignment.py | 228 +++++++++++++----- .../potential_alignment/utils.py | 46 +++- 10 files changed, 424 insertions(+), 102 deletions(-) create mode 100644 aiida_defects/formation_energy/potential_alignment/density_weighted/density_weighted.py create mode 100644 aiida_defects/formation_energy/potential_alignment/density_weighted/utils.py diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 9092838..8a22828 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -9,6 +9,7 @@ from aiida.engine import WorkChain, calcfunction, ToContext, while_ from aiida import orm +from qe_tools.constants import hartree_to_ev from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain from .model_potential.model_potential import ModelPotentialWorkchain @@ -50,13 +51,13 @@ def define(cls, spec): help="Plane wave cutoff for electrostatic model.") spec.input("v_host", valid_type=orm.ArrayData, - help="The electrostatic potential of the host system.") + help="The electrostatic potential of the host system (in eV).") spec.input("v_defect_q0", valid_type=orm.ArrayData, - help="The electrostatic potential of the defect system in the 0 charge state.") + help="The electrostatic potential of the defect system in the 0 charge state (in eV).") spec.input("v_defect_q", valid_type=orm.ArrayData, - help="The electrostatic potential of the defect system in the target charge state.") + help="The electrostatic potential of the defect system in the target charge state (in eV).") spec.input("rho_host", valid_type=orm.ArrayData, help="The charge density of the host system.") @@ -93,7 +94,8 @@ def define(cls, spec): spec.output('total_correction', valid_type=orm.Float) spec.output('electrostatic_correction', valid_type=orm.Float) # spec.output('isolated_energy', valid_type=orm.Float, required=True) # Not sure if anyone would use this - # spec.output('model_correction_energies', valid_type=orm.Dict, required=True) # Again, not sure if useful + # spec.output('model_correction_energies', valid_type=orm.Dict, required=True) + spec.exit_code(201, 'ERROR_INVALID_INPUT_ARRAY', message='the input ArrayData object can only contain one array') @@ -111,7 +113,7 @@ def define(cls, spec): message='the final scf PwBaseWorkChain sub process failed') spec.exit_code(304, 'ERROR_BAD_CHARGE_FIT', - message='the mode fit to charge density is extremely poor') + message='the mode fit to charge density is exceeds tolerances') def setup(self): @@ -121,7 +123,7 @@ def setup(self): ## Verification if self.inputs.model_iterations_required < 3: - self.report('The requested number of iterations, {}, is too low. At least 3 are required to achieve an #adequate data fit'.format(self.inputs.model_iterations_required.value)) + self.report('The requested number of iterations, {}, is too low. At least 3 are required to achieve an adequate data fit'.format(self.inputs.model_iterations_required.value)) return self.exit_codes.ERROR_BAD_INPUT_ITERATIONS_REQUIRED # Track iteration number @@ -212,7 +214,7 @@ def compute_model_potential(self): def check_model_potential_workchains(self): """ - Check if the model potential alignment workchains have finished correctly. + Check if the model potential workchains have finished correctly. If yes, assign the outputs to the context """ for ii in range(self.inputs.model_iterations_required.value): @@ -228,6 +230,7 @@ def check_model_potential_workchains(self): else: if scale_factor == 1: self.ctx.v_model = model_workchain.outputs.model_potential + self.ctx.charge_model = model_workchain.outputs.model_charge self.ctx.model_energies[str(scale_factor)] = model_workchain.outputs.model_energy self.ctx.model_structures[str(scale_factor)] = model_workchain.outputs.model_structure @@ -249,18 +252,32 @@ def submit_alignment_workchains(self): # Compute the alignment between the defect, in q=0, and the host inputs = { - "first_potential": self.inputs.v_defect_q0, - "second_potential": self.inputs.v_host + "density_weighted":{ + "first_potential": self.inputs.v_defect_q0, + "second_potential": self.inputs.v_host, + "charge_density": self.ctx.charge_model + }, + "allow_interpolation": orm.Bool(True) } + workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) label = 'workchain_alignment_q0_to_host' self.to_context(**{label: workchain_future}) + # Convert units from model potential workchain, and also change sign + # TODO: Check if this breaks provenance graph + v_model = orm.ArrayData() + v_model.set_array('data', + self.ctx.v_model.get_array(self.ctx.v_model.get_arraynames()[0])*-2.0) # Ha to Ry - This is dirty - need to harmonise units + # Compute the alignment between the defect DFT difference potential, and the model inputs = { - "first_potential": self.ctx.v_defect_q_q0, - "second_potential": self.ctx.v_model, - "interpolate": orm.Bool(True) # This will more or less always be required + "density_weighted":{ + "first_potential": self.ctx.v_defect_q_q0, + "second_potential": v_model, + "charge_density": self.ctx.charge_model + }, + "allow_interpolation": orm.Bool(True) } workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) label = 'workchain_alignment_dft_to_model' diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index 591d164..94b3c23 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -63,6 +63,7 @@ def define(cls, spec): ) #spec.expose_outputs(PwBaseWorkChain, exclude=('output_structure',)) spec.output('model_energy', valid_type=orm.Float, required=True) + spec.output('model_charge', valid_type=orm.ArrayData, required=True) spec.output('model_potential', valid_type=orm.ArrayData, required=True) spec.output('model_structure', valid_type=orm.StructureData, @@ -83,7 +84,7 @@ def get_model_structure(self): self.report("Generating model structure") self.ctx.model_structure = create_model_structure( self.inputs.host_structure, self.inputs.scale_factor) - # Get cell matricies + # Get cell matrices self.ctx.real_cell = get_cell_matrix(self.ctx.model_structure) self.ctx.reciprocal_cell = get_reciprocal_cell(self.ctx.real_cell) self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) @@ -138,8 +139,6 @@ def compute_energy(self): self.report("Computing model energy for scale factor {}".format( self.inputs.scale_factor.value)) - self.report("DEBUG: type {}".format(type(self.ctx.model_potential))) - self.ctx.model_energy = get_energy( potential=self.ctx.model_potential, charge_density=self.ctx.charge_model, @@ -154,6 +153,7 @@ def results(self): """ # Return the model potential for the cell which corresponds to the host structure self.out('model_energy', self.ctx.model_energy) + self.out('model_charge', self.ctx.charge_model) self.out('model_potential', self.ctx.model_potential) self.out('model_structure', self.ctx.model_structure) self.report("Finished successfully") diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index b042943..33a3cc1 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -11,7 +11,7 @@ from aiida import orm from aiida.engine import calcfunction -from qe_tools.constants import hartree_to_ev, bohr_to_ang +from qe_tools.constants import bohr_to_ang """ Utility functions for the gaussian countercharge workchain @@ -54,7 +54,7 @@ def get_total_alignment(alignment_dft_model, alignment_q0_host, charge): """ - total_alignment = (charge * alignment_dft_model) + ( + total_alignment = -1.0*(charge * alignment_dft_model) + ( charge * alignment_q0_host) return total_alignment diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 7297221..c3b3675 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -16,7 +16,6 @@ get_corrected_aligned_formation_energy, ) - class FormationEnergyWorkchainBase(WorkChain): """ The base class to compute the formation energy for a given defect, containing the @@ -109,7 +108,6 @@ def define(cls, spec): spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", message="DFPT calculation failed" ) - spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", message="The requested method is not yet implemented", ) @@ -171,6 +169,8 @@ def run_gaussian_correction_workchain(self): "v_host": self.ctx.v_host, "v_defect_q0": self.ctx.v_defect_q0, "v_defect_q": self.ctx.v_defect_q, + "rho_host": self.ctx.rho_host, + "rho_defect_q": self.ctx.rho_defect_q, "defect_charge": self.inputs.defect_charge, "defect_site": self.inputs.defect_site, "host_structure": self.inputs.host_structure, @@ -220,7 +220,7 @@ def check_correction_workchain(self): correction_wc.exit_status ) ) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION + return self.exit_codes.ERROR_CORRECTION_WORKCHAIN_FAILED else: self.ctx.total_correction = correction_wc.outputs.total_correction self.ctx.electrostatic_correction = ( diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 8142840..719dc73 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -325,8 +325,15 @@ def get_dft_potentials_gaussian_correction(self): pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() # Fixed settings - pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential - pp_inputs.plot_dimension = orm.Int(3) # 3D + params = orm.Dict(dict={ + 'INPUTPP': { + 'plot_num': 11, # Electrostatic potential + }, + 'PLOT': { + 'iflag' : 3 # 3D + } + }) + pp_inputs.parameters = params pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder future = self.submit(pp_inputs) @@ -377,7 +384,7 @@ def check_dft_potentials_gaussian_correction(self): # Defect (q=0) defect_q0_pp = self.ctx['pp_v_defect_q0'] if defect_q0_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') + data_array = defect_q0_pp.outputs.output_data.get_array('data') v_data = orm.ArrayData() v_data.set_array('data', data_array) self.ctx.v_defect_q0 = v_data @@ -390,7 +397,7 @@ def check_dft_potentials_gaussian_correction(self): # Defect (q=q) defect_q_pp = self.ctx['pp_v_defect_q'] if defect_q_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') + data_array = defect_q_pp.outputs.output_data.get_array('data') v_data = orm.ArrayData() v_data.set_array('data', data_array) self.ctx.v_defect_q = v_data @@ -412,8 +419,16 @@ def get_dft_charge_density_gaussian_correction(self): pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() # Fixed settings - pp_inputs.plot_number = orm.Int(1) # Charge density - pp_inputs.plot_dimension = orm.Int(3) # 3D + # Fixed settings + params = orm.Dict(dict={ + 'INPUTPP': { + 'plot_num': 0, # Electron density + }, + 'PLOT': { + 'iflag' : 3 # 3D + } + }) + pp_inputs.parameters = params pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder future = self.submit(pp_inputs) @@ -456,7 +471,7 @@ def check_dft_charge_density_gaussian_correction(self): # Defect (q=q) defect_q_pp = self.ctx['pp_rho_defect_q'] if defect_q_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') + data_array = defect_q_pp.outputs.output_data.get_array('data') rho_data = orm.ArrayData() rho_data.set_array('data', data_array) self.ctx.rho_defect_q = rho_data diff --git a/aiida_defects/formation_energy/potential_alignment/density_weighted/density_weighted.py b/aiida_defects/formation_energy/potential_alignment/density_weighted/density_weighted.py new file mode 100644 index 0000000..2340394 --- /dev/null +++ b/aiida_defects/formation_energy/potential_alignment/density_weighted/density_weighted.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida import orm +from aiida.engine import WorkChain, calcfunction + +from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference +from .utils import get_alignment, AllValuesMaskedError + + +class DensityWeightedAlignmentWorkchain(WorkChain): + """ + Comput the alignment needed between two electrostatic potentials according to + the charge-weighted potential alignment method. + """ + + @classmethod + def define(cls, spec): + super(DensityWeightedAlignmentWorkchain, cls).define(spec) + spec.input('first_potential', + valid_type=orm.ArrayData, + help="The first electrostatic potential array") + spec.input('second_potential', + valid_type=orm.ArrayData, + help="The second electrostatic potential array") + spec.input('charge_density', + valid_type=orm.ArrayData, + help="The fitted model charge density array") + spec.input('tolerance', + valid_type=orm.Float, + default=orm.Float(1.0e-3), + help="The threshold for determining whether a given array element has charge density present") + + spec.outline( + cls.setup, + cls.compute_difference, + cls.calculate_alignment, + cls.results, + ) + #spec.expose_outputs(PwBaseWorkChain, exclude=('output_structure',)) + spec.output('alignment_required', + valid_type=orm.Float, + required=True, + help="The computed potential alignment required") + spec.output('potential_difference', + valid_type=orm.ArrayData, + required=True, + help="The unmasked difference in electrostatic potentials") + + # Exit codes + spec.exit_code(301, 'ERROR_ALL_VALUES_MASKED', + message='All values in the potential difference array were masked. ' + 'Try increasing the tolerance to include fewer elements from the charge density array.') + + + def setup(self): + pass + + + def compute_difference(self): + """ + Compute the difference of the two potentials + """ + + self.ctx.potential_difference = get_potential_difference( + first_potential = self.inputs.first_potential, + second_potential = self.inputs.second_potential + ) + + + def calculate_alignment(self): + """ + Compute the alignment + """ + + try: + self.ctx.alignment = get_alignment( + potential_difference = self.ctx.potential_difference, + charge_density = self.inputs.charge_density, + tolerance = self.inputs.tolerance + ) + except AllValuesMaskedError: + return self.exit_codes.ERROR_ALL_VALUES_MASKED + + + + def results(self): + """ + Pack the results + """ + self.out('alignment_required', self.ctx.alignment) + self.out('potential_difference', self.ctx.potential_difference) \ No newline at end of file diff --git a/aiida_defects/formation_energy/potential_alignment/density_weighted/utils.py b/aiida_defects/formation_energy/potential_alignment/density_weighted/utils.py new file mode 100644 index 0000000..1ef436b --- /dev/null +++ b/aiida_defects/formation_energy/potential_alignment/density_weighted/utils.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +import numpy as np + +from aiida.engine import calcfunction +from aiida import orm +""" +Utility functions for the potential alignment workchain +""" + +class AllValuesMaskedError(ValueError): + """ + Error raised when no values are left after the masking procedure. + If one proceeds to compute averages using an array in which all values + are masked, the resulting object is an instance of 'numpy.ma.core.MaskedConstant' + which cannot be stored by AiiDA and is, in any case, meaningless. + """ + pass + +@calcfunction +def get_alignment(potential_difference, charge_density, tolerance): + """ + Compute the density-weighted potential alignment + """ + # Unpack + tol = tolerance.value + v_diff = potential_difference.get_array( + potential_difference.get_arraynames()[0]) + charge_density = charge_density.get_array( + charge_density.get_arraynames()[0]) + + # Get array mask based on elements' charge exceeding the tolerance. + mask = np.ma.greater(np.abs(charge_density), tol) + + # Apply this mask to the diff array + v_diff_masked = np.ma.masked_array(v_diff, mask=mask) + + # Check if any values are left after masking + if v_diff_masked.count() == 0: + raise AllValuesMaskedError + + # Compute average alignment + alignment = np.average(np.abs(v_diff_masked)) + + return orm.Float(alignment) \ No newline at end of file diff --git a/aiida_defects/formation_energy/potential_alignment/lany_zunger/lany_zunger.py b/aiida_defects/formation_energy/potential_alignment/lany_zunger/lany_zunger.py index 9257980..54a73ee 100644 --- a/aiida_defects/formation_energy/potential_alignment/lany_zunger/lany_zunger.py +++ b/aiida_defects/formation_energy/potential_alignment/lany_zunger/lany_zunger.py @@ -15,7 +15,7 @@ # from aiida_defects.pp.fft_tools import avg_potential_at_core -class LanyZungerWorkchain(WorkChain): +class LanyZungerAlignmentWorkchain(WorkChain): """ Compute the electrostatic potential alignment via the Lany-Zunger method. See: S. Lany and A. Zunger, PRB 78, 235104 (2008) @@ -24,17 +24,13 @@ class LanyZungerWorkchain(WorkChain): @classmethod def define(cls, spec): - super(LanyZungerWorkchain, cls).define(spec) + super(LanyZungerAlignmentWorkchain, cls).define(spec) spec.input('bulk_structure', valid_type=orm.StructureData), - spec.input( 'e_tol', - valid_type=orm.Float(), + valid_type=orm.Float, default=orm.Float(0.2), - help= - "Energy tolerance to decide which atoms to exclude to compute alignment" - ) - + help="Energy tolerance to decide which atoms to exclude to compute alignment") spec.input('first_potential', valid_type=orm.ArrayData) spec.input('second_potential', valid_type=orm.ArrayData) spec.input( @@ -43,10 +39,6 @@ def define(cls, spec): default=orm.Str('lany-zunger')) spec.input('interpolate', valid_type=orm.Bool, default=orm.Bool(False)) spec.outline( - cls.setup, - cls.do_interpolation, - cls.calculate_alignment, - cls.results, ) #spec.expose_outputs(PwBaseWorkChain, exclude=('output_structure',)) spec.output('alignment_required', valid_type=orm.Float, required=True) diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 2e57f73..2957ea2 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -7,15 +7,22 @@ ######################################################################################## from __future__ import absolute_import +import numpy as np + from aiida import orm -from aiida.engine import WorkChain, calcfunction -from aiida_defects.formation_energy.potential_alignment.lany_zunger import lany_zunger +from aiida.common import AttributeDict +from aiida.engine import WorkChain, calcfunction, if_ +from qe_tools.constants import hartree_to_ev +from .utils import get_interpolation +from .lany_zunger.lany_zunger import LanyZungerAlignmentWorkchain +from .density_weighted.density_weighted import DensityWeightedAlignmentWorkchain -@calcfunction -def testing(): - return orm.Float(0.0) +valid_schemes = { + 'lany_zunger' : LanyZungerAlignmentWorkchain, + 'density_weighted': DensityWeightedAlignmentWorkchain +} class PotentialAlignmentWorkchain(WorkChain): """ @@ -25,76 +32,150 @@ class PotentialAlignmentWorkchain(WorkChain): @classmethod def define(cls, spec): super(PotentialAlignmentWorkchain, cls).define(spec) - spec.input('first_potential', valid_type=orm.ArrayData) - spec.input('second_potential', valid_type=orm.ArrayData) - spec.input( - 'alignment_scheme', - valid_type=orm.Str, - default=orm.Str('lany-zunger')) - spec.input('interpolate', valid_type=orm.Bool, default=orm.Bool(False)) + spec.input('allow_interpolation', + valid_type=orm.Bool, + default=orm.Bool(False), + help="Whether to allow arrays of different shapes to be interpolated") + spec.expose_inputs(DensityWeightedAlignmentWorkchain, + namespace='density_weighted', + namespace_options={'required': False, 'populate_defaults': False}) + spec.expose_inputs(LanyZungerAlignmentWorkchain, + namespace='lany_zunger', + namespace_options={'required': False, 'populate_defaults': False}) + spec.outline( cls.setup, - cls.do_interpolation, + if_(cls.interpolation_required)( + cls.do_interpolation, + ), cls.calculate_alignment, + cls.check_alignment_workchain, cls.results, ) #spec.expose_outputs(PwBaseWorkChain, exclude=('output_structure',)) spec.output('alignment_required', valid_type=orm.Float, required=True) + # Exit codes - spec.exit_code( - 401, - 'ERROR_SUB_PROCESS_FAILED_WRONG_SHAPE', - message= - 'the two electrostatic potentials must be the same shape, unless interpolation is allowed' - ) - spec.exit_code( - 402, - 'ERROR_SUB_PROCESS_FAILED_INTERPOLATION', - message='the interpolation could not be completed') - spec.exit_code( - 403, - 'ERROR_SUB_PROCESS_FAILED_BAD_SCHEME', - message='the alignment scheme requested is unknown') + spec.exit_code(201, 'ERROR_INPUT_BAD_SCHEME', + message='the alignment scheme requested is unknown.') + spec.exit_code(202, 'ERROR_INPUT_NO_SCHEME', + message='no alignment scheme was setup.') + spec.exit_code(203, 'ERROR_INPUT_EXTRA_ARRAYS', + message='an ArrayData object has more than one array packed inside.') + spec.exit_code(204, 'ERROR_INPUT_WRONG_SHAPE', + message='all input arrays must have the same shape, unless interpolation is allowed.') + spec.exit_code(205, 'ERROR_INPUT_WRONG_ASPECT_RATIO', + message='all input arrays must have the same aspect ratio for interpolation to be effective.') + spec.exit_code(301, 'ERROR_SUB_PROCESS_FAILED_INTERPOLATION', + message='the interpolation could not be completed.') + spec.exit_code(302, 'ERROR_SUB_PROCESS_FAILED_ALIGNMENT', + message='the potential alignment could not be completed.') + spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", + message="The requested method is not yet implemented.") def setup(self): """ Input validation and context setup """ - # Two potentials need have the same shape - first_potential_shape = self.inputs.first_potential.get_shape( - self.inputs.first_potential.get_arraynames()[0]) - second_potential_shape = self.inputs.second_potential.get_shape( - self.inputs.second_potential.get_arraynames()[0]) - if first_potential_shape != second_potential_shape: - if self.inputs.interpolate: - self.ctx.interpolation_required = True - else: - self.report( - 'The two potentials could not be aligned as they are the different shapes and interpolation is not allowed.' - ) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_WRONG_SHAPE - else: - self.ctx.interpolation_required = False - - if self.inputs.alignment_scheme not in ['lany-zunger']: - self.report( - 'The requested alignment scheme, "{}" is not recognised.'. - format(self.inputs.alignment_scheme)) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_BAD_SCHEME - self.ctx.first_potential = self.inputs.first_potential - self.ctx.second_potential = self.inputs.second_potential + # Only one namespace should be used at a time, and only one + schemes_found = [] + for namespace in valid_schemes: + if namespace in self.inputs: + schemes_found.append(namespace) + if len(schemes_found) == 1: + self.ctx.alignment_scheme = namespace + elif len(schemes_found) == 0: + return self.exit_codes.ERROR_INPUT_NO_SCHEME + else: + return self.exit_codes.ERROR_INPUT_BAD_SCHEME + + + # Collect the inputs from the selected scheme + inputs = AttributeDict( + self.exposed_inputs(valid_schemes[self.ctx.alignment_scheme], + namespace=self.ctx.alignment_scheme)) + self.ctx.inputs = inputs + + # Array should have the same shape - if not they should be interpolated to have the same shape + # Collect the arrays + arrays = { + 'first_potential': inputs.first_potential, + 'second_potential': inputs.second_potential + } + if 'charge_density' in inputs: # density-weighted case + arrays['charge_density'] = inputs.charge_density + + # Check if ArrayData objects have more than one array packed in them + for array in arrays.values(): + if len(array.get_arraynames()) != 1: + return self.exit_codes.ERROR_INPUT_EXTRA_ARRAYS + + # Unpack and obtain the shapes + array_shapes = {} + for array_name, array in arrays.items(): + shape = array.get_shape(array.get_arraynames()[0]) + array_shapes[array_name] = shape + + # Check if the shapes are the same. If not, we must be allowed to interpolate + self.ctx.interpolation_required = False + if len(set(array_shapes.values())) != 1: + self.ctx.interpolation_required = True + if not self.inputs.allow_interpolation: + return self.exit_codes.ERROR_INPUT_WRONG_SHAPE + + # For interpolation to be meaningful, the dimensions of the arrays must be compatible + # For example, if one grid was (3,1) and another was (1,3), how would interpolation + # be done? We try to avoid the situation where data is thrown away, and also one + # where we make new grids which are the product of others. + # Check that, when in ascending order according the dimension of the first axis, + # all other axis keep the correct ordering. + # If the reasoning was compelling, this could be relaxed later to the product type + # situation where having a (3,1) and a (1,3) would result in a target grid of (3,3) + sorted_shapes = sorted(list(array_shapes.values())) + for index, shape in enumerate(sorted_shapes): + for axis in [1,2]: # Sorting is correct for axis 0, now check if the others are okay + if index == 0: + continue + else: + if (shape[axis] < sorted_shapes[index-1][axis]) : # Are the values not ascending? + return self.exit_codes.ERROR_INPUT_WRONG_ASPECT_RATIO + + # Keep the dicts for later use + self.ctx.arrays = arrays + self.ctx.array_shapes = array_shapes + + + def interpolation_required(self): + """ + Return wether interpolation of the input arrays is needed due to their sizes being mismatched + """ + return self.ctx.interpolation_required - self.ctx.alignment = 0.0 def do_interpolation(self): - """ + """ If interpolation is required, apply it """ - - if self.ctx.interpolation_required: - self.report('Doing potential alignment') - # TODO: Call the interpolation function and update the context + self.report('Interpolating between mismatched arrays') + + shapes_array = np.array(list(self.ctx.array_shapes.values())) + # Get max size along each axis - this is the target array size + target_shape = orm.List(list=[ + np.max(shapes_array[:,0]), + np.max(shapes_array[:,1]), + np.max(shapes_array[:,2]) + ]) + + self.report('Target interpolation size: {}'.format(target_shape.get_list())) + + self.report('Doing interpolation') + interpolated_arrays = {} + for array_name, array in self.ctx.arrays.items(): + interpolated_arrays[array_name] = get_interpolation( + input_array=array, + target_shape=target_shape) + self.ctx.interpolated_arrays = interpolated_arrays return @@ -102,19 +183,42 @@ def calculate_alignment(self): """ Calculate the alignment according to the requested scheme """ - # Call the correct alignment scheme - if self.inputs.alignment_scheme == 'lany-zunger': - # TODO: import and call the alignment function - self.ctx.alignment = testing() - #self.ctx.alignment = + # Get the correct alignment scheme workchain + alignment_workchain = valid_schemes[self.ctx.alignment_scheme] + + inputs = self.ctx.inputs + + # Replace input arrays with interpolated versions + for array_name, array in self.ctx.interpolated_arrays.items(): + inputs[array_name] = array + + workchain_future = self.submit(alignment_workchain, **inputs) + self.to_context(**{'alignment_wc': workchain_future}) return + + def check_alignment_workchain(self): + """ + Check if the model potential alignment workchain have finished correctly. + If yes, assign the outputs to the context + """ + + alignment_workchain = self.ctx['alignment_wc'] + + if not alignment_workchain.is_finished_ok: + self.report( + 'Potential alignment workchain has failed with status {}' + .format(alignment_workchain.exit_status)) + return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT + else: + self.ctx.alignment = alignment_workchain.outputs.alignment_required + def results(self): """ Collect results """ self.report( "Completed alignment. An alignment of {} eV is required".format( - self.ctx.alignment.value)) + self.ctx.alignment.value * hartree_to_ev/2.0 )) self.out('alignment_required', self.ctx.alignment) diff --git a/aiida_defects/formation_energy/potential_alignment/utils.py b/aiida_defects/formation_energy/potential_alignment/utils.py index 34c3ba6..a40a11e 100644 --- a/aiida_defects/formation_energy/potential_alignment/utils.py +++ b/aiida_defects/formation_energy/potential_alignment/utils.py @@ -6,6 +6,9 @@ # For further information on the license, see the LICENSE.txt file # ######################################################################################## from __future__ import absolute_import + +import numpy as np + from aiida.engine import calcfunction from aiida import orm """ @@ -16,7 +19,7 @@ @calcfunction def get_potential_difference(first_potential, second_potential): """ - Calculate the difference of two potentials + Calculate the difference of two potentials that have the same size Parameters ---------- @@ -41,3 +44,44 @@ def get_potential_difference(first_potential, second_potential): difference_potential.set_array('difference_potential', difference_array) return difference_potential + +@calcfunction +def get_interpolation(input_array, target_shape): + """ + Interpolate an array into a larger array of size, `target_size` + + Parameters + ---------- + array: orm.ArrayData + Array to interpolate + target_shape: orm.List + The target shape to interpolate the array to + + Returns + ------- + interpolated_array + The calculated difference of the two potentials + """ + + from scipy.ndimage.interpolation import map_coordinates + + # Unpack + array = input_array.get_array(input_array.get_arraynames()[0]) + target_shape = target_shape.get_list() + + # It's a bit complicated to understand map_coordinates + # The coordinates used to understand the data are the matrix coords of the data + # The coords passed are the new coords you want to interpolate for + # So, we meshgrid a new set of coords in units of the matrix coords of the data + i = np.linspace(0, array.shape[0]-1, target_shape[0]) + j = np.linspace(0, array.shape[1]-1, target_shape[1]) + k = np.linspace(0, array.shape[2]-1, target_shape[2]) + + ii,jj,kk = np.meshgrid(i,j,k) + target_coords = np.array([ii,jj,kk]) + interp_array = map_coordinates(input=np.real(array), coordinates=target_coords) + + interpolated_array = orm.ArrayData() + interpolated_array.set_array('interpolated_array', interp_array) + + return interpolated_array \ No newline at end of file From 77813ef63b22330fe8968e029b6343904701c643 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 15 Jun 2020 00:16:27 +0200 Subject: [PATCH 04/60] add chemicalpotential workchain --- .../chemical_potential/__init__.py | 7 + .../chemical_potential/chemical_potential.py | 191 ++++++++++++++++++ .../chemical_potential/utils.py | 105 ++++++++++ aiida_defects/formation_energy/utils.py | 12 +- 4 files changed, 313 insertions(+), 2 deletions(-) create mode 100644 aiida_defects/formation_energy/chemical_potential/__init__.py create mode 100644 aiida_defects/formation_energy/chemical_potential/chemical_potential.py create mode 100644 aiida_defects/formation_energy/chemical_potential/utils.py diff --git a/aiida_defects/formation_energy/chemical_potential/__init__.py b/aiida_defects/formation_energy/chemical_potential/__init__.py new file mode 100644 index 0000000..4d27567 --- /dev/null +++ b/aiida_defects/formation_energy/chemical_potential/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py new file mode 100644 index 0000000..a4fda21 --- /dev/null +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -0,0 +1,191 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida.engine import WorkChain, calcfunction, ToContext, while_ +from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData +import sys +import numpy as np +from pymatgen.core.composition import Composition +from pymatgen import MPRester, Composition, Element +from itertools import combinations + +from .utils import * + +class ChemicalPotentialWorkchain(WorkChain): + """ + Compute the range of chemical potential of different elements which are consistent with the stability + of that compound. + Here we implement method similar to Buckeridge et al., (https://doi.org/10.1016/j.cpc.2013.08.026), + """ + ref_energy = {'Li':-195.51408, 'P':-191.03878, 'O':-557.49850, 'S':-326.67885, 'Cl':-451.66500, 'B':-86.50025, 'Zn':-6275.54609, + 'Mg':-445.18254, 'Ta':-1928.66788, 'Zr':-1348.75011, 'Sn':-2162.23795, 'Mo':-1865.95416, 'Ta':-1928.66325, 'Be':-382.31135, + 'C':-246.491433, 'Si':-154.27445, 'Na': -1294.781, 'K': -1515.34028, 'Rb': -665.48096, 'Cs': -855.71637, 'Ca': -1018.30809, + 'Sr': -953.20309, 'Ba': -5846.81333} + @classmethod + def define(cls, spec): + super(ChemicalPotentialWorkchain, cls).define(spec) + spec.input("formation_energy_dict", valid_type=Dict) + spec.input("compound", valid_type=Str) + spec.input("dependent_element", valid_type=Str) + spec.input("defect_specie", valid_type=Str) + #spec.input("ref_energy", valid_type=Float) + spec.input("tolerance", valid_type=Float) + + spec.outline( + cls.set_matrix_of_constraint, + cls.solve_matrix_of_constraint, + cls.get_centroid, + cls.chemical_potential, + ) + #spec.output(stability_corners', valid_type=ArrayData) + spec.output('matrix_of_constraints', valid_type=ArrayData) + spec.output('chemical_potential', valid_type=Float) + + spec.exit_code(601, "ERROR_CHEMICAL_POTENTIAL_FAILED", + message="The stability region can't be determined. The compound is probably unstable" + ) + + def set_matrix_of_constraint(self): + compound_of_interest = Composition(self.inputs.compound.value) + N_species = len(compound_of_interest) + N_competing_phases = len(self.inputs.formation_energy_dict.get_dict()) - 1 + + column_order = {} # To track which element corresponds to each column, the dependent element is always the last column + i = 0 + for ele in compound_of_interest: + if ele.symbol != self.inputs.dependent_element.value: + column_order[ele.symbol] = i + i += 1 + column_order[self.inputs.dependent_element.value] = N_species - 1 + self.ctx.column_order = Dict(dict=column_order) + + ############################################################################## + # Construct matrix containing all linear equations. The last column is the rhs + # of the system of equations + ############################################################################## + + # Construct the 1st equation corresponding to the compound of interest + eqns = np.zeros(N_species+1) + for ele in compound_of_interest: + eqns[column_order[ele.symbol]] = -1.0*compound_of_interest[ele] + eqns[N_species] = -1.0*self.inputs.formation_energy_dict.get_dict()[self.inputs.compound.value] + self.ctx.first_eqn = eqns + #print(eqns) + + # Now loop through all the competing phases + for key in self.inputs.formation_energy_dict.keys(): + # if key != compound: + if not same_composition(key, self.inputs.compound.value): + tmp = np.zeros(N_species+1) + temp_composition = Composition(key) + for ele in temp_composition: + tmp[column_order[ele.symbol]] = temp_composition[ele] + tmp[N_species] = self.inputs.formation_energy_dict.get_dict()[key] + eqns = np.vstack((eqns, tmp)) + #print(eqns) + + # Add constraints corresponding to the stability with respect to decomposition into + # elements and combine it with the constraint on the stability of compound of interest + for ele in compound_of_interest: + if ele.symbol != self.inputs.dependent_element.value: + tmp = np.zeros(N_species+1) + tmp[column_order[ele.symbol]] = 1.0 + eqns = np.vstack((eqns, tmp)) + tmp = np.zeros(N_species+1) + tmp[column_order[ele.symbol]] = -1.0 + tmp[N_species] = -1.*self.inputs.formation_energy_dict.get_dict()[self.inputs.compound.value]/compound_of_interest[ele] + eqns = np.vstack((eqns, tmp)) + #print(eqns) + + # Eliminate the dependent element (variable) from the equations + mask = eqns[1:, N_species-1] != 0.0 + eqns_0 = eqns[1:,:][mask] + common_factor = compound_of_interest[self.inputs.dependent_element.value]/eqns_0[:, N_species-1] + eqns_0 = eqns_0*np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting + eqns_0 = (eqns_0+eqns[0,:])/np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting + eqns[1:,:][mask] = eqns_0 + #print(eqns) + + # Store the matrix of constraint (before removing the depedent-element row) in the database + temp_data = ArrayData() + temp_data.set_array('data', eqns) + set_of_constraints = return_matrix_of_constraint(temp_data) + #self.ctx.constraints = set_of_constraints + self.out('matrix_of_constraints', set_of_constraints) + + matrix = np.delete(eqns, N_species-1, axis=1) + matrix_data = ArrayData() + matrix_data.set_array('set_of_constraints', matrix) + self.ctx.matrix_eqns = matrix_data + + def solve_matrix_of_constraint(self): + matrix_eqns = self.ctx.matrix_eqns.get_array('set_of_constraints') + N_species = matrix_eqns.shape[1] + + ### Look at all combination of lines and find their intersections + comb = combinations(np.arange(np.shape(matrix_eqns)[0]), N_species-1) + intersecting_points = [] + for item in list(comb): + try: + point = np.linalg.solve(matrix_eqns[item,:-1], matrix_eqns[item,-1]) + intersecting_points.append(point) + except np.linalg.LinAlgError: + ### Singular matrix: lines are parallels therefore don't have any intersection + pass + + intersecting_points = np.array(intersecting_points) + get_constraint = np.dot(intersecting_points, matrix_eqns[:,:-1].T) + check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= self.inputs.tolerance.value + bool_mask = [not(False in x) for x in check_constraint] + corners_of_stability_region = intersecting_points[bool_mask] + #corners_of_stability_region = remove_duplicate(corners_of_stability_region) + + if corners_of_stability_region.size == 0: + self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(self.inputs.compound.value)) + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED + + ### compute the corresponding chemical potential of the dependent element + with_dependent = (self.ctx.first_eqn[-1]-np.sum(corners_of_stability_region*self.ctx.first_eqn[:-2], axis=1))/self.ctx.first_eqn[-2] + corners_of_stability_region = np.hstack((corners_of_stability_region, np.reshape(with_dependent,(len(with_dependent),1)))) + #print(corners_of_stability_region) + + stability_data = ArrayData() + stability_data.set_array('stability_corners', corners_of_stability_region) + self.ctx.stability_corners = stability_data + #self.out("stability_corners", self.ctx.stability_corners) + + def get_centroid(self): + + ### Use to determine centroid (as oppose to center). Applicable only in 2D chemical potential map (ternary systems) + #stability_corners = Order_point_clockwise(self.ctx.stability_corners.get_array('stability_corners')) + #P = Polygon(stability_corners) + #centroid_of_stability = np.array([P.centroid.x, P.centroid.y]) + + stability_corners = self.ctx.stability_corners.get_array('stability_corners') + M = self.ctx.matrix_eqns.get_array('set_of_constraints') + grid = get_grid(stability_corners[:,:-1], M) + ctr_stability = get_centroid(grid) #without the dependent element + #ctr_stability = np.mean(stability_corners[:,:-1], axis=0) #without the dependent element + + ### Add the corresponding chemical potential of the dependent element + with_dependent = (self.ctx.first_eqn[-1]-np.sum(ctr_stability*self.ctx.first_eqn[:-2]))/self.ctx.first_eqn[-2] + centroid_of_stability = np.append(ctr_stability, with_dependent) + self.report('center of stability is {}'.format(centroid_of_stability)) + ctrd = ArrayData() + ctrd.set_array('data', centroid_of_stability) + self.ctx.centroid = ctrd + #self.out("centroid", self.ctx.centroid) + + def chemical_potential(self): + index = self.ctx.column_order[self.inputs.defect_specie.value] + #chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), self.inputs.ref_energy) + chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), Float(self.ref_energy[self.inputs.defect_specie.value])) + self.ctx.chemical_potential = chemical_potential + self.out('chemical_potential', chemical_potential) + self.report('The chemical potential of {} is {}'.format(self.inputs.defect_specie.value, chemical_potential.value)) diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py new file mode 100644 index 0000000..12d01cc --- /dev/null +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida.engine import calcfunction +import numpy as np +from pymatgen.core.composition import Composition +from aiida.orm import ArrayData, Float +from pymatgen import Element +from shapely.geometry import Polygon +from itertools import combinations + +def same_composition(compound_1, compound_2): + composition_1 = Composition(compound_1) + composition_2 = Composition(compound_2) + list_1 = [ele.symbol for ele in composition_1] + list_2 = [ele.symbol for ele in composition_2] + list_1.sort() + list_2.sort() + if list_1 != list_2: + return False + else: + number_ele_1 = [composition_1[ele] for ele in list_1] + number_ele_2 = [composition_2[ele] for ele in list_2] + return number_ele_1 == number_ele_2 + +def is_point_in_array(ref_point, ref_array): + for point in ref_array: + if np.array_equal(ref_point, point): + return True + return False + +def remove_duplicate(array): + non_duplicate_array = [] + for point in array: + if not is_point_in_array(point, non_duplicate_array): + non_duplicate_array.append(point) + return np.array(non_duplicate_array) + +def Order_point_clockwise(points): + center = np.mean(points, axis=0) + # compute angle + t = np.arctan2(points[:,0]-center[0], points[:,1]-center[1]) + sort_t = np.sort(t) + t = list(t) + u = [t.index(element) for element in sort_t] + ordered_points = points[u] + return ordered_points + +def get_grid(stability_corners, matrix_eqns, N_point=100, tolerance=1E-4): + xmin = np.amin(stability_corners[:,0]) + xmax = np.amax(stability_corners[:,0]) + ymin = np.amin(stability_corners[:,1]) + ymax = np.amax(stability_corners[:,1]) + x = np.linspace(xmin, xmax, N_point) + y = np.linspace(ymin, ymax, N_point) + + dim = stability_corners.shape[1] + if dim == 2: + xx, yy = np.meshgrid(x, y) + points = np.append(xx.reshape(-1,1),yy.reshape(-1,1),axis=1) + elif dim == 3: + zmin = np.amin(stability_corners[:,2]) + zmax = np.amax(stability_corners[:,2]) + z = np.linspace(zmin, zmax, N_point) + xx, yy, zz = np.meshgrid(x, y, z) + points = np.append(xx.reshape(-1,1),yy.reshape(-1,1),axis=1) + points = np.append(points,zz.reshape(-1,1),axis=1) + else: + print('Not yet implemented for quinternary compounds and higher. Use center instead of centroid') + return stability_corners + + get_constraint = np.dot(points, matrix_eqns[:,:-1].T) + check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= tolerance + bool_mask = [not(False in x) for x in check_constraint] + points_in_stable_region = points[bool_mask] + + return points_in_stable_region + +def get_centroid(stability_region): + return np.mean(stability_region, axis=0) + +def PolygoneArea(stability_corners): + # stability corners must be ordered clockwise or anticlockwise + x = stability_corners[:,0] + y = stability_corners[:,1] + return 0.5*np.abs(np.dot(x,np.roll(y,1))-np.dot(y,np.roll(x,1))) + +@calcfunction +def return_matrix_of_constraint(matrix_data): + matrix = matrix_data.get_array('data') + x = matrix + np.zeros_like(matrix) + mat = ArrayData() + mat.set_array('data', x) + #matrix_data.set_array('data', eqn) + return mat + +@calcfunction +def get_chemical_potential(ref_energy, chem_pot): + return Float(ref_energy.value + chem_pot.value) diff --git a/aiida_defects/formation_energy/utils.py b/aiida_defects/formation_energy/utils.py index 2c370d0..2e8516d 100644 --- a/aiida_defects/formation_energy/utils.py +++ b/aiida_defects/formation_energy/utils.py @@ -8,7 +8,14 @@ from __future__ import absolute_import from aiida.engine import calcfunction +import numpy as np +def get_vbm(calc_node): + N_electron = calc_node.res.number_of_electrons + vb_index = int(N_electron/2)-1 + vbm = np.amax(calc_node.outputs.output_band.get_array('bands')[:,vb_index]) + + return vbm def run_pw_calculation(pw_inputs, structure, charge): """ @@ -45,12 +52,13 @@ def run_pw_calculation(pw_inputs, structure, charge): @calcfunction -def get_raw_formation_energy(defect_energy, host_energy, chemical_potential, +def get_raw_formation_energy(defect_energy, host_energy, add_or_remove, chemical_potential, charge, fermi_energy, valence_band_maximum): """ Compute the formation energy without correction """ - e_f_uncorrected = defect_energy - host_energy - chemical_potential + ( + sign_of_mu = {'add': +1.0, 'remove': -1.0} + e_f_uncorrected = defect_energy - host_energy - sign_of_mu[add_or_remove.value]*chemical_potential + ( charge * (valence_band_maximum + fermi_energy)) return e_f_uncorrected From b9f131bcdce5c0cce04fdf622d86e312da171a5e Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 15 Jun 2020 00:40:22 +0200 Subject: [PATCH 05/60] add chemicalpotential workchain to the formation_energy workchain --- .../formation_energy/formation_energy_qe.py | 534 ++++++++++-------- 1 file changed, 284 insertions(+), 250 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 719dc73..c64a5c2 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -13,10 +13,11 @@ from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit from aiida.plugins import WorkflowFactory from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain +# from aiida_quantumespresso.calculations.pp import PpCalculation from aiida_defects.formation_energy.formation_energy_base import FormationEnergyWorkchainBase from aiida_defects.formation_energy.utils import run_pw_calculation -from .utils import get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy +from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy class FormationEnergyWorkchainQE(FormationEnergyWorkchainBase): @@ -39,25 +40,30 @@ def define(cls, spec): spec.input_namespace('qe.pp', help="Inputs for postprocessing calculations") + # What calculations to run + spec.input('run_pw_host', valid_type=orm.Bool, required=True) + spec.input('run_pw_defect_q0', valid_type=orm.Bool, required=True) + spec.input('run_pw_defect_q', valid_type=orm.Bool, required=True) + spec.input('run_dfpt', valid_type=orm.Bool, required=True) + + spec.input('host_node', valid_type=orm.Int, required=False) + spec.input('defect_q0_node', valid_type=orm.Int, required=False) + spec.input('defect_q_node', valid_type=orm.Int, required=False) + spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) # DFT inputs (PW.x) - spec.input("qe.dft.supercell.code", - valid_type=orm.Code, + spec.input("qe.dft.supercell.code", valid_type=orm.Code, help="The pw.x code to use for the calculations") - spec.input("qe.dft.supercell.kpoints", - valid_type=orm.KpointsData, + spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, help="The k-point grid to use for the calculations") - spec.input("qe.dft.supercell.parameters", - valid_type=orm.Dict, + spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, help="Parameters for the PWSCF calcuations. Some will be set automatically") - spec.input("qe.dft.supercell.scheduler_options", - valid_type=orm.Dict, + spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, help="Scheduler options for the PW.x calculations") - spec.input_namespace("qe.dft.supercell.pseudopotentials", - valid_type=orm.UpfData, - dynamic=True, - help="The pseudopotential family for use with the code, if required" - ) + spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, + help="Settings for the PW.x calculations") + spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, + help="The pseudopotential family for use with the code, if required") # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant spec.input("qe.dft.unitcell.code", @@ -101,14 +107,14 @@ def define(cls, spec): cls.check_dft_calcs_gaussian_correction, cls.get_dft_potentials_gaussian_correction, cls.check_dft_potentials_gaussian_correction, - cls.get_dft_charge_density_gaussian_correction, - cls.check_dft_charge_density_gaussian_correction, - if_(cls.host_unitcell_provided)( + cls.get_kohn_sham_potentials, + cls.get_charge_density, + if_(cls.if_run_dfpt)( cls.prep_hostcell_calc_for_dfpt, cls.check_hostcell_calc_for_dfpt, + cls.prep_calc_dfpt_calculation, ), - cls.prep_calc_dfpt_calculation, - cls.check_dfpt_calculation, + cls.get_permittivity, cls.run_gaussian_correction_workchain), if_(cls.is_point_scheme)( cls.raise_not_implemented @@ -116,6 +122,8 @@ def define(cls, spec): #cls.run_point_correction_workchain), ), cls.check_correction_workchain), + cls.run_chemical_potential_workchain, + cls.check_chemical_potential_workchain, cls.compute_formation_energy ) @@ -132,6 +140,7 @@ def prep_dft_calcs_gaussian_correction(self): pw_inputs.pseudos = self.inputs.qe.dft.supercell.pseudopotentials pw_inputs.kpoints = self.inputs.qe.dft.supercell.kpoints pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + pw_inputs.settings = self.inputs.qe.dft.supercell.settings parameters = self.inputs.qe.dft.supercell.parameters.get_dict() @@ -142,39 +151,40 @@ def prep_dft_calcs_gaussian_correction(self): return self.exit_codes.ERROR_PARAMETER_OVERRIDE # Host structure - pw_inputs.structure = self.inputs.host_structure - parameters['SYSTEM']['tot_charge'] = orm.Float(0.) - pw_inputs.parameters = orm.Dict(dict=parameters) + if self.inputs.run_pw_host: + pw_inputs.structure = self.inputs.host_structure + parameters['SYSTEM']['tot_charge'] = orm.Float(0.) + pw_inputs.parameters = orm.Dict(dict=parameters) - future = self.submit(pw_inputs) - self.report( - 'Launching PWSCF for host structure (PK={}) with charge {} (PK={})' - .format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'calc_host': future}) + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for host structure (PK={}) with charge {} (PK={})' + .format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_host': future}) # Defect structure; neutral charge state - pw_inputs.structure = self.inputs.defect_structure - parameters['SYSTEM']['tot_charge'] = orm.Float(0.) - pw_inputs.parameters = orm.Dict(dict=parameters) + if self.inputs.run_pw_defect_q0: + pw_inputs.structure = self.inputs.defect_structure + parameters['SYSTEM']['tot_charge'] = orm.Float(0.) + pw_inputs.parameters = orm.Dict(dict=parameters) - future = self.submit(pw_inputs) - self.report( - 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'calc_defect_q0': future}) + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_defect_q0': future}) # Defect structure; target charge state - pw_inputs.structure = self.inputs.defect_structure - parameters['SYSTEM']['tot_charge'] = self.inputs.defect_charge - pw_inputs.parameters = orm.Dict(dict=parameters) - - future = self.submit(pw_inputs) - self.report( - 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, - self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'calc_defect_q': future}) + if self.inputs.run_pw_defect_q: + pw_inputs.structure = self.inputs.defect_structure + parameters['SYSTEM']['tot_charge'] = self.inputs.defect_charge + pw_inputs.parameters = orm.Dict(dict=parameters) + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'calc_defect_q': future}) def check_dft_calcs_gaussian_correction(self): """ @@ -183,41 +193,230 @@ def check_dft_calcs_gaussian_correction(self): """ # Host - host_calc = self.ctx['calc_host'] - if host_calc.is_finished_ok: - self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV - self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum + if self.inputs.run_pw_host: + host_calc = self.ctx['calc_host'] + if host_calc.is_finished_ok: + self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) + #self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum + self.ctx.host_vbm = orm.Float(get_vbm(host_calc)) + self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + else: + self.report( + 'PWSCF for the host structure has failed with status {}'.format(host_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + HostNode = orm.load_node(self.inputs.host_node.value) + self.ctx.host_energy = orm.Float(HostNode.outputs.output_parameters.get_dict()['energy']) # eV + self.report('Extracting PWSCF for host structure with charge {} from node PK={}' + .format("0.0", self.inputs.host_node.value)) + self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) + #self.ctx.host_vbm = orm.Float(HostNode.outputs.output_band.get_array('bands')[0][-1]) # eV + self.ctx.host_vbm = orm.Float(get_vbm(HostNode)) + self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + defect_q0_calc = self.ctx['calc_defect_q0'] + if not defect_q0_calc.is_finished_ok: + self.report('PWSCF for the defect structure (with charge 0) has failed with status {}'.format(defect_q0_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + self.report('The energy of neutral defect structure is: {} eV'.format(defect_q0_calc.outputs.output_parameters.get_dict()['energy'])) + else: + Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) + self.report('Extracting PWSCF for defect structure with charge {} from node PK={}'.format("0.0", self.inputs.defect_q0_node.value)) + self.report('The energy of neutral defect structure is: {} eV'.format(Defect_q0Node.outputs.output_parameters.get_dict()['energy'])) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + defect_q_calc = self.ctx['calc_defect_q'] + if defect_q_calc.is_finished_ok: + self.ctx.defect_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of defect structure with charge {} is: {} eV'. + format(self.inputs.defect_charge.value, defect_q_calc.outputs.output_parameters.get_dict()['energy'])) + else: + self.report( + 'PWSCF for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value, defect_q_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + self.report('Extracting PWSCF for defect structure with charge {} from node PK={}' + .format(self.inputs.defect_charge.value, self.inputs.defect_q_node.value)) + self.ctx.defect_energy = orm.Float(Defect_qNode.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of defect structure with charge {} is: {} eV'. + format(self.inputs.defect_charge.value, Defect_qNode.outputs.output_parameters.get_dict()['energy'])) + + def get_dft_potentials_gaussian_correction(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Host + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + HostNode = orm.load_node(int(self.inputs.host_node)) + pp_inputs.parent_folder = HostNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for host structure (PK={}) with charge {} (PK={})'. + format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'pp_host': future}) + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + else: + Defect_q0Node = orm.load_node(int(self.inputs.defect_q0_node)) + pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'pp_defect_q0': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(int(self.inputs.defect_q_node)) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'pp_defect_q': future}) + + def check_dft_potentials_gaussian_correction(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['pp_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_host = v_data else: self.report( - 'PWSCF for the host structure has failed with status {}'. - format(host_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + 'Post processing for the host structure has failed with status {}'.format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED # Defect (q=0) - defect_q0_calc = self.ctx['calc_defect_q0'] - if not defect_q0_calc.is_finished_ok: + defect_q0_pp = self.ctx['pp_defect_q0'] + if defect_q0_pp.is_finished_ok: + data_array = defect_q0_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q0 = v_data + else: self.report( - 'PWSCF for the defect structure (with charge 0) has failed with status {}' - .format(defect_q0_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + 'Post processing for the defect structure (with charge 0) has failed with status {}' + .format(defect_q0_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED # Defect (q=q) - defect_q_calc = self.ctx['calc_defect_q'] - if defect_q_calc.is_finished_ok: - self.ctx.defect_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['energy']) # eV + defect_q_pp = self.ctx['pp_defect_q'] + if defect_q_pp.is_finished_ok: + data_array = defect_q_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q = v_data else: self.report( - 'PWSCF for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value, - defect_q_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + 'Post processing for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value,defect_q_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + def get_kohn_sham_potentials(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(1) # Kohn-Sham potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Host + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + HostNode = orm.load_node(self.inputs.host_node.value) + pp_inputs.parent_folder = HostNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting Kohn-Sham potential of host structure (PK={}) with charge {} (PK={})'. + format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'V_KS_host': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting Kohn-Sham potential of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'V_KS_defect_q': future}) + + def get_charge_density(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(0) # Elctrostatic potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + else: + Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) + pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'rho_defect_q0': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'rho_defect_q': future}) def prep_hostcell_calc_for_dfpt(self): """ Run a DFT calculation on the structure to be used for the computation of the dielectric constant """ - self.report("An alternative unit cell has been requested") # Another code may be desirable - N.B. in AiiDA a code refers to a specific @@ -236,13 +435,15 @@ def prep_hostcell_calc_for_dfpt(self): pw_inputs.parameters = orm.Dict(dict=parameters) future = self.submit(pw_inputs) + # self.report( + # 'Launching PWSCF for host unitcell structure (PK={})' + # .format(self.inputs.host_structure.pk, future.pk) + # ) self.report( - 'Launching PWSCF for host unitcell structure (PK={})' - .format(self.inputs.host_structure.pk, future.pk) - ) + 'Launching PWSCF for host unitcell structure (PK={})'.format(self.inputs.host_unitcell.pk, future.pk)) self.to_context(**{'calc_host_unitcell': future}) - return + # return ToContext(**{'calc_host_unitcell': future}) def check_hostcell_calc_for_dfpt(self): """ @@ -294,190 +495,23 @@ def prep_calc_dfpt_calculation(self): ph_inputs.metadata = self.inputs.qe.dfpt.scheduler_options.get_dict() future = self.submit(ph_inputs) - self.report('Launching PH for host structure (PK={})'.format( - self.inputs.host_structure.pk, future.pk)) + self.report('Launching PH for host structure (PK={})'.format(self.inputs.host_structure.pk, future.pk)) self.to_context(**{'calc_dfpt': future}) - def check_dfpt_calculation(self): - - """ - Check that the DFPT calculation has completed successfully - """ - dfpt_calc = self.ctx['calc_dfpt'] - - if dfpt_calc.is_finished_ok: - epsilion_tensor = np.array(dfpt_calc.outputs.output_parameters.get_dict()['dielectric_constant']) - self.ctx.epsilon = orm.Float(np.trace(epsilion_tensor/3.)) - self.report('The computed relative permittivity is {}'.format( - self.ctx.epsilon.value)) - else: - self.report( - 'PH for the host structure has failed with status {}'.format(dfpt_calc.exit_status)) - return self.exit_codes.ERROR_DFPT_CALCULATION_FAILED - - def get_dft_potentials_gaussian_correction(self): - """ - Obtain the electrostatic potentials from the PWSCF calculations. - """ - - # User inputs - pp_inputs = self.inputs.qe.pp.code.get_builder() - pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() - - # Fixed settings - params = orm.Dict(dict={ - 'INPUTPP': { - 'plot_num': 11, # Electrostatic potential - }, - 'PLOT': { - 'iflag' : 3 # 3D - } - }) - pp_inputs.parameters = params - - pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder - future = self.submit(pp_inputs) - self.report( - 'Launching PP.x for host structure (PK={}) with charge {} (PK={}) ' - 'to compute the electrostatic potential.' - .format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_v_host': future}) - - pp_inputs.parent_folder = self.ctx[ - 'calc_defect_q0'].outputs.remote_folder - future = self.submit(pp_inputs) - self.report( - 'Launching PP.x for defect structure (PK={}) with charge {} (PK={}) ' - 'to compute the electrostatic potential.' - .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_v_defect_q0': future}) - - pp_inputs.parent_folder = self.ctx[ - 'calc_defect_q'].outputs.remote_folder - future = self.submit(pp_inputs) - self.report( - 'Launching PP.x for defect structure (PK={}) with charge {} (PK={}) ' - 'to compute the electrostatic potential.' - .format(self.inputs.defect_structure.pk, - self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'pp_v_defect_q': future}) - - def check_dft_potentials_gaussian_correction(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - - # Host - host_pp = self.ctx['pp_v_host'] - if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_host = v_data - else: - self.report( - 'Post processing for the host structure has failed with status {}' - .format(host_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defect (q=0) - defect_q0_pp = self.ctx['pp_v_defect_q0'] - if defect_q0_pp.is_finished_ok: - data_array = defect_q0_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q0 = v_data - else: - self.report( - 'Post processing for the defect structure (with charge 0) has failed with status {}' - .format(defect_q0_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defect (q=q) - defect_q_pp = self.ctx['pp_v_defect_q'] - if defect_q_pp.is_finished_ok: - data_array = defect_q_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q = v_data - else: - self.report( - 'Post processing for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value, - defect_q_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - - def get_dft_charge_density_gaussian_correction(self): - """ - Obtain the charge densities from the PWSCF calculations. - """ - - # User inputs - pp_inputs = self.inputs.qe.pp.code.get_builder() - pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() - - # Fixed settings - # Fixed settings - params = orm.Dict(dict={ - 'INPUTPP': { - 'plot_num': 0, # Electron density - }, - 'PLOT': { - 'iflag' : 3 # 3D - } - }) - pp_inputs.parameters = params - - pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder - future = self.submit(pp_inputs) - self.report( - 'Launching PP.x for host structure (PK={}) with charge {} (PK={}) ' - 'to compute the charge density.' - .format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_rho_host': future}) - - pp_inputs.parent_folder = self.ctx[ - 'calc_defect_q'].outputs.remote_folder - future = self.submit(pp_inputs) - self.report( - 'Launching PP.x for defect structure (PK={}) with charge {} (PK={})' - 'to compute the charge density.' - .format(self.inputs.defect_structure.pk, - self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'pp_rho_defect_q': future}) - - - def check_dft_charge_density_gaussian_correction(self): + def get_permittivity(self): """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. + Compute the dielectric constant to be used in the correction """ - - # Host - host_pp = self.ctx['pp_rho_host'] - if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - rho_data = orm.ArrayData() - rho_data.set_array('data', data_array) - self.ctx.rho_host = rho_data + if self.inputs.run_dfpt: + dfpt_calc = self.ctx['calc_dfpt'] + if dfpt_calc.is_finished_ok: + epsilion_tensor = np.array(dfpt_calc.outputs.output_parameters.get_dict()['dielectric_constant']) + self.ctx.epsilon = orm.Float(np.trace(epsilion_tensor/3.)) + self.report('The computed relative permittivity is {}'.format(self.ctx.epsilon.value)) + else: + self.report( + 'PH for the host structure has failed with status {}'.format(dfpt_calc.exit_status)) + return self.exit_codes.ERROR_DFPT_CALCULATION_FAILED else: - self.report( - 'Post processing for the host structure has failed with status {}' - .format(host_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED + self.ctx.epsilon = self.inputs.epsilon - # Defect (q=q) - defect_q_pp = self.ctx['pp_rho_defect_q'] - if defect_q_pp.is_finished_ok: - data_array = defect_q_pp.outputs.output_data.get_array('data') - rho_data = orm.ArrayData() - rho_data.set_array('data', data_array) - self.ctx.rho_defect_q = rho_data - else: - self.report( - 'Post processing for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value, - defect_q_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED \ No newline at end of file From c0f7ea1b8bc33b0d7d4e16548ae556ed0f647ab0 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Wed, 8 Jul 2020 00:17:12 +0200 Subject: [PATCH 06/60] modify the base and qe workchain to allow restart from finished pw calculations and to include chemical potential workchain --- .../formation_energy/formation_energy_base.py | 123 +++++++++++++----- .../formation_energy/formation_energy_qe.py | 2 +- 2 files changed, 91 insertions(+), 34 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index c3b3675..bdbf7be 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -18,28 +18,28 @@ class FormationEnergyWorkchainBase(WorkChain): """ - The base class to compute the formation energy for a given defect, containing the + The base class to compute the formation energy for a given defect, containing the generic, code-agnostic methods, error codes, etc. - Any computational code can be used to calculate the required energies and relative permittivity. - However, different codes must be setup in specific ways, and so separate classes are used to implement these - possibilities. This is an abstract class and should not be used directly, but rather the - concrete code-specific classes should be used instead. + Any computational code can be used to calculate the required energies and relative permittivity. + However, different codes must be setup in specific ways, and so separate classes are used to implement these + possibilities. This is an abstract class and should not be used directly, but rather the + concrete code-specific classes should be used instead. """ @classmethod def define(cls, spec): super(FormationEnergyWorkchainBase, cls).define(spec) # fmt: off - # Structures + # Structures spec.input( - "host_structure", - valid_type=orm.StructureData, + "host_structure", + valid_type=orm.StructureData, help="Pristine structure" ) spec.input( - "defect_structure", - valid_type=orm.StructureData, + "defect_structure", + valid_type=orm.StructureData, help="Defective structure" ) spec.input( @@ -51,25 +51,38 @@ def define(cls, spec): # Defect details spec.input( - "defect_charge", - valid_type=orm.Float, - help="Defect charge state") + "defect_charge", + valid_type=orm.Float, + help="Defect charge state") + spec.input( + "defect_specie", + valid_type=orm.Str) spec.input( "defect_site", valid_type=orm.List, - help="Defect site position in crystal coordinates", - ) + help="Defect site position in crystal coordinates" ) + #spec.input('ref_energy',valid_type=orm.Float) spec.input( - "fermi_level", - valid_type=orm.Float, - default=orm.Float(0.0), - help="Fermi level position with respect to the valence band maximum", - ) - spec.input( - "chemical_potential", - valid_type=orm.Float, - help="The chemical potential of the given defect type. The convention is that removing an atom is positive", - ) + "fermi_level", + valid_type=orm.Float, + default=lambda: orm.Float(0.0), + help="Fermi level position with respect to the valence band maximum") + # spec.input( + # "chemical_potential", + # valid_type=orm.Float, + # help="The chemical potential of the given defect type. The convention is that removing an atom is positive", + # ) + spec.input("add_or_remove", valid_type=orm.Str, + help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") + + # Chemical potential + spec.input('formation_energy_dict', valid_type=orm.Dict) + spec.input('compound', valid_type=orm.Str) + spec.input('dependent_element', valid_type=orm.Str) + spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) + + + spec.input("run_dfpt", valid_type=orm.Bool) # Methodology spec.input( @@ -99,22 +112,28 @@ def define(cls, spec): spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", message="The correction scheme sub-workchain failed", ) - spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", + spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", message="DFT calculation failed", ) spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", message="A post-processing calculation failed", ) - spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", + spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", message="DFPT calculation failed" ) + spec.exit_code(406, "ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED", + message="The chemical potential calculation failed" + ) + spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly" + ) spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", message="The requested method is not yet implemented", ) # fmt: on def setup(self): - """ + """ Setup the workchain """ @@ -124,6 +143,9 @@ def setup(self): if self.inputs.correction_scheme not in correction_schemes_available: return self.exit_codes.ERROR_INVALID_CORRECTION + def if_run_dfpt(self): + return self.inputs.run_dfpt + def correction_required(self): """ Check if correction is requested @@ -228,20 +250,55 @@ def check_correction_workchain(self): ) self.ctx.total_alignment = correction_wc.outputs.total_alignment + def run_chemical_potential_workchain(self): + from .chemical_potential.chemical_potential import ( + ChemicalPotentialWorkchain, ) + + self.report('Computing the chemical potential of {}'.format(self.inputs.defect_specie.value)) + inputs = { + "formation_energy_dict": self.inputs.formation_energy_dict, + "compound": self.inputs.compound, + "dependent_element": self.inputs.dependent_element, + "defect_specie": self.inputs.defect_specie, + #"ref_energy": self.inputs.ref_energy, + "tolerance": self.inputs.tolerance, + } + workchain_future = self.submit(ChemicalPotentialWorkchain, **inputs) + label = "chemical_potential_workchain" + self.to_context(**{label: workchain_future}) + + def check_chemical_potential_workchain(self): + """ + Check if the chemical potential workchain have finished correctly. + If yes, assign the output to context + """ + + chem_potential_wc = self.ctx["chemical_potential_workchain"] + if not chem_potential_wc.is_finished_ok: + self.report( + "Chemical potential workchain failed with status {}".format( + chem_potential_wc.exit_status + ) + ) + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED + #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION + else: + self.ctx.chemical_potential = chem_potential_wc.outputs.chemical_potential + def compute_formation_energy(self): - """ + """ Compute the formation energy """ - # Raw formation energy self.ctx.e_f_uncorrected = get_raw_formation_energy( self.ctx.defect_energy, self.ctx.host_energy, - self.inputs.chemical_potential, + self.inputs.add_or_remove, + self.ctx.chemical_potential, self.inputs.defect_charge, self.inputs.fermi_level, - self.ctx.host_vbm, - ) + self.ctx.host_vbm + ) self.report( "The computed uncorrected formation energy is {} eV".format( self.ctx.e_f_uncorrected.value diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index c64a5c2..d806ca1 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -108,7 +108,7 @@ def define(cls, spec): cls.get_dft_potentials_gaussian_correction, cls.check_dft_potentials_gaussian_correction, cls.get_kohn_sham_potentials, - cls.get_charge_density, + #cls.get_charge_density, if_(cls.if_run_dfpt)( cls.prep_hostcell_calc_for_dfpt, cls.check_hostcell_calc_for_dfpt, From 095b8dad997e49e9611018bea99055593e5813ae Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Wed, 15 Jul 2020 12:18:38 +0200 Subject: [PATCH 07/60] change pp setup --- .../formation_energy/formation_energy_qe.py | 44 +++++++++++-------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 719dc73..7e440a4 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -325,15 +325,18 @@ def get_dft_potentials_gaussian_correction(self): pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() # Fixed settings - params = orm.Dict(dict={ - 'INPUTPP': { - 'plot_num': 11, # Electrostatic potential - }, - 'PLOT': { - 'iflag' : 3 # 3D - } - }) - pp_inputs.parameters = params + #params = orm.Dict(dict={ + # 'INPUTPP': { + # 'plot_num': 11, # Electrostatic potential + # }, + # 'PLOT': { + # 'iflag' : 3 # 3D + # } + #}) + #pp_inputs.parameters = params + + pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential + pp_inputs.plot_dimension = orm.Int(3) # 3D pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder future = self.submit(pp_inputs) @@ -420,15 +423,18 @@ def get_dft_charge_density_gaussian_correction(self): # Fixed settings # Fixed settings - params = orm.Dict(dict={ - 'INPUTPP': { - 'plot_num': 0, # Electron density - }, - 'PLOT': { - 'iflag' : 3 # 3D - } - }) - pp_inputs.parameters = params +# params = orm.Dict(dict={ +# 'INPUTPP': { +# 'plot_num': 0, # Electron density +# }, +# 'PLOT': { +# 'iflag' : 3 # 3D +# } +# }) +# pp_inputs.parameters = params + + pp_inputs.plot_number = orm.Int(0) # Electron density + pp_inputs.plot_dimension = orm.Int(3) # 3D pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder future = self.submit(pp_inputs) @@ -480,4 +486,4 @@ def check_dft_charge_density_gaussian_correction(self): 'Post processing for the defect structure (with charge {}) has failed with status {}' .format(self.inputs.defect_charge.value, defect_q_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED \ No newline at end of file + return self.exit_codes.ERROR_PP_CALCULATION_FAILED From 3dca05fb47ae17764b91fb4e33dd7126034db92a Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 21 Jul 2020 19:24:56 +0200 Subject: [PATCH 08/60] add files --- aiida_defects/formation_energy_base.py | 335 ++++++++++++++++ aiida_defects/formation_energy_qe.py | 517 +++++++++++++++++++++++++ 2 files changed, 852 insertions(+) create mode 100644 aiida_defects/formation_energy_base.py create mode 100644 aiida_defects/formation_energy_qe.py diff --git a/aiida_defects/formation_energy_base.py b/aiida_defects/formation_energy_base.py new file mode 100644 index 0000000..bdbf7be --- /dev/null +++ b/aiida_defects/formation_energy_base.py @@ -0,0 +1,335 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit + +from .utils import ( + get_raw_formation_energy, + get_corrected_formation_energy, + get_corrected_aligned_formation_energy, +) + +class FormationEnergyWorkchainBase(WorkChain): + """ + The base class to compute the formation energy for a given defect, containing the + generic, code-agnostic methods, error codes, etc. + + Any computational code can be used to calculate the required energies and relative permittivity. + However, different codes must be setup in specific ways, and so separate classes are used to implement these + possibilities. This is an abstract class and should not be used directly, but rather the + concrete code-specific classes should be used instead. + """ + + @classmethod + def define(cls, spec): + super(FormationEnergyWorkchainBase, cls).define(spec) + # fmt: off + # Structures + spec.input( + "host_structure", + valid_type=orm.StructureData, + help="Pristine structure" + ) + spec.input( + "defect_structure", + valid_type=orm.StructureData, + help="Defective structure" + ) + spec.input( + "host_unitcell", + valid_type=orm.StructureData, + help="Pristine structure to use in the calculation of permittivity", + required=False, + ) + + # Defect details + spec.input( + "defect_charge", + valid_type=orm.Float, + help="Defect charge state") + spec.input( + "defect_specie", + valid_type=orm.Str) + spec.input( + "defect_site", + valid_type=orm.List, + help="Defect site position in crystal coordinates" ) + #spec.input('ref_energy',valid_type=orm.Float) + spec.input( + "fermi_level", + valid_type=orm.Float, + default=lambda: orm.Float(0.0), + help="Fermi level position with respect to the valence band maximum") + # spec.input( + # "chemical_potential", + # valid_type=orm.Float, + # help="The chemical potential of the given defect type. The convention is that removing an atom is positive", + # ) + spec.input("add_or_remove", valid_type=orm.Str, + help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") + + # Chemical potential + spec.input('formation_energy_dict', valid_type=orm.Dict) + spec.input('compound', valid_type=orm.Str) + spec.input('dependent_element', valid_type=orm.Str) + spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) + + + spec.input("run_dfpt", valid_type=orm.Bool) + + # Methodology + spec.input( + "correction_scheme", + valid_type=orm.Str, + help="The correction scheme to apply", + ) + + # Outputs + spec.output( + "formation_energy_uncorrected", valid_type=orm.Float, required=True + ) + spec.output( + "formation_energy_corrected", valid_type=orm.Float, required=True + ) + spec.output( + "formation_energy_corrected_aligned", valid_type=orm.Float, required=True + ) + + # Error codes + spec.exit_code(201, "ERROR_INVALID_CORRECTION", + message="The requested correction scheme is not recognised", + ) + spec.exit_code(202, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly", + ) + spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", + message="The correction scheme sub-workchain failed", + ) + spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", + message="DFT calculation failed", + ) + spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", + message="A post-processing calculation failed", + ) + spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", + message="DFPT calculation failed" + ) + spec.exit_code(406, "ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED", + message="The chemical potential calculation failed" + ) + spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly" + ) + spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", + message="The requested method is not yet implemented", + ) + # fmt: on + + def setup(self): + """ + Setup the workchain + """ + + # Check if correction scheme is valid: + correction_schemes_available = ["gaussian", "point"] + if self.inputs.correction_scheme is not None: + if self.inputs.correction_scheme not in correction_schemes_available: + return self.exit_codes.ERROR_INVALID_CORRECTION + + def if_run_dfpt(self): + return self.inputs.run_dfpt + + def correction_required(self): + """ + Check if correction is requested + """ + if self.inputs.correction_scheme is not None: + return True + else: + return False + + def is_gaussian_scheme(self): + """ + Check if Gaussian countercharge correction scheme is being used + """ + return self.inputs.correction_scheme == "gaussian" + + def is_point_scheme(self): + """ + Check if Point countercharge correction scheme is being used + """ + return self.inputs.correction_scheme == "point" + + def host_unitcell_provided(self): + """ + Check if a cell other than the host supercell is provided, such as a unitcell. + An additional DFT calculation is required in this instance + """ + if self.inputs.host_unitcell: + return True + else: + return False + + def run_gaussian_correction_workchain(self): + """ + Run the workchain for the Gaussian Countercharge correction + """ + from .corrections.gaussian_countercharge.gaussian_countercharge import ( + GaussianCounterChargeWorkchain, + ) + + self.report("Computing correction via the Gaussian Countercharge scheme") + + inputs = { + "v_host": self.ctx.v_host, + "v_defect_q0": self.ctx.v_defect_q0, + "v_defect_q": self.ctx.v_defect_q, + "rho_host": self.ctx.rho_host, + "rho_defect_q": self.ctx.rho_defect_q, + "defect_charge": self.inputs.defect_charge, + "defect_site": self.inputs.defect_site, + "host_structure": self.inputs.host_structure, + "epsilon": self.ctx.epsilon, + } + + workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) + label = "correction_workchain" + self.to_context(**{label: workchain_future}) + + def prepare_point_correction_workchain(self): + """ + Get the required inputs for the Point Countercharge correction workchain + + TODO: Finish implementing this interface + """ + return + + def run_point_correction_workchain(self): + """ + Run the workchain for the Point Countercharge correction + + TODO: Finish implementing this interface + """ + from .corrections.point_countercharge.point_countercharge import ( + PointCounterChargeWorkchain, + ) + + self.report("Computing correction via the Point Countercharge scheme") + + inputs = {} + + workchain_future = self.submit(PointCounterChargeWorkchain, **inputs) + label = "correction_workchain" + self.to_context(**{label: workchain_future}) + + def check_correction_workchain(self): + """ + Check if the potential alignment workchains have finished correctly. + If yes, assign the outputs to the context + """ + + correction_wc = self.ctx["correction_workchain"] + if not correction_wc.is_finished_ok: + self.report( + "Correction workchain failed with status {}".format( + correction_wc.exit_status + ) + ) + return self.exit_codes.ERROR_CORRECTION_WORKCHAIN_FAILED + else: + self.ctx.total_correction = correction_wc.outputs.total_correction + self.ctx.electrostatic_correction = ( + correction_wc.outputs.electrostatic_correction + ) + self.ctx.total_alignment = correction_wc.outputs.total_alignment + + def run_chemical_potential_workchain(self): + from .chemical_potential.chemical_potential import ( + ChemicalPotentialWorkchain, ) + + self.report('Computing the chemical potential of {}'.format(self.inputs.defect_specie.value)) + inputs = { + "formation_energy_dict": self.inputs.formation_energy_dict, + "compound": self.inputs.compound, + "dependent_element": self.inputs.dependent_element, + "defect_specie": self.inputs.defect_specie, + #"ref_energy": self.inputs.ref_energy, + "tolerance": self.inputs.tolerance, + } + workchain_future = self.submit(ChemicalPotentialWorkchain, **inputs) + label = "chemical_potential_workchain" + self.to_context(**{label: workchain_future}) + + def check_chemical_potential_workchain(self): + """ + Check if the chemical potential workchain have finished correctly. + If yes, assign the output to context + """ + + chem_potential_wc = self.ctx["chemical_potential_workchain"] + if not chem_potential_wc.is_finished_ok: + self.report( + "Chemical potential workchain failed with status {}".format( + chem_potential_wc.exit_status + ) + ) + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED + #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION + else: + self.ctx.chemical_potential = chem_potential_wc.outputs.chemical_potential + + def compute_formation_energy(self): + """ + Compute the formation energy + """ + # Raw formation energy + self.ctx.e_f_uncorrected = get_raw_formation_energy( + self.ctx.defect_energy, + self.ctx.host_energy, + self.inputs.add_or_remove, + self.ctx.chemical_potential, + self.inputs.defect_charge, + self.inputs.fermi_level, + self.ctx.host_vbm + ) + self.report( + "The computed uncorrected formation energy is {} eV".format( + self.ctx.e_f_uncorrected.value + ) + ) + self.out("formation_energy_uncorrected", self.ctx.e_f_uncorrected) + + # Corrected formation energy + self.ctx.e_f_corrected = get_corrected_formation_energy( + self.ctx.e_f_uncorrected, self.ctx.electrostatic_correction + ) + self.report( + "The computed corrected formation energy is {} eV".format( + self.ctx.e_f_corrected.value + ) + ) + self.out("formation_energy_corrected", self.ctx.e_f_corrected) + + # Corrected formation energy with potential alignment + self.ctx.e_f_corrected_aligned = get_corrected_aligned_formation_energy( + self.ctx.e_f_corrected, self.ctx.total_alignment + ) + self.report( + "The computed corrected formation energy, including potential alignments, is {} eV".format( + self.ctx.e_f_corrected_aligned.value + ) + ) + self.out("formation_energy_corrected_aligned", self.ctx.e_f_corrected_aligned) + + def raise_not_implemented(self): + """ + Raise a not-implemented error + """ + return self.exit_codes.ERROR_NOT_IMPLEMENTED diff --git a/aiida_defects/formation_energy_qe.py b/aiida_defects/formation_energy_qe.py new file mode 100644 index 0000000..d806ca1 --- /dev/null +++ b/aiida_defects/formation_energy_qe.py @@ -0,0 +1,517 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +import numpy as np + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit +from aiida.plugins import WorkflowFactory +from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain +# from aiida_quantumespresso.calculations.pp import PpCalculation + +from aiida_defects.formation_energy.formation_energy_base import FormationEnergyWorkchainBase +from aiida_defects.formation_energy.utils import run_pw_calculation +from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy + + +class FormationEnergyWorkchainQE(FormationEnergyWorkchainBase): + """ + Compute the formation energy for a given defect using QuantumESPRESSO + """ + @classmethod + def define(cls, spec): + super(FormationEnergyWorkchainQE, cls).define(spec) + + # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here + # we keep track of things with two separate namespaces. An additional code, and an additional + # namespace, is used for postprocessing + spec.input_namespace('qe.dft.supercell', + help="Inputs for DFT calculations on supercells") + spec.input_namespace('qe.dft.unitcell', required=False, + help="Inputs for a DFT calculation on an alternative host cell for use with DFPT") + spec.input_namespace('qe.dfpt', + help="Inputs for DFPT calculation for calculating the relative permittivity of the host material") + spec.input_namespace('qe.pp', + help="Inputs for postprocessing calculations") + + # What calculations to run + spec.input('run_pw_host', valid_type=orm.Bool, required=True) + spec.input('run_pw_defect_q0', valid_type=orm.Bool, required=True) + spec.input('run_pw_defect_q', valid_type=orm.Bool, required=True) + spec.input('run_dfpt', valid_type=orm.Bool, required=True) + + spec.input('host_node', valid_type=orm.Int, required=False) + spec.input('defect_q0_node', valid_type=orm.Int, required=False) + spec.input('defect_q_node', valid_type=orm.Int, required=False) + spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) + + # DFT inputs (PW.x) + spec.input("qe.dft.supercell.code", valid_type=orm.Code, + help="The pw.x code to use for the calculations") + spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, + help="Parameters for the PWSCF calcuations. Some will be set automatically") + spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the PW.x calculations") + spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, + help="Settings for the PW.x calculations") + spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, + help="The pseudopotential family for use with the code, if required") + + # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant + spec.input("qe.dft.unitcell.code", + valid_type=orm.Code, + help="The pw.x code to use for the calculations") + spec.input("qe.dft.unitcell.kpoints", + valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("qe.dft.unitcell.parameters", + valid_type=orm.Dict, + help="Parameters for the PWSCF calcuations. Some will be set automatically") + spec.input("qe.dft.unitcell.scheduler_options", + valid_type=orm.Dict, + help="Scheduler options for the PW.x calculations") + spec.input_namespace("qe.dft.unitcell.pseudopotentials", + valid_type=orm.UpfData, + dynamic=True, + help="The pseudopotential family for use with the code, if required") + + # Postprocessing inputs (PP.x) + spec.input("qe.pp.code", + valid_type=orm.Code, + help="The pp.x code to use for the calculations") + spec.input("qe.pp.scheduler_options", + valid_type=orm.Dict, + help="Scheduler options for the PP.x calculations") + + # DFPT inputs (PH.x) + spec.input("qe.dfpt.code", + valid_type=orm.Code, + help="The ph.x code to use for the calculations") + spec.input("qe.dfpt.scheduler_options", + valid_type=orm.Dict, + help="Scheduler options for the PH.x calculations") + + spec.outline( + cls.setup, + if_(cls.correction_required)( + if_(cls.is_gaussian_scheme)( + cls.prep_dft_calcs_gaussian_correction, + cls.check_dft_calcs_gaussian_correction, + cls.get_dft_potentials_gaussian_correction, + cls.check_dft_potentials_gaussian_correction, + cls.get_kohn_sham_potentials, + #cls.get_charge_density, + if_(cls.if_run_dfpt)( + cls.prep_hostcell_calc_for_dfpt, + cls.check_hostcell_calc_for_dfpt, + cls.prep_calc_dfpt_calculation, + ), + cls.get_permittivity, + cls.run_gaussian_correction_workchain), + if_(cls.is_point_scheme)( + cls.raise_not_implemented + #cls.prepare_point_correction_workchain, + #cls.run_point_correction_workchain), + ), + cls.check_correction_workchain), + cls.run_chemical_potential_workchain, + cls.check_chemical_potential_workchain, + cls.compute_formation_energy + ) + + def prep_dft_calcs_gaussian_correction(self): + """ + Get the required inputs for the Gaussian Countercharge correction workchain. + This method runs the required calculations to generate the energies and potentials + for the Gaussian scheme. + """ + + self.report("Setting up the Gaussian Countercharge correction workchain") + + pw_inputs = self.inputs.qe.dft.supercell.code.get_builder() + pw_inputs.pseudos = self.inputs.qe.dft.supercell.pseudopotentials + pw_inputs.kpoints = self.inputs.qe.dft.supercell.kpoints + pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + pw_inputs.settings = self.inputs.qe.dft.supercell.settings + + parameters = self.inputs.qe.dft.supercell.parameters.get_dict() + + # We set 'tot_charge' later so throw an error if the user tries to set it to avoid + # any ambiguity or unseen modification of user input + if 'tot_charge' in parameters['SYSTEM']: + self.report('You cannot set the "tot_charge" PW.x parameter explicitly') + return self.exit_codes.ERROR_PARAMETER_OVERRIDE + + # Host structure + if self.inputs.run_pw_host: + pw_inputs.structure = self.inputs.host_structure + parameters['SYSTEM']['tot_charge'] = orm.Float(0.) + pw_inputs.parameters = orm.Dict(dict=parameters) + + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for host structure (PK={}) with charge {} (PK={})' + .format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_host': future}) + + # Defect structure; neutral charge state + if self.inputs.run_pw_defect_q0: + pw_inputs.structure = self.inputs.defect_structure + parameters['SYSTEM']['tot_charge'] = orm.Float(0.) + pw_inputs.parameters = orm.Dict(dict=parameters) + + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_defect_q0': future}) + + # Defect structure; target charge state + if self.inputs.run_pw_defect_q: + pw_inputs.structure = self.inputs.defect_structure + parameters['SYSTEM']['tot_charge'] = self.inputs.defect_charge + pw_inputs.parameters = orm.Dict(dict=parameters) + + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'calc_defect_q': future}) + + def check_dft_calcs_gaussian_correction(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + if self.inputs.run_pw_host: + host_calc = self.ctx['calc_host'] + if host_calc.is_finished_ok: + self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) + #self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum + self.ctx.host_vbm = orm.Float(get_vbm(host_calc)) + self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + else: + self.report( + 'PWSCF for the host structure has failed with status {}'.format(host_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + HostNode = orm.load_node(self.inputs.host_node.value) + self.ctx.host_energy = orm.Float(HostNode.outputs.output_parameters.get_dict()['energy']) # eV + self.report('Extracting PWSCF for host structure with charge {} from node PK={}' + .format("0.0", self.inputs.host_node.value)) + self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) + #self.ctx.host_vbm = orm.Float(HostNode.outputs.output_band.get_array('bands')[0][-1]) # eV + self.ctx.host_vbm = orm.Float(get_vbm(HostNode)) + self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + defect_q0_calc = self.ctx['calc_defect_q0'] + if not defect_q0_calc.is_finished_ok: + self.report('PWSCF for the defect structure (with charge 0) has failed with status {}'.format(defect_q0_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + self.report('The energy of neutral defect structure is: {} eV'.format(defect_q0_calc.outputs.output_parameters.get_dict()['energy'])) + else: + Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) + self.report('Extracting PWSCF for defect structure with charge {} from node PK={}'.format("0.0", self.inputs.defect_q0_node.value)) + self.report('The energy of neutral defect structure is: {} eV'.format(Defect_q0Node.outputs.output_parameters.get_dict()['energy'])) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + defect_q_calc = self.ctx['calc_defect_q'] + if defect_q_calc.is_finished_ok: + self.ctx.defect_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of defect structure with charge {} is: {} eV'. + format(self.inputs.defect_charge.value, defect_q_calc.outputs.output_parameters.get_dict()['energy'])) + else: + self.report( + 'PWSCF for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value, defect_q_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + self.report('Extracting PWSCF for defect structure with charge {} from node PK={}' + .format(self.inputs.defect_charge.value, self.inputs.defect_q_node.value)) + self.ctx.defect_energy = orm.Float(Defect_qNode.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of defect structure with charge {} is: {} eV'. + format(self.inputs.defect_charge.value, Defect_qNode.outputs.output_parameters.get_dict()['energy'])) + + def get_dft_potentials_gaussian_correction(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Host + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + HostNode = orm.load_node(int(self.inputs.host_node)) + pp_inputs.parent_folder = HostNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for host structure (PK={}) with charge {} (PK={})'. + format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'pp_host': future}) + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + else: + Defect_q0Node = orm.load_node(int(self.inputs.defect_q0_node)) + pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'pp_defect_q0': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(int(self.inputs.defect_q_node)) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'pp_defect_q': future}) + + def check_dft_potentials_gaussian_correction(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['pp_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_host = v_data + else: + self.report( + 'Post processing for the host structure has failed with status {}'.format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=0) + defect_q0_pp = self.ctx['pp_defect_q0'] + if defect_q0_pp.is_finished_ok: + data_array = defect_q0_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q0 = v_data + else: + self.report( + 'Post processing for the defect structure (with charge 0) has failed with status {}' + .format(defect_q0_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=q) + defect_q_pp = self.ctx['pp_defect_q'] + if defect_q_pp.is_finished_ok: + data_array = defect_q_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q = v_data + else: + self.report( + 'Post processing for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value,defect_q_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + def get_kohn_sham_potentials(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(1) # Kohn-Sham potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Host + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + HostNode = orm.load_node(self.inputs.host_node.value) + pp_inputs.parent_folder = HostNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting Kohn-Sham potential of host structure (PK={}) with charge {} (PK={})'. + format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'V_KS_host': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting Kohn-Sham potential of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'V_KS_defect_q': future}) + + def get_charge_density(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(0) # Elctrostatic potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + else: + Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) + pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'rho_defect_q0': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'rho_defect_q': future}) + + def prep_hostcell_calc_for_dfpt(self): + """ + Run a DFT calculation on the structure to be used for the computation of the + dielectric constant + """ + self.report("An alternative unit cell has been requested") + + # Another code may be desirable - N.B. in AiiDA a code refers to a specific + # executable on a specific computer. As the PH calculation may have to be run on + # an HPC cluster, the PW calculation must be run on the same machine and so this + # may necessitate that a different code is used than that for the supercell calculations. + pw_inputs = self.inputs.qe.dft.unitcell.code.get_builder() + + # These are not necessarily the same as for the other DFT calculations + pw_inputs.pseudos = self.inputs.qe.dft.unitcell.pseudopotentials + pw_inputs.kpoints = self.inputs.qe.dft.unitcell.kpoints + pw_inputs.metadata = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() + + pw_inputs.structure = self.inputs.host_unitcell + parameters = self.inputs.qe.dft.unitcell.parameters.get_dict() + pw_inputs.parameters = orm.Dict(dict=parameters) + + future = self.submit(pw_inputs) + # self.report( + # 'Launching PWSCF for host unitcell structure (PK={})' + # .format(self.inputs.host_structure.pk, future.pk) + # ) + self.report( + 'Launching PWSCF for host unitcell structure (PK={})'.format(self.inputs.host_unitcell.pk, future.pk)) + self.to_context(**{'calc_host_unitcell': future}) + + # return ToContext(**{'calc_host_unitcell': future}) + + def check_hostcell_calc_for_dfpt(self): + """ + Check if the DFT calculation to be used for the computation of the + dielectric constant has completed successfully. + """ + + host_unitcell_calc = self.ctx['calc_host_unitcell'] + if not host_unitcell_calc.is_finished_ok: + self.report( + 'PWSCF for the host unitcell structure has failed with status {}'. + format(host_unitcell_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + def prep_calc_dfpt_calculation(self): + """ + Run a DFPT calculation to compute the dielectric constant for the pristine material + """ + + ph_inputs = self.inputs.qe.dfpt.code.get_builder() + + # Setting up the calculation depends on whether the parent SCF calculation is either + # the host supercell or an alternative host unitcell + if self.inputs.host_unitcell: + ph_inputs.parent_folder = self.ctx['calc_host_unitcell'].outputs.remote_folder + else: + ph_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + + parameters = orm.Dict(dict={ + 'INPUTPH': { + "tr2_ph" : 1e-16, + 'epsil': True, + 'trans': False + } + }) + ph_inputs.parameters = parameters + + # Set the q-points for a Gamma-point calculation + # N.B. Setting a 1x1x1 mesh is not equivalent as this will trigger a full phonon dispersion calculation + qpoints = orm.KpointsData() + if self.inputs.host_unitcell: + qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host_unitcell'].inputs.structure) + else: + qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host'].inputs.structure) + qpoints.set_kpoints([[0.,0.,0.]]) + qpoints.get_kpoints(cartesian=True) + ph_inputs.qpoints = qpoints + + ph_inputs.metadata = self.inputs.qe.dfpt.scheduler_options.get_dict() + + future = self.submit(ph_inputs) + self.report('Launching PH for host structure (PK={})'.format(self.inputs.host_structure.pk, future.pk)) + self.to_context(**{'calc_dfpt': future}) + + def get_permittivity(self): + """ + Compute the dielectric constant to be used in the correction + """ + if self.inputs.run_dfpt: + dfpt_calc = self.ctx['calc_dfpt'] + if dfpt_calc.is_finished_ok: + epsilion_tensor = np.array(dfpt_calc.outputs.output_parameters.get_dict()['dielectric_constant']) + self.ctx.epsilon = orm.Float(np.trace(epsilion_tensor/3.)) + self.report('The computed relative permittivity is {}'.format(self.ctx.epsilon.value)) + else: + self.report( + 'PH for the host structure has failed with status {}'.format(dfpt_calc.exit_status)) + return self.exit_codes.ERROR_DFPT_CALCULATION_FAILED + else: + self.ctx.epsilon = self.inputs.epsilon + From 3a061d2c026aa8a70efd3bd2515d7ebcf789b6a5 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 21 Jul 2020 19:27:26 +0200 Subject: [PATCH 09/60] add formation_energy workchains --- .../formation_energy/formation_energy_base.py | 335 ++++++++++++ .../formation_energy/formation_energy_qe.py | 517 ++++++++++++++++++ 2 files changed, 852 insertions(+) create mode 100644 aiida_defects/formation_energy/formation_energy_base.py create mode 100644 aiida_defects/formation_energy/formation_energy_qe.py diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py new file mode 100644 index 0000000..bdbf7be --- /dev/null +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -0,0 +1,335 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit + +from .utils import ( + get_raw_formation_energy, + get_corrected_formation_energy, + get_corrected_aligned_formation_energy, +) + +class FormationEnergyWorkchainBase(WorkChain): + """ + The base class to compute the formation energy for a given defect, containing the + generic, code-agnostic methods, error codes, etc. + + Any computational code can be used to calculate the required energies and relative permittivity. + However, different codes must be setup in specific ways, and so separate classes are used to implement these + possibilities. This is an abstract class and should not be used directly, but rather the + concrete code-specific classes should be used instead. + """ + + @classmethod + def define(cls, spec): + super(FormationEnergyWorkchainBase, cls).define(spec) + # fmt: off + # Structures + spec.input( + "host_structure", + valid_type=orm.StructureData, + help="Pristine structure" + ) + spec.input( + "defect_structure", + valid_type=orm.StructureData, + help="Defective structure" + ) + spec.input( + "host_unitcell", + valid_type=orm.StructureData, + help="Pristine structure to use in the calculation of permittivity", + required=False, + ) + + # Defect details + spec.input( + "defect_charge", + valid_type=orm.Float, + help="Defect charge state") + spec.input( + "defect_specie", + valid_type=orm.Str) + spec.input( + "defect_site", + valid_type=orm.List, + help="Defect site position in crystal coordinates" ) + #spec.input('ref_energy',valid_type=orm.Float) + spec.input( + "fermi_level", + valid_type=orm.Float, + default=lambda: orm.Float(0.0), + help="Fermi level position with respect to the valence band maximum") + # spec.input( + # "chemical_potential", + # valid_type=orm.Float, + # help="The chemical potential of the given defect type. The convention is that removing an atom is positive", + # ) + spec.input("add_or_remove", valid_type=orm.Str, + help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") + + # Chemical potential + spec.input('formation_energy_dict', valid_type=orm.Dict) + spec.input('compound', valid_type=orm.Str) + spec.input('dependent_element', valid_type=orm.Str) + spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) + + + spec.input("run_dfpt", valid_type=orm.Bool) + + # Methodology + spec.input( + "correction_scheme", + valid_type=orm.Str, + help="The correction scheme to apply", + ) + + # Outputs + spec.output( + "formation_energy_uncorrected", valid_type=orm.Float, required=True + ) + spec.output( + "formation_energy_corrected", valid_type=orm.Float, required=True + ) + spec.output( + "formation_energy_corrected_aligned", valid_type=orm.Float, required=True + ) + + # Error codes + spec.exit_code(201, "ERROR_INVALID_CORRECTION", + message="The requested correction scheme is not recognised", + ) + spec.exit_code(202, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly", + ) + spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", + message="The correction scheme sub-workchain failed", + ) + spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", + message="DFT calculation failed", + ) + spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", + message="A post-processing calculation failed", + ) + spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", + message="DFPT calculation failed" + ) + spec.exit_code(406, "ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED", + message="The chemical potential calculation failed" + ) + spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly" + ) + spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", + message="The requested method is not yet implemented", + ) + # fmt: on + + def setup(self): + """ + Setup the workchain + """ + + # Check if correction scheme is valid: + correction_schemes_available = ["gaussian", "point"] + if self.inputs.correction_scheme is not None: + if self.inputs.correction_scheme not in correction_schemes_available: + return self.exit_codes.ERROR_INVALID_CORRECTION + + def if_run_dfpt(self): + return self.inputs.run_dfpt + + def correction_required(self): + """ + Check if correction is requested + """ + if self.inputs.correction_scheme is not None: + return True + else: + return False + + def is_gaussian_scheme(self): + """ + Check if Gaussian countercharge correction scheme is being used + """ + return self.inputs.correction_scheme == "gaussian" + + def is_point_scheme(self): + """ + Check if Point countercharge correction scheme is being used + """ + return self.inputs.correction_scheme == "point" + + def host_unitcell_provided(self): + """ + Check if a cell other than the host supercell is provided, such as a unitcell. + An additional DFT calculation is required in this instance + """ + if self.inputs.host_unitcell: + return True + else: + return False + + def run_gaussian_correction_workchain(self): + """ + Run the workchain for the Gaussian Countercharge correction + """ + from .corrections.gaussian_countercharge.gaussian_countercharge import ( + GaussianCounterChargeWorkchain, + ) + + self.report("Computing correction via the Gaussian Countercharge scheme") + + inputs = { + "v_host": self.ctx.v_host, + "v_defect_q0": self.ctx.v_defect_q0, + "v_defect_q": self.ctx.v_defect_q, + "rho_host": self.ctx.rho_host, + "rho_defect_q": self.ctx.rho_defect_q, + "defect_charge": self.inputs.defect_charge, + "defect_site": self.inputs.defect_site, + "host_structure": self.inputs.host_structure, + "epsilon": self.ctx.epsilon, + } + + workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) + label = "correction_workchain" + self.to_context(**{label: workchain_future}) + + def prepare_point_correction_workchain(self): + """ + Get the required inputs for the Point Countercharge correction workchain + + TODO: Finish implementing this interface + """ + return + + def run_point_correction_workchain(self): + """ + Run the workchain for the Point Countercharge correction + + TODO: Finish implementing this interface + """ + from .corrections.point_countercharge.point_countercharge import ( + PointCounterChargeWorkchain, + ) + + self.report("Computing correction via the Point Countercharge scheme") + + inputs = {} + + workchain_future = self.submit(PointCounterChargeWorkchain, **inputs) + label = "correction_workchain" + self.to_context(**{label: workchain_future}) + + def check_correction_workchain(self): + """ + Check if the potential alignment workchains have finished correctly. + If yes, assign the outputs to the context + """ + + correction_wc = self.ctx["correction_workchain"] + if not correction_wc.is_finished_ok: + self.report( + "Correction workchain failed with status {}".format( + correction_wc.exit_status + ) + ) + return self.exit_codes.ERROR_CORRECTION_WORKCHAIN_FAILED + else: + self.ctx.total_correction = correction_wc.outputs.total_correction + self.ctx.electrostatic_correction = ( + correction_wc.outputs.electrostatic_correction + ) + self.ctx.total_alignment = correction_wc.outputs.total_alignment + + def run_chemical_potential_workchain(self): + from .chemical_potential.chemical_potential import ( + ChemicalPotentialWorkchain, ) + + self.report('Computing the chemical potential of {}'.format(self.inputs.defect_specie.value)) + inputs = { + "formation_energy_dict": self.inputs.formation_energy_dict, + "compound": self.inputs.compound, + "dependent_element": self.inputs.dependent_element, + "defect_specie": self.inputs.defect_specie, + #"ref_energy": self.inputs.ref_energy, + "tolerance": self.inputs.tolerance, + } + workchain_future = self.submit(ChemicalPotentialWorkchain, **inputs) + label = "chemical_potential_workchain" + self.to_context(**{label: workchain_future}) + + def check_chemical_potential_workchain(self): + """ + Check if the chemical potential workchain have finished correctly. + If yes, assign the output to context + """ + + chem_potential_wc = self.ctx["chemical_potential_workchain"] + if not chem_potential_wc.is_finished_ok: + self.report( + "Chemical potential workchain failed with status {}".format( + chem_potential_wc.exit_status + ) + ) + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED + #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION + else: + self.ctx.chemical_potential = chem_potential_wc.outputs.chemical_potential + + def compute_formation_energy(self): + """ + Compute the formation energy + """ + # Raw formation energy + self.ctx.e_f_uncorrected = get_raw_formation_energy( + self.ctx.defect_energy, + self.ctx.host_energy, + self.inputs.add_or_remove, + self.ctx.chemical_potential, + self.inputs.defect_charge, + self.inputs.fermi_level, + self.ctx.host_vbm + ) + self.report( + "The computed uncorrected formation energy is {} eV".format( + self.ctx.e_f_uncorrected.value + ) + ) + self.out("formation_energy_uncorrected", self.ctx.e_f_uncorrected) + + # Corrected formation energy + self.ctx.e_f_corrected = get_corrected_formation_energy( + self.ctx.e_f_uncorrected, self.ctx.electrostatic_correction + ) + self.report( + "The computed corrected formation energy is {} eV".format( + self.ctx.e_f_corrected.value + ) + ) + self.out("formation_energy_corrected", self.ctx.e_f_corrected) + + # Corrected formation energy with potential alignment + self.ctx.e_f_corrected_aligned = get_corrected_aligned_formation_energy( + self.ctx.e_f_corrected, self.ctx.total_alignment + ) + self.report( + "The computed corrected formation energy, including potential alignments, is {} eV".format( + self.ctx.e_f_corrected_aligned.value + ) + ) + self.out("formation_energy_corrected_aligned", self.ctx.e_f_corrected_aligned) + + def raise_not_implemented(self): + """ + Raise a not-implemented error + """ + return self.exit_codes.ERROR_NOT_IMPLEMENTED diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py new file mode 100644 index 0000000..d806ca1 --- /dev/null +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -0,0 +1,517 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +import numpy as np + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit +from aiida.plugins import WorkflowFactory +from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain +# from aiida_quantumespresso.calculations.pp import PpCalculation + +from aiida_defects.formation_energy.formation_energy_base import FormationEnergyWorkchainBase +from aiida_defects.formation_energy.utils import run_pw_calculation +from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy + + +class FormationEnergyWorkchainQE(FormationEnergyWorkchainBase): + """ + Compute the formation energy for a given defect using QuantumESPRESSO + """ + @classmethod + def define(cls, spec): + super(FormationEnergyWorkchainQE, cls).define(spec) + + # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here + # we keep track of things with two separate namespaces. An additional code, and an additional + # namespace, is used for postprocessing + spec.input_namespace('qe.dft.supercell', + help="Inputs for DFT calculations on supercells") + spec.input_namespace('qe.dft.unitcell', required=False, + help="Inputs for a DFT calculation on an alternative host cell for use with DFPT") + spec.input_namespace('qe.dfpt', + help="Inputs for DFPT calculation for calculating the relative permittivity of the host material") + spec.input_namespace('qe.pp', + help="Inputs for postprocessing calculations") + + # What calculations to run + spec.input('run_pw_host', valid_type=orm.Bool, required=True) + spec.input('run_pw_defect_q0', valid_type=orm.Bool, required=True) + spec.input('run_pw_defect_q', valid_type=orm.Bool, required=True) + spec.input('run_dfpt', valid_type=orm.Bool, required=True) + + spec.input('host_node', valid_type=orm.Int, required=False) + spec.input('defect_q0_node', valid_type=orm.Int, required=False) + spec.input('defect_q_node', valid_type=orm.Int, required=False) + spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) + + # DFT inputs (PW.x) + spec.input("qe.dft.supercell.code", valid_type=orm.Code, + help="The pw.x code to use for the calculations") + spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, + help="Parameters for the PWSCF calcuations. Some will be set automatically") + spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the PW.x calculations") + spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, + help="Settings for the PW.x calculations") + spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, + help="The pseudopotential family for use with the code, if required") + + # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant + spec.input("qe.dft.unitcell.code", + valid_type=orm.Code, + help="The pw.x code to use for the calculations") + spec.input("qe.dft.unitcell.kpoints", + valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("qe.dft.unitcell.parameters", + valid_type=orm.Dict, + help="Parameters for the PWSCF calcuations. Some will be set automatically") + spec.input("qe.dft.unitcell.scheduler_options", + valid_type=orm.Dict, + help="Scheduler options for the PW.x calculations") + spec.input_namespace("qe.dft.unitcell.pseudopotentials", + valid_type=orm.UpfData, + dynamic=True, + help="The pseudopotential family for use with the code, if required") + + # Postprocessing inputs (PP.x) + spec.input("qe.pp.code", + valid_type=orm.Code, + help="The pp.x code to use for the calculations") + spec.input("qe.pp.scheduler_options", + valid_type=orm.Dict, + help="Scheduler options for the PP.x calculations") + + # DFPT inputs (PH.x) + spec.input("qe.dfpt.code", + valid_type=orm.Code, + help="The ph.x code to use for the calculations") + spec.input("qe.dfpt.scheduler_options", + valid_type=orm.Dict, + help="Scheduler options for the PH.x calculations") + + spec.outline( + cls.setup, + if_(cls.correction_required)( + if_(cls.is_gaussian_scheme)( + cls.prep_dft_calcs_gaussian_correction, + cls.check_dft_calcs_gaussian_correction, + cls.get_dft_potentials_gaussian_correction, + cls.check_dft_potentials_gaussian_correction, + cls.get_kohn_sham_potentials, + #cls.get_charge_density, + if_(cls.if_run_dfpt)( + cls.prep_hostcell_calc_for_dfpt, + cls.check_hostcell_calc_for_dfpt, + cls.prep_calc_dfpt_calculation, + ), + cls.get_permittivity, + cls.run_gaussian_correction_workchain), + if_(cls.is_point_scheme)( + cls.raise_not_implemented + #cls.prepare_point_correction_workchain, + #cls.run_point_correction_workchain), + ), + cls.check_correction_workchain), + cls.run_chemical_potential_workchain, + cls.check_chemical_potential_workchain, + cls.compute_formation_energy + ) + + def prep_dft_calcs_gaussian_correction(self): + """ + Get the required inputs for the Gaussian Countercharge correction workchain. + This method runs the required calculations to generate the energies and potentials + for the Gaussian scheme. + """ + + self.report("Setting up the Gaussian Countercharge correction workchain") + + pw_inputs = self.inputs.qe.dft.supercell.code.get_builder() + pw_inputs.pseudos = self.inputs.qe.dft.supercell.pseudopotentials + pw_inputs.kpoints = self.inputs.qe.dft.supercell.kpoints + pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + pw_inputs.settings = self.inputs.qe.dft.supercell.settings + + parameters = self.inputs.qe.dft.supercell.parameters.get_dict() + + # We set 'tot_charge' later so throw an error if the user tries to set it to avoid + # any ambiguity or unseen modification of user input + if 'tot_charge' in parameters['SYSTEM']: + self.report('You cannot set the "tot_charge" PW.x parameter explicitly') + return self.exit_codes.ERROR_PARAMETER_OVERRIDE + + # Host structure + if self.inputs.run_pw_host: + pw_inputs.structure = self.inputs.host_structure + parameters['SYSTEM']['tot_charge'] = orm.Float(0.) + pw_inputs.parameters = orm.Dict(dict=parameters) + + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for host structure (PK={}) with charge {} (PK={})' + .format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_host': future}) + + # Defect structure; neutral charge state + if self.inputs.run_pw_defect_q0: + pw_inputs.structure = self.inputs.defect_structure + parameters['SYSTEM']['tot_charge'] = orm.Float(0.) + pw_inputs.parameters = orm.Dict(dict=parameters) + + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_defect_q0': future}) + + # Defect structure; target charge state + if self.inputs.run_pw_defect_q: + pw_inputs.structure = self.inputs.defect_structure + parameters['SYSTEM']['tot_charge'] = self.inputs.defect_charge + pw_inputs.parameters = orm.Dict(dict=parameters) + + future = self.submit(pw_inputs) + self.report( + 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'calc_defect_q': future}) + + def check_dft_calcs_gaussian_correction(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + if self.inputs.run_pw_host: + host_calc = self.ctx['calc_host'] + if host_calc.is_finished_ok: + self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) + #self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum + self.ctx.host_vbm = orm.Float(get_vbm(host_calc)) + self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + else: + self.report( + 'PWSCF for the host structure has failed with status {}'.format(host_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + HostNode = orm.load_node(self.inputs.host_node.value) + self.ctx.host_energy = orm.Float(HostNode.outputs.output_parameters.get_dict()['energy']) # eV + self.report('Extracting PWSCF for host structure with charge {} from node PK={}' + .format("0.0", self.inputs.host_node.value)) + self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) + #self.ctx.host_vbm = orm.Float(HostNode.outputs.output_band.get_array('bands')[0][-1]) # eV + self.ctx.host_vbm = orm.Float(get_vbm(HostNode)) + self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + defect_q0_calc = self.ctx['calc_defect_q0'] + if not defect_q0_calc.is_finished_ok: + self.report('PWSCF for the defect structure (with charge 0) has failed with status {}'.format(defect_q0_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + self.report('The energy of neutral defect structure is: {} eV'.format(defect_q0_calc.outputs.output_parameters.get_dict()['energy'])) + else: + Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) + self.report('Extracting PWSCF for defect structure with charge {} from node PK={}'.format("0.0", self.inputs.defect_q0_node.value)) + self.report('The energy of neutral defect structure is: {} eV'.format(Defect_q0Node.outputs.output_parameters.get_dict()['energy'])) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + defect_q_calc = self.ctx['calc_defect_q'] + if defect_q_calc.is_finished_ok: + self.ctx.defect_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of defect structure with charge {} is: {} eV'. + format(self.inputs.defect_charge.value, defect_q_calc.outputs.output_parameters.get_dict()['energy'])) + else: + self.report( + 'PWSCF for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value, defect_q_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + self.report('Extracting PWSCF for defect structure with charge {} from node PK={}' + .format(self.inputs.defect_charge.value, self.inputs.defect_q_node.value)) + self.ctx.defect_energy = orm.Float(Defect_qNode.outputs.output_parameters.get_dict()['energy']) # eV + self.report('The energy of defect structure with charge {} is: {} eV'. + format(self.inputs.defect_charge.value, Defect_qNode.outputs.output_parameters.get_dict()['energy'])) + + def get_dft_potentials_gaussian_correction(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Host + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + HostNode = orm.load_node(int(self.inputs.host_node)) + pp_inputs.parent_folder = HostNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for host structure (PK={}) with charge {} (PK={})'. + format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'pp_host': future}) + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + else: + Defect_q0Node = orm.load_node(int(self.inputs.defect_q0_node)) + pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'pp_defect_q0': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(int(self.inputs.defect_q_node)) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'pp_defect_q': future}) + + def check_dft_potentials_gaussian_correction(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['pp_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_host = v_data + else: + self.report( + 'Post processing for the host structure has failed with status {}'.format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=0) + defect_q0_pp = self.ctx['pp_defect_q0'] + if defect_q0_pp.is_finished_ok: + data_array = defect_q0_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q0 = v_data + else: + self.report( + 'Post processing for the defect structure (with charge 0) has failed with status {}' + .format(defect_q0_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=q) + defect_q_pp = self.ctx['pp_defect_q'] + if defect_q_pp.is_finished_ok: + data_array = defect_q_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q = v_data + else: + self.report( + 'Post processing for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value,defect_q_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + def get_kohn_sham_potentials(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(1) # Kohn-Sham potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Host + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + HostNode = orm.load_node(self.inputs.host_node.value) + pp_inputs.parent_folder = HostNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting Kohn-Sham potential of host structure (PK={}) with charge {} (PK={})'. + format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'V_KS_host': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting Kohn-Sham potential of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'V_KS_defect_q': future}) + + def get_charge_density(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + + # Fixed settings + pp_inputs.plot_number = orm.Int(0) # Elctrostatic potential + pp_inputs.plot_dimension = orm.Int(3) # 3D + + # Defect (q=0) + if self.inputs.run_pw_defect_q0: + pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + else: + Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) + pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'rho_defect_q0': future}) + + # Defect (q=q) + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) + pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'rho_defect_q': future}) + + def prep_hostcell_calc_for_dfpt(self): + """ + Run a DFT calculation on the structure to be used for the computation of the + dielectric constant + """ + self.report("An alternative unit cell has been requested") + + # Another code may be desirable - N.B. in AiiDA a code refers to a specific + # executable on a specific computer. As the PH calculation may have to be run on + # an HPC cluster, the PW calculation must be run on the same machine and so this + # may necessitate that a different code is used than that for the supercell calculations. + pw_inputs = self.inputs.qe.dft.unitcell.code.get_builder() + + # These are not necessarily the same as for the other DFT calculations + pw_inputs.pseudos = self.inputs.qe.dft.unitcell.pseudopotentials + pw_inputs.kpoints = self.inputs.qe.dft.unitcell.kpoints + pw_inputs.metadata = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() + + pw_inputs.structure = self.inputs.host_unitcell + parameters = self.inputs.qe.dft.unitcell.parameters.get_dict() + pw_inputs.parameters = orm.Dict(dict=parameters) + + future = self.submit(pw_inputs) + # self.report( + # 'Launching PWSCF for host unitcell structure (PK={})' + # .format(self.inputs.host_structure.pk, future.pk) + # ) + self.report( + 'Launching PWSCF for host unitcell structure (PK={})'.format(self.inputs.host_unitcell.pk, future.pk)) + self.to_context(**{'calc_host_unitcell': future}) + + # return ToContext(**{'calc_host_unitcell': future}) + + def check_hostcell_calc_for_dfpt(self): + """ + Check if the DFT calculation to be used for the computation of the + dielectric constant has completed successfully. + """ + + host_unitcell_calc = self.ctx['calc_host_unitcell'] + if not host_unitcell_calc.is_finished_ok: + self.report( + 'PWSCF for the host unitcell structure has failed with status {}'. + format(host_unitcell_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + def prep_calc_dfpt_calculation(self): + """ + Run a DFPT calculation to compute the dielectric constant for the pristine material + """ + + ph_inputs = self.inputs.qe.dfpt.code.get_builder() + + # Setting up the calculation depends on whether the parent SCF calculation is either + # the host supercell or an alternative host unitcell + if self.inputs.host_unitcell: + ph_inputs.parent_folder = self.ctx['calc_host_unitcell'].outputs.remote_folder + else: + ph_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + + parameters = orm.Dict(dict={ + 'INPUTPH': { + "tr2_ph" : 1e-16, + 'epsil': True, + 'trans': False + } + }) + ph_inputs.parameters = parameters + + # Set the q-points for a Gamma-point calculation + # N.B. Setting a 1x1x1 mesh is not equivalent as this will trigger a full phonon dispersion calculation + qpoints = orm.KpointsData() + if self.inputs.host_unitcell: + qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host_unitcell'].inputs.structure) + else: + qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host'].inputs.structure) + qpoints.set_kpoints([[0.,0.,0.]]) + qpoints.get_kpoints(cartesian=True) + ph_inputs.qpoints = qpoints + + ph_inputs.metadata = self.inputs.qe.dfpt.scheduler_options.get_dict() + + future = self.submit(ph_inputs) + self.report('Launching PH for host structure (PK={})'.format(self.inputs.host_structure.pk, future.pk)) + self.to_context(**{'calc_dfpt': future}) + + def get_permittivity(self): + """ + Compute the dielectric constant to be used in the correction + """ + if self.inputs.run_dfpt: + dfpt_calc = self.ctx['calc_dfpt'] + if dfpt_calc.is_finished_ok: + epsilion_tensor = np.array(dfpt_calc.outputs.output_parameters.get_dict()['dielectric_constant']) + self.ctx.epsilon = orm.Float(np.trace(epsilion_tensor/3.)) + self.report('The computed relative permittivity is {}'.format(self.ctx.epsilon.value)) + else: + self.report( + 'PH for the host structure has failed with status {}'.format(dfpt_calc.exit_status)) + return self.exit_codes.ERROR_DFPT_CALCULATION_FAILED + else: + self.ctx.epsilon = self.inputs.epsilon + From 05bb32672479f8dbb1f995268de1dce16a0a4c67 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Thu, 23 Jul 2020 23:36:25 +0200 Subject: [PATCH 10/60] add a step to formation_energy_qe.py to check and extract the charge density from get_charge_density calculations --- .../formation_energy/formation_energy_base.py | 1 + .../formation_energy/formation_energy_qe.py | 67 +++++++++++++++++-- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index bdbf7be..f29a7b3 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -192,6 +192,7 @@ def run_gaussian_correction_workchain(self): "v_defect_q0": self.ctx.v_defect_q0, "v_defect_q": self.ctx.v_defect_q, "rho_host": self.ctx.rho_host, + #"rho_host": self.ctx.rho_defect_q0, "rho_defect_q": self.ctx.rho_defect_q, "defect_charge": self.inputs.defect_charge, "defect_site": self.inputs.defect_site, diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index d806ca1..8263bcc 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -107,8 +107,9 @@ def define(cls, spec): cls.check_dft_calcs_gaussian_correction, cls.get_dft_potentials_gaussian_correction, cls.check_dft_potentials_gaussian_correction, - cls.get_kohn_sham_potentials, - #cls.get_charge_density, + #cls.get_kohn_sham_potentials, + cls.get_charge_density, + cls.check_charge_density_calculations, if_(cls.if_run_dfpt)( cls.prep_hostcell_calc_for_dfpt, cls.check_hostcell_calc_for_dfpt, @@ -385,9 +386,21 @@ def get_charge_density(self): pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() # Fixed settings - pp_inputs.plot_number = orm.Int(0) # Elctrostatic potential + pp_inputs.plot_number = orm.Int(0) # Electron Density pp_inputs.plot_dimension = orm.Int(3) # 3D + # Host + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + HostNode = orm.load_node(self.inputs.host_node.value) + pp_inputs.parent_folder = HostNode.outputs.remote_folder + + future = self.submit(pp_inputs) + self.report('Extracting charge density of host structure (PK={}) with charge {} (PK={})' + .format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_rho_host': future}) + # Defect (q=0) if self.inputs.run_pw_defect_q0: pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder @@ -398,7 +411,7 @@ def get_charge_density(self): future = self.submit(pp_inputs) self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'rho_defect_q0': future}) + self.to_context(**{'calc_rho_defect_q0': future}) # Defect (q=q) if self.inputs.run_pw_defect_q: @@ -410,7 +423,51 @@ def get_charge_density(self): future = self.submit(pp_inputs) self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'rho_defect_q': future}) + self.to_context(**{'calc_rho_defect_q': future}) + + def check_charge_density_calculations(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['calc_rho_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.rho_host = v_data + else: + self.report( + 'Post processing for the host structure has failed with status {}'.format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=0) + defect_q0_pp = self.ctx['calc_rho_defect_q0'] + if defect_q0_pp.is_finished_ok: + data_array = defect_q0_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.rho_defect_q0 = v_data + else: + self.report( + 'Post processing for the defect structure (with charge 0) has failed with status {}' + .format(defect_q0_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=q) + defect_q_pp = self.ctx['calc_rho_defect_q'] + if defect_q_pp.is_finished_ok: + data_array = defect_q_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.rho_defect_q = v_data + else: + self.report( + 'Post processing for the defect structure (with charge 0) has failed with status {}' + .format(defect_q_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED def prep_hostcell_calc_for_dfpt(self): """ From 72852ebdd201d7994ac5dee33f864281d610f5dd Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Sun, 26 Jul 2020 21:50:40 +0200 Subject: [PATCH 11/60] update the reference energy dictionary --- .../chemical_potential/chemical_potential.py | 16 +- aiida_defects/formation_energy_base.py | 335 ------------ aiida_defects/formation_energy_qe.py | 517 ------------------ 3 files changed, 12 insertions(+), 856 deletions(-) delete mode 100644 aiida_defects/formation_energy_base.py delete mode 100644 aiida_defects/formation_energy_qe.py diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index a4fda21..34ea76f 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -23,10 +23,18 @@ class ChemicalPotentialWorkchain(WorkChain): of that compound. Here we implement method similar to Buckeridge et al., (https://doi.org/10.1016/j.cpc.2013.08.026), """ - ref_energy = {'Li':-195.51408, 'P':-191.03878, 'O':-557.49850, 'S':-326.67885, 'Cl':-451.66500, 'B':-86.50025, 'Zn':-6275.54609, - 'Mg':-445.18254, 'Ta':-1928.66788, 'Zr':-1348.75011, 'Sn':-2162.23795, 'Mo':-1865.95416, 'Ta':-1928.66325, 'Be':-382.31135, - 'C':-246.491433, 'Si':-154.27445, 'Na': -1294.781, 'K': -1515.34028, 'Rb': -665.48096, 'Cs': -855.71637, 'Ca': -1018.30809, - 'Sr': -953.20309, 'Ba': -5846.81333} + ref_energy = {'Li':-195.51408, 'Na': -1294.781, 'K': -1515.34028, 'Rb': -665.48096, 'Cs': -855.71637, + 'Be':-382.31135, 'Mg':-445.18254, 'Ca': -1018.30809, 'Sr': -953.20309, 'Ba': -5846.81333, + 'Zn':-6275.54609, 'Cd': -1654.6221, 'Hg': -4220.15135, + 'Sc': -1248.9897, 'Y': -1260.65816, 'La': -6144.92827, + 'Ti': -1621.05852, 'Zr':-1348.75011, 'Hf': -1534.22174, 'Ce': -6467.05434, + 'V': -1972.58745, 'Ta':-1928.66788, 'Nb': -4490.36915, 'Mo':-1865.95416, 'W': -2163.94756, + 'B':-86.50025, 'Al': -524.03435, 'Ga': -3741.75933, 'In': -1964.75235, + 'C':-246.491433, 'Si':-154.27445, 'Ge': -2900.6119, 'Sn':-2162.23795, 'Pb': -11693.19885, + 'N': -274.00734, 'P':-191.03878, 'As': -247.16661, 'Sb': -2511.63434, 'Bi': -2516.86824, + 'O':-557.49850, 'S':-326.67885, 'Se': -589.11981, 'Te': -359.67088, + 'F': -657.89303, 'Cl':-451.66500, 'Br': -551.1849, 'I': -5073.88094 + } @classmethod def define(cls, spec): super(ChemicalPotentialWorkchain, cls).define(spec) diff --git a/aiida_defects/formation_energy_base.py b/aiida_defects/formation_energy_base.py deleted file mode 100644 index bdbf7be..0000000 --- a/aiida_defects/formation_energy_base.py +++ /dev/null @@ -1,335 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## -from __future__ import absolute_import - -from aiida import orm -from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit - -from .utils import ( - get_raw_formation_energy, - get_corrected_formation_energy, - get_corrected_aligned_formation_energy, -) - -class FormationEnergyWorkchainBase(WorkChain): - """ - The base class to compute the formation energy for a given defect, containing the - generic, code-agnostic methods, error codes, etc. - - Any computational code can be used to calculate the required energies and relative permittivity. - However, different codes must be setup in specific ways, and so separate classes are used to implement these - possibilities. This is an abstract class and should not be used directly, but rather the - concrete code-specific classes should be used instead. - """ - - @classmethod - def define(cls, spec): - super(FormationEnergyWorkchainBase, cls).define(spec) - # fmt: off - # Structures - spec.input( - "host_structure", - valid_type=orm.StructureData, - help="Pristine structure" - ) - spec.input( - "defect_structure", - valid_type=orm.StructureData, - help="Defective structure" - ) - spec.input( - "host_unitcell", - valid_type=orm.StructureData, - help="Pristine structure to use in the calculation of permittivity", - required=False, - ) - - # Defect details - spec.input( - "defect_charge", - valid_type=orm.Float, - help="Defect charge state") - spec.input( - "defect_specie", - valid_type=orm.Str) - spec.input( - "defect_site", - valid_type=orm.List, - help="Defect site position in crystal coordinates" ) - #spec.input('ref_energy',valid_type=orm.Float) - spec.input( - "fermi_level", - valid_type=orm.Float, - default=lambda: orm.Float(0.0), - help="Fermi level position with respect to the valence band maximum") - # spec.input( - # "chemical_potential", - # valid_type=orm.Float, - # help="The chemical potential of the given defect type. The convention is that removing an atom is positive", - # ) - spec.input("add_or_remove", valid_type=orm.Str, - help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") - - # Chemical potential - spec.input('formation_energy_dict', valid_type=orm.Dict) - spec.input('compound', valid_type=orm.Str) - spec.input('dependent_element', valid_type=orm.Str) - spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) - - - spec.input("run_dfpt", valid_type=orm.Bool) - - # Methodology - spec.input( - "correction_scheme", - valid_type=orm.Str, - help="The correction scheme to apply", - ) - - # Outputs - spec.output( - "formation_energy_uncorrected", valid_type=orm.Float, required=True - ) - spec.output( - "formation_energy_corrected", valid_type=orm.Float, required=True - ) - spec.output( - "formation_energy_corrected_aligned", valid_type=orm.Float, required=True - ) - - # Error codes - spec.exit_code(201, "ERROR_INVALID_CORRECTION", - message="The requested correction scheme is not recognised", - ) - spec.exit_code(202, "ERROR_PARAMETER_OVERRIDE", - message="Input parameter dictionary key cannot be set explicitly", - ) - spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", - message="The correction scheme sub-workchain failed", - ) - spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", - message="DFT calculation failed", - ) - spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", - message="A post-processing calculation failed", - ) - spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", - message="DFPT calculation failed" - ) - spec.exit_code(406, "ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED", - message="The chemical potential calculation failed" - ) - spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", - message="Input parameter dictionary key cannot be set explicitly" - ) - spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", - message="The requested method is not yet implemented", - ) - # fmt: on - - def setup(self): - """ - Setup the workchain - """ - - # Check if correction scheme is valid: - correction_schemes_available = ["gaussian", "point"] - if self.inputs.correction_scheme is not None: - if self.inputs.correction_scheme not in correction_schemes_available: - return self.exit_codes.ERROR_INVALID_CORRECTION - - def if_run_dfpt(self): - return self.inputs.run_dfpt - - def correction_required(self): - """ - Check if correction is requested - """ - if self.inputs.correction_scheme is not None: - return True - else: - return False - - def is_gaussian_scheme(self): - """ - Check if Gaussian countercharge correction scheme is being used - """ - return self.inputs.correction_scheme == "gaussian" - - def is_point_scheme(self): - """ - Check if Point countercharge correction scheme is being used - """ - return self.inputs.correction_scheme == "point" - - def host_unitcell_provided(self): - """ - Check if a cell other than the host supercell is provided, such as a unitcell. - An additional DFT calculation is required in this instance - """ - if self.inputs.host_unitcell: - return True - else: - return False - - def run_gaussian_correction_workchain(self): - """ - Run the workchain for the Gaussian Countercharge correction - """ - from .corrections.gaussian_countercharge.gaussian_countercharge import ( - GaussianCounterChargeWorkchain, - ) - - self.report("Computing correction via the Gaussian Countercharge scheme") - - inputs = { - "v_host": self.ctx.v_host, - "v_defect_q0": self.ctx.v_defect_q0, - "v_defect_q": self.ctx.v_defect_q, - "rho_host": self.ctx.rho_host, - "rho_defect_q": self.ctx.rho_defect_q, - "defect_charge": self.inputs.defect_charge, - "defect_site": self.inputs.defect_site, - "host_structure": self.inputs.host_structure, - "epsilon": self.ctx.epsilon, - } - - workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) - label = "correction_workchain" - self.to_context(**{label: workchain_future}) - - def prepare_point_correction_workchain(self): - """ - Get the required inputs for the Point Countercharge correction workchain - - TODO: Finish implementing this interface - """ - return - - def run_point_correction_workchain(self): - """ - Run the workchain for the Point Countercharge correction - - TODO: Finish implementing this interface - """ - from .corrections.point_countercharge.point_countercharge import ( - PointCounterChargeWorkchain, - ) - - self.report("Computing correction via the Point Countercharge scheme") - - inputs = {} - - workchain_future = self.submit(PointCounterChargeWorkchain, **inputs) - label = "correction_workchain" - self.to_context(**{label: workchain_future}) - - def check_correction_workchain(self): - """ - Check if the potential alignment workchains have finished correctly. - If yes, assign the outputs to the context - """ - - correction_wc = self.ctx["correction_workchain"] - if not correction_wc.is_finished_ok: - self.report( - "Correction workchain failed with status {}".format( - correction_wc.exit_status - ) - ) - return self.exit_codes.ERROR_CORRECTION_WORKCHAIN_FAILED - else: - self.ctx.total_correction = correction_wc.outputs.total_correction - self.ctx.electrostatic_correction = ( - correction_wc.outputs.electrostatic_correction - ) - self.ctx.total_alignment = correction_wc.outputs.total_alignment - - def run_chemical_potential_workchain(self): - from .chemical_potential.chemical_potential import ( - ChemicalPotentialWorkchain, ) - - self.report('Computing the chemical potential of {}'.format(self.inputs.defect_specie.value)) - inputs = { - "formation_energy_dict": self.inputs.formation_energy_dict, - "compound": self.inputs.compound, - "dependent_element": self.inputs.dependent_element, - "defect_specie": self.inputs.defect_specie, - #"ref_energy": self.inputs.ref_energy, - "tolerance": self.inputs.tolerance, - } - workchain_future = self.submit(ChemicalPotentialWorkchain, **inputs) - label = "chemical_potential_workchain" - self.to_context(**{label: workchain_future}) - - def check_chemical_potential_workchain(self): - """ - Check if the chemical potential workchain have finished correctly. - If yes, assign the output to context - """ - - chem_potential_wc = self.ctx["chemical_potential_workchain"] - if not chem_potential_wc.is_finished_ok: - self.report( - "Chemical potential workchain failed with status {}".format( - chem_potential_wc.exit_status - ) - ) - return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED - #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION - else: - self.ctx.chemical_potential = chem_potential_wc.outputs.chemical_potential - - def compute_formation_energy(self): - """ - Compute the formation energy - """ - # Raw formation energy - self.ctx.e_f_uncorrected = get_raw_formation_energy( - self.ctx.defect_energy, - self.ctx.host_energy, - self.inputs.add_or_remove, - self.ctx.chemical_potential, - self.inputs.defect_charge, - self.inputs.fermi_level, - self.ctx.host_vbm - ) - self.report( - "The computed uncorrected formation energy is {} eV".format( - self.ctx.e_f_uncorrected.value - ) - ) - self.out("formation_energy_uncorrected", self.ctx.e_f_uncorrected) - - # Corrected formation energy - self.ctx.e_f_corrected = get_corrected_formation_energy( - self.ctx.e_f_uncorrected, self.ctx.electrostatic_correction - ) - self.report( - "The computed corrected formation energy is {} eV".format( - self.ctx.e_f_corrected.value - ) - ) - self.out("formation_energy_corrected", self.ctx.e_f_corrected) - - # Corrected formation energy with potential alignment - self.ctx.e_f_corrected_aligned = get_corrected_aligned_formation_energy( - self.ctx.e_f_corrected, self.ctx.total_alignment - ) - self.report( - "The computed corrected formation energy, including potential alignments, is {} eV".format( - self.ctx.e_f_corrected_aligned.value - ) - ) - self.out("formation_energy_corrected_aligned", self.ctx.e_f_corrected_aligned) - - def raise_not_implemented(self): - """ - Raise a not-implemented error - """ - return self.exit_codes.ERROR_NOT_IMPLEMENTED diff --git a/aiida_defects/formation_energy_qe.py b/aiida_defects/formation_energy_qe.py deleted file mode 100644 index d806ca1..0000000 --- a/aiida_defects/formation_energy_qe.py +++ /dev/null @@ -1,517 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## -from __future__ import absolute_import - -import numpy as np - -from aiida import orm -from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit -from aiida.plugins import WorkflowFactory -from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain -# from aiida_quantumespresso.calculations.pp import PpCalculation - -from aiida_defects.formation_energy.formation_energy_base import FormationEnergyWorkchainBase -from aiida_defects.formation_energy.utils import run_pw_calculation -from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy - - -class FormationEnergyWorkchainQE(FormationEnergyWorkchainBase): - """ - Compute the formation energy for a given defect using QuantumESPRESSO - """ - @classmethod - def define(cls, spec): - super(FormationEnergyWorkchainQE, cls).define(spec) - - # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here - # we keep track of things with two separate namespaces. An additional code, and an additional - # namespace, is used for postprocessing - spec.input_namespace('qe.dft.supercell', - help="Inputs for DFT calculations on supercells") - spec.input_namespace('qe.dft.unitcell', required=False, - help="Inputs for a DFT calculation on an alternative host cell for use with DFPT") - spec.input_namespace('qe.dfpt', - help="Inputs for DFPT calculation for calculating the relative permittivity of the host material") - spec.input_namespace('qe.pp', - help="Inputs for postprocessing calculations") - - # What calculations to run - spec.input('run_pw_host', valid_type=orm.Bool, required=True) - spec.input('run_pw_defect_q0', valid_type=orm.Bool, required=True) - spec.input('run_pw_defect_q', valid_type=orm.Bool, required=True) - spec.input('run_dfpt', valid_type=orm.Bool, required=True) - - spec.input('host_node', valid_type=orm.Int, required=False) - spec.input('defect_q0_node', valid_type=orm.Int, required=False) - spec.input('defect_q_node', valid_type=orm.Int, required=False) - spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) - - # DFT inputs (PW.x) - spec.input("qe.dft.supercell.code", valid_type=orm.Code, - help="The pw.x code to use for the calculations") - spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") - spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, - help="Parameters for the PWSCF calcuations. Some will be set automatically") - spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, - help="Scheduler options for the PW.x calculations") - spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, - help="Settings for the PW.x calculations") - spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, - help="The pseudopotential family for use with the code, if required") - - # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant - spec.input("qe.dft.unitcell.code", - valid_type=orm.Code, - help="The pw.x code to use for the calculations") - spec.input("qe.dft.unitcell.kpoints", - valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") - spec.input("qe.dft.unitcell.parameters", - valid_type=orm.Dict, - help="Parameters for the PWSCF calcuations. Some will be set automatically") - spec.input("qe.dft.unitcell.scheduler_options", - valid_type=orm.Dict, - help="Scheduler options for the PW.x calculations") - spec.input_namespace("qe.dft.unitcell.pseudopotentials", - valid_type=orm.UpfData, - dynamic=True, - help="The pseudopotential family for use with the code, if required") - - # Postprocessing inputs (PP.x) - spec.input("qe.pp.code", - valid_type=orm.Code, - help="The pp.x code to use for the calculations") - spec.input("qe.pp.scheduler_options", - valid_type=orm.Dict, - help="Scheduler options for the PP.x calculations") - - # DFPT inputs (PH.x) - spec.input("qe.dfpt.code", - valid_type=orm.Code, - help="The ph.x code to use for the calculations") - spec.input("qe.dfpt.scheduler_options", - valid_type=orm.Dict, - help="Scheduler options for the PH.x calculations") - - spec.outline( - cls.setup, - if_(cls.correction_required)( - if_(cls.is_gaussian_scheme)( - cls.prep_dft_calcs_gaussian_correction, - cls.check_dft_calcs_gaussian_correction, - cls.get_dft_potentials_gaussian_correction, - cls.check_dft_potentials_gaussian_correction, - cls.get_kohn_sham_potentials, - #cls.get_charge_density, - if_(cls.if_run_dfpt)( - cls.prep_hostcell_calc_for_dfpt, - cls.check_hostcell_calc_for_dfpt, - cls.prep_calc_dfpt_calculation, - ), - cls.get_permittivity, - cls.run_gaussian_correction_workchain), - if_(cls.is_point_scheme)( - cls.raise_not_implemented - #cls.prepare_point_correction_workchain, - #cls.run_point_correction_workchain), - ), - cls.check_correction_workchain), - cls.run_chemical_potential_workchain, - cls.check_chemical_potential_workchain, - cls.compute_formation_energy - ) - - def prep_dft_calcs_gaussian_correction(self): - """ - Get the required inputs for the Gaussian Countercharge correction workchain. - This method runs the required calculations to generate the energies and potentials - for the Gaussian scheme. - """ - - self.report("Setting up the Gaussian Countercharge correction workchain") - - pw_inputs = self.inputs.qe.dft.supercell.code.get_builder() - pw_inputs.pseudos = self.inputs.qe.dft.supercell.pseudopotentials - pw_inputs.kpoints = self.inputs.qe.dft.supercell.kpoints - pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() - pw_inputs.settings = self.inputs.qe.dft.supercell.settings - - parameters = self.inputs.qe.dft.supercell.parameters.get_dict() - - # We set 'tot_charge' later so throw an error if the user tries to set it to avoid - # any ambiguity or unseen modification of user input - if 'tot_charge' in parameters['SYSTEM']: - self.report('You cannot set the "tot_charge" PW.x parameter explicitly') - return self.exit_codes.ERROR_PARAMETER_OVERRIDE - - # Host structure - if self.inputs.run_pw_host: - pw_inputs.structure = self.inputs.host_structure - parameters['SYSTEM']['tot_charge'] = orm.Float(0.) - pw_inputs.parameters = orm.Dict(dict=parameters) - - future = self.submit(pw_inputs) - self.report( - 'Launching PWSCF for host structure (PK={}) with charge {} (PK={})' - .format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'calc_host': future}) - - # Defect structure; neutral charge state - if self.inputs.run_pw_defect_q0: - pw_inputs.structure = self.inputs.defect_structure - parameters['SYSTEM']['tot_charge'] = orm.Float(0.) - pw_inputs.parameters = orm.Dict(dict=parameters) - - future = self.submit(pw_inputs) - self.report( - 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'calc_defect_q0': future}) - - # Defect structure; target charge state - if self.inputs.run_pw_defect_q: - pw_inputs.structure = self.inputs.defect_structure - parameters['SYSTEM']['tot_charge'] = self.inputs.defect_charge - pw_inputs.parameters = orm.Dict(dict=parameters) - - future = self.submit(pw_inputs) - self.report( - 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'calc_defect_q': future}) - - def check_dft_calcs_gaussian_correction(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - - # Host - if self.inputs.run_pw_host: - host_calc = self.ctx['calc_host'] - if host_calc.is_finished_ok: - self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV - self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) - #self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum - self.ctx.host_vbm = orm.Float(get_vbm(host_calc)) - self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) - else: - self.report( - 'PWSCF for the host structure has failed with status {}'.format(host_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - else: - HostNode = orm.load_node(self.inputs.host_node.value) - self.ctx.host_energy = orm.Float(HostNode.outputs.output_parameters.get_dict()['energy']) # eV - self.report('Extracting PWSCF for host structure with charge {} from node PK={}' - .format("0.0", self.inputs.host_node.value)) - self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) - #self.ctx.host_vbm = orm.Float(HostNode.outputs.output_band.get_array('bands')[0][-1]) # eV - self.ctx.host_vbm = orm.Float(get_vbm(HostNode)) - self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) - - # Defect (q=0) - if self.inputs.run_pw_defect_q0: - defect_q0_calc = self.ctx['calc_defect_q0'] - if not defect_q0_calc.is_finished_ok: - self.report('PWSCF for the defect structure (with charge 0) has failed with status {}'.format(defect_q0_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - else: - self.report('The energy of neutral defect structure is: {} eV'.format(defect_q0_calc.outputs.output_parameters.get_dict()['energy'])) - else: - Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) - self.report('Extracting PWSCF for defect structure with charge {} from node PK={}'.format("0.0", self.inputs.defect_q0_node.value)) - self.report('The energy of neutral defect structure is: {} eV'.format(Defect_q0Node.outputs.output_parameters.get_dict()['energy'])) - - # Defect (q=q) - if self.inputs.run_pw_defect_q: - defect_q_calc = self.ctx['calc_defect_q'] - if defect_q_calc.is_finished_ok: - self.ctx.defect_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['energy']) # eV - self.report('The energy of defect structure with charge {} is: {} eV'. - format(self.inputs.defect_charge.value, defect_q_calc.outputs.output_parameters.get_dict()['energy'])) - else: - self.report( - 'PWSCF for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value, defect_q_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - else: - Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) - self.report('Extracting PWSCF for defect structure with charge {} from node PK={}' - .format(self.inputs.defect_charge.value, self.inputs.defect_q_node.value)) - self.ctx.defect_energy = orm.Float(Defect_qNode.outputs.output_parameters.get_dict()['energy']) # eV - self.report('The energy of defect structure with charge {} is: {} eV'. - format(self.inputs.defect_charge.value, Defect_qNode.outputs.output_parameters.get_dict()['energy'])) - - def get_dft_potentials_gaussian_correction(self): - """ - Obtain the electrostatic potentials from the PWSCF calculations. - """ - # User inputs - pp_inputs = self.inputs.qe.pp.code.get_builder() - pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() - - # Fixed settings - pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential - pp_inputs.plot_dimension = orm.Int(3) # 3D - - # Host - if self.inputs.run_pw_host: - pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder - else: - HostNode = orm.load_node(int(self.inputs.host_node)) - pp_inputs.parent_folder = HostNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Launching PP.x for host structure (PK={}) with charge {} (PK={})'. - format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_host': future}) - - # Defect (q=0) - if self.inputs.run_pw_defect_q0: - pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder - else: - Defect_q0Node = orm.load_node(int(self.inputs.defect_q0_node)) - pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_defect_q0': future}) - - # Defect (q=q) - if self.inputs.run_pw_defect_q: - pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder - else: - Defect_qNode = orm.load_node(int(self.inputs.defect_q_node)) - pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'pp_defect_q': future}) - - def check_dft_potentials_gaussian_correction(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - - # Host - host_pp = self.ctx['pp_host'] - if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_host = v_data - else: - self.report( - 'Post processing for the host structure has failed with status {}'.format(host_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defect (q=0) - defect_q0_pp = self.ctx['pp_defect_q0'] - if defect_q0_pp.is_finished_ok: - data_array = defect_q0_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q0 = v_data - else: - self.report( - 'Post processing for the defect structure (with charge 0) has failed with status {}' - .format(defect_q0_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defect (q=q) - defect_q_pp = self.ctx['pp_defect_q'] - if defect_q_pp.is_finished_ok: - data_array = defect_q_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q = v_data - else: - self.report( - 'Post processing for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value,defect_q_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - def get_kohn_sham_potentials(self): - """ - Obtain the electrostatic potentials from the PWSCF calculations. - """ - # User inputs - pp_inputs = self.inputs.qe.pp.code.get_builder() - pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() - - # Fixed settings - pp_inputs.plot_number = orm.Int(1) # Kohn-Sham potential - pp_inputs.plot_dimension = orm.Int(3) # 3D - - # Host - if self.inputs.run_pw_host: - pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder - else: - HostNode = orm.load_node(self.inputs.host_node.value) - pp_inputs.parent_folder = HostNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Extracting Kohn-Sham potential of host structure (PK={}) with charge {} (PK={})'. - format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'V_KS_host': future}) - - # Defect (q=q) - if self.inputs.run_pw_defect_q: - pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder - else: - Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) - pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Extracting Kohn-Sham potential of defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'V_KS_defect_q': future}) - - def get_charge_density(self): - """ - Obtain the electrostatic potentials from the PWSCF calculations. - """ - # User inputs - pp_inputs = self.inputs.qe.pp.code.get_builder() - pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() - - # Fixed settings - pp_inputs.plot_number = orm.Int(0) # Elctrostatic potential - pp_inputs.plot_dimension = orm.Int(3) # 3D - - # Defect (q=0) - if self.inputs.run_pw_defect_q0: - pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder - else: - Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) - pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'rho_defect_q0': future}) - - # Defect (q=q) - if self.inputs.run_pw_defect_q: - pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder - else: - Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) - pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'rho_defect_q': future}) - - def prep_hostcell_calc_for_dfpt(self): - """ - Run a DFT calculation on the structure to be used for the computation of the - dielectric constant - """ - self.report("An alternative unit cell has been requested") - - # Another code may be desirable - N.B. in AiiDA a code refers to a specific - # executable on a specific computer. As the PH calculation may have to be run on - # an HPC cluster, the PW calculation must be run on the same machine and so this - # may necessitate that a different code is used than that for the supercell calculations. - pw_inputs = self.inputs.qe.dft.unitcell.code.get_builder() - - # These are not necessarily the same as for the other DFT calculations - pw_inputs.pseudos = self.inputs.qe.dft.unitcell.pseudopotentials - pw_inputs.kpoints = self.inputs.qe.dft.unitcell.kpoints - pw_inputs.metadata = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() - - pw_inputs.structure = self.inputs.host_unitcell - parameters = self.inputs.qe.dft.unitcell.parameters.get_dict() - pw_inputs.parameters = orm.Dict(dict=parameters) - - future = self.submit(pw_inputs) - # self.report( - # 'Launching PWSCF for host unitcell structure (PK={})' - # .format(self.inputs.host_structure.pk, future.pk) - # ) - self.report( - 'Launching PWSCF for host unitcell structure (PK={})'.format(self.inputs.host_unitcell.pk, future.pk)) - self.to_context(**{'calc_host_unitcell': future}) - - # return ToContext(**{'calc_host_unitcell': future}) - - def check_hostcell_calc_for_dfpt(self): - """ - Check if the DFT calculation to be used for the computation of the - dielectric constant has completed successfully. - """ - - host_unitcell_calc = self.ctx['calc_host_unitcell'] - if not host_unitcell_calc.is_finished_ok: - self.report( - 'PWSCF for the host unitcell structure has failed with status {}'. - format(host_unitcell_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - - def prep_calc_dfpt_calculation(self): - """ - Run a DFPT calculation to compute the dielectric constant for the pristine material - """ - - ph_inputs = self.inputs.qe.dfpt.code.get_builder() - - # Setting up the calculation depends on whether the parent SCF calculation is either - # the host supercell or an alternative host unitcell - if self.inputs.host_unitcell: - ph_inputs.parent_folder = self.ctx['calc_host_unitcell'].outputs.remote_folder - else: - ph_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder - - parameters = orm.Dict(dict={ - 'INPUTPH': { - "tr2_ph" : 1e-16, - 'epsil': True, - 'trans': False - } - }) - ph_inputs.parameters = parameters - - # Set the q-points for a Gamma-point calculation - # N.B. Setting a 1x1x1 mesh is not equivalent as this will trigger a full phonon dispersion calculation - qpoints = orm.KpointsData() - if self.inputs.host_unitcell: - qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host_unitcell'].inputs.structure) - else: - qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host'].inputs.structure) - qpoints.set_kpoints([[0.,0.,0.]]) - qpoints.get_kpoints(cartesian=True) - ph_inputs.qpoints = qpoints - - ph_inputs.metadata = self.inputs.qe.dfpt.scheduler_options.get_dict() - - future = self.submit(ph_inputs) - self.report('Launching PH for host structure (PK={})'.format(self.inputs.host_structure.pk, future.pk)) - self.to_context(**{'calc_dfpt': future}) - - def get_permittivity(self): - """ - Compute the dielectric constant to be used in the correction - """ - if self.inputs.run_dfpt: - dfpt_calc = self.ctx['calc_dfpt'] - if dfpt_calc.is_finished_ok: - epsilion_tensor = np.array(dfpt_calc.outputs.output_parameters.get_dict()['dielectric_constant']) - self.ctx.epsilon = orm.Float(np.trace(epsilion_tensor/3.)) - self.report('The computed relative permittivity is {}'.format(self.ctx.epsilon.value)) - else: - self.report( - 'PH for the host structure has failed with status {}'.format(dfpt_calc.exit_status)) - return self.exit_codes.ERROR_DFPT_CALCULATION_FAILED - else: - self.ctx.epsilon = self.inputs.epsilon - From 6e4395a54641233a03ff3626b23c07f508c40dac Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Sat, 1 Aug 2020 18:10:39 +0200 Subject: [PATCH 12/60] adding FermiLevelWorkchain --- aiida_defects/formation_energy/Test.py | 107 +++++++++++++ .../fermi_level/fermi_level.py | 92 +++++++++++ .../formation_energy/fermi_level/utils.py | 150 ++++++++++++++++++ 3 files changed, 349 insertions(+) create mode 100644 aiida_defects/formation_energy/Test.py create mode 100644 aiida_defects/formation_energy/fermi_level/fermi_level.py create mode 100644 aiida_defects/formation_energy/fermi_level/utils.py diff --git a/aiida_defects/formation_energy/Test.py b/aiida_defects/formation_energy/Test.py new file mode 100644 index 0000000..3c49f77 --- /dev/null +++ b/aiida_defects/formation_energy/Test.py @@ -0,0 +1,107 @@ +import json +import numpy as np +import re +from pymatgen.core.structure import Structure +from pymatgen.core.composition import Composition +from aiida.engine import submit +from aiida.orm import StructureData +from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData, XyData, StructureData +from aiida_defects.formation_energy.utils import get_vbm +from aiida_defects.formation_energy.fermi_level.fermi_level import FermiLevelWorkchain +#from aiida_defects.formation_energy.fermi_level.utils import compute_net_charge + +with open('/home/sokseiham/Documents/Defect_calculations/Li7PS6/defect_dict.json') as f: + defect_dict = json.load(f) + dos = np.array(defect_dict['DOS']) + host_structure = Structure.from_dict(defect_dict['unitcell']) + defect_data = defect_dict['defect_data'] + band_gap = defect_dict['band_gap'] + Ef = defect_dict['Ef'] + +# While save in json, floats in the dict key were converted into strings. We need to convert those keys back to float. +for key in defect_data: + key_list = list(defect_data[key]['charge'].keys()) + for chg in key_list: + defect_data[key]['charge'][float(chg)] = defect_data[key]['charge'].pop(chg) + +# site = {'S_1': 1, 'S_2': 2, 'S_3': 1, 'S_oct': 1, 'S_tet': 1, 'Li_1': 2, 'Li_2': 1, 'Li_3': 2, 'Li_4': 2} +# for key in defect_data: +# # print(defect_data[key]['N_site']) +# for defect in site.keys(): +# if defect in key: +# defect_data[key]['N_site'] = site[defect] +# break + +temp = {} +aliovalent = 'Br' +for defect in defect_data: + split = re.split('_|-', defect) + if '-' in defect: + # if split[0] == aliovalent: + # temp[defect] = defect_data[defect] + pass + else: + # if split[0] == 'V': + temp[defect] = defect_data[defect] +defect_data = temp +#print(defect_data) + +compound = 'Li7PS6' +dependent_element = 'P' +temperature = 300.0 +# dopant = None + +dos_node = load_node(48514) +unitcell_node = load_node(48495) +vbm = get_vbm(unitcell_node) +Dos = dos_node.outputs.output_dos +dos_x = Dos.get_x()[1] - vbm +dos_y = Dos.get_y()[1][1] +chem_potentials = {'Li': -1.923-195.514, 'P':-191.038, 'S':-0.835-326.678} +#chem_potentials = {'Li': -1.923-195.514*np.ones(3), 'P':-191.038*np.ones(3), 'S':-0.835-326.678*np.ones(3)} +#chem_potentials = {'Li': -1.923-195.514*np.ones((3,3)), 'P':-191.038*np.ones((3,3)), 'S':-0.835-326.678*np.ones((3,3))} +#print(chem_potentials) +input_chem_shape = np.ones_like(chem_potentials['Li']) + +#f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, host_structure, dos_x, dos_y, band_gap, dopant=None) +#print(f(0.2*input_chem_shape)) + +inputs = { + "defect_data": Dict(dict=defect_data), + "chem_potentials": Dict(dict=chem_potentials), + "temperature": Float(temperature), + "valence_band_maximum": Float(vbm), + "number_of_electrons": Float(unitcell_node.res.number_of_electrons), + "unitcell": StructureData(pymatgen=host_structure), + "DOS": Dos, + "band_gap": Float(band_gap), + "dopant": Dict(dict={'X_1':{'c': 1E18, 'q':-1}}) + } +#print(inputs["defect_data"].get_dict()) +#defect_data = inputs["defect_data"].get_dict() +#E_Fermi = 0.0 +#E_defect_formation = {} +#for defect in defect_data.keys(): +# temp = defect_data[defect] +# Ef = {} +# for chg in temp['charge'].keys(): +# E_formation = temp['charge'][chg]['E']-temp['E_host']+chg*(E_Fermi+temp['vbm'])+temp['charge'][chg]['E_corr'] +# for spc in temp['species'].keys(): +# E_formation -= temp['species'][spc]*chem_potentials[spc] +# Ef[chg] = E_formation +# E_defect_formation[defect] = Ef +#print(E_defect_formation) + +#defect_data = inputs["defect_data"].get_dict() +#chem_potentials = inputs["chem_potentials"].get_dict() +#temperature = inputs["temperature"].value +#unitcell = inputs["unitcell"].get_pymatgen_structure() +#dos_x = dos_x.get_array('data') +#dos_y = dos_y.get_array('data') +#band_gap = inputs["band_gap"].value + +#f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, dos_x, dos_y, band_gap, dopant=None) +#print(f(0.2*input_chem_shape)) + +workchain_future = submit(FermiLevelWorkchain, **inputs) +print('Submitted workchain with PK=' + str(workchain_future.pk)) diff --git a/aiida_defects/formation_energy/fermi_level/fermi_level.py b/aiida_defects/formation_energy/fermi_level/fermi_level.py new file mode 100644 index 0000000..3494b35 --- /dev/null +++ b/aiida_defects/formation_energy/fermi_level/fermi_level.py @@ -0,0 +1,92 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData, XyData, StructureData +from aiida.engine import WorkChain, calcfunction, ToContext, while_ +import sys +import numpy as np +from pymatgen.core.composition import Composition + +from .utils import * + +class FermiLevelWorkchain(WorkChain): + ''' + Compute the self-consistent Fermi level by imposing the overall charge neutrality + Here we implement method similar to Buckeridge et al., (doi:10.1016/j.cpc.2019.06.017) + ''' + @classmethod + def define(cls, spec): + super(FermiLevelWorkchain, cls).define(spec) + spec.input("defect_data", valid_type=Dict) + spec.input("chem_potentials", valid_type=Dict) + spec.input("temperature", valid_type=Float) + spec.input("valence_band_maximum", valid_type=Float) + spec.input("number_of_electrons", valid_type=Float, help="number of electrons in the unitcell used to compute the DOS") + spec.input("unitcell", valid_type=StructureData) + spec.input("DOS", valid_type=XyData) + spec.input("band_gap", valid_type=Float) + spec.input("dopant", valid_type=Dict, default=lambda: Dict(dict=None), + help="aliovalent dopants specified by its charge and concentration. Used to compute the change in the defect concentrations with frozen defect approach") + + spec.outline( + cls.setup, + cls.compute_sc_fermi_level, + ) + spec.output('fermi_level', valid_type=ArrayData) # we use ArrayData instead of Float in other to be general and be able to accomodate the situtation where the chemical potential is a numpy array allowing to vectorize the calculations of defect concentrations in stability region instead of doing one value of chemical potential at a time. + + spec.exit_code(701, "ERROR_FERMI_LEVEL_FAILED", + message="The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input" + ) + + def setup(self): + """ + Setup the calculation + """ + chempot_dict = self.inputs.chem_potentials.get_dict() + for key in chempot_dict: + data_array = np.ones_like(chempot_dict[key]) + v_data = ArrayData() + v_data.set_array('data', data_array) + self.ctx.input_chem_shape = v_data + + # extracting the DOS of the unitcell, assuming that the calculation is non-spin polarized. + dos_x = self.inputs.DOS.get_x()[1] - self.inputs.valence_band_maximum.value + v_data = ArrayData() + v_data.set_array('data', dos_x) + self.ctx.dos_x = v_data + + dos_y = self.inputs.DOS.get_y()[1][1] + v_data = ArrayData() + v_data.set_array('data', dos_y) + self.ctx.dos_y = v_data + + mask = (dos_x <= 0.05) + N_electron = np.trapz(dos_y[mask], dos_x[mask]) + if np.absolute(N_electron-self.inputs.number_of_electrons.value) > 1e-3: + self.report('The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input') + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED + + #is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(unitcell_node.outputs.output_band) + #if not is_insulator: + #self.report('WARNING!') + #self.report('The compound is metallic!') + + def compute_sc_fermi_level(self): + E_Fermi = solve_for_sc_fermi(self.inputs.defect_data, + self.inputs.chem_potentials, + self.ctx.input_chem_shape, + self.inputs.temperature, + self.inputs.unitcell, + self.inputs.band_gap, + self.ctx.dos_x, + self.ctx.dos_y, + self.inputs.dopant) + self.ctx.sc_fermi_level = E_Fermi + self.out('fermi_level', E_Fermi) + self.report('The self-consistent Fermi level is: {} eV'.format(E_Fermi.get_array('data'))) diff --git a/aiida_defects/formation_energy/fermi_level/utils.py b/aiida_defects/formation_energy/fermi_level/utils.py new file mode 100644 index 0000000..a7c3283 --- /dev/null +++ b/aiida_defects/formation_energy/fermi_level/utils.py @@ -0,0 +1,150 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida.engine import calcfunction +import numpy as np +from pymatgen.core.composition import Composition +from aiida.orm import ArrayData, Float +from pymatgen import Element +from scipy.optimize import broyden1 + +def _get_first_element(x): + ''' + This is needed in the electron_concentration and hole_concentration methods because we want to accept + the chemical potential (and fermi level) of any shape as input to vectorize the numpy operations but + the two methods accept only a scalar. + ''' + if x.ndim == 0: + return x + elif x.ndim == 1: + return x[0] + else: + return x[0,0] + +def compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant): + ''' + This is a nested function that return a function (with E_Fermi as variable) to be use in the + non-linear solver to obtain the self-consistent Fermi level. + + arguments: + defect_data : dictionary containing information required to compute the formation energy of each defect + chem_potentials : dictionary containing the chemical potential of all elements constituting the compound. Can be a float or numpy array + input_chem_shape : the shape of values of chem_potentials. this is needed because we want the code to work both for float or numpy array + for ex. when computing the concentration of a particular defect in the stability region. We can of course do that one + value at a time but it is much slower than vectorization using numpy + dopant : aliovalent dopants specified by its charge and concentration with the format {'X_1': {'c':, 'q':}, 'X_2': {'c':, 'q':}, ...}. + Used to compute the change in the defect concentrations with 'frozen defect' approach + uniticell : is the structure used to compute the Dos not the host supercell used to compute the formation energy + ''' + + dE = dos_x[1] - dos_x[0] + k_B = 8.617333262145E-05 + convert = 1E24 + + def defect_formation_energy(E_Fermi): + ''' + Compute the defect formation energy of all defects given in the input file as a function of the fermi level + E_Fermi. + ''' + E_defect_formation = {} + for defect in defect_data.keys(): + temp = defect_data[defect] + Ef = {} + for chg in temp['charge'].keys(): + E_formation = temp['charge'][chg]['E']-temp['E_host']+float(chg)*(E_Fermi+temp['vbm'])+temp['charge'][chg]['E_corr'] + for spc in temp['species'].keys(): + E_formation -= temp['species'][spc]*input_chem_shape*chem_potentials[spc] + Ef[chg] = E_formation + E_defect_formation[defect] = Ef + return E_defect_formation + + def electron_concentration(E_Fermi): + ''' + compute the concentration of electrons + ''' + + E_Fermi = _get_first_element(E_Fermi) + upper_dos = dos_y[dos_x>=band_gap] + E_upper = dos_x[dos_x>=band_gap] + # plt.plot(E_upper, upper_dos) + mask_n = ((E_upper-E_Fermi)/(k_B*temperature) < 700.0) # To avoid overflow in the exp + temp_n = upper_dos[mask_n]/(np.exp((E_upper[mask_n]-E_Fermi)/(k_B*temperature))+1.0) + return input_chem_shape*convert*np.sum(temp_n)*dE/unitcell.volume + + def hole_concentration(E_Fermi): + ''' + compute the concentration of holes + ''' + + E_Fermi = _get_first_element(E_Fermi) + lower_dos = dos_y[dos_x<=0.0] + E_lower = dos_x[dos_x<=0.0] + # plt.plot(E_lower, lower_dos) + mask_p = ((E_Fermi-E_lower)/(k_B*temperature) < 700.0) # To avoid overflow in the exp + temp_p = lower_dos[mask_p]/(np.exp((E_Fermi-E_lower[mask_p])/(k_B*temperature))+1.0) + return input_chem_shape*convert*np.sum(temp_p)*dE/unitcell.volume + + def c_defect(N_site, Ef): + ''' + compute the concentration of defects having formation energy Ef and can exist in N_sites in the unitcell + ''' + + return convert*N_site*np.exp(-1.0*Ef/(k_B*temperature))/unitcell.volume + + def Net_charge(E_Fermi): + ''' + compute the total charge of the system. The self-consistent Fermi level is the one for with this net (or total) charge is zero. + ''' + n = electron_concentration(E_Fermi) + p = hole_concentration(E_Fermi) + E_defect_formation = defect_formation_energy(E_Fermi) + # print(n, p) + # positive_charge = np.zeros(4) + # negative_charge = np.zeros(4) + positive_charge = 0.0 + negative_charge = 0.0 + for key in E_defect_formation.keys(): + # print(key) + for chg in E_defect_formation[key]: + # print(chg) + if float(chg) > 0: + positive_charge += float(chg)*c_defect(defect_data[key]['N_site'], E_defect_formation[key][chg]) + else: + negative_charge += float(chg)*c_defect(defect_data[key]['N_site'], E_defect_formation[key][chg]) + if dopant != None: + for key in dopant.keys(): + if dopant[key]['q'] > 0: + positive_charge += dopant[key]['q']*dopant[key]['c'] + else: + negative_charge += dopant[key]['q']*dopant[key]['c'] + return np.log(p + positive_charge) - np.log(n + abs(negative_charge)) + + return Net_charge + +@calcfunction +def solve_for_sc_fermi(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant): + ''' + solve the non-linear equation with E_fermi as variable to obtain the self-consistent Fermi level. The non-linear solver broyden1 in + scipy is used. + ''' + + defect_data = defect_data.get_dict() + chem_potentials = chem_potentials.get_dict() + input_chem_shape = input_chem_shape.get_array('data') + temperature = temperature.value + unitcell = unitcell.get_pymatgen_structure() + dos_x = dos_x.get_array('data') + dos_y = dos_y.get_array('data') + band_gap = band_gap.value + + net_charge = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant) + sc_fermi = broyden1(net_charge, input_chem_shape*band_gap/2, f_tol=1e-12) + v_data = ArrayData() + v_data.set_array('data', sc_fermi) + return v_data From 8708ebdb78c22099614355c5f497afde864c5b73 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Sun, 2 Aug 2020 21:39:21 +0200 Subject: [PATCH 13/60] adding __init__.py --- .../formation_energy/fermi_level/Test.py | 107 ++++++++++++++++++ .../formation_energy/fermi_level/__init__.py | 7 ++ 2 files changed, 114 insertions(+) create mode 100644 aiida_defects/formation_energy/fermi_level/Test.py create mode 100644 aiida_defects/formation_energy/fermi_level/__init__.py diff --git a/aiida_defects/formation_energy/fermi_level/Test.py b/aiida_defects/formation_energy/fermi_level/Test.py new file mode 100644 index 0000000..e4dc21a --- /dev/null +++ b/aiida_defects/formation_energy/fermi_level/Test.py @@ -0,0 +1,107 @@ +import json +import numpy as np +import re +from pymatgen.core.structure import Structure +from pymatgen.core.composition import Composition +from aiida.engine import submit +from aiida.orm import StructureData +from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData, XyData, StructureData +from aiida_defects.formation_energy.utils import get_vbm +from aiida_defects.formation_energy.fermi_level.fermi_level import FermiLevelWorkchain +#from aiida_defects.formation_energy.fermi_level.utils import compute_net_charge + +with open('/home/sokseiham/Documents/Defect_calculations/Li7PS6/defect_dict.json') as f: + defect_dict = json.load(f) + dos = np.array(defect_dict['DOS']) + host_structure = Structure.from_dict(defect_dict['unitcell']) + defect_data = defect_dict['defect_data'] + band_gap = defect_dict['band_gap'] + Ef = defect_dict['Ef'] + +# While save in json, floats in the dict key were converted into strings. We need to convert those keys back to float. +for key in defect_data: + key_list = list(defect_data[key]['charge'].keys()) + for chg in key_list: + defect_data[key]['charge'][float(chg)] = defect_data[key]['charge'].pop(chg) + +# site = {'S_1': 1, 'S_2': 2, 'S_3': 1, 'S_oct': 1, 'S_tet': 1, 'Li_1': 2, 'Li_2': 1, 'Li_3': 2, 'Li_4': 2} +# for key in defect_data: +# # print(defect_data[key]['N_site']) +# for defect in site.keys(): +# if defect in key: +# defect_data[key]['N_site'] = site[defect] +# break + +temp = {} +aliovalent = 'Br' +for defect in defect_data: + split = re.split('_|-', defect) + if '-' in defect: + # if split[0] == aliovalent: + # temp[defect] = defect_data[defect] + pass + else: + # if split[0] == 'V': + temp[defect] = defect_data[defect] +defect_data = temp +#print(defect_data) + +compound = 'Li7PS6' +dependent_element = 'P' +temperature = 300.0 +# dopant = None + +dos_node = load_node(48514) +unitcell_node = load_node(48495) +vbm = get_vbm(unitcell_node) +Dos = dos_node.outputs.output_dos +dos_x = Dos.get_x()[1] - vbm +dos_y = Dos.get_y()[1][1] +chem_potentials = {'Li': -1.923-195.514, 'P':-191.038, 'S':-0.835-326.678} +#chem_potentials = {'Li': -1.923-195.514*np.ones(3), 'P':-191.038*np.ones(3), 'S':-0.835-326.678*np.ones(3)} +#chem_potentials = {'Li': -1.923-195.514*np.ones((3,3)), 'P':-191.038*np.ones((3,3)), 'S':-0.835-326.678*np.ones((3,3))} +#print(chem_potentials) +input_chem_shape = np.ones_like(chem_potentials['Li']) + +#f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, host_structure, dos_x, dos_y, band_gap, dopant=None) +#print(f(0.2*input_chem_shape)) + +inputs = { + "defect_data": Dict(dict=defect_data), + "chem_potentials": Dict(dict=chem_potentials), + "temperature": Float(temperature), + "valence_band_maximum": Float(vbm), + "number_of_electrons": Float(unitcell_node.res.number_of_electrons), + "unitcell": StructureData(pymatgen=host_structure), + "DOS": Dos, + "band_gap": Float(band_gap), + #"dopant": Dict(dict={'X_1':{'c': 1E18, 'q':-1}}) + } +#print(inputs["defect_data"].get_dict()) +#defect_data = inputs["defect_data"].get_dict() +#E_Fermi = 0.0 +#E_defect_formation = {} +#for defect in defect_data.keys(): +# temp = defect_data[defect] +# Ef = {} +# for chg in temp['charge'].keys(): +# E_formation = temp['charge'][chg]['E']-temp['E_host']+chg*(E_Fermi+temp['vbm'])+temp['charge'][chg]['E_corr'] +# for spc in temp['species'].keys(): +# E_formation -= temp['species'][spc]*chem_potentials[spc] +# Ef[chg] = E_formation +# E_defect_formation[defect] = Ef +#print(E_defect_formation) + +#defect_data = inputs["defect_data"].get_dict() +#chem_potentials = inputs["chem_potentials"].get_dict() +#temperature = inputs["temperature"].value +#unitcell = inputs["unitcell"].get_pymatgen_structure() +#dos_x = dos_x.get_array('data') +#dos_y = dos_y.get_array('data') +#band_gap = inputs["band_gap"].value + +#f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, dos_x, dos_y, band_gap, dopant=None) +#print(f(0.2*input_chem_shape)) + +workchain_future = submit(FermiLevelWorkchain, **inputs) +print('Submitted workchain with PK=' + str(workchain_future.pk)) diff --git a/aiida_defects/formation_energy/fermi_level/__init__.py b/aiida_defects/formation_energy/fermi_level/__init__.py new file mode 100644 index 0000000..4d27567 --- /dev/null +++ b/aiida_defects/formation_energy/fermi_level/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## From 096cf655d2f8cfc4414c19faf09290a3fa447c9c Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Sun, 2 Aug 2020 22:40:17 +0200 Subject: [PATCH 14/60] test FermiLevelWorkchain --- .../formation_energy/fermi_level/Test.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/aiida_defects/formation_energy/fermi_level/Test.py b/aiida_defects/formation_energy/fermi_level/Test.py index e4dc21a..91469ac 100644 --- a/aiida_defects/formation_energy/fermi_level/Test.py +++ b/aiida_defects/formation_energy/fermi_level/Test.py @@ -8,7 +8,7 @@ from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData, XyData, StructureData from aiida_defects.formation_energy.utils import get_vbm from aiida_defects.formation_energy.fermi_level.fermi_level import FermiLevelWorkchain -#from aiida_defects.formation_energy.fermi_level.utils import compute_net_charge +from aiida_defects.formation_energy.fermi_level.utils import compute_net_charge with open('/home/sokseiham/Documents/Defect_calculations/Li7PS6/defect_dict.json') as f: defect_dict = json.load(f) @@ -57,10 +57,9 @@ Dos = dos_node.outputs.output_dos dos_x = Dos.get_x()[1] - vbm dos_y = Dos.get_y()[1][1] -chem_potentials = {'Li': -1.923-195.514, 'P':-191.038, 'S':-0.835-326.678} -#chem_potentials = {'Li': -1.923-195.514*np.ones(3), 'P':-191.038*np.ones(3), 'S':-0.835-326.678*np.ones(3)} +#chem_potentials = {'Li': -1.923-195.514, 'P':-191.038, 'S':-0.835-326.678} +chem_potentials = {'Li': -1.923-195.514+np.array([-1.5,0,1.5]), 'P':-191.038*np.ones(3), 'S':-0.835-326.678*np.ones(3)} #chem_potentials = {'Li': -1.923-195.514*np.ones((3,3)), 'P':-191.038*np.ones((3,3)), 'S':-0.835-326.678*np.ones((3,3))} -#print(chem_potentials) input_chem_shape = np.ones_like(chem_potentials['Li']) #f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, host_structure, dos_x, dos_y, band_gap, dopant=None) @@ -100,8 +99,8 @@ #dos_y = dos_y.get_array('data') #band_gap = inputs["band_gap"].value -#f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, dos_x, dos_y, band_gap, dopant=None) -#print(f(0.2*input_chem_shape)) +f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, host_structure, band_gap, dos_x, dos_y, dopant=None) +print(f(0.2*input_chem_shape)) -workchain_future = submit(FermiLevelWorkchain, **inputs) -print('Submitted workchain with PK=' + str(workchain_future.pk)) +#workchain_future = submit(FermiLevelWorkchain, **inputs) +#print('Submitted workchain with PK=' + str(workchain_future.pk)) From fb1d95dba3888e5958eff202a42485940843d886 Mon Sep 17 00:00:00 2001 From: Arsalan Date: Thu, 3 Sep 2020 09:35:36 +0200 Subject: [PATCH 15/60] Adding siesta-dev branch --- .../DefectWorkflowExample.ipynb | 823 ++++++++ .../DefectWorkflowExample.py | 322 +++ .../formation_energy_siesta/__init__.py | 7 + .../gaussian/gaussian_countercharge.py | 338 +++ .../formation_energy_base.py | 364 ++++ .../formation_energy_siesta.py | 314 +++ .../formation_energy_siesta.py-backup | 340 +++ .../pseudos/GhostH.psf | 1527 ++++++++++++++ .../formation_energy_siesta/pseudos/H.psf | 1527 ++++++++++++++ .../formation_energy_siesta/pseudos/O.psf | 1821 +++++++++++++++++ .../formation_energy_siesta/utils.py | 132 ++ 11 files changed, 7515 insertions(+) create mode 100644 aiida_defects/formation_energy_siesta/DefectWorkflowExample.ipynb create mode 100644 aiida_defects/formation_energy_siesta/DefectWorkflowExample.py create mode 100644 aiida_defects/formation_energy_siesta/__init__.py create mode 100644 aiida_defects/formation_energy_siesta/corrections/gaussian/gaussian_countercharge.py create mode 100644 aiida_defects/formation_energy_siesta/formation_energy_base.py create mode 100644 aiida_defects/formation_energy_siesta/formation_energy_siesta.py create mode 100644 aiida_defects/formation_energy_siesta/formation_energy_siesta.py-backup create mode 100644 aiida_defects/formation_energy_siesta/pseudos/GhostH.psf create mode 100644 aiida_defects/formation_energy_siesta/pseudos/H.psf create mode 100644 aiida_defects/formation_energy_siesta/pseudos/O.psf create mode 100644 aiida_defects/formation_energy_siesta/utils.py diff --git a/aiida_defects/formation_energy_siesta/DefectWorkflowExample.ipynb b/aiida_defects/formation_energy_siesta/DefectWorkflowExample.ipynb new file mode 100644 index 0000000..b670818 --- /dev/null +++ b/aiida_defects/formation_energy_siesta/DefectWorkflowExample.ipynb @@ -0,0 +1,823 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from __future__ import absolute_import\n", + "import aiida" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from aiida import load_profile\n", + "load_profile()\n", + "\n", + "# Import commonly used functionality\n", + "import numpy as np\n", + "from aiida import orm, engine, common\n", + "from aiida.plugins import WorkflowFactory\n", + "from aiida.orm import Code\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "#!pwd" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "!reentry scan" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[22mRestarting the daemon... \u001b[0m\u001b[32m\u001b[1mOK\u001b[0m\n" + ] + } + ], + "source": [ + "!verdi daemon restart\n", + "#!verdi daemon restart\n", + "#!$JUPYTER_PATH\n", + "#!export JUPYTER_PATH=\"/home/aakhtar/Projects/aiida-defects-siesta/siesta-defect-formation/aiida-workflow/formation_energy/;$JUPYTER_PATH\"" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from aiida_siesta.workflows.defect_formation.formation_energy_siesta import FormationEnergyWorkchainSIESTA\n", + "#import .formation_energy_siesta\n", + "#!pwd" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from aiida.orm import StructureData\n", + "#Structure Pure\n", + "cell = [[15.0, 0.0, 0.0,],\n", + " [ 0.0,15.0, 0.0,],\n", + " [ 0.0, 0.0,15.0,],\n", + " ]\n", + "pure = StructureData(cell=cell)\n", + "pure.append_atom(position=( 0.000 , 0.000 , 0.000 ),symbols=['O']) #1\n", + "#pure.append_atom(position=( 0.757 , 0.586 , 0.000 ),symbols=['H']) #2\n", + "#pure.append_atom(position=(-0.757 , 0.586 , 0.000),symbols=['H']) #3 \n", + "#pure.append_atom(position=( 0.000 , 3.500 , 0.000),symbols=['O']) #4\n", + "#pure.append_atom(position=( 0.757 , 2.914 , 0.000 ),symbols=['H']) #5\n", + "#pure.append_atom(position=(-0.757 , 2.914 , 0.000),symbols=['H']) #6\n", + "\n", + "\n", + "defect=StructureData(cell=cell)\n", + "defect.append_atom(position=( 0.000 , 0.000 , 0.000 ),symbols=['O']) #1\n", + "#defect.append_atom(position=( 0.757 , 0.586 , 0.000 ),symbols=['H']) #2\n", + "#defect.append_atom(position=(-0.757 , 0.586 , 0.000),symbols=['H']) #3 \n", + "#defect.append_atom(position=( 0.000 , 3.500 , 0.000),symbols=['O']) #4\n", + "#defect.append_atom(position=( 0.757 , 2.914 , 0.000 ),symbols=['H']) #5\n", + "#defect.append_atom(position=(-0.757 , 2.914 , 0.000),symbols=['H'],name=\"GhostH\") #6" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "code = Code.get_from_string('siesta-psml-lua@N552VW')\n", + "charge=-2" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from aiida.orm import Dict\n", + "parameters_host = Dict(dict={\n", + " \"mesh-cutoff\": \"250 Ry\",\n", + " \"dm-tolerance\": \"0.0001\",\n", + " \"MD-TypeOfRun\": \"cg\",\n", + " \"MD-NumCGsteps\": \"5000\",\n", + " #\"LUA-script\": \"neb.lua\",\n", + " \"DM-NumberPulay \": \"3\",\n", + " \"DM-History-Depth\": \"0\",\n", + " \"SCF-Mixer-weight\": \"0.02\",\n", + " \"SCF-Mix\": \"density\",\n", + " \"SCF-Mixer-kick\": \"35\",\n", + " \"MD-VariableCell\": \"F\",\n", + " \"MD-MaxCGDispl\": \"0.3 Bohr\",\n", + " \"MD-MaxForceTol\": \" 0.04000 eV/Ang\", \n", + " })\n", + "parameters_defect_q0 = Dict(dict={\n", + " \"mesh-cutoff\": \"250 Ry\",\n", + " \"dm-tolerance\": \"0.0001\",\n", + " \"MD-TypeOfRun\": \"cg\",\n", + " \"MD-NumCGsteps\": \"5000\",\n", + " #\"LUA-script\": \"neb.lua\",\n", + " \"DM-NumberPulay \": \"3\",\n", + " \"DM-History-Depth\": \"0\",\n", + " \"SCF-Mixer-weight\": \"0.02\",\n", + " \"SCF-Mix\": \"density\",\n", + " \"SCF-Mixer-kick\": \"35\",\n", + " \"MD-VariableCell\": \"F\",\n", + " \"MD-MaxCGDispl\": \"0.3 Bohr\",\n", + " \"MD-MaxForceTol\": \" 0.04000 eV/Ang\", \n", + " \"NetCharge\": \"0\",\n", + " })\n", + "parameters_defect_q = Dict(dict={\n", + " \"mesh-cutoff\": \"250 Ry\",\n", + " \"dm-tolerance\": \"0.0001\",\n", + " \"MD-TypeOfRun\": \"cg\",\n", + " \"MD-NumCGsteps\": \"5000\",\n", + " #\"LUA-script\": \"neb.lua\",\n", + " \"DM-NumberPulay \": \"3\",\n", + " \"DM-History-Depth\": \"0\",\n", + " \"SCF-Mixer-weight\": \"0.02\",\n", + " \"SCF-Mix\": \"density\",\n", + " \"SCF-Mixer-kick\": \"35\",\n", + " \"MD-VariableCell\": \"F\",\n", + " \"MD-MaxCGDispl\": \"0.3 Bohr\",\n", + " \"MD-MaxForceTol\": \" 0.04000 eV/Ang\",\n", + " \"NetCharge\": str(charge),\n", + " })\n", + "#options_host=Dict(dict={'options':{\"max_wallclock_seconds\": 360},\n", + "# \"resources\":{\"num_machines\": 1,\n", + "# \"num_mpiprocs_per_machine\": 1}\n", + "# })\n", + "options_host=Dict(dict={\n", + " \"max_wallclock_seconds\": 360000,\n", + " #'withmpi': True,\n", + " #'account': \"tcphy113c\",\n", + " #'queue_name': \"DevQ\",\n", + " \"resources\": {\n", + " \"num_machines\": 1,\n", + " \"num_mpiprocs_per_machine\": 1,\n", + " }\n", + " })\n", + "options_defect_q0=Dict(dict={\n", + " \"max_wallclock_seconds\": 360000,\n", + " #'withmpi': True,\n", + " #'account': \"tcphy113c\",\n", + " #'queue_name': \"DevQ\",\n", + " \"resources\": {\n", + " \"num_machines\": 1,\n", + " \"num_mpiprocs_per_machine\": 1,\n", + " }\n", + " })\n", + "options_defect_q=Dict(dict={\n", + " \"max_wallclock_seconds\": 360000,\n", + " #'withmpi': True,\n", + " #'account': \"tcphy113c\",\n", + " #'queue_name': \"DevQ\",\n", + " \"resources\": {\n", + " \"num_machines\": 1,\n", + " \"num_mpiprocs_per_machine\": 1,\n", + " }\n", + " })\n", + "\n" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "basis_dict_host =Dict(dict= {\n", + "'pao-basistype':'split',\n", + "'pao-splitnorm': 0.150,\n", + "'pao-energyshift': '0.020 Ry',\n", + "'%block pao-basis-sizes':\n", + "\"\"\"\n", + "O DZP\n", + "#H DZP\n", + "%endblock pao-basis-sizes\"\"\",\n", + "})\n", + "basis_dict_defect_q0 = Dict(dict= {\n", + "'pao-basistype':'split',\n", + "'pao-splitnorm': 0.150,\n", + "'pao-energyshift': '0.020 Ry',\n", + "'%block pao-basis-sizes':\n", + "\"\"\"\n", + "O DZP\n", + "#GhostH DZP\n", + "#H DZP\n", + "%endblock pao-basis-sizes\"\"\",\n", + "})\n", + "basis_dict_defect_q =Dict(dict= {\n", + "'pao-basistype':'split',\n", + "'pao-splitnorm': 0.150,\n", + "'pao-energyshift': '0.020 Ry',\n", + "'%block pao-basis-sizes':\n", + "\"\"\"\n", + "O DZP\n", + "#GhostH DZP\n", + "#H DZP\n", + "%endblock pao-basis-sizes\"\"\",\n", + "})" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'mesh-cutoff': '250 Ry',\n", + " 'dm-tolerance': '0.0001',\n", + " 'MD-TypeOfRun': 'cg',\n", + " 'MD-NumCGsteps': '5000',\n", + " 'DM-NumberPulay ': '3',\n", + " 'DM-History-Depth': '0',\n", + " 'SCF-Mixer-weight': '0.02',\n", + " 'SCF-Mix': 'density',\n", + " 'SCF-Mixer-kick': '35',\n", + " 'MD-VariableCell': 'F',\n", + " 'MD-MaxCGDispl': '0.3 Bohr',\n", + " 'MD-MaxForceTol': ' 0.04000 eV/Ang',\n", + " 'NetCharge': '0'}" + ] + }, + "execution_count": 11, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "parameters_defect_q0.get_dict()" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "kpoints_host = orm.KpointsData()\n", + "kpoints_host.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly\n", + "kpoints_defect_q0 = orm.KpointsData()\n", + "kpoints_defect_q0.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly\n", + "kpoints_defect_q = orm.KpointsData()\n", + "kpoints_defect_q.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'O': }" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "import os\n", + "from aiida_siesta.data.psf import PsfData\n", + "pseudo_file_to_species_map = [ (\"O.psf\", ['O'])]\n", + "#pseudo_file_to_species_map = [ (\"H.psf\", ['H']),(\"O.psf\", ['O'])]\n", + "#pseudo_file_to_species_map = [ (\"H.psf\",[\"H\"]),(\"GhostH.psf\",[\"GhostH\"]),(\"O.psf\", ['O'])]\n", + "pseudos_dict_host = {}\n", + "for fname, kinds, in pseudo_file_to_species_map:\n", + " absname = os.path.realpath(os.path.join(\"./pseudos\",fname))\n", + " pseudo, created = PsfData.get_or_create(absname, use_first=True)\n", + " for j in kinds:\n", + " pseudos_dict_host[j]=pseudo \n", + "pseudos_dict_host\n" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'O': }" + ] + }, + "execution_count": 14, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "pseudo_file_to_species_map = [(\"O.psf\", ['O'])]\n", + "#pseudo_file_to_species_map = [ (\"H.psf\", ['GhostH','H']),(\"O.psf\", ['O'])]\n", + "pseudos_dict_defect = {}\n", + "for fname, kinds, in pseudo_file_to_species_map:\n", + " absname = os.path.realpath(os.path.join(\"./pseudos\",fname))\n", + " pseudo, created = PsfData.get_or_create(absname, use_first=True)\n", + " for j in kinds:\n", + " pseudos_dict_defect[j]=pseudo\n", + "pseudos_dict_defect" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "inputs = {\n", + " # Structures\n", + " 'host_structure': pure,\n", + " 'defect_structure': defect,\n", + " # Defect information \n", + " #'defect_charge' : orm.Float(-2.),\n", + " 'defect_charge' : orm.Float(charge),\n", + " 'defect_site' : orm.List(list=[-0.757 , 2.914 , 0.000]), # Position of the defect in crystal coordinates\n", + " 'fermi_level' : orm.Float(0.0), # Position of the Fermi level, with respect to the valence band maximum \n", + " 'chemical_potential' : orm.Float(250.709), # eV, the chemical potentical of a C atom\n", + " 'gaussian_sigma':orm.Float(0.5),\n", + " 'correction_scheme' : orm.Str('none'),\n", + " \"epsilon\":orm.Float(1.0),\n", + " \"pseudos_host\":pseudos_dict_host,\n", + " \"pseudos_defect\":pseudos_dict_defect,\n", + " #\"pseudos_q0\":pseudos_dict,\n", + " #\"pseudos_q\":pseudos_dict,\n", + " # Computational (chosen code is QE)\n", + " 'siesta' : { 'dft': {'supercell_host':{'code': code, 'kpoints': kpoints_host, 'parameters' : parameters_host,\n", + " 'options':options_host,\"basis\": basis_dict_host},\n", + " 'supercell_defect_q0':{'code': code, 'kpoints': kpoints_defect_q,'parameters' : parameters_defect_q0,\n", + " 'options':options_defect_q0,\"basis\": basis_dict_defect_q0},\n", + " 'supercell_defect_q':{'code': code, 'kpoints': kpoints_defect_q,'parameters' : parameters_defect_q,\n", + " 'options':options_defect_q,\"basis\": basis_dict_defect_q}\n", + "}}}" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "{'host_structure': ,\n", + " 'defect_structure': ,\n", + " 'defect_charge': ,\n", + " 'defect_site': ,\n", + " 'fermi_level': ,\n", + " 'chemical_potential': ,\n", + " 'gaussian_sigma': ,\n", + " 'correction_scheme': ,\n", + " 'epsilon': ,\n", + " 'pseudos_host': {'O': },\n", + " 'pseudos_defect': {'O': },\n", + " 'siesta': {'dft': {'supercell_host': {'code': ,\n", + " 'kpoints': ,\n", + " 'parameters': ,\n", + " 'options': ,\n", + " 'basis': },\n", + " 'supercell_defect_q0': {'code': ,\n", + " 'kpoints': ,\n", + " 'parameters': ,\n", + " 'options': ,\n", + " 'basis': },\n", + " 'supercell_defect_q': {'code': ,\n", + " 'kpoints': ,\n", + " 'parameters': ,\n", + " 'options': ,\n", + " 'basis': }}}}" + ] + }, + "execution_count": 16, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "inputs" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "scrolled": false + }, + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/aakhtar/venv/aiida/lib/python3.6/site-packages/aiida/engine/processes/ports.py:111: UserWarning: default of input port `fermi_level` is a `Node` instance, which can lead to unexpected side effects. It is advised to use a lambda instead, e.g.: `default=lambda: orm.Int(5)`.\n", + " warnings.warn(UserWarning(message)) # pylint: disable=no-member\n" + ] + } + ], + "source": [ + "workchain_future = engine.submit(FormationEnergyWorkchainSIESTA, **inputs)" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 18, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "workchain_future" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[22m PK Created Process label Process State Process status\n", + "---- --------- ------------------------------ ---------------- ---------------------------------------------\n", + "2411 23h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", + "2412 23h ago SiestaCalculation ☠ Killed Killed by parent<2411>\n", + "2413 23h ago SiestaCalculation ☠ Killed Killed by parent<2411>\n", + "2414 23h ago SiestaCalculation ☠ Killed Killed by parent<2411>\n", + "2438 23h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", + "2439 23h ago SiestaCalculation ☠ Killed Killed by parent<2438>\n", + "2440 23h ago SiestaCalculation ☠ Killed Killed by parent<2438>\n", + "2442 23h ago SiestaCalculation ☠ Killed Killed by parent<2438>\n", + "2465 23h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", + "2466 23h ago SiestaCalculation ☠ Killed Killed by parent<2465>\n", + "2467 23h ago SiestaCalculation ☠ Killed Killed by parent<2465>\n", + "2469 23h ago SiestaCalculation ☠ Killed Killed by parent<2465>\n", + "2492 23h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", + "2493 23h ago SiestaCalculation ☠ Killed Killed by parent<2492>\n", + "2494 23h ago SiestaCalculation ☠ Killed Killed by parent<2492>\n", + "2496 23h ago SiestaCalculation ☠ Killed Killed by parent<2492>\n", + "2519 22h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", + "2520 22h ago SiestaCalculation ☠ Killed Killed by parent<2519>\n", + "2521 22h ago SiestaCalculation ☠ Killed Killed by parent<2519>\n", + "2522 22h ago SiestaCalculation ☠ Killed Killed by parent<2519>\n", + "2546 22h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", + "2547 22h ago SiestaCalculation ☠ Killed Killed by parent<2546>\n", + "2548 22h ago SiestaCalculation ☠ Killed Killed by parent<2546>\n", + "2550 22h ago SiestaCalculation ☠ Killed Killed by parent<2546>\n", + "2573 22h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", + "2574 22h ago SiestaCalculation ☠ Killed Killed by parent<2573>\n", + "2575 22h ago SiestaCalculation ☠ Killed Killed by parent<2573>\n", + "2576 22h ago SiestaCalculation ☠ Killed Killed by parent<2573>\n", + "2600 22h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", + "2601 22h ago SiestaCalculation ☠ Killed Killed by parent<2600>\n", + "2602 22h ago SiestaCalculation ☠ Killed Killed by parent<2600>\n", + "2604 22h ago SiestaCalculation ☠ Killed Killed by parent<2600>\n", + "2627 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", + "2648 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", + "2669 3h ago FormationEnergyWorkchainSIESTA ⏹ Finished [403]\n", + "2670 3h ago SiestaCalculation ⨯ Excepted Waiting for transport task: upload\n", + "2671 3h ago SiestaCalculation ⨯ Excepted Waiting for transport task: upload\n", + "2672 3h ago SiestaCalculation ⨯ Excepted Waiting for transport task: upload\n", + "2693 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", + "2694 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2695 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2696 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2732 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", + "2733 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2734 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2735 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2774 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", + "2775 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2776 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2777 3h ago SiestaCalculation ⏹ Finished [0]\n", + "2816 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", + "2817 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2818 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2819 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2839 2h ago get_raw_formation_energy ⏹ Finished [0]\n", + "2861 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", + "2862 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2863 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2864 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2884 2h ago get_raw_formation_energy ⏹ Finished [0]\n", + "2906 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", + "2907 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2908 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2909 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2929 2h ago get_raw_formation_energy ⏹ Finished [0]\n", + "2951 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", + "2952 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2953 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2954 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2974 2h ago get_raw_formation_energy ⏹ Finished [0]\n", + "2996 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", + "2997 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2998 2h ago SiestaCalculation ⏹ Finished [0]\n", + "2999 2h ago SiestaCalculation ⏹ Finished [0]\n", + "3019 2h ago get_raw_formation_energy ⏹ Finished [0]\n", + "3021 2h ago get_raw_formation_energy ⏹ Finished [0]\n", + "3043 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", + "3044 2h ago SiestaCalculation ⏹ Finished [0]\n", + "3045 2h ago SiestaCalculation ⏹ Finished [0]\n", + "3046 2h ago SiestaCalculation ⏹ Finished [0]\n", + "3066 2h ago get_raw_formation_energy ⏹ Finished [0]\n", + "3068 2h ago get_raw_formation_energy ⏹ Finished [0]\n", + "3074 1h ago SiestaCalculation ⨯ Excepted\n", + "3077 1h ago SiestaCalculation ⨯ Excepted\n", + "3084 1h ago SiestaCalculation ⨯ Excepted\n", + "3089 1h ago SiestaCalculation ⨯ Excepted\n", + "3094 1h ago SiestaCalculation ⨯ Excepted\n", + "3101 1h ago SiestaCalculation ⨯ Excepted\n", + "3108 1h ago SiestaCalculation ⏹ Finished [350]\n", + "3116 1h ago SiestaCalculation ⏹ Finished [0]\n", + "3125 1h ago SiestaCalculation ⏹ Finished [0]\n", + "3135 1h ago SiestaCalculation ⏹ Finished [0]\n", + "3160 5s ago FormationEnergyWorkchainSIESTA ⏵ Waiting Waiting for child processes: 3161, 3162, 3163\n", + "3161 3s ago SiestaCalculation ⏵ Waiting Monitoring scheduler: job state RUNNING\n", + "3162 3s ago SiestaCalculation ⏵ Waiting Monitoring scheduler: job state RUNNING\n", + "3163 3s ago SiestaCalculation ⏵ Waiting Monitoring scheduler: job state RUNNING\u001b[0m\n", + "\u001b[22m\n", + "Total results: 96\n", + "\u001b[0m\n", + "\u001b[34m\u001b[1mInfo: \u001b[0m\u001b[22mlast time an entry changed state: 1s ago (at 11:47:58 on 2020-07-17)\u001b[0m\n" + ] + } + ], + "source": [ + "!verdi process list -a -p 1" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#!verdi process kill 2669" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "scrolled": true + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[22mProperty Value\n", + "----------- ------------------------------------\n", + "type FormationEnergyWorkchainSIESTA\n", + "state Waiting\n", + "pk 3160\n", + "uuid 24c9a196-77f2-4f18-a105-378bf00e105b\n", + "label\n", + "description\n", + "ctime 2020-07-17 11:47:54.819648+00:00\n", + "mtime 2020-07-17 11:47:56.908830+00:00\n", + "computer [1] N552VW\n", + "\n", + "Inputs PK Type\n", + "--------------------------- ---- -------------\n", + "pseudos_defect\n", + " O 3 PsfData\n", + "pseudos_host\n", + " O 3 PsfData\n", + "siesta\n", + " dft\n", + " supercell_defect_q\n", + " basis 3159 Dict\n", + " options 3158 Dict\n", + " parameters 3157 Dict\n", + " kpoints 3153 KpointsData\n", + " code 403 Code\n", + " supercell_defect_q0\n", + " basis 3156 Dict\n", + " options 3155 Dict\n", + " parameters 3154 Dict\n", + " kpoints 3153 KpointsData\n", + " code 403 Code\n", + " supercell_host\n", + " basis 3152 Dict\n", + " options 3151 Dict\n", + " parameters 3150 Dict\n", + " kpoints 3149 KpointsData\n", + " code 403 Code\n", + "chemical_potential 3145 Float\n", + "correction_scheme 3147 Str\n", + "defect_charge 3142 Float\n", + "defect_site 3143 List\n", + "defect_structure 3141 StructureData\n", + "epsilon 3148 Float\n", + "fermi_level 3144 Float\n", + "gaussian_sigma 3146 Float\n", + "host_structure 3140 StructureData\n", + "\n", + "Called PK Type\n", + "-------- ---- -----------\n", + "CALL 3163 CalcJobNode\n", + "CALL 3162 CalcJobNode\n", + "CALL 3161 CalcJobNode\n", + "\n", + "Log messages\n", + "---------------------------------------------\n", + "There are 5 log messages for this calculation\n", + "Run 'verdi process report 3160' to see them\u001b[0m\n" + ] + } + ], + "source": [ + "!verdi process show 3160" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\u001b[22m2020-07-17 11:47:56 [613 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|setup]: Checking Formation Scheme\n", + "2020-07-17 11:47:56 [614 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|run_dft_calcs]: Setting Up the No correction Formation Energy Workchain \n", + "2020-07-17 11:47:56 [615 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|run_dft_calcs]: Workflow Launching SIESTA for host structure (PK=3140) (PK=3161)\n", + "2020-07-17 11:47:56 [616 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|run_dft_calcs]: Launching SIESTA for defect structure (PK=3141) with charge 0.0 (PK=3162)\n", + "2020-07-17 11:47:56 [617 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|run_dft_calcs]: Launching SIESTA for defect structure (PK=3141) with charge -2.0 (PK=3163)\n", + "2020-07-17 11:48:39 [618 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|correction_required]: Ther will be no Corrections applied\n", + "2020-07-17 11:48:40 [619 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|check_dft_calcs]: Checking Up Whether DFT Caclucations are Finished \n", + "2020-07-17 11:48:40 [620 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|compute_neutral_formation_energy]: The computed neutral formation energy without correction is -250.709 eV\n", + "2020-07-17 11:48:41 [621 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|compute_charged_formation_energy_no_corre]: The computed charge -2.0 e formation energy without correction is -236.278591 eV\n", + "2020-07-17 11:48:41 [622 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|compute_charged_formation_energy_no_corre]: The Grid Units is 13.605814541346533\u001b[0m\n" + ] + } + ], + "source": [ + "!verdi process report 3160" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "#workchain_future.outputs.formation_energy_uncorrected.value #.outputs.formation_energy_uncorrected.value\n", + "from aiida.orm import load_node\n", + "results=load_node('2952')" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "results.outputs['output_parameters'].get_dict()#['Etot']\n", + "#results['forces_and_stress']" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "results.outputs.output_parameters.get_dict()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "code" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "from aiida_siesta.calculations.siesta import SiestaCalculation\n", + "builder = SiestaCalculation.get_builder()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "builder.metadata" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.6.9" + } + }, + "nbformat": 4, + "nbformat_minor": 4 +} diff --git a/aiida_defects/formation_energy_siesta/DefectWorkflowExample.py b/aiida_defects/formation_energy_siesta/DefectWorkflowExample.py new file mode 100644 index 0000000..34ea0e3 --- /dev/null +++ b/aiida_defects/formation_energy_siesta/DefectWorkflowExample.py @@ -0,0 +1,322 @@ +#!/usr/bin/env python +# coding: utf-8 + +# In[1]: + + +from __future__ import absolute_import +import aiida + + +# In[2]: + + +#from aiida import load_profile +#load_profile() + +# Import commonly used functionality +import numpy as np +from aiida import orm, engine, common +from aiida.plugins import WorkflowFactory +from aiida.orm import Code + + +# In[3]: + + +#get_ipython().system('pwd') + + +# In[8]: + + +#!$JUPYTER_PATH +#!export JUPYTER_PATH="/home/aakhtar/Projects/aiida-defects-siesta/siesta-defect-formation/aiida-workflow/formation_energy/;$JUPYTER_PATH" + + +# In[5]: + + +from aiida_siesta.workflows.defect_formation.formation_energy_siesta import FormationEnergyWorkchainSIESTA +#import .formation_energy_siesta +#!pwd + + +# In[6]: + + +from aiida.orm import StructureData +#Structure Pure +cell = [[15.0, 0.0, 0.0,], + [ 0.0,15.0, 0.0,], + [ 0.0, 0.0,15.0,], + ] +pure = StructureData(cell=cell) +pure.append_atom(position=( 0.000 , 0.000 , 0.000 ),symbols=['O']) #1 +pure.append_atom(position=( 0.757 , 0.586 , 0.000 ),symbols=['H']) #2 +pure.append_atom(position=(-0.757 , 0.586 , 0.000),symbols=['H']) #3 +pure.append_atom(position=( 0.000 , 3.500 , 0.000),symbols=['O']) #4 +pure.append_atom(position=( 0.757 , 2.914 , 0.000 ),symbols=['H']) #5 +pure.append_atom(position=(-0.757 , 2.914 , 0.000),symbols=['H']) #6 + + +defect=StructureData(cell=cell) +defect.append_atom(position=( 0.000 , 0.000 , 0.000 ),symbols=['O']) #1 +defect.append_atom(position=( 0.757 , 0.586 , 0.000 ),symbols=['H']) #2 +defect.append_atom(position=(-0.757 , 0.586 , 0.000),symbols=['H']) #3 +defect.append_atom(position=( 0.000 , 3.500 , 0.000),symbols=['O']) #4 +defect.append_atom(position=( 0.757 , 2.914 , 0.000 ),symbols=['H']) #5 +defect.append_atom(position=(-0.757 , 2.914 , 0.000),symbols=['H'],name="GhostH") #6 + + +# In[7]: + + +code = Code.get_from_string('siesta-psml-lua@N552VW') +charge=-2 + + +# In[8]: + + +from aiida.orm import Dict +parameters_host = Dict(dict={ + "mesh-cutoff": "250 Ry", + "dm-tolerance": "0.0001", + "MD-TypeOfRun": "LUA", + "LUA-script": "neb.lua", + "DM-NumberPulay ": "3", + "DM-History-Depth": "0", + "SCF-Mixer-weight": "0.02", + "SCF-Mix": "density", + "SCF-Mixer-kick": "35", + "MD-VariableCell": "F", + "MD-MaxCGDispl": "0.3 Bohr", + "MD-MaxForceTol": " 0.04000 eV/Ang", + }) +parameters_defect_q0 = Dict(dict={ + "mesh-cutoff": "250 Ry", + "dm-tolerance": "0.0001", + "MD-TypeOfRun": "LUA", + "LUA-script": "neb.lua", + "DM-NumberPulay ": "3", + "DM-History-Depth": "0", + "SCF-Mixer-weight": "0.02", + "SCF-Mix": "density", + "SCF-Mixer-kick": "35", + "MD-VariableCell": "F", + "MD-MaxCGDispl": "0.3 Bohr", + "MD-MaxForceTol": " 0.04000 eV/Ang", + "NetCharge": "0", + }) +parameters_defect_q = Dict(dict={ + "mesh-cutoff": "250 Ry", + "dm-tolerance": "0.0001", + "MD-TypeOfRun": "LUA", + "LUA-script": "neb.lua", + "DM-NumberPulay ": "3", + "DM-History-Depth": "0", + "SCF-Mixer-weight": "0.02", + "SCF-Mix": "density", + "SCF-Mixer-kick": "35", + "MD-VariableCell": "F", + "MD-MaxCGDispl": "0.3 Bohr", + "MD-MaxForceTol": " 0.04000 eV/Ang", + "NetCharge": str(charge), + }) +options_host=Dict( + dict={ + "max_wallclock_seconds": 360, + #'withmpi': True, + #'account': "tcphy113c", + #'queue_name': "DevQ", + "resources": { + "num_machines": 1, + "num_mpiprocs_per_machine": 1, + } + } +) +options_defect_q0=Dict( + dict={ + "max_wallclock_seconds": 360, + #'withmpi': True, + #'account': "tcphy113c", + #'queue_name': "DevQ", + "resources": { + "num_machines": 1, + "num_mpiprocs_per_machine": 1, + } + } +) +options_defect_q=Dict( + dict={ + "max_wallclock_seconds": 360, + #'withmpi': True, + #'account': "tcphy113c", + #'queue_name': "DevQ", + "resources": { + "num_machines": 1, + "num_mpiprocs_per_machine": 1, + } + } +) + + +# In[9]: + + +basis_dict_host =Dict(dict= { +'pao-basistype':'split', +'pao-splitnorm': 0.150, +'pao-energyshift': '0.020 Ry', +'%block pao-basis-sizes': +""" +GhostH DZP +H DZP +%endblock pao-basis-sizes""", +}) +basis_dict_defect_q0 = Dict(dict= { +'pao-basistype':'split', +'pao-splitnorm': 0.150, +'pao-energyshift': '0.020 Ry', +'%block pao-basis-sizes': +""" +GhostH DZP +H DZP +%endblock pao-basis-sizes""", +}) +basis_dict_defect_q =Dict(dict= { +'pao-basistype':'split', +'pao-splitnorm': 0.150, +'pao-energyshift': '0.020 Ry', +'%block pao-basis-sizes': +""" +GhostH DZP +H DZP +%endblock pao-basis-sizes""", +}) + + +# In[10]: + + +parameters_defect_q0.get_dict() + + +# In[11]: + + +kpoints_host = orm.KpointsData() +kpoints_host.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly +kpoints_defect_q0 = orm.KpointsData() +kpoints_defect_q0.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly +kpoints_defect_q = orm.KpointsData() +kpoints_defect_q.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly + + +# In[12]: + + +import os +from aiida_siesta.data.psf import PsfData +pseudo_file_to_species_map = [ ("H.psf", ['GhostH','H']),("O.psf", ['O'])] +pseudos_dict = {} +for fname, kinds, in pseudo_file_to_species_map: + absname = os.path.realpath(os.path.join("./aiida_siesta/workflows/defect_formation/pseudos",fname)) + pseudo, created = PsfData.get_or_create(absname, use_first=True) + for j in kinds: + pseudos_dict[j]=pseudo +pseudos_dict + + +# In[13]: + + +inputs = { + # Structures + 'host_structure': pure, + 'defect_structure': defect, + # Defect information + 'defect_charge' : orm.Float(-2.), + 'defect_site' : orm.List(list=[-0.757 , 2.914 , 0.000]), # Position of the defect in crystal coordinates + 'fermi_level' : orm.Float(0.0), # Position of the Fermi level, with respect to the valence band maximum + 'chemical_potential' : orm.Float(250.709), # eV, the chemical potentical of a C atom + 'gaussian_sigma':orm.Float(0.5), + 'correction_scheme' : orm.Str('gaussian'), + "epsilon":orm.Float(1.0), + # Computational (chosen code is QE) + 'siesta' : { 'dft': {'supercell_host':{'code': code, 'kpoints': kpoints_host, 'parameters' : parameters_host, + 'options':options_host,"basis": basis_dict_host}, + 'supercell_defect_q0':{'code': code, 'kpoints': kpoints_defect_q,'parameters' : parameters_defect_q0, + 'options':options_defect_q0,"basis": basis_dict_defect_q0}, + 'supercell_defect_q':{'code': code, 'kpoints': kpoints_defect_q,'parameters' : parameters_defect_q, + 'options':options_defect_q,"basis": basis_dict_defect_q} +}}} + + +# In[14]: + + +inputs + + +# In[15]: + + +workchain_future = engine.submit(FormationEnergyWorkchainSIESTA, **inputs) + + +# In[16]: + + +workchain_future + + +# In[17]: + + +#get_ipython().system('verdi process list -a') + + +# In[18]: + + +#get_ipython().system('verdi process show 799') + + +# In[ ]: + + +#get_ipython().system('verdi process report 584') + + +# In[ ]: + + +#from aiida.orm import load_node +#results=load_node('584') + + +# In[ ]: + + +#results.outputs['output_parameters'.get_dict()] + + +# In[ ]: + + +#results.outputs.output_parameters.get_dict() + + +# In[ ]: + + +#code + + +# In[ ]: + + + + diff --git a/aiida_defects/formation_energy_siesta/__init__.py b/aiida_defects/formation_energy_siesta/__init__.py new file mode 100644 index 0000000..4d27567 --- /dev/null +++ b/aiida_defects/formation_energy_siesta/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## diff --git a/aiida_defects/formation_energy_siesta/corrections/gaussian/gaussian_countercharge.py b/aiida_defects/formation_energy_siesta/corrections/gaussian/gaussian_countercharge.py new file mode 100644 index 0000000..672f0b7 --- /dev/null +++ b/aiida_defects/formation_energy_siesta/corrections/gaussian/gaussian_countercharge.py @@ -0,0 +1,338 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida.engine import WorkChain, calcfunction, ToContext, while_ +from aiida import orm + +from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain +from .model_potential.model_potential import ModelPotentialWorkchain +from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference +from aiida_defects.formation_energy.corrections.gaussian_countercharge.utils import get_total_correction, get_total_alignment + +from .utils import fit_energies, calc_correction + + +class GaussianCounterChargeWorkchain(WorkChain): + """ + Compute the electrostatic correction for charged defects according to the + Guassian counter-charge method. + Here we implement the Komsa-Pasquarello method (https://doi.org/10.1103/PhysRevLett.110.095505), + which is itself based on the Freysoldt method + (https://doi.org/10.1103/PhysRevLett.102.016402). + """ + @classmethod + def define(cls, spec): + super(GaussianCounterChargeWorkchain, cls).define(spec) + + spec.input("v_host", + valid_type=orm.ArrayData, + help="Host VT array readed by sisl") + spec.input("v_defect_q0", + valid_type=orm.ArrayData + help="Defect VT array readed by sisl") + spec.input("v_defect_q", + valid_type=orm.ArrayData + help="Defect with charge VT array readed by sisl") + spec.input("defect_charge", + valid_type=orm.Float + help="Defect charge") + spec.input("defect_site", + valid_type=orm.List, + help="Defect site position in crystal coordinates") + spec.input("host_structure", + valid_type=orm.StructureData + help="Host Structure") + spec.input("epsilon", + valid_type=orm.Float, + help="Dielectric constant for the host material") +# spec.input("model_iterations_required", +# valid_type=orm.Int, +# default=orm.Int(3)) +# spec.input("cutoff", +# valid_type=orm.Float, +# default=orm.Float(40.), +# help="Plane wave cutoff for electrostatic model") +#aakhtar + spec.outline( +# cls.setup, +# while_(cls.should_run_model)( +# cls.compute_model_potential, +# ), + cls.compute_model_potential, +#aakhtar + cls.check_model_potential_workchains, + cls.compute_dft_difference_potential, + cls.submit_alignment_workchains, + cls.check_alignment_workchains, + cls.get_isolated_energy, + cls.get_model_corrections, + cls.compute_correction, + ) + spec.output('v_dft_difference', valid_type=orm.ArrayData) + spec.output('alignment_q0_to_host', valid_type=orm.Float) + spec.output('alignment_dft_to_model', valid_type=orm.Float) + spec.output('total_alignment', valid_type=orm.Float, required=True) + spec.output('total_correction', valid_type=orm.Float) + spec.output('electrostatic_correction', valid_type=orm.Float) + # spec.output('isolated_energy', valid_type=orm.Float, required=True) # Not sure if anyone would use this + # spec.output('model_correction_energies', valid_type=orm.Dict, required=True) # Again, not sure if useful + spec.exit_code( + 401, + 'ERROR_INVALID_INPUT_ARRAY', + message='the input ArrayData object can only contain one array') + spec.exit_code( + 409, + 'ERROR_SUB_PROCESS_FAILED_ALIGNMENT', + message='the electrostatic potentials could not be aligned') + spec.exit_code( + 413, + 'ERROR_SUB_PROCESS_FAILED_MODEL_POTENTIAL', + message='The model electrostatic potential could not be computed') + spec.exit_code( + 410, + 'ERROR_SUB_PROCESS_FAILED_FINAL_SCF', + message='the final scf PwBaseWorkChain sub process failed') + spec.exit_code( + 411, + 'ERROR_BAD_INPUT_ITERATIONS_REQUIRED', + message='The required number of iterations must be at least 3') + + + def setup(self): + """ + Setup the calculation + """ + +# ## Verification +# if self.inputs.model_iterations_required < 3: +# self.report('The requested number of iterations, {}, is too low. At least 3 are required to achieve an #adequate data fit'.format(self.inputs.model_iterations_required.value)) +# return self.exit_codes.ERROR_BAD_INPUT_ITERATIONS_REQUIRED + + # Track iteration number +# self.ctx.model_iteration = orm.Int(0) + + # Check that the input ArrayData objects contain only one array + for arraydata in [ + self.inputs.v_host, self.inputs.v_defect_q0, + self.inputs.v_defect_q + ]: + if len(arraydata.get_arraynames()) != 1: + self.report('Input array is invalid') + return self.exit_codes.ERROR_INVALID_INPUT_ARRAY + + v_defect_q0 = self.inputs.v_defect_q0 + self.ctx.v_defect_q0_array = v_defect_q0.get_array( + v_defect_q0.get_arraynames()[0]) + + v_defect_q = self.inputs.v_defect_q + self.ctx.v_defect_q_array = v_defect_q.get_array( + v_defect_q.get_arraynames()[0]) + + # Dict to store model energies + self.ctx.model_energies = {} + + # Dict to store model structures + self.ctx.model_structures = {} + + # Dict to store correction energies + self.ctx.model_correction_energies = {} + + return + + # def should_run_model(self): + # """ + # Return whether a model workchain should be run, which is dependant on the number of model energies computed + # with respect to to the total number of model energies needed. + # """ + # return self.ctx.model_iteration < self.inputs.model_iterations_required + + def compute_model_potential(self): + """ + Compute the potential for the system using a model charge distribution + """ +# self.ctx.model_iteration += 1 +# scale_factor = self.ctx.model_iteration + + self.report("Computing model potential for scale factor {}".format( + scale_factor.value)) + + inputs = { + 'defect_charge': self.inputs.defect_charge, +# 'scale_factor': scale_factor, + 'host_structure': self.inputs.host_structure, + 'defect_site': self.inputs.defect_site, + # 'cutoff': self.inputs.cutoff, + 'epsilon': self.inputs.epsilon, + } + workchain_future = self.submit(ModelPotentialWorkchain, **inputs) + label = 'model_potential_scale_factor_{}'.format(scale_factor.value) + self.to_context(**{label: workchain_future}) + + def check_model_potential_workchains(self): + """ + Check if the model potential alignment workchains have finished correctly. + If yes, assign the outputs to the context + """ + # for ii in range(self.inputs.model_iterations_required.value): + # scale_factor = ii + 1 + # label = 'model_potential_scale_factor_{}'.format(scale_factor) + label="model_potential" + model_workchain = self.ctx[label] + if not model_workchain.is_finished_ok: + self.report( + 'Model potential workchain failed with status {}'.format(model_workchain.exit_status)) +# 'Model potential workchain for scale factor {} failed with status {}' +# .format(model_workchain.scale_factor, +# model_workchain.exit_status)) + return self.exit_codes.ERROR_SUB_PROCESS_FAILED_MODEL_POTENTIAL + else: + self.ctx.v_model = model_workchain.outputs.model_potential + self.ctx.model_energies= model_workchain.outputs.model_energy + self.ctx.model_structures= model_workchain.outputs.model_structure + +# if scale_factor == 1: +# self.ctx.v_model = model_workchain.outputs.model_potential +# self.ctx.model_energies[str( +# scale_factor)] = model_workchain.outputs.model_energy +# self.ctx.model_structures[str( +# scale_factor)] = model_workchain.outputs.model_structure + + def compute_dft_difference_potential(self): + """ + Compute the difference in the DFT potentials for the cases of q=q and q=0 + """ + self.ctx.v_defect_q_q0 = get_potential_difference( + self.inputs.v_defect_q, self.inputs.v_defect_q0) + self.out('v_dft_difference', self.ctx.v_defect_q_q0) + + def submit_alignment_workchains(self): + """ + Align the electrostatic potential of the defective material in the q=0 charge + state with the pristine host system + """ + + # Compute the alignment between the defect, in q=0, and the host + inputs = { + "first_potential": self.inputs.v_defect_q0, + "second_potential": self.inputs.v_host + } + workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) + label = 'workchain_alignment_q0_to_host' + self.to_context(**{label: workchain_future}) + + # Compute the alignment between the defect DFT difference potential, and the model + inputs = { + "first_potential": self.ctx.v_defect_q_q0, + "second_potential": self.ctx.v_model, + "interpolate": + orm.Bool(True) # This will more or less always be required + } + workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) + label = 'workchain_alignment_dft_to_model' + self.to_context(**{label: workchain_future}) + + def check_alignment_workchains(self): + """ + Check if the potential alignment workchains have finished correctly. + If yes, assign the outputs to the context + """ + + # q0 to host + alignment_wc = self.ctx['workchain_alignment_q0_to_host'] + if not alignment_wc.is_finished_ok: + self.report( + 'Potential alignment workchain (defect q=0 to host) failed with status {}' + .format(alignment_wc.exit_status)) + return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT + else: + self.ctx.alignment_q0_to_host = alignment_wc.outputs.alignment_required + + # DFT diff to model + alignment_wc = self.ctx['workchain_alignment_dft_to_model'] + if not alignment_wc.is_finished_ok: + self.report( + 'Potential alignment workchain (DFT diff to model) failed with status {}' + .format(alignment_wc.exit_status)) + return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT + else: + self.ctx.alignment_dft_to_model = alignment_wc.outputs.alignment_required + + def get_isolated_energy(self): + """ + Without any fitting + """ + + self.ctx.isolated_energy = orm.Float(self.ctx.model_energies) + self.report("The isolated model energy is {} eV".format( + self.ctx.isolated_energy.value)) +# def get_isolated_energy(self): +# """ +# Fit the calculated model energies and obtain an estimate for the isolated model energy +# """ + + # Get the linear dimensions of the structures +# linear_dimensions = {} +# +# for scale, structure in self.ctx.model_structures.items(): +# volume = structure.get_cell_volume() +# linear_dimensions[scale] = 1 / (volume**(1 / 3.)) +# +# self.report( +# "Fitting the model energies to obtain the model energy for the isolated case" +# ) +# self.ctx.isolated_energy = fit_energies( +# orm.Dict(dict=linear_dimensions), +# orm.Dict(dict=self.ctx.model_energies)) +# self.report("The isolated model energy is {} eV".format( +# self.ctx.isolated_energy.value)) + + def get_model_corrections(self): + """ + Get the energy corrections for each model size + """ +# self.report("Computing the required correction for each model size") + +# for scale_factor, model_energy in self.ctx.model_energies.items(): +# self.ctx.model_correction_energies[scale_factor] = calc_correction( +# self.ctx.isolated_energy, model_energy) + self.ctx.model_energies = calc_correction( + self.ctx.isolated_energy, model_energy) + + def compute_correction(self): + """ + Compute the Gaussian Countercharge correction + """ + + electrostatic_correction = self.ctx.model_correction_energies['1'] + + total_alignment = get_total_alignment(self.ctx.alignment_dft_to_model, + self.ctx.alignment_q0_to_host, + self.inputs.defect_charge) + + total_correction = get_total_correction(electrostatic_correction, + total_alignment) + + self.report('The computed total alignment is {} eV'.format( + total_alignment.value)) + self.out('total_alignment', total_alignment) + + self.report('The computed electrostatic correction is {} eV'.format( + electrostatic_correction.value)) + self.out('electrostatic_correction', electrostatic_correction) + + self.report( + 'The computed total correction, including potential alignments, is {} eV' + .format(total_correction.value)) + self.out('total_correction', total_correction) + + # Store additional outputs + self.out('alignment_q0_to_host', self.ctx.alignment_q0_to_host) + self.out('alignment_dft_to_model', self.ctx.alignment_dft_to_model) + + self.report('Gaussian Countercharge workchain completed successfully') diff --git a/aiida_defects/formation_energy_siesta/formation_energy_base.py b/aiida_defects/formation_energy_siesta/formation_energy_base.py new file mode 100644 index 0000000..318ee6e --- /dev/null +++ b/aiida_defects/formation_energy_siesta/formation_energy_base.py @@ -0,0 +1,364 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit + +from .utils import ( + get_raw_formation_energy, + get_corrected_formation_energy, + get_corrected_aligned_formation_energy, +) + + +class FormationEnergyWorkchainBase(WorkChain): + """ + The base class to compute the formation energy for a given defect, containing the + generic, code-agnostic methods, error codes, etc. + + Any computational code can be used to calculate the required energies and relative permittivity. + However, different codes must be setup in specific ways, and so separate classes are used to implement these + possibilities. This is an abstract class and should not be used directly, but rather the + concrete code-specific classes should be used instead. + """ + + @classmethod + def define(cls, spec): + super(FormationEnergyWorkchainBase, cls).define(spec) + # fmt: off + # Structures + spec.input( + "host_structure", + valid_type=orm.StructureData, + help="Pristine structure" + ) + spec.input( + "defect_structure", + valid_type=orm.StructureData, + help="Defective structure" + ) + + # aakhtar + # spec.input( + # "host_unitcell", + # valid_type=orm.StructureData, + # help="Pristine structure to use in the calculation of permittivity", + # required=False, + # ) + + # Defect details + spec.input( + "defect_charge", + valid_type=orm.Float, + help="Defect charge state") + spec.input( + "defect_site", + valid_type=orm.List, + help="Defect site position in crystal coordinates", + ) + spec.input( + "fermi_level", + valid_type=orm.Float, + default=orm.Float(0.0), + help="Fermi level position with respect to the valence band maximum", + ) + spec.input( + "chemical_potential", + valid_type=orm.Float, + help="The chemical potential of the given defect type. The convention is that removing an atom is positive", + ) + + # Methodology + spec.input( + "correction_scheme", + valid_type=orm.Str, + help="The correction scheme to apply", + ) + #aakhtar + spec.input( + "gaussian_sigma", + valid_type=orm.Float, + help="the width fo gaussian sigma", + ) + + spec.input( + "epsilon", + valid_type=orm.Float, + help="the width fo gaussian sigma", + ) + #aakhtar + + + # Outputs + spec.output("neutral_formation_energy_uncorrected", + valid_type=orm.Float, + required=False + ) + spec.output("charged_formation_energy_uncorrected", valid_type=orm.Float, required=False + ) + + spec.output( + "formation_energy_uncorrected", valid_type=orm.Float, required=False + ) + spec.output( + "formation_energy_corrected", valid_type=orm.Float, required=False + ) + spec.output( + "formation_energy_corrected_aligned", valid_type=orm.Float, required=False + ) + + # Error codes + spec.exit_code( 401, "ERROR_INVALID_CORRECTION", + message="The requested correction scheme is not recognised", + ) + spec.exit_code(402, "ERROR_CORRECTION_WORKCHAIN_FAILED", + message="The correction scheme sub-workchain failed", + ) + spec.exit_code(403, "ERROR_DFT_CALCULATION_FAILED", + message="DFT calculation failed", + ) + spec.exit_code(404, "ERROR_PP_CALCULATION_FAILED", + message="A post-processing calculation failed", + ) + spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly", + ) + spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", + message="The requested method is not yet implemented", + ) + # fmt: on + + def setup(self): + """ + Setup the workchain + """ + + # Check if correction scheme is valid: + self.report("Checking Formation Scheme") + correction_schemes_available = ["gaussian","point","none"] + if self.inputs.correction_scheme is not None: + if self.inputs.correction_scheme not in correction_schemes_available: + return self.exit_codes.ERROR_INVALID_CORRECTION + + + def correction_required(self): + """ + Check if correction is requested + """ + #if self.inputs.correction_scheme is not None: + if self.inputs.correction_scheme=="gaussian" or self.inputs.correction_scheme=="point": + self.report("Ther will be Corrections applied") + return True + else: + self.report("Ther will be no Corrections applied") + return False + + def is_gaussian_scheme(self): + """ + Check if Gaussian countercharge correction scheme is being used + """ + return self.inputs.correction_scheme == "gaussian" + + def is_point_scheme(self): + """ + Check if Point countercharge correction scheme is being used + """ + return self.inputs.correction_scheme == "point" + + def is_none_scheme(self): + """ + Check if there is none scheme for correction + """ + return self.inputs.correction_scheme == "none" + + def run_gaussian_correction_workchain(self): + """ + Run the workchain for the Gaussian Countercharge correction + """ + from .corrections.gaussian.gaussian_countercharge import ( + GaussianCounterChargeWorkchain, + ) + + self.report("Computing correction via the Gaussian Countercharge scheme") + + inputs = { + "v_host": self.ctx.v_host, + "v_defect_q0": self.ctx.v_defect_q0, + "v_defect_q": self.ctx.v_defect_q, + "defect_charge": self.inputs.defect_charge, + "defect_site": self.inputs.defect_site, + "host_structure": self.inputs.host_structure, + "epsilon": self.input.epsilon + # "epsilon": self.ctx.epsilon, + } + + workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) + label = "correction_workchain" + self.to_context(**{label: workchain_future}) + + def prepare_point_correction_workchain(self): + """ + Get the required inputs for the Point Countercharge correction workchain + + TODO: Finish implementing this interface + """ + return + + def run_point_correction_workchain(self): + """ + Run the workchain for the Point Countercharge correction + + TODO: Finish implementing this interface + """ + from .corrections.point_countercharge.point_countercharge import ( + PointCounterChargeWorkchain, + ) + + self.report("Computing correction via the Point Countercharge scheme") + + inputs = {} + + workchain_future = self.submit(PointCounterChargeWorkchain, **inputs) + label = "correction_workchain" + self.to_context(**{label: workchain_future}) + + def check_correction_workchain(self): + """ + Check if the potential alignment workchains have finished correctly. + If yes, assign the outputs to the context + """ + + correction_wc = self.ctx["correction_workchain"] + if not correction_wc.is_finished_ok: + self.report( + "Correction workchain failed with status {}".format( + correction_wc.exit_status + ) + ) + return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION + else: + self.ctx.total_correction = correction_wc.outputs.total_correction + self.ctx.electrostatic_correction = ( + correction_wc.outputs.electrostatic_correction + ) + self.ctx.total_alignment = correction_wc.outputs.total_alignment + + + + + #============================================ + # Compute Charged Formation Energy without Corrections + #============================================ + def compute_neutral_formation_energy(self): + """ + Compute the formation energy without Correction + """ + # Raw formation energy + self.ctx.n_f_uncorrected = get_raw_formation_energy( + self.ctx.defect_q0_energy, + self.ctx.host_energy, + self.inputs.chemical_potential, + self.inputs.defect_charge, + self.inputs.fermi_level, + self.ctx.host_vbm + ) + self.report( + "The computed neutral formation energy without correction is {} eV".format( + self.ctx.n_f_uncorrected.value + ) + ) + self.out("neutral_formation_energy_uncorrected", self.ctx.n_f_uncorrected) + + #============================================== + # Compute Charged Formation Energy without Corrections + #============================================= + def compute_charged_formation_energy_no_corre(self): + """ + Compute the formation energy without Correction + """ + # Raw formation energy + self.ctx.e_f_uncorrected = get_raw_formation_energy( + self.ctx.defect_q_energy, + self.ctx.host_energy, + self.inputs.chemical_potential, + self.inputs.defect_charge, + self.inputs.fermi_level, + self.ctx.host_vbm + ) + self.report( + "The computed charge {} e formation energy without correction is {} eV".format( + self.inputs.defect_charge.value ,self.ctx.e_f_uncorrected.value + ) + ) + + self.report( + "The Grid Units is {}".format( + self.ctx.host_VT.grid_unit + ) + ) + + + self.out("charged_formation_energy_uncorrected", self.ctx.e_f_uncorrected) + + + + + + + #============================================ + # Compute Formation Energy with Corrections + #============================================ + def compute_corrected_formation_energy(self): + """ + Compute the formation energy + """ + + # Raw formation energy + self.ctx.e_f_uncorrected = get_raw_formation_energy( + self.ctx.defect_energy, + self.ctx.host_energy, + self.inputs.chemical_potential, + self.inputs.defect_charge, + self.inputs.fermi_level, + self.ctx.host_vbm, + ) + self.report( + "The computed uncorrected formation energy is {} eV".format( + self.ctx.e_f_uncorrected.value + ) + ) + self.out("formation_energy_uncorrected", self.ctx.e_f_uncorrected) + + # Corrected formation energy + self.ctx.e_f_corrected = get_corrected_formation_energy( + self.ctx.e_f_uncorrected, self.ctx.electrostatic_correction + ) + self.report( + "The computed corrected formation energy is {} eV".format( + self.ctx.e_f_corrected.value + ) + ) + self.out("formation_energy_corrected", self.ctx.e_f_corrected) + + # Corrected formation energy with potential alignment + self.ctx.e_f_corrected_aligned = get_corrected_aligned_formation_energy( + self.ctx.e_f_corrected, self.ctx.total_alignment + ) + self.report( + "The computed corrected formation energy, including potential alignments, is {} eV".format( + self.ctx.e_f_corrected_aligned.value + ) + ) + self.out("formation_energy_corrected_aligned", self.ctx.e_f_corrected_aligned) + + def raise_not_implemented(self): + """ + Raise a not-implemented error + """ + return self.exit_codes.ERROR_NOT_IMPLEMENTED diff --git a/aiida_defects/formation_energy_siesta/formation_energy_siesta.py b/aiida_defects/formation_energy_siesta/formation_energy_siesta.py new file mode 100644 index 0000000..20b9cc3 --- /dev/null +++ b/aiida_defects/formation_energy_siesta/formation_energy_siesta.py @@ -0,0 +1,314 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +import numpy as np + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit +from aiida.plugins import WorkflowFactory +from aiida_siesta.workflows.base import SiestaBaseWorkChain + +from .formation_energy_base import FormationEnergyWorkchainBase +#from .utils import run_siesta_calculation +from .utils import get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy + +from aiida.common import AttributeDict +from aiida_siesta.calculations.tkdict import FDFDict +#from aiida_siesta.data.common import get_pseudos_from_structure +#from aiida_siesta.data.psf import PsfData +#from aiida_siesta.data.psml import PsmlData +def prepare_pseudo_inputs(structure, pseudos): + """ + Reading Pseudos + """ + if pseudos is None : + raise ValueError('neither an explicit pseudos dictionary was specified') + for kind in structure.get_kind_names(): + if kind not in pseudos: + raise ValueError('no pseudo available for element {}'.format(kind)) + + return pseudos + + + +class FormationEnergyWorkchainSIESTA(FormationEnergyWorkchainBase): + """ + Compute the formation energy for a given defect using SIESTA + """ + @classmethod + def define(cls, spec): + super(FormationEnergyWorkchainSIESTA, cls).define(spec) + + # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here + # we keep track of things with two separate namespaces. An additional code, and an additional + # namespace, is used for postprocessing + #spec.expose_inputs(SiestaBaseWorkChain, exclude=('metadata',)) + #spec.inputs._ports['pseudos'].dynamic = True #Temporary fix to issue #135 plumpy + # spec.inputs._ports["pseudos.defect"].dynamic = True + # DFT inputs for Host (SIESTA) + spec.input_namespace("siesta.dft.supercell_host", + help="The siesta code to use for the calculations") + spec.input_namespace("siesta.dft.supercell_defect_q0", + help="The siesta code to use for the calculations") + spec.input_namespace("siesta.dft.supercell_defect_q", + help="The siesta code to use for the calculations") + spec.input_namespace('pseudos_host', required=False, dynamic=True) + spec.input_namespace('pseudos_defect', required=False, dynamic=True) + # HOST Inputs + spec.input("siesta.dft.supercell_host.code", + valid_type=orm.Code, + help="The siesta code to use for the calculations") + #spec.input_namespace('pseudos_host' + # valid_type=(PsfData,PsmlData), + # help='Input pseudo potentials',dynamic=True) + spec.input("siesta.dft.supercell_host.kpoints", + valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("siesta.dft.supercell_host.basis", + valid_type=orm.Dict, + help="The siesta basis to use for the host calculations") + spec.input("siesta.dft.supercell_host.parameters", + valid_type=orm.Dict, + help="Parameters for the SIESTA calcuations. Some will be set automatically") + spec.input("siesta.dft.supercell_host.options", + valid_type=orm.Dict, + help="options for the SIESTA calcuations") + # Defect_q0 without charge + spec.input("siesta.dft.supercell_defect_q0.code", + valid_type=orm.Code, + help="The siesta code to use for the calculations") + #spec.input_namespace('pseudos_q0', + # valid_type=(PsfData,PsmlData), + # help='Input pseudo potentials',dynamic=True) + spec.input("siesta.dft.supercell_defect_q0.kpoints", + valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("siesta.dft.supercell_defect_q0.basis", + valid_type=orm.Dict, + help="The siesta basis to use for the host calculations") + spec.input("siesta.dft.supercell_defect_q0.parameters", + valid_type=orm.Dict, + help="Parameters for the SIESTA calcuations. Some will be set automatically") + spec.input("siesta.dft.supercell_defect_q0.options", + valid_type=orm.Dict, + help="options for the SIESTA calcuations.") + # DFT inputs for Defect With Charge (SIESTA) + spec.input("siesta.dft.supercell_defect_q.code", + valid_type=orm.Code, + help="The siesta code to use for the calculations") + #spec.input_namespace('pseudos_q', + # valid_type=(PsfData,PsmlData), + # help='Input pseudo potentials',dynamic=True) + spec.input("siesta.dft.supercell_defect_q.kpoints", + valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("siesta.dft.supercell_defect_q.basis", + valid_type=orm.Dict, + help="The siesta basis to use for the host calculations") + spec.input("siesta.dft.supercell_defect_q.parameters", + valid_type=orm.Dict, + help="Parameters for the SIESTA calcuations. Some will be set automatically") + spec.input("siesta.dft.supercell_defect_q.options", + valid_type=orm.Dict, + help="options for the SIESTA calcuations.") + + #=================================================================== + # The Steps of Workflow + #=================================================================== + + spec.outline( + cls.setup, + cls.run_dft_calcs, + if_(cls.correction_required)( + if_(cls.is_gaussian_scheme)( + cls.raise_not_implemented + )).else_( + cls.check_dft_calcs, + cls.compute_neutral_formation_energy, + cls.compute_charged_formation_energy_no_corre)) + #if_(cls.is_none_scheme)( + # cls.check_dft_calcs, + # cls.compute_no_corrected_formation_energy)) + + + + #========================================================================= + # This function is for running Host and defect structure neutral & charge + #======================================================================== + def run_dft_calcs(self): + + """ + Submit All DFT Calculations + """ + self.report("Setting Up the No correction Formation Energy Workchain ") + #-------------- + # For the Host + #------------- + siesta_inputs = self.inputs.siesta.dft.supercell_host.code.get_builder() + #siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) For reusing + pseudos = None + if "pseudos_host" in self.inputs: #in case in the future Issue #142 will be solved + if self.inputs.pseudos_host: + pseudos = self.inputs.pseudos_host + #structure = None + structure = self.inputs.host_structure + siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) + siesta_inputs.structure = structure + siesta_inputs.parameters = self.inputs.siesta.dft.supercell_host.parameters + siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_host.kpoints + siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_host.options.get_dict() + siesta_inputs.basis = self.inputs.siesta.dft.supercell_host.basis #get_dict() + #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) + future = self.submit(siesta_inputs) + self.report( + 'Workflow Launching SIESTA for host structure (PK={}) (PK={})' + .format(structure.pk, future.pk)) + #.format(self.inputs.host_structure.pk, future.pk)) + self.to_context(**{'calc_host': future}) + #------------------------------------------- + # For Defect structure; neutral charge state + #------------------------------------------ + siesta_inputs = self.inputs.siesta.dft.supercell_defect_q0.code.get_builder() + #siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) + pseudos = None + if "pseudos_defect" in self.inputs: #in case in the future Issue #142 will be solved + if self.inputs.pseudos_defect: + pseudos = self.inputs.pseudos_defect + structure = self.inputs.defect_structure + siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) + siesta_inputs.structure = structure + siesta_inputs.parameters = self.inputs.siesta.dft.supercell_defect_q0.parameters + siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_defect_q0.kpoints + siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_defect_q0.options.get_dict() + siesta_inputs.basis = self.inputs.siesta.dft.supercell_defect_q0.basis + #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) + future = self.submit(siesta_inputs) + self.report( + 'Launching SIESTA for defect structure (PK={}) with charge {} (PK={})' + .format(structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_defect_q0': future}) + #------------------------------------------ + # For Defect structure; target charge state + #----------------------------------------- + siesta_inputs = self.inputs.siesta.dft.supercell_defect_q.code.get_builder() + # siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) + pseudos = None + if "pseudos_defect" in self.inputs: #in case in the future Issue #142 will be solved + if self.inputs.pseudos_defect: + pseudos = self.inputs.pseudos_defect + structure = self.inputs.defect_structure + siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) + siesta_inputs.structure = structure + siesta_inputs.parameters = self.inputs.siesta.dft.supercell_defect_q.parameters + siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_defect_q.kpoints + siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_defect_q.options.get_dict() + siesta_inputs.basis = self.inputs.siesta.dft.supercell_defect_q.basis + #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) + future = self.submit(siesta_inputs) + self.report( + 'Launching SIESTA for defect structure (PK={}) with charge {} (PK={})' + .format(structure.pk, + self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'calc_defect_q': future}) + #========================================= + # Retrieving DFT Calculations results + #========================================= + def check_dft_calcs(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + import sisl + + # We used sisl library read the Potential Grids + + self.report("Checking Up Whether DFT Caclucations are Finished ") + # Host + host_calc = self.ctx['calc_host'] + if host_calc.is_finished_ok: + self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['E_KS']) # eV + self.ctx.host_vbm = orm.Float(0.0) + self.ctx.host_VT = sisl.get_sile(host_calc.outputs.remote_folder.get_remote_path()+"/aiida.VT") + # self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum + else: + self.report( + 'SIESTA for the host structure has failed with status {}'. + format(host_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + # Defect (q=0) + defect_q0_calc = self.ctx['calc_defect_q0'] + if defect_q0_calc.is_finished_ok: + self.ctx.defect_q0_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['E_KS']) + self.ctx.defect_q0_VT = sisl.get_sile(calc_defect_q0.outputs.remote_folder.get_remote_path()+"/aiida.VT") + else: + self.report( + 'SIESTA for the defect structure (with charge 0) has failed with status {}' + .format(defect_q0_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + # Defect (q=q) + defect_q_calc = self.ctx['calc_defect_q'] + if defect_q_calc.is_finished_ok: + self.ctx.defect_q_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['E_KS']) # eV + self.ctx.defect_q_VT = sisl.get_sile(calc_defect_q.outputs.remote_folder.get_remote_path()+"/aiida.VT") + else: + self.report( + 'SIESTA for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value, + defect_q_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + + + def check_dft_potentials_gaussian_correction(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['pp_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_host = v_data + else: + self.report( + 'Post processing for the host structure has failed with status {}' + .format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=0) + defect_q0_pp = self.ctx['pp_defect_q0'] + if defect_q0_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q0 = v_data + else: + self.report( + 'Post processing for the defect structure (with charge 0) has failed with status {}' + .format(defect_q0_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=q) + defect_q_pp = self.ctx['pp_defect_q'] + if defect_q_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q = v_data + else: + self.report( + 'Post processing for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value, + defect_q_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED diff --git a/aiida_defects/formation_energy_siesta/formation_energy_siesta.py-backup b/aiida_defects/formation_energy_siesta/formation_energy_siesta.py-backup new file mode 100644 index 0000000..426ac8a --- /dev/null +++ b/aiida_defects/formation_energy_siesta/formation_energy_siesta.py-backup @@ -0,0 +1,340 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +import numpy as np + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit +from aiida.plugins import WorkflowFactory +from aiida_siesta.workflows.base import SiestaBaseWorkChain + +from .formation_energy_base import FormationEnergyWorkchainBase +#from .utils import run_siesta_calculation +from .utils import get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy + +from aiida.common import AttributeDict +from aiida_siesta.calculations.tkdict import FDFDict +#from aiida_siesta.data.common import get_pseudos_from_structure +#from aiida_siesta.data.psf import PsfData +#from aiida_siesta.data.psml import PsmlData +def prepare_pseudo_inputs(structure, pseudos): + """ + Reading Pseudos + """ + if pseudos is None : + raise ValueError('neither an explicit pseudos dictionary was specified') + for kind in structure.get_kind_names(): + if kind not in pseudos: + raise ValueError('no pseudo available for element {}'.format(kind)) + + return pseudos + + + +class FormationEnergyWorkchainSIESTA(FormationEnergyWorkchainBase): + """ + Compute the formation energy for a given defect using SIESTA + """ + @classmethod + def define(cls, spec): + super(FormationEnergyWorkchainSIESTA, cls).define(spec) + + # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here + # we keep track of things with two separate namespaces. An additional code, and an additional + # namespace, is used for postprocessing + #spec.expose_inputs(SiestaBaseWorkChain, exclude=('metadata',)) + #spec.inputs._ports['pseudos'].dynamic = True #Temporary fix to issue #135 plumpy + # spec.inputs._ports["pseudos.defect"].dynamic = True + # DFT inputs for Host (SIESTA) + spec.input_namespace("siesta.dft.supercell_host", + help="The siesta code to use for the calculations") + spec.input_namespace("siesta.dft.supercell_defect_q0", + help="The siesta code to use for the calculations") + spec.input_namespace("siesta.dft.supercell_defect_q", + help="The siesta code to use for the calculations") + spec.input_namespace('pseudos_host', required=False, dynamic=True) + spec.input_namespace('pseudos_defect', required=False, dynamic=True) + # HOST Inputs + spec.input("siesta.dft.supercell_host.code", + valid_type=orm.Code, + help="The siesta code to use for the calculations") + #spec.input_namespace('pseudos_host' + # valid_type=(PsfData,PsmlData), + # help='Input pseudo potentials',dynamic=True) + spec.input("siesta.dft.supercell_host.kpoints", + valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("siesta.dft.supercell_host.basis", + valid_type=orm.Dict, + help="The siesta basis to use for the host calculations") + spec.input("siesta.dft.supercell_host.parameters", + valid_type=orm.Dict, + help="Parameters for the SIESTA calcuations. Some will be set automatically") + spec.input("siesta.dft.supercell_host.options", + valid_type=orm.Dict, + help="options for the SIESTA calcuations") + # Defect_q0 without charge + spec.input("siesta.dft.supercell_defect_q0.code", + valid_type=orm.Code, + help="The siesta code to use for the calculations") + #spec.input_namespace('pseudos_q0', + # valid_type=(PsfData,PsmlData), + # help='Input pseudo potentials',dynamic=True) + spec.input("siesta.dft.supercell_defect_q0.kpoints", + valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("siesta.dft.supercell_defect_q0.basis", + valid_type=orm.Dict, + help="The siesta basis to use for the host calculations") + spec.input("siesta.dft.supercell_defect_q0.parameters", + valid_type=orm.Dict, + help="Parameters for the SIESTA calcuations. Some will be set automatically") + spec.input("siesta.dft.supercell_defect_q0.options", + valid_type=orm.Dict, + help="options for the SIESTA calcuations.") + # DFT inputs for Defect With Charge (SIESTA) + spec.input("siesta.dft.supercell_defect_q.code", + valid_type=orm.Code, + help="The siesta code to use for the calculations") + #spec.input_namespace('pseudos_q', + # valid_type=(PsfData,PsmlData), + # help='Input pseudo potentials',dynamic=True) + spec.input("siesta.dft.supercell_defect_q.kpoints", + valid_type=orm.KpointsData, + help="The k-point grid to use for the calculations") + spec.input("siesta.dft.supercell_defect_q.basis", + valid_type=orm.Dict, + help="The siesta basis to use for the host calculations") + spec.input("siesta.dft.supercell_defect_q.parameters", + valid_type=orm.Dict, + help="Parameters for the SIESTA calcuations. Some will be set automatically") + spec.input("siesta.dft.supercell_defect_q.options", + valid_type=orm.Dict, + help="options for the SIESTA calcuations.") + + #=================================================================== + # The Steps of Workflow + #=================================================================== + + spec.outline( + cls.setup, + #cls.run_dft_calcs, + if_(cls.correction_required)( + if_(cls.is_gaussian_scheme)( + cls.raise_not_implemented + )).else_( + cls.check_dft_calcs, + cls.compute_no_corrected_formation_energy)) + #if_(cls.is_none_scheme)( + # cls.check_dft_calcs, + # cls.compute_no_corrected_formation_energy)) + + + + #========================================================================= + # This function is for running Host and defect structure neutral & charge + #======================================================================== +# def run_dft_calcs(self): +# +# """ +# Submit All DFT Calculations +# """ +# self.report("Setting Up the No correction Formation Energy Workchain ") +# #-------------- +# # For the Host +# #------------- +# siesta_inputs = self.inputs.siesta.dft.supercell_host.code.get_builder() +# #siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) For reusing +# pseudos = None +# if "pseudos_host" in self.inputs: #in case in the future Issue #142 will be solved +# if self.inputs.pseudos_host: +# pseudos = self.inputs.pseudos_host +# #structure = None +# structure = self.inputs.host_structure +# siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) +# siesta_inputs.structure = structure +# siesta_inputs.parameters = self.inputs.siesta.dft.supercell_host.parameters +# siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_host.kpoints +# siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_host.options.get_dict() +# siesta_inputs.basis = self.inputs.siesta.dft.supercell_host.basis #get_dict() +# #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) +# future = self.submit(siesta_inputs) +# self.report( +# 'Launching SIESTA for host structure (PK={}) (PK={})' +# .format(structure.pk, future.pk)) +# #.format(self.inputs.host_structure.pk, future.pk)) +# self.to_context(**{'calc_host': future}) +# #------------------------------------------- +# # For Defect structure; neutral charge state +# #------------------------------------------ +# siesta_inputs = self.inputs.siesta.dft.supercell_defect_q0.code.get_builder() +# #siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) +# pseudos = None +# if "pseudos_defect" in self.inputs: #in case in the future Issue #142 will be solved +# if self.inputs.pseudos_defect: +# pseudos = self.inputs.pseudos_defect +# structure = self.inputs.defect_structure +# siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) +# siesta_inputs.structure = structure +# siesta_inputs.parameters = self.inputs.siesta.dft.supercell_defect_q0.parameters +# siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_defect_q0.kpoints +# siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_defect_q0.options.get_dict() +# siesta_inputs.basis = self.inputs.siesta.dft.supercell_defect_q0.basis +# #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) +# future = self.submit(siesta_inputs) +# self.report( +# 'Launching SIESTA for defect structure (PK={}) with charge {} (PK={})' +# .format(structure.pk, "0.0", future.pk)) +# self.to_context(**{'calc_defect_q0': future}) +# #------------------------------------------ +# # For Defect structure; target charge state +# #----------------------------------------- +# siesta_inputs = self.inputs.siesta.dft.supercell_defect_q.code.get_builder() +# # siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) +# pseudos = None +# if "pseudos_defect" in self.inputs: #in case in the future Issue #142 will be solved +# if self.inputs.pseudos_defect: +# pseudos = self.inputs.pseudos_defect +# structure = self.inputs.defect_structure +# siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) +# siesta_inputs.structure = structure +# siesta_inputs.parameters = self.inputs.siesta.dft.supercell_defect_q.parameters +# siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_defect_q.kpoints +# siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_defect_q.options.get_dict() +# siesta_inputs.basis = self.inputs.siesta.dft.supercell_defect_q.basis +# #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) +# future = self.submit(siesta_inputs) +# self.report( +# 'Launching SIESTA for defect structure (PK={}) with charge {} (PK={})' +# .format(structure.pk, +# self.inputs.defect_charge.value, future.pk)) +# self.to_context(**{'calc_defect_q': future}) + + #========================================= + # Retrieving DFT Calculations results + #========================================= + def check_dft_calcs(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + self.report("Checking Up Whether DFT Caclucations are Finished ") + # Host + host_calc = self.ctx['calc_host'] + if host_calc.is_finished_ok: + self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV + self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum + else: + self.report( + 'SIESTA for the host structure has failed with status {}'. + format(host_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + # Defect (q=0) + defect_q0_calc = self.ctx['calc_defect_q0'] + if not defect_q0_calc.is_finished_ok: + self.report( + 'SIESTA for the defect structure (with charge 0) has failed with status {}' + .format(defect_q0_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + # Defect (q=q) + defect_q_calc = self.ctx['calc_defect_q'] + if defect_q_calc.is_finished_ok: + self.ctx.defect_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['energy']) # eV + else: + self.report( + 'SIESTA for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value, + defect_q_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + +# def get_dft_potentials_gaussian_correction(self): +# """ +# Obtain the electrostatic potentials from the SIESTA calculations. +# """ + +# # User inputs +# pp_inputs = self.inputs.qe.pp.code.get_builder() +# pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() + +# # Fixed settings +# pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential +# pp_inputs.plot_dimension = orm.Int(3) # 3D + +# inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder +# future = self.submit(pp_inputs) +# self.report( +# 'Launching SIESTA VT retrieved for host structure (PK={}) with charge {} (PK={})'. +# format(self.inputs.host_structure.pk, "0.0", future.pk)) +# self.to_context(**{'pp_host': future}) + +# pp_inputs.parent_folder = self.ctx[ +# 'calc_defect_q0'].outputs.remote_folder +# future = self.submit(pp_inputs) +# self.report( +# 'Launching PP.x for defect structure (PK={}) with charge {} (PK={})' +# .format(self.inputs.defect_structure.pk, "0.0", future.pk)) +# self.to_context(**{'pp_defect_q0': future}) +# +# pp_inputs.parent_folder = self.ctx[ +# 'calc_defect_q'].outputs.remote_folder +# future = self.submit(pp_inputs) +# self.report( +# 'Launching PP.x for defect structure (PK={}) with charge {} (PK={})' +# .format(self.inputs.defect_structure.pk, +# self.inputs.defect_charge.value, future.pk)) +# self.to_context(**{'pp_defect_q': future}) + + def check_dft_potentials_gaussian_correction(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['pp_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_host = v_data + else: + self.report( + 'Post processing for the host structure has failed with status {}' + .format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=0) + defect_q0_pp = self.ctx['pp_defect_q0'] + if defect_q0_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q0 = v_data + else: + self.report( + 'Post processing for the defect structure (with charge 0) has failed with status {}' + .format(defect_q0_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defect (q=q) + defect_q_pp = self.ctx['pp_defect_q'] + if defect_q_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.v_defect_q = v_data + else: + self.report( + 'Post processing for the defect structure (with charge {}) has failed with status {}' + .format(self.inputs.defect_charge.value, + defect_q_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED diff --git a/aiida_defects/formation_energy_siesta/pseudos/GhostH.psf b/aiida_defects/formation_energy_siesta/pseudos/GhostH.psf new file mode 100644 index 0000000..25a223e --- /dev/null +++ b/aiida_defects/formation_energy_siesta/pseudos/GhostH.psf @@ -0,0 +1,1527 @@ + H ca nrl nc + ATM3 19-FEB-98 Troullier-Martins + 1s 1.00 r= 1.25/2p 0.00 r= 1.25/3d 0.00 r= 1.25/4f 0.00 r= 1.25/ + 4 0 863 0.247875217667E-02 0.125000000000E-01 1.00000000000 + Radial grid follows + 0.311788641354E-04 0.627499101025E-04 0.947180709413E-04 0.127088341742E-03 + 0.159865780426E-03 0.193055508533E-03 0.226662712027E-03 0.260692642102E-03 + 0.295150616003E-03 0.330042017859E-03 0.365372299523E-03 0.401146981422E-03 + 0.437371653424E-03 0.474051975707E-03 0.511193679647E-03 0.548802568709E-03 + 0.586884519361E-03 0.625445481983E-03 0.664491481805E-03 0.704028619843E-03 + 0.744063073857E-03 0.784601099310E-03 0.825649030352E-03 0.867213280805E-03 + 0.909300345168E-03 0.951916799631E-03 0.995069303102E-03 0.103876459825E-02 + 0.108300951254E-02 0.112781095935E-02 0.117317593898E-02 0.121911153982E-02 + 0.126562493938E-02 0.131272340548E-02 0.136041429736E-02 0.140870506681E-02 + 0.145760325936E-02 0.150711651546E-02 0.155725257165E-02 0.160801926180E-02 + 0.165942451829E-02 0.171147637332E-02 0.176418296008E-02 0.181755251409E-02 + 0.187159337444E-02 0.192631398514E-02 0.198172289639E-02 0.203782876595E-02 + 0.209464036046E-02 0.215216655687E-02 0.221041634375E-02 0.226939882275E-02 + 0.232912321000E-02 0.238959883756E-02 0.245083515488E-02 0.251284173024E-02 + 0.257562825231E-02 0.263920453161E-02 0.270358050205E-02 0.276876622252E-02 + 0.283477187841E-02 0.290160778324E-02 0.296928438027E-02 0.303781224409E-02 + 0.310720208233E-02 0.317746473729E-02 0.324861118764E-02 0.332065255018E-02 + 0.339360008150E-02 0.346746517981E-02 0.354225938667E-02 0.361799438885E-02 + 0.369468202008E-02 0.377233426296E-02 0.385096325082E-02 0.393058126959E-02 + 0.401120075975E-02 0.409283431826E-02 0.417549470053E-02 0.425919482242E-02 + 0.434394776223E-02 0.442976676279E-02 0.451666523349E-02 0.460465675239E-02 + 0.469375506834E-02 0.478397410315E-02 0.487532795371E-02 0.496783089426E-02 + 0.506149737856E-02 0.515634204219E-02 0.525237970483E-02 0.534962537256E-02 + 0.544809424020E-02 0.554780169373E-02 0.564876331263E-02 0.575099487235E-02 + 0.585451234680E-02 0.595933191079E-02 0.606546994257E-02 0.617294302645E-02 + 0.628176795531E-02 0.639196173326E-02 0.650354157831E-02 0.661652492503E-02 + 0.673092942730E-02 0.684677296106E-02 0.696407362710E-02 0.708284975388E-02 + 0.720311990041E-02 0.732490285916E-02 0.744821765894E-02 0.757308356797E-02 + 0.769952009678E-02 0.782754700133E-02 0.795718428611E-02 0.808845220719E-02 + 0.822137127545E-02 0.835596225977E-02 0.849224619027E-02 0.863024436158E-02 + 0.876997833620E-02 0.891146994785E-02 0.905474130488E-02 0.919981479373E-02 + 0.934671308243E-02 0.949545912414E-02 0.964607616072E-02 0.979858772640E-02 + 0.995301765142E-02 0.101093900658E-01 0.102677294030E-01 0.104280604038E-01 + 0.105904081204E-01 0.107547979199E-01 0.109212554885E-01 0.110898068355E-01 + 0.112604782975E-01 0.114332965423E-01 0.116082885729E-01 0.117854817323E-01 + 0.119649037073E-01 0.121465825329E-01 0.123305465968E-01 0.125168246438E-01 + 0.127054457802E-01 0.128964394784E-01 0.130898355815E-01 0.132856643082E-01 + 0.134839562570E-01 0.136847424115E-01 0.138880541449E-01 0.140939232251E-01 + 0.143023818195E-01 0.145134625003E-01 0.147271982492E-01 0.149436224628E-01 + 0.151627689580E-01 0.153846719766E-01 0.156093661917E-01 0.158368867121E-01 + 0.160672690883E-01 0.163005493180E-01 0.165367638518E-01 0.167759495987E-01 + 0.170181439319E-01 0.172633846948E-01 0.175117102068E-01 0.177631592691E-01 + 0.180177711713E-01 0.182755856970E-01 0.185366431302E-01 0.188009842617E-01 + 0.190686503953E-01 0.193396833544E-01 0.196141254884E-01 0.198920196795E-01 + 0.201734093492E-01 0.204583384653E-01 0.207468515484E-01 0.210389936793E-01 + 0.213348105059E-01 0.216343482502E-01 0.219376537154E-01 0.222447742937E-01 + 0.225557579733E-01 0.228706533461E-01 0.231895096150E-01 0.235123766021E-01 + 0.238393047559E-01 0.241703451597E-01 0.245055495391E-01 0.248449702706E-01 + 0.251886603893E-01 0.255366735976E-01 0.258890642730E-01 0.262458874776E-01 + 0.266071989655E-01 0.269730551924E-01 0.273435133242E-01 0.277186312457E-01 + 0.280984675697E-01 0.284830816465E-01 0.288725335729E-01 0.292668842014E-01 + 0.296661951502E-01 0.300705288124E-01 0.304799483660E-01 0.308945177837E-01 + 0.313143018426E-01 0.317393661350E-01 0.321697770780E-01 0.326056019242E-01 + 0.330469087721E-01 0.334937665768E-01 0.339462451607E-01 0.344044152246E-01 + 0.348683483584E-01 0.353381170527E-01 0.358137947097E-01 0.362954556551E-01 + 0.367831751493E-01 0.372770293996E-01 0.377770955716E-01 0.382834518017E-01 + 0.387961772091E-01 0.393153519083E-01 0.398410570212E-01 0.403733746904E-01 + 0.409123880916E-01 0.414581814467E-01 0.420108400372E-01 0.425704502169E-01 + 0.431370994261E-01 0.437108762050E-01 0.442918702073E-01 0.448801722145E-01 + 0.454758741499E-01 0.460790690933E-01 0.466898512951E-01 0.473083161912E-01 + 0.479345604180E-01 0.485686818275E-01 0.492107795024E-01 0.498609537718E-01 + 0.505193062267E-01 0.511859397361E-01 0.518609584627E-01 0.525444678797E-01 + 0.532365747868E-01 0.539373873271E-01 0.546470150040E-01 0.553655686982E-01 + 0.560931606852E-01 0.568299046528E-01 0.575759157186E-01 0.583313104486E-01 + 0.590962068745E-01 0.598707245130E-01 0.606549843841E-01 0.614491090300E-01 + 0.622532225343E-01 0.630674505414E-01 0.638919202759E-01 0.647267605631E-01 + 0.655721018483E-01 0.664280762180E-01 0.672948174198E-01 0.681724608838E-01 + 0.690611437435E-01 0.699610048576E-01 0.708721848311E-01 0.717948260377E-01 + 0.727290726420E-01 0.736750706219E-01 0.746329677917E-01 0.756029138245E-01 + 0.765850602765E-01 0.775795606101E-01 0.785865702179E-01 0.796062464472E-01 + 0.806387486246E-01 0.816842380806E-01 0.827428781751E-01 0.838148343227E-01 + 0.849002740188E-01 0.859993668654E-01 0.871122845982E-01 0.882392011127E-01 + 0.893802924921E-01 0.905357370340E-01 0.917057152791E-01 0.928904100389E-01 + 0.940900064243E-01 0.953046918747E-01 0.965346561872E-01 0.977800915461E-01 + 0.990411925534E-01 0.100318156259 0.101611182190 0.102920472385 + 0.104246231424 0.105588666458 0.106947987247 0.108324406186 + 0.109718138344 0.111129401494 0.112558416150 0.114005405597 + 0.115470595931 0.116954216090 0.118456497894 0.119977676076 + 0.121517988325 0.123077675317 0.124656980755 0.126256151411 + 0.127875437158 0.129515091011 0.131175369171 0.132856531060 + 0.134558839362 0.136282560066 0.138027962508 0.139795319410 + 0.141584906925 0.143397004680 0.145231895818 0.147089867046 + 0.148971208675 0.150876214668 0.152805182687 0.154758414137 + 0.156736214214 0.158738891953 0.160766760277 0.162820136045 + 0.164899340100 0.167004697323 0.169136536679 0.171295191274 + 0.173480998400 0.175694299596 0.177935440694 0.180204771876 + 0.182502647731 0.184829427305 0.187185474164 0.189571156444 + 0.191986846913 0.194432923028 0.196909766992 0.199417765818 + 0.201957311386 0.204528800504 0.207132634974 0.209769221650 + 0.212438972503 0.215142304689 0.217879640607 0.220651407972 + 0.223458039878 0.226299974869 0.229177657000 0.232091535917 + 0.235042066919 0.238029711032 0.241054935081 0.244118211765 + 0.247220019726 0.250360843628 0.253541174231 0.256761508469 + 0.260022349525 0.263324206912 0.266667596553 0.270053040857 + 0.273481068809 0.276952216045 0.280467024937 0.284026044684 + 0.287629831387 0.291278948147 0.294973965145 0.298715459736 + 0.302504016534 0.306340227511 0.310224692082 0.314158017202 + 0.318140817462 0.322173715182 0.326257340510 0.330392331521 + 0.334579334317 0.338819003124 0.343112000400 0.347458996934 + 0.351860671954 0.356317713229 0.360830817182 0.365400688995 + 0.370028042718 0.374713601386 0.379458097127 0.384262271278 + 0.389126874500 0.394052666898 0.399040418138 0.404090907564 + 0.409204924327 0.414383267502 0.419626746215 0.424936179772 + 0.430312397781 0.435756240288 0.441268557904 0.446850211941 + 0.452502074542 0.458225028822 0.464019969006 0.469887800564 + 0.475829440357 0.481845816779 0.487937869899 0.494106551615 + 0.500352825794 0.506677668431 0.513082067794 0.519567024584 + 0.526133552089 0.532782676342 0.539515436283 0.546332883917 + 0.553236084487 0.560226116630 0.567304072554 0.574471058204 + 0.581728193435 0.589076612190 0.596517462674 0.604051907536 + 0.611681124047 0.619406304288 0.627228655335 0.635149399445 + 0.643169774251 0.651291032953 0.659514444514 0.667841293859 + 0.676272882075 0.684810526614 0.693455561502 0.702209337542 + 0.711073222530 0.720048601465 0.729136876770 0.738339468505 + 0.747657814594 0.757093371048 0.766647612192 0.776322030895 + 0.786118138804 0.796037466583 0.806081564145 0.816252000901 + 0.826550366004 0.836978268593 0.847537338049 0.858229224248 + 0.869055597820 0.880018150408 0.891118594932 0.902358665859 + 0.913740119474 0.925264734152 0.936934310637 0.948750672324 + 0.960715665544 0.972831159852 0.985099048317 0.997521247823 + 1.01009969936 1.02283636835 1.03573324491 1.04879234420 + 1.06201570674 1.07540539871 1.08896351227 1.10269216590 + 1.11659350474 1.13066970089 1.14492295380 1.15935549055 + 1.17396956627 1.18876746444 1.20375149724 1.21892400598 + 1.23428736139 1.24984396402 1.26559624461 1.28154666451 + 1.29769771599 1.31405192269 1.33061183999 1.34738005540 + 1.36435918900 1.38155189380 1.39896085622 1.41658879642 + 1.43443846881 1.45251266244 1.47081420144 1.48934594546 + 1.50811079013 1.52711166749 1.54635154646 1.56583343331 + 1.58556037214 1.60553544531 1.62576177397 1.64624251852 + 1.66698087913 1.68798009620 1.70924345091 1.73077426569 + 1.75257590478 1.77465177474 1.79700532495 1.81964004821 + 1.84255948125 1.86576720526 1.88926684650 1.91306207684 + 1.93715661433 1.96155422379 1.98625871741 2.01127395529 + 2.03660384614 2.06225234779 2.08822346788 2.11452126444 + 2.14114984656 2.16811337501 2.19541606289 2.22306217632 + 2.25105603504 2.27940201315 2.30810453978 2.33716809975 + 2.36659723430 2.39639654179 2.42657067843 2.45712435898 + 2.48806235752 2.51938950818 2.55111070589 2.58323090714 + 2.61575513079 2.64868845881 2.68203603710 2.71580307628 + 2.74999485254 2.78461670839 2.81967405358 2.85517236589 + 2.89111719200 2.92751414836 2.96436892207 3.00168727177 + 3.03947502852 3.07773809674 3.11648245511 3.15571415751 + 3.19543933398 3.23566419166 3.27639501576 3.31763817056 + 3.35940010038 3.40168733061 3.44450646872 3.48786420529 + 3.53176731504 3.57622265792 3.62123718019 3.66681791544 + 3.71297198576 3.75970660282 3.80702906900 3.85494677852 + 3.90346721863 3.95259797074 4.00234671164 4.05272121467 + 4.10372935094 4.15537909058 4.20767850397 4.26063576299 + 4.31425914233 4.36855702075 4.42353788241 4.47921031816 + 4.53558302695 4.59266481713 4.65046460784 4.70899143041 + 4.76825442979 4.82826286593 4.88902611528 4.95055367222 + 5.01285515055 5.07594028500 5.13981893277 5.20450107500 + 5.26999681843 5.33631639690 5.40347017296 5.47146863955 + 5.54032242155 5.61004227752 5.68063910131 5.75212392383 + 5.82450791472 5.89780238414 5.97201878449 6.04716871224 + 6.12326390971 6.20031626693 6.27833782349 6.35734077043 + 6.43733745210 6.51834036815 6.60036217546 6.68341569010 + 6.76751388935 6.85266991372 6.93889706902 7.02620882841 + 7.11461883454 7.20414090164 7.29478901773 7.38657734675 + 7.47952023083 7.57363219246 7.66892793684 7.76542235413 + 7.86313052177 7.96206770686 8.06224936854 8.16369116039 + 8.26640893291 8.37041873595 8.47573682126 8.58237964500 + 8.69036387033 8.79970637001 8.91042422902 9.02253474726 + 9.13605544221 9.25100405173 9.36739853676 9.48525708418 + 9.60459810963 9.72544026038 9.84780241827 9.97170370264 + 10.0971634733 10.2242013336 10.3528371335 10.4830909726 + 10.6149832032 10.7485344339 10.8837655323 11.0206976285 + 11.1593521184 11.2997506671 11.4419152122 11.5858679670 + 11.7316314247 11.8792283609 12.0286818381 12.1800152085 + 12.3332521185 12.4884165114 12.6455326322 12.8046250305 + 12.9657185648 13.1288384063 13.2940100429 13.4612592828 + 13.6306122593 13.8020954339 13.9757356013 14.1515598932 + 14.3295957824 14.5098710874 14.6924139766 14.8772529727 + 15.0644169571 15.2539351747 15.4458372379 15.6401531320 + 15.8369132191 16.0361482435 16.2378893359 16.4421680189 + 16.6490162114 16.8584662339 17.0705508133 17.2853030884 + 17.5027566145 17.7229453693 17.9459037576 18.1716666173 + 18.4002692241 18.6317472977 18.8661370071 19.1034749761 + 19.3437982892 19.5871444974 19.8335516242 20.0830581710 + 20.3357031239 20.5915259590 20.8505666493 21.1128656704 + 21.3784640069 21.6474031593 21.9197251498 22.1954725293 + 22.4746883838 22.7574163414 23.0437005789 23.3335858288 + 23.6271173862 23.9243411162 24.2253034604 24.5300514449 + 24.8386326872 25.1510954036 25.4674884172 25.7878611650 + 26.1122637059 26.4407467284 26.7733615587 27.1101601685 + 27.4511951833 27.7965198905 28.1461882478 28.5002548916 + 28.8587751455 29.2218050291 29.5894012664 29.9616212952 + 30.3385232756 30.7201660993 31.1066093988 31.4979135566 + 31.8941397147 32.2953497844 32.7016064555 33.1129732065 + 33.5295143142 33.9512948641 34.3783807601 34.8108387354 + 35.2487363624 35.6921420635 36.1411251217 36.5957556915 + 37.0561048099 37.5222444074 37.9942473193 38.4721872969 + 38.9561390193 39.4461781050 39.9423811236 40.4448256079 + 40.9535900657 41.4687539927 41.9903978841 42.5186032479 + 43.0534526173 43.5950295635 44.1434187092 44.6987057411 + 45.2609774241 45.8303216142 46.4068272725 46.9905844794 + 47.5816844480 48.1802195389 48.7862832745 49.3999703534 + 50.0213766654 50.6505993067 51.2877365944 51.9328880827 + 52.5861545776 53.2476381536 53.9174421686 54.5956712810 + 55.2824314654 55.9778300295 56.6819756307 57.3949782933 + 58.1169494253 58.8480018362 59.5882497544 60.3378088452 + 61.0967962287 61.8653304982 62.6435317388 63.4315215459 + 64.2294230447 65.0373609088 65.8554613802 66.6838522887 + 67.5226630722 68.3720247964 69.2320701759 70.1029335945 + 70.9847511265 71.8776605575 72.7818014065 73.6973149474 + 74.6243442310 75.5630341076 76.5135312492 77.4759841731 + 78.4505432644 79.4373608001 80.4365909723 81.4483899128 + 82.4729157172 83.5103284699 84.5607902685 85.6244652500 + 86.7015196157 87.7921216576 88.8964417844 90.0146525483 + 91.1469286722 92.2934470765 93.4543869069 94.6299295627 + 95.8202587249 97.0255603848 98.2460228731 99.4818368898 + 100.733195533 102.000294331 103.283331269 104.582506825 + 105.898023998 107.230088340 108.578907989 109.944693700 + 111.327658881 112.728019622 114.145994733 115.581805775 + 117.035677097 118.507835869 119.998512118 + Down Pseudopotential follows (l on next line) + 0 + -0.194762529562E-03 -0.391974870160E-03 -0.591667836617E-03 -0.793872631361E-03 + -0.998620849296E-03 -0.120594448274E-02 -0.141587592643E-02 -0.162844798257E-02 + -0.184369386597E-02 -0.206164720924E-02 -0.228234206800E-02 -0.250581292628E-02 + -0.273209470185E-02 -0.296122275167E-02 -0.319323287747E-02 -0.342816133128E-02 + -0.366604482114E-02 -0.390692051682E-02 -0.415082605562E-02 -0.439779954827E-02 + -0.464787958486E-02 -0.490110524088E-02 -0.515751608334E-02 -0.541715217695E-02 + -0.568005409035E-02 -0.594626290247E-02 -0.621582020897E-02 -0.648876812870E-02 + -0.676514931030E-02 -0.704500693888E-02 -0.732838474272E-02 -0.761532700016E-02 + -0.790587854648E-02 -0.820008478092E-02 -0.849799167377E-02 -0.879964577356E-02 + -0.910509421431E-02 -0.941438472292E-02 -0.972756562664E-02 -0.100446858606E-01 + -0.103657949753E-01 -0.106909431449E-01 -0.110201811742E-01 -0.113535605073E-01 + -0.116911332354E-01 -0.120329521049E-01 -0.123790705255E-01 -0.127295425790E-01 + -0.130844230272E-01 -0.134437673208E-01 -0.138076316081E-01 -0.141760727436E-01 + -0.145491482967E-01 -0.149269165614E-01 -0.153094365644E-01 -0.156967680753E-01 + -0.160889716154E-01 -0.164861084670E-01 -0.168882406836E-01 -0.172954310990E-01 + -0.177077433375E-01 -0.181252418235E-01 -0.185479917919E-01 -0.189760592981E-01 + -0.194095112284E-01 -0.198484153105E-01 -0.202928401237E-01 -0.207428551103E-01 + -0.211985305858E-01 -0.216599377502E-01 -0.221271486993E-01 -0.226002364354E-01 + -0.230792748793E-01 -0.235643388815E-01 -0.240555042341E-01 -0.245528476824E-01 + -0.250564469370E-01 -0.255663806862E-01 -0.260827286079E-01 -0.266055713821E-01 + -0.271349907039E-01 -0.276710692958E-01 -0.282138909209E-01 -0.287635403958E-01 + -0.293201036040E-01 -0.298836675093E-01 -0.304543201693E-01 -0.310321507493E-01 + -0.316172495360E-01 -0.322097079519E-01 -0.328096185693E-01 -0.334170751251E-01 + -0.340321725351E-01 -0.346550069089E-01 -0.352856755651E-01 -0.359242770464E-01 + -0.365709111350E-01 -0.372256788682E-01 -0.378886825541E-01 -0.385600257875E-01 + -0.392398134667E-01 -0.399281518089E-01 -0.406251483677E-01 -0.413309120494E-01 + -0.420455531300E-01 -0.427691832727E-01 -0.435019155454E-01 -0.442438644377E-01 + -0.449951458798E-01 -0.457558772597E-01 -0.465261774420E-01 -0.473061667866E-01 + -0.480959671669E-01 -0.488957019896E-01 -0.497054962133E-01 -0.505254763687E-01 + -0.513557705775E-01 -0.521965085735E-01 -0.530478217217E-01 -0.539098430398E-01 + -0.547827072184E-01 -0.556665506423E-01 -0.565615114116E-01 -0.574677293636E-01 + -0.583853460943E-01 -0.593145049806E-01 -0.602553512030E-01 -0.612080317677E-01 + -0.621726955301E-01 -0.631494932179E-01 -0.641385774545E-01 -0.651401027828E-01 + -0.661542256898E-01 -0.671811046303E-01 -0.682209000524E-01 -0.692737744221E-01 + -0.703398922486E-01 -0.714194201105E-01 -0.725125266812E-01 -0.736193827558E-01 + -0.747401612773E-01 -0.758750373639E-01 -0.770241883364E-01 -0.781877937454E-01 + -0.793660354000E-01 -0.805590973957E-01 -0.817671661434E-01 -0.829904303985E-01 + -0.842290812900E-01 -0.854833123510E-01 -0.867533195482E-01 -0.880393013131E-01 + -0.893414585725E-01 -0.906599947802E-01 -0.919951159485E-01 -0.933470306807E-01 + -0.947159502032E-01 -0.961020883988E-01 -0.975056618399E-01 -0.989268898224E-01 + -0.100365994400 -0.101823200419 -0.103298735551 -0.104792830335 + -0.106305718203 -0.107837635528 -0.109388821651 -0.110959518924 + -0.112549972747 -0.114160431605 -0.115791147105 -0.117442374021 + -0.119114370328 -0.120807397245 -0.122521719275 -0.124257604246 + -0.126015323354 -0.127795151202 -0.129597365848 -0.131422248843 + -0.133270085277 -0.135141163824 -0.137035776788 -0.138954220144 + -0.140896793589 -0.142863800586 -0.144855548410 -0.146872348199 + -0.148914515000 -0.150982367820 -0.153076229673 -0.155196427631 + -0.157343292876 -0.159517160749 -0.161718370805 -0.163947266863 + -0.166204197062 -0.168489513911 -0.170803574346 -0.173146739787 + -0.175519376190 -0.177921854106 -0.180354548738 -0.182817839999 + -0.185312112568 -0.187837755955 -0.190395164554 -0.192984737710 + -0.195606879776 -0.198262000178 -0.200950513476 -0.203672839428 + -0.206429403055 -0.209220634707 -0.212046970126 -0.214908850515 + -0.217806722603 -0.220741038718 -0.223712256850 -0.226720840723 + -0.229767259867 -0.232851989688 -0.235975511537 -0.239138312790 + -0.242340886912 -0.245583733541 -0.248867358556 -0.252192274155 + -0.255558998935 -0.258968057962 -0.262419982858 -0.265915311874 + -0.269454589971 -0.273038368901 -0.276667207291 -0.280341670720 + -0.284062331804 -0.287829770283 -0.291644573098 -0.295507334485 + -0.299418656053 -0.303379146874 -0.307389423570 -0.311450110401 + -0.315561839351 -0.319725250222 -0.323940990717 -0.328209716536 + -0.332532091465 -0.336908787466 -0.341340484768 -0.345827871964 + -0.350371646098 -0.354972512762 -0.359631186186 -0.364348389335 + -0.369124853999 -0.373961320892 -0.378858539738 -0.383817269375 + -0.388838277840 -0.393922342468 -0.399070249986 -0.404282796601 + -0.409560788098 -0.414905039931 -0.420316377315 -0.425795635314 + -0.431343658934 -0.436961303214 -0.442649433309 -0.448408924579 + -0.454240662674 -0.460145543617 -0.466124473889 -0.472178370500 + -0.478308161075 -0.484514783924 -0.490799188114 -0.497162333541 + -0.503605190988 -0.510128742196 -0.516733979917 -0.523421907964 + -0.530193541267 -0.537049905913 -0.543992039183 -0.551020989585 + -0.558137816883 -0.565343592111 -0.572639397588 -0.580026326919 + -0.587505484991 -0.595077987960 -0.602744963225 -0.610507549390 + -0.618366896224 -0.626324164598 -0.634380526413 -0.642537164515 + -0.650795272594 -0.659156055069 -0.667620726951 -0.676190513691 + -0.684866651009 -0.693650384702 -0.702542970427 -0.711545673465 + -0.720659768455 -0.729886539103 -0.739227277864 -0.748683285595 + -0.758255871165 -0.767946351046 -0.777756048857 -0.787686294872 + -0.797738425485 -0.807913782637 -0.818213713186 -0.828639568239 + -0.839192702424 -0.849874473107 -0.860686239555 -0.871629362029 + -0.882705200816 -0.893915115190 -0.905260462298 -0.916742595966 + -0.928362865421 -0.940122613932 -0.952023177348 -0.964065882543 + -0.976252045755 -0.988582970817 -1.00105994727 -1.01368424835 + -1.02645712885 -1.03937982286 -1.05245354131 -1.06567946944 + -1.07905876404 -1.09259255057 -1.10628192006 -1.12012792586 + -1.13413158017 -1.14829385038 -1.16261565520 -1.17709786051 + -1.19174127502 -1.20654664569 -1.22151465286 -1.23664590505 + -1.25194093363 -1.26740018699 -1.28302402455 -1.29881271035 + -1.31476640633 -1.33088516528 -1.34716892330 -1.36361749204 + -1.38023055036 -1.39700763571 -1.41394813495 -1.43105127484 + -1.44831611191 -1.46574152198 -1.48332618906 -1.50106859384 + -1.51896700151 -1.53701944917 -1.55522373251 -1.57357739208 + -1.59207769880 -1.61072163897 -1.62950589859 -1.64842684709 + -1.66748052042 -1.68666260343 -1.70596841165 -1.72539287244 + -1.74493050538 -1.76457540215 -1.78432120562 -1.80416108844 + -1.82408773091 -1.84409329832 -1.86416941769 -1.88430715400 + -1.90449698587 -1.92472878086 -1.94499177033 -1.96527452397 + -1.98556492413 -2.00585013987 -2.02611660103 -2.04634997233 + -2.06653512754 -2.08665612400 -2.10669617764 -2.12663763848 + -2.14646196701 -2.16614971161 -2.18568048708 -2.20503295477 + -2.22418480441 -2.24311273792 -2.26179245573 -2.28019864564 + -2.29830497488 -2.31608408563 -2.33350759440 -2.35054609586 + -2.36716917152 -2.38334540376 -2.39904239592 -2.41422679881 + -2.42886434452 -2.44291988792 -2.45635745680 -2.46914031110 + -2.48123101224 -2.49259150308 -2.50318319943 -2.51296709391 + -2.52190387294 -2.52995404775 -2.53707810010 -2.54323664379 + -2.54839060250 -2.55250140496 -2.55553119804 -2.55744307860 + -2.55820134465 -2.55777176648 -2.55612187808 -2.55322128934 + -2.54904201922 -2.54355884980 -2.53674970129 -2.52859602746 + -2.51908323087 -2.50820109716 -2.49594424696 -2.48231260388 + -2.46731187667 -2.45095405283 -2.43325790086 -2.41424947744 + -2.39396263533 -2.37243952709 -2.34973109881 -2.32589756734 + -2.30100887342 -2.27514510226 -2.24839686178 -2.22086560771 + -2.19266390333 -2.16391560019 -2.13475592487 -2.10533145483 + -2.07579996517 -2.04633012619 -2.01710102967 -1.98830152040 + -1.96012930749 -1.93278982840 -1.90649483737 -1.88146068872 + -1.85790628503 -1.83605066032 -1.81611016941 -1.79829525701 + -1.78280678442 -1.76983189745 -1.75953942893 -1.75207484099 + -1.74755473005 -1.74606093907 -1.74763435140 -1.75226847712 + -1.75990299000 -1.77041743150 -1.78362537071 -1.79926939758 + -1.81701743465 -1.83646098262 -1.85711607103 -1.87842787192 + -1.89978015569 -1.92051103067 -1.93993671843 -1.95738548285 + -1.97224426393 -1.98402107934 -1.99242686316 -1.99748113219 + -1.99967284813 -1.99999990846 -2.00000001587 -2.00000001441 + -2.00000001306 -2.00000001183 -2.00000001069 -2.00000000965 + -2.00000000870 -2.00000000783 -2.00000000704 -2.00000000632 + -2.00000000567 -2.00000000507 -2.00000000453 -2.00000000404 + -2.00000000360 -2.00000000320 -2.00000000284 -2.00000000252 + -2.00000000223 -2.00000000197 -2.00000000174 -2.00000000153 + -2.00000000134 -2.00000000118 -2.00000000103 -2.00000000090 + -2.00000000079 -2.00000000069 -2.00000000060 -2.00000000052 + -2.00000000045 -2.00000000039 -2.00000000034 -2.00000000029 + -2.00000000025 -2.00000000022 -2.00000000019 -2.00000000016 + -2.00000000014 -2.00000000012 -2.00000000010 -2.00000000009 + -2.00000000007 -2.00000000006 -2.00000000005 -2.00000000005 + -2.00000000004 -2.00000000003 -2.00000000003 -2.00000000002 + -2.00000000002 -2.00000000002 -2.00000000002 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 + Down Pseudopotential follows (l on next line) + 1 + -0.136130541247E-03 -0.273973393905E-03 -0.413550096195E-03 -0.554882457257E-03 + -0.697992560553E-03 -0.842902767322E-03 -0.989635720071E-03 -0.113821434612E-02 + -0.128866186116E-02 -0.144100177293E-02 -0.159525788484E-02 -0.175145429970E-02 + -0.190961542352E-02 -0.206976596928E-02 -0.223193096083E-02 -0.239613573675E-02 + -0.256240595437E-02 -0.273076759373E-02 -0.290124696167E-02 -0.307387069592E-02 + -0.324866576928E-02 -0.342565949381E-02 -0.360487952514E-02 -0.378635386672E-02 + -0.397011087429E-02 -0.415617926022E-02 -0.434458809806E-02 -0.453536682705E-02 + -0.472854525673E-02 -0.492415357160E-02 -0.512222233583E-02 -0.532278249803E-02 + -0.552586539612E-02 -0.573150276218E-02 -0.593972672744E-02 -0.615056982727E-02 + -0.636406500630E-02 -0.658024562356E-02 -0.679914545767E-02 -0.702079871212E-02 + -0.724524002065E-02 -0.747250445263E-02 -0.770262751853E-02 -0.793564517550E-02 + -0.817159383298E-02 -0.841051035836E-02 -0.865243208278E-02 -0.889739680695E-02 + -0.914544280703E-02 -0.939660884066E-02 -0.965093415295E-02 -0.990845848270E-02 + -0.101692220685E-01 -0.104332656552E-01 -0.107006304999E-01 -0.109713583790E-01 + -0.112454915941E-01 -0.115230729789E-01 -0.118041459061E-01 -0.120887542937E-01 + -0.123769426123E-01 -0.126687558918E-01 -0.129642397284E-01 -0.132634402921E-01 + -0.135664043333E-01 -0.138731791906E-01 -0.141838127982E-01 -0.144983536930E-01 + -0.148168510225E-01 -0.151393545523E-01 -0.154659146743E-01 -0.157965824137E-01 + -0.161314094381E-01 -0.164704480645E-01 -0.168137512682E-01 -0.171613726910E-01 + -0.175133666490E-01 -0.178697881418E-01 -0.182306928608E-01 -0.185961371978E-01 + -0.189661782539E-01 -0.193408738486E-01 -0.197202825284E-01 -0.201044635766E-01 + -0.204934770217E-01 -0.208873836477E-01 -0.212862450029E-01 -0.216901234098E-01 + -0.220990819748E-01 -0.225131845983E-01 -0.229324959841E-01 -0.233570816500E-01 + -0.237870079380E-01 -0.242223420245E-01 -0.246631519308E-01 -0.251095065338E-01 + -0.255614755768E-01 -0.260191296803E-01 -0.264825403532E-01 -0.269517800036E-01 + -0.274269219506E-01 -0.279080404354E-01 -0.283952106331E-01 -0.288885086641E-01 + -0.293880116067E-01 -0.298937975082E-01 -0.304059453981E-01 -0.309245352995E-01 + -0.314496482423E-01 -0.319813662754E-01 -0.325197724800E-01 -0.330649509819E-01 + -0.336169869655E-01 -0.341759666862E-01 -0.347419774846E-01 -0.353151077998E-01 + -0.358954471834E-01 -0.364830863130E-01 -0.370781170071E-01 -0.376806322391E-01 + -0.382907261514E-01 -0.389084940711E-01 -0.395340325237E-01 -0.401674392493E-01 + -0.408088132170E-01 -0.414582546408E-01 -0.421158649954E-01 -0.427817470314E-01 + -0.434560047922E-01 -0.441387436294E-01 -0.448300702201E-01 -0.455300925827E-01 + -0.462389200946E-01 -0.469566635088E-01 -0.476834349710E-01 -0.484193480379E-01 + -0.491645176940E-01 -0.499190603703E-01 -0.506830939621E-01 -0.514567378475E-01 + -0.522401129060E-01 -0.530333415376E-01 -0.538365476815E-01 -0.546498568360E-01 + -0.554733960775E-01 -0.563072940808E-01 -0.571516811391E-01 -0.580066891842E-01 + -0.588724518072E-01 -0.597491042793E-01 -0.606367835730E-01 -0.615356283836E-01 + -0.624457791506E-01 -0.633673780796E-01 -0.643005691648E-01 -0.652454982114E-01 + -0.662023128582E-01 -0.671711626006E-01 -0.681521988143E-01 -0.691455747785E-01 + -0.701514457002E-01 -0.711699687382E-01 -0.722013030276E-01 -0.732456097049E-01 + -0.743030519326E-01 -0.753737949255E-01 -0.764580059756E-01 -0.775558544788E-01 + -0.786675119613E-01 -0.797931521058E-01 -0.809329507793E-01 -0.820870860603E-01 + -0.832557382661E-01 -0.844390899817E-01 -0.856373260878E-01 -0.868506337897E-01 + -0.880792026466E-01 -0.893232246011E-01 -0.905828940088E-01 -0.918584076694E-01 + -0.931499648565E-01 -0.944577673492E-01 -0.957820194633E-01 -0.971229280832E-01 + -0.984807026942E-01 -0.998555554151E-01 -0.101247701031 -0.102657357027 + -0.104084743623 -0.105530083805 -0.106993603363 -0.108475530926 + -0.109976097993 -0.111495538978 -0.113034091235 -0.114591995105 + -0.116169493948 -0.117766834181 -0.119384265320 -0.121022040013 + -0.122680414083 -0.124359646570 -0.126059999764 -0.127781739253 + -0.129525133958 -0.131290456182 -0.133077981645 -0.134887989530 + -0.136720762526 -0.138576586873 -0.140455752403 -0.142358552587 + -0.144285284582 -0.146236249272 -0.148211751321 -0.150212099212 + -0.152237605304 -0.154288585871 -0.156365361155 -0.158468255419 + -0.160597596988 -0.162753718307 -0.164936955990 -0.167147650867 + -0.169386148044 -0.171652796951 -0.173947951396 -0.176271969619 + -0.178625214346 -0.181008052849 -0.183420856993 -0.185864003302 + -0.188337873009 -0.190842852117 -0.193379331458 -0.195947706749 + -0.198548378654 -0.201181752845 -0.203848240061 -0.206548256169 + -0.209282222228 -0.212050564552 -0.214853714772 -0.217692109900 + -0.220566192396 -0.223476410229 -0.226423216949 -0.229407071748 + -0.232428439529 -0.235487790977 -0.238585602620 -0.241722356908 + -0.244898542271 -0.248114653200 -0.251371190309 -0.254668660413 + -0.258007576595 -0.261388458279 -0.264811831304 -0.268278227998 + -0.271788187249 -0.275342254579 -0.278940982222 -0.282584929195 + -0.286274661374 -0.290010751570 -0.293793779606 -0.297624332390 + -0.301503003992 -0.305430395720 -0.309407116200 -0.313433781445 + -0.317511014937 -0.321639447701 -0.325819718382 -0.330052473318 + -0.334338366620 -0.338678060242 -0.343072224059 -0.347521535938 + -0.352026681815 -0.356588355764 -0.361207260069 -0.365884105297 + -0.370619610363 -0.375414502603 -0.380269517833 -0.385185400424 + -0.390162903355 -0.395202788280 -0.400305825584 -0.405472794442 + -0.410704482868 -0.416001687772 -0.421365215003 -0.426795879392 + -0.432294504799 -0.437861924142 -0.443498979436 -0.449206521813 + -0.454985411553 -0.460836518092 -0.466760720040 -0.472758905183 + -0.478831970478 -0.484980822051 -0.491206375171 -0.497509554231 + -0.503891292711 -0.510352533132 -0.516894227005 -0.523517334760 + -0.530222825677 -0.537011677785 -0.543884877768 -0.550843420841 + -0.557888310622 -0.565020558976 -0.572241185853 -0.579551219101 + -0.586951694262 -0.594443654341 -0.602028149565 -0.609706237103 + -0.617478980774 -0.625347450718 -0.633312723047 -0.641375879459 + -0.649538006823 -0.657800196730 -0.666163545004 -0.674629151185 + -0.683198117955 -0.691871550535 -0.700650556032 -0.709536242734 + -0.718529719356 -0.727632094237 -0.736844474470 -0.746167964978 + -0.755603667527 -0.765152679665 -0.774816093594 -0.784594994967 + -0.794490461602 -0.804503562116 -0.814635354466 -0.824886884397 + -0.835259183800 -0.845753268950 -0.856370138650 -0.867110772254 + -0.877976127565 -0.888967138614 -0.900084713300 -0.911329730890 + -0.922703039374 -0.934205452663 -0.945837747629 -0.957600660968 + -0.969494885896 -0.981521068645 -0.993679804780 -1.00597163530 + -1.01839704253 -1.03095644580 -1.04365019689 -1.05647857521 + -1.06944178278 -1.08253993888 -1.09577307453 -1.10914112656 + -1.12264393152 -1.13628121920 -1.15005260587 -1.16395758719 + -1.17799553081 -1.19216566863 -1.20646708864 -1.22089872654 + -1.23545935684 -1.25014758369 -1.26496183131 -1.27990033396 + -1.29496112564 -1.31014202931 -1.32544064568 -1.34085434172 + -1.35638023865 -1.37201519959 -1.38775581681 -1.40359839862 + -1.41953895579 -1.43557318777 -1.45169646838 -1.46790383135 + -1.48418995542 -1.50054914928 -1.51697533619 -1.53346203845 + -1.55000236173 -1.56658897928 -1.58321411610 -1.59986953318 + -1.61654651181 -1.63323583811 -1.64992778781 -1.66661211148 + -1.68327802026 -1.69991417217 -1.71650865927 -1.73304899575 + -1.74952210710 -1.76591432056 -1.78221135711 -1.79839832514 + -1.81445971605 -1.83037940206 -1.84614063652 -1.86172605688 + -1.87711769085 -1.89229696586 -1.90724472234 -1.92194123103 + -1.93636621491 -1.95049887596 -1.96431792731 -1.97780163116 + -1.99092784300 -2.00367406251 -2.01601749173 -2.02793510095 + -2.03940370278 -2.05040003501 -2.06090085266 -2.07088302977 + -2.08032367139 -2.08920023617 -2.09749067004 -2.10517355129 + -2.11222824732 -2.11863508341 -2.12437552349 -2.12943236308 + -2.13378993425 -2.13743432227 -2.14035359367 -2.14253803497 + -2.14398040128 -2.14467617353 -2.14462382298 -2.14382508123 + -2.14228521337 -2.14001329189 -2.13702246807 -2.13333023718 + -2.12895869340 -2.12393476939 -2.11829045502 -2.11206298885 + -2.10529501515 -2.09803469854 -2.09033578715 -2.08225761461 + -2.07386502991 -2.06522824351 -2.05642257719 -2.04752810398 + -2.03862916446 -2.02981374473 -2.02117270151 -2.01279881991 + -2.00478569029 -1.99722639192 -1.99021197376 -1.98382972566 + -1.97816123883 -1.97328026028 -1.96925035553 -1.96612240480 + -1.96393197306 -1.96269661302 -1.96241318385 -1.96305529778 + -1.96457104347 -1.96688117982 -1.96987804864 -1.97342552174 + -1.97736037848 -1.98149560791 -1.98562624689 -1.98953850677 + -1.99302311021 -1.99589396179 -1.99801351736 -1.99937570793 + -1.99991758633 -2.00000016366 -2.00000001471 -2.00000001335 + -2.00000001211 -2.00000001096 -2.00000000991 -2.00000000895 + -2.00000000807 -2.00000000726 -2.00000000653 -2.00000000586 + -2.00000000525 -2.00000000470 -2.00000000420 -2.00000000375 + -2.00000000334 -2.00000000297 -2.00000000263 -2.00000000234 + -2.00000000207 -2.00000000183 -2.00000000161 -2.00000000142 + -2.00000000125 -2.00000000109 -2.00000000096 -2.00000000084 + -2.00000000073 -2.00000000064 -2.00000000056 -2.00000000048 + -2.00000000042 -2.00000000036 -2.00000000031 -2.00000000027 + -2.00000000023 -2.00000000020 -2.00000000017 -2.00000000015 + -2.00000000013 -2.00000000011 -2.00000000009 -2.00000000008 + -2.00000000007 -2.00000000006 -2.00000000005 -2.00000000004 + -2.00000000004 -2.00000000003 -2.00000000003 -2.00000000002 + -2.00000000002 -2.00000000002 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 + Down Pseudopotential follows (l on next line) + 2 + -0.119484445649E-03 -0.240471820603E-03 -0.362981029380E-03 -0.487031214288E-03 + -0.612641758414E-03 -0.739832288657E-03 -0.868622678788E-03 -0.999033052560E-03 + -0.113108378685E-02 -0.126479551485E-02 -0.140018912928E-02 -0.153728578566E-02 + -0.167610690561E-02 -0.181667418020E-02 -0.195900957334E-02 -0.210313532521E-02 + -0.224907395576E-02 -0.239684826816E-02 -0.254648135245E-02 -0.269799658908E-02 + -0.285141765260E-02 -0.300676851535E-02 -0.316407345120E-02 -0.332335703935E-02 + -0.348464416816E-02 -0.364796003906E-02 -0.381333017046E-02 -0.398078040175E-02 + -0.415033689736E-02 -0.432202615081E-02 -0.449587498886E-02 -0.467191057572E-02 + -0.485016041728E-02 -0.503065236541E-02 -0.521341462232E-02 -0.539847574493E-02 + -0.558586464941E-02 -0.577561061559E-02 -0.596774329165E-02 -0.616229269866E-02 + -0.635928923531E-02 -0.655876368268E-02 -0.676074720899E-02 -0.696527137455E-02 + -0.717236813661E-02 -0.738206985440E-02 -0.759440929420E-02 -0.780941963441E-02 + -0.802713447077E-02 -0.824758782160E-02 -0.847081413312E-02 -0.869684828482E-02 + -0.892572559491E-02 -0.915748182587E-02 -0.939215318999E-02 -0.962977635507E-02 + -0.987038845011E-02 -0.101140270712E-01 -0.103607302871E-01 -0.106105366458E-01 + -0.108634851798E-01 -0.111196154128E-01 -0.113789673655E-01 -0.116415815620E-01 + -0.119074990363E-01 -0.121767613383E-01 -0.124494105407E-01 -0.127254892452E-01 + -0.130050405897E-01 -0.132881082545E-01 -0.135747364691E-01 -0.138649700198E-01 + -0.141588542559E-01 -0.144564350972E-01 -0.147577590412E-01 -0.150628731700E-01 + -0.153718251582E-01 -0.156846632800E-01 -0.160014364166E-01 -0.163221940643E-01 + -0.166469863418E-01 -0.169758639983E-01 -0.173088784214E-01 -0.176460816449E-01 + -0.179875263572E-01 -0.183332659094E-01 -0.186833543236E-01 -0.190378463016E-01 + -0.193967972330E-01 -0.197602632042E-01 -0.201283010073E-01 -0.205009681483E-01 + -0.208783228569E-01 -0.212604240950E-01 -0.216473315662E-01 -0.220391057252E-01 + -0.224358077868E-01 -0.228374997361E-01 -0.232442443376E-01 -0.236561051455E-01 + -0.240731465132E-01 -0.244954336036E-01 -0.249230323992E-01 -0.253560097126E-01 + -0.257944331965E-01 -0.262383713548E-01 -0.266878935528E-01 -0.271430700285E-01 + -0.276039719033E-01 -0.280706711931E-01 -0.285432408197E-01 -0.290217546219E-01 + -0.295062873676E-01 -0.299969147649E-01 -0.304937134741E-01 -0.309967611199E-01 + -0.315061363032E-01 -0.320219186137E-01 -0.325441886421E-01 -0.330730279926E-01 + -0.336085192961E-01 -0.341507462225E-01 -0.346997934944E-01 -0.352557468998E-01 + -0.358186933059E-01 -0.363887206722E-01 -0.369659180649E-01 -0.375503756702E-01 + -0.381421848086E-01 -0.387414379495E-01 -0.393482287250E-01 -0.399626519450E-01 + -0.405848036120E-01 -0.412147809358E-01 -0.418526823489E-01 -0.424986075219E-01 + -0.431526573789E-01 -0.438149341134E-01 -0.444855412044E-01 -0.451645834321E-01 + -0.458521668947E-01 -0.465483990248E-01 -0.472533886062E-01 -0.479672457910E-01 + -0.486900821165E-01 -0.494220105230E-01 -0.501631453711E-01 -0.509136024598E-01 + -0.516734990445E-01 -0.524429538552E-01 -0.532220871152E-01 -0.540110205600E-01 + -0.548098774559E-01 -0.556187826195E-01 -0.564378624371E-01 -0.572672448849E-01 + -0.581070595480E-01 -0.589574376416E-01 -0.598185120310E-01 -0.606904172524E-01 + -0.615732895340E-01 -0.624672668170E-01 -0.633724887777E-01 -0.642890968486E-01 + -0.652172342410E-01 -0.661570459671E-01 -0.671086788627E-01 -0.680722816102E-01 + -0.690480047616E-01 -0.700360007622E-01 -0.710364239741E-01 -0.720494307008E-01 + -0.730751792110E-01 -0.741138297636E-01 -0.751655446329E-01 -0.762304881333E-01 + -0.773088266455E-01 -0.784007286424E-01 -0.795063647149E-01 -0.806259075991E-01 + -0.817595322027E-01 -0.829074156327E-01 -0.840697372229E-01 -0.852466785616E-01 + -0.864384235202E-01 -0.876451582818E-01 -0.888670713701E-01 -0.901043536789E-01 + -0.913571985016E-01 -0.926258015616E-01 -0.939103610428E-01 -0.952110776201E-01 + -0.965281544910E-01 -0.978617974071E-01 -0.992122147061E-01 -0.100579617344 + -0.101964218929 -0.103366235753 -0.104785886827 -0.106223393913 + -0.107678981560 -0.109152877141 -0.110645310884 -0.112156515908 + -0.113686728265 -0.115236186970 -0.116805134040 -0.118393814536 + -0.120002476593 -0.121631371466 -0.123280753563 -0.124950880489 + -0.126642013083 -0.128354415460 -0.130088355052 -0.131844102646 + -0.133621932432 -0.135422122038 -0.137244952581 -0.139090708702 + -0.140959678617 -0.142852154157 -0.144768430815 -0.146708807790 + -0.148673588036 -0.150663078303 -0.152677589191 -0.154717435192 + -0.156782934743 -0.158874410270 -0.160992188240 -0.163136599211 + -0.165307977882 -0.167506663144 -0.169732998132 -0.171987330276 + -0.174270011355 -0.176581397552 -0.178921849503 -0.181291732356 + -0.183691415825 -0.186121274247 -0.188581686633 -0.191073036733 + -0.193595713087 -0.196150109087 -0.198736623031 -0.201355658191 + -0.204007622862 -0.206692930433 -0.209411999439 -0.212165253630 + -0.214953122028 -0.217776038993 -0.220634444285 -0.223528783130 + -0.226459506281 -0.229427070086 -0.232431936552 -0.235474573413 + -0.238555454195 -0.241675058284 -0.244833870992 -0.248032383630 + -0.251271093569 -0.254550504316 -0.257871125580 -0.261233473341 + -0.264638069924 -0.268085444066 -0.271576130987 -0.275110672463 + -0.278689616898 -0.282313519390 -0.285982941810 -0.289698452870 + -0.293460628193 -0.297270050389 -0.301127309124 -0.305033001194 + -0.308987730593 -0.312992108588 -0.317046753787 -0.321152292212 + -0.325309357368 -0.329518590312 -0.333780639723 -0.338096161968 + -0.342465821172 -0.346890289283 -0.351370246136 -0.355906379518 + -0.360499385230 -0.365149967147 -0.369858837278 -0.374626715825 + -0.379454331232 -0.384342420245 -0.389291727957 -0.394303007858 + -0.399377021878 -0.404514540430 -0.409716342444 -0.414983215407 + -0.420315955386 -0.425715367058 -0.431182263729 -0.436717467347 + -0.442321808516 -0.447996126498 -0.453741269207 -0.459558093205 + -0.465447463681 -0.471410254426 -0.477447347801 -0.483559634696 + -0.489748014473 -0.496013394905 -0.502356692105 -0.508778830435 + -0.515280742411 -0.521863368590 -0.528527657443 -0.535274565213 + -0.542105055756 -0.549020100366 -0.556020677581 -0.563107772966 + -0.570282378881 -0.577545494219 -0.584898124132 -0.592341279713 + -0.599875977674 -0.607503239975 -0.615224093436 -0.623039569313 + -0.630950702837 -0.638958532721 -0.647064100629 -0.655268450598 + -0.663572628430 -0.671977681023 -0.680484655667 -0.689094599283 + -0.697808557608 -0.706627574327 -0.715552690144 -0.724584941786 + -0.733725360943 -0.742974973143 -0.752334796541 -0.761805840640 + -0.771389104926 -0.781085577414 -0.790896233103 -0.800822032341 + -0.810863919077 -0.821022819017 -0.831299637665 -0.841695258242 + -0.852210539484 -0.862846313316 -0.873603382382 -0.884482517437 + -0.895484454587 -0.906609892376 -0.917859488710 -0.929233857606 + -0.940733565768 -0.952359128972 -0.964111008263 -0.975989605944 + -0.987995261361 -1.00012824646 -1.01238876113 -1.02477692831 + -1.03729278881 -1.04993629596 -1.06270730993 -1.07560559180 + -1.08863079736 -1.10178247062 -1.11506003702 -1.12846279632 + -1.14198991527 -1.15564041981 -1.16941318711 -1.18330693716 + -1.19732022411 -1.21145142723 -1.22569874156 -1.24006016818 + -1.25453350421 -1.26911633242 -1.28380601051 -1.29859966013 + -1.31349415547 -1.32848611167 -1.34357187284 -1.35874749986 + -1.37400875793 -1.38935110383 -1.40476967306 -1.42025926679 + -1.43581433862 -1.45142898139 -1.46709691381 -1.48281146722 + -1.49856557242 -1.51435174663 -1.53016208071 -1.54598822674 + -1.56182138598 -1.57765229742 -1.59347122692 -1.60926795726 + -1.62503177897 -1.64075148236 -1.65641535078 -1.67201115531 + -1.68752615108 -1.70294707548 -1.71826014841 -1.73345107488 + -1.74850505017 -1.76340676790 -1.77814043122 -1.79268976745 + -1.80703804660 -1.82116810389 -1.83506236690 -1.84870288752 + -1.86207137909 -1.87514925930 -1.88791769902 -1.90035767758 + -1.91245004495 -1.92417559110 -1.93551512300 -1.94644954962 + -1.95695997528 -1.96702780173 -1.97663483902 -1.98576342576 + -1.99439655853 -2.00251803085 -2.01011258144 -2.01716605191 + -2.02366555334 -2.02959964160 -2.03495850066 -2.03973413318 + -2.04392055727 -2.04751400830 -2.05051314393 -2.05291925071 + -2.05473644972 -2.05597189871 -2.05663598747 -2.05674252293 + -2.05630889960 -2.05535625082 -2.05390957528 -2.05199783293 + -2.04965400362 -2.04691510106 -2.04382213423 -2.04042000767 + -2.03675735125 -2.03288627011 -2.02886200443 -2.02474248914 + -2.02058780338 -2.01645950029 -2.01241980842 -2.00853069774 + -2.00485280558 -2.00144422086 -1.99835912979 -1.99564633185 + -1.99334764297 -1.99149621264 -1.99011479470 -1.98921402759 + -1.98879080005 -1.98882680336 -1.98928740206 -1.99012099306 + -1.99125906914 -1.99261725937 -1.99409768678 -1.99559306622 + -1.99699306407 -1.99819356069 -1.99917387050 -1.99973594752 + -1.99996465494 -2.00000014812 -2.00000001365 -2.00000001239 + -2.00000001123 -2.00000001017 -2.00000000920 -2.00000000830 + -2.00000000748 -2.00000000674 -2.00000000606 -2.00000000544 + -2.00000000487 -2.00000000436 -2.00000000390 -2.00000000348 + -2.00000000310 -2.00000000275 -2.00000000244 -2.00000000217 + -2.00000000192 -2.00000000169 -2.00000000149 -2.00000000132 + -2.00000000116 -2.00000000102 -2.00000000089 -2.00000000078 + -2.00000000068 -2.00000000059 -2.00000000052 -2.00000000045 + -2.00000000039 -2.00000000034 -2.00000000029 -2.00000000025 + -2.00000000022 -2.00000000019 -2.00000000016 -2.00000000014 + -2.00000000012 -2.00000000010 -2.00000000009 -2.00000000007 + -2.00000000006 -2.00000000005 -2.00000000005 -2.00000000004 + -2.00000000003 -2.00000000003 -2.00000000002 -2.00000000002 + -2.00000000002 -2.00000000002 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 + Down Pseudopotential follows (l on next line) + 3 + -0.111619570255E-03 -0.224643141861E-03 -0.339088374976E-03 -0.454973151894E-03 + -0.572315579843E-03 -0.691133993809E-03 -0.811446959404E-03 -0.933273275767E-03 + -0.105663197850E-02 -0.118154234264E-02 -0.130802388569E-02 -0.143609637062E-02 + -0.156577980902E-02 -0.169709446418E-02 -0.183006085426E-02 -0.196469975553E-02 + -0.210103220557E-02 -0.223907950660E-02 -0.237886322878E-02 -0.252040521357E-02 + -0.266372757718E-02 -0.280885271402E-02 -0.295580330017E-02 -0.310460229692E-02 + -0.325527295441E-02 -0.340783881522E-02 -0.356232371804E-02 -0.371875180145E-02 + -0.387714750761E-02 -0.403753558616E-02 -0.419994109803E-02 -0.436438941940E-02 + -0.453090624560E-02 -0.469951759521E-02 -0.487024981407E-02 -0.504312957938E-02 + -0.521818390394E-02 -0.539544014029E-02 -0.557492598506E-02 -0.575666948322E-02 + -0.594069903252E-02 -0.612704338791E-02 -0.631573166603E-02 -0.650679334976E-02 + -0.670025829281E-02 -0.689615672443E-02 -0.709451925408E-02 -0.729537687626E-02 + -0.749876097531E-02 -0.770470333035E-02 -0.791323612021E-02 -0.812439192851E-02 + -0.833820374869E-02 -0.855470498920E-02 -0.877392947871E-02 -0.899591147142E-02 + -0.922068565236E-02 -0.944828714288E-02 -0.967875150605E-02 -0.991211475231E-02 + -0.101484133450E-01 -0.103876842062E-01 -0.106299647223E-01 -0.108752927501E-01 + -0.111237066223E-01 -0.113752451541E-01 -0.116299476486E-01 -0.118878539036E-01 + -0.121490042172E-01 -0.124134393946E-01 -0.126812007541E-01 -0.129523301337E-01 + -0.132268698979E-01 -0.135048629439E-01 -0.137863527083E-01 -0.140713831744E-01 + -0.143599988785E-01 -0.146522449172E-01 -0.149481669543E-01 -0.152478112279E-01 + -0.155512245578E-01 -0.158584543526E-01 -0.161695486175E-01 -0.164845559611E-01 + -0.168035256038E-01 -0.171265073848E-01 -0.174535517704E-01 -0.177847098615E-01 + -0.181200334019E-01 -0.184595747863E-01 -0.188033870682E-01 -0.191515239686E-01 + -0.195040398841E-01 -0.198609898957E-01 -0.202224297770E-01 -0.205884160032E-01 + -0.209590057599E-01 -0.213342569519E-01 -0.217142282126E-01 -0.220989789124E-01 + -0.224885691690E-01 -0.228830598559E-01 -0.232825126124E-01 -0.236869898532E-01 + -0.240965547779E-01 -0.245112713811E-01 -0.249312044622E-01 -0.253564196360E-01 + -0.257869833422E-01 -0.262229628564E-01 -0.266644263003E-01 -0.271114426525E-01 + -0.275640817593E-01 -0.280224143453E-01 -0.284865120247E-01 -0.289564473127E-01 + -0.294322936364E-01 -0.299141253464E-01 -0.304020177286E-01 -0.308960470158E-01 + -0.313962903996E-01 -0.319028260427E-01 -0.324157330906E-01 -0.329350916844E-01 + -0.334609829734E-01 -0.339934891272E-01 -0.345326933492E-01 -0.350786798893E-01 + -0.356315340568E-01 -0.361913422343E-01 -0.367581918907E-01 -0.373321715951E-01 + -0.379133710307E-01 -0.385018810084E-01 -0.390977934815E-01 -0.397012015599E-01 + -0.403121995243E-01 -0.409308828416E-01 -0.415573481790E-01 -0.421916934198E-01 + -0.428340176783E-01 -0.434844213155E-01 -0.441430059545E-01 -0.448098744967E-01 + -0.454851311374E-01 -0.461688813828E-01 -0.468612320656E-01 -0.475622913626E-01 + -0.482721688109E-01 -0.489909753250E-01 -0.497188232148E-01 -0.504558262024E-01 + -0.512020994403E-01 -0.519577595292E-01 -0.527229245360E-01 -0.534977140129E-01 + -0.542822490153E-01 -0.550766521212E-01 -0.558810474501E-01 -0.566955606825E-01 + -0.575203190796E-01 -0.583554515028E-01 -0.592010884341E-01 -0.600573619966E-01 + -0.609244059749E-01 -0.618023558359E-01 -0.626913487502E-01 -0.635915236132E-01 + -0.645030210674E-01 -0.654259835234E-01 -0.663605551829E-01 -0.673068820609E-01 + -0.682651120086E-01 -0.692353947361E-01 -0.702178818365E-01 -0.712127268086E-01 + -0.722200850818E-01 -0.732401140395E-01 -0.742729730443E-01 -0.753188234625E-01 + -0.763778286893E-01 -0.774501541744E-01 -0.785359674477E-01 -0.796354381455E-01 + -0.807487380368E-01 -0.818760410502E-01 -0.830175233011E-01 -0.841733631190E-01 + -0.853437410751E-01 -0.865288400109E-01 -0.877288450664E-01 -0.889439437088E-01 + -0.901743257622E-01 -0.914201834365E-01 -0.926817113579E-01 -0.939591065989E-01 + -0.952525687090E-01 -0.965622997459E-01 -0.978885043067E-01 -0.992313895600E-01 + -0.100591165278 -0.101968043869 -0.103362240410 -0.104773972683 + -0.106203461203 -0.107650929259 -0.109116602943 -0.110600711189 + -0.112103485807 -0.113625161518 -0.115165975994 -0.116726169889 + -0.118305986882 -0.119905673712 -0.121525480217 -0.123165659371 + -0.124826467326 -0.126508163450 -0.128211010366 -0.129935273994 + -0.131681223595 -0.133449131805 -0.135239274685 -0.137051931759 + -0.138887386058 -0.140745924164 -0.142627836255 -0.144533416147 + -0.146462961342 -0.148416773073 -0.150395156347 -0.152398419999 + -0.154426876730 -0.156480843163 -0.158560639888 -0.160666591508 + -0.162799026694 -0.164958278234 -0.167144683079 -0.169358582400 + -0.171600321636 -0.173870250548 -0.176168723273 -0.178496098373 + -0.180852738895 -0.183239012423 -0.185655291130 -0.188101951841 + -0.190579376082 -0.193087950142 -0.195628065130 -0.198200117030 + -0.200804506763 -0.203441640245 -0.206111928447 -0.208815787455 + -0.211553638534 -0.214325908183 -0.217133028204 -0.219975435763 + -0.222853573449 -0.225767889343 -0.228718837079 -0.231706875911 + -0.234732470777 -0.237796092365 -0.240898217178 -0.244039327604 + -0.247219911978 -0.250440464655 -0.253701486075 -0.257003482830 + -0.260346967736 -0.263732459898 -0.267160484785 -0.270631574291 + -0.274146266813 -0.277705107316 -0.281308647404 -0.284957445390 + -0.288652066366 -0.292393082274 -0.296181071975 -0.300016621320 + -0.303900323215 -0.307832777700 -0.311814592006 -0.315846380634 + -0.319928765417 -0.324062375588 -0.328247847851 -0.332485826441 + -0.336776963195 -0.341121917609 -0.345521356908 -0.349975956103 + -0.354486398054 -0.359053373524 -0.363677581240 -0.368359727948 + -0.373100528462 -0.377900705715 -0.382760990810 -0.387682123063 + -0.392664850043 -0.397709927613 -0.402818119964 -0.407990199646 + -0.413226947598 -0.418529153164 -0.423897614118 -0.429333136672 + -0.434836535483 -0.440408633656 -0.446050262737 -0.451762262700 + -0.457545481928 -0.463400777185 -0.469329013576 -0.475331064508 + -0.481407811628 -0.487560144759 -0.493788961826 -0.500095168761 + -0.506479679407 -0.512943415398 -0.519487306033 -0.526112288128 + -0.532819305855 -0.539609310564 -0.546483260585 -0.553442121007 + -0.560486863446 -0.567618465780 -0.574837911863 -0.582146191219 + -0.589544298704 -0.597033234141 -0.604614001925 -0.612287610596 + -0.620055072378 -0.627917402684 -0.635875619579 -0.643930743208 + -0.652083795177 -0.660335797890 -0.668687773840 -0.677140744851 + -0.685695731260 -0.694353751050 -0.703115818921 -0.711982945298 + -0.720956135272 -0.730036387475 -0.739224692876 -0.748522033506 + -0.757929381094 -0.767447695623 -0.777077923794 -0.786820997395 + -0.796677831567 -0.806649322968 -0.816736347829 -0.826939759888 + -0.837260388205 -0.847699034856 -0.858256472481 -0.868933441701 + -0.879730648391 -0.890648760790 -0.901688406460 -0.912850169074 + -0.924134585033 -0.935542139897 -0.947073264630 -0.958728331649 + -0.970507650666 -0.982411464322 -0.994439943592 -1.00659318297 + -1.01887119543 -1.03127390710 -1.04380115174 -1.05645266491 + -1.06922807792 -1.08212691146 -1.09514856898 -1.10829232979 + -1.12155734179 -1.13494261405 -1.14844700891 -1.16206923394 + -1.17580783344 -1.18966117976 -1.20362746421 -1.21770468773 + -1.23189065119 -1.24618294546 -1.26057894107 -1.27507577774 + -1.28967035347 -1.30435931350 -1.31913903893 -1.33400563518 + -1.34895492019 -1.36398241252 -1.37908331925 -1.39425252381 + -1.40948457374 -1.42477366846 -1.44011364706 -1.45549797622 + -1.47091973832 -1.48637161976 -1.50184589969 -1.51733443911 + -1.53282867058 -1.54831958851 -1.56379774030 -1.57925321836 + -1.59467565322 -1.61005420784 -1.62537757337 -1.64063396644 + -1.65581112829 -1.67089632588 -1.68587635530 -1.70073754755 + -1.71546577717 -1.73004647386 -1.74446463738 -1.75870485610 + -1.77275132946 -1.78658789470 -1.80019805816 -1.81356503154 + -1.82667177347 -1.83950103669 -1.85203542125 -1.86425743410 + -1.87614955535 -1.88769431155 -1.89887435629 -1.90967255846 + -1.92007209834 -1.93005657161 -1.93961010171 -1.94871746025 + -1.95736419569 -1.96553677004 -1.97322270331 -1.98041072541 + -1.98709093479 -1.99325496322 -1.99889614556 -2.00400969353 + -2.00859287178 -2.01264517460 -2.01616850114 -2.01916732657 + -2.02164886640 -2.02362323052 -2.02510356316 -2.02610616461 + -2.02665058962 -2.02675971746 -2.02645978733 -2.02578039308 + -2.02475442998 -2.02341798628 -2.02181017171 -2.01997287488 + -2.01795044134 -2.01578926438 -2.01353728081 -2.01124336503 + -2.00895661586 -2.00672553267 -2.00459707998 -2.00261564368 + -2.00082188694 -1.99925152038 -1.99793400978 -1.99689125513 + -1.99613628865 -1.99567205615 -1.99549036741 -1.99557112714 + -1.99588199005 -1.99637862261 -1.99700580137 -1.99769963559 + -1.99839127112 -1.99908294242 -1.99957256569 -1.99986106869 + -1.99998115880 -2.00000013158 -2.00000001268 -2.00000001151 + -2.00000001043 -2.00000000944 -2.00000000854 -2.00000000771 + -2.00000000695 -2.00000000626 -2.00000000562 -2.00000000505 + -2.00000000452 -2.00000000405 -2.00000000362 -2.00000000323 + -2.00000000287 -2.00000000256 -2.00000000227 -2.00000000201 + -2.00000000178 -2.00000000157 -2.00000000139 -2.00000000122 + -2.00000000107 -2.00000000094 -2.00000000083 -2.00000000072 + -2.00000000063 -2.00000000055 -2.00000000048 -2.00000000042 + -2.00000000036 -2.00000000031 -2.00000000027 -2.00000000023 + -2.00000000020 -2.00000000017 -2.00000000015 -2.00000000013 + -2.00000000011 -2.00000000009 -2.00000000008 -2.00000000007 + -2.00000000006 -2.00000000005 -2.00000000004 -2.00000000004 + -2.00000000003 -2.00000000003 -2.00000000002 -2.00000000002 + -2.00000000002 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 + Core charge follows + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 + Valence charge follows + 0.192859942394E-08 0.781173797153E-08 0.177986530177E-07 0.320429777590E-07 + 0.507028602581E-07 0.739410855989E-07 0.101925201233E-06 0.134827645597E-06 + 0.172825880089E-06 0.216102524489E-06 0.264845495903E-06 0.319248151340E-06 + 0.379509433995E-06 0.445834023349E-06 0.518432489170E-06 0.597521449530E-06 + 0.683323732926E-06 0.776068544625E-06 0.875991637323E-06 0.983335486252E-06 + 0.109834946882E-05 0.122129004895E-05 0.135242096614E-05 0.149201342952E-05 + 0.164034631684E-05 0.179770637873E-05 0.196438844814E-05 0.214069565534E-05 + 0.232693964833E-05 0.252344081913E-05 0.273052853577E-05 0.294854138044E-05 + 0.317782739366E-05 0.341874432486E-05 0.367165988941E-05 0.393695203229E-05 + 0.421500919859E-05 0.450623061099E-05 0.481102655440E-05 0.512981866796E-05 + 0.546304024460E-05 0.581113653829E-05 0.617456507923E-05 0.655379599720E-05 + 0.694931235324E-05 0.736161047981E-05 0.779120032985E-05 0.823860583470E-05 + 0.870436527134E-05 0.918903163903E-05 0.969317304571E-05 0.102173731042E-04 + 0.107622313389E-04 0.113283636025E-04 0.119164025038E-04 0.125269978465E-04 + 0.131608170789E-04 0.138185457558E-04 0.145008880115E-04 0.152085670456E-04 + 0.159423256210E-04 0.167029265745E-04 0.174911533412E-04 0.183078104914E-04 + 0.191537242818E-04 0.200297432214E-04 0.209367386506E-04 0.218756053360E-04 + 0.228472620808E-04 0.238526523500E-04 0.248927449119E-04 0.259685344964E-04 + 0.270810424697E-04 0.282313175266E-04 0.294204364004E-04 0.306495045908E-04 + 0.319196571109E-04 0.332320592526E-04 0.345879073726E-04 0.359884296973E-04 + 0.374348871494E-04 0.389285741946E-04 0.404708197112E-04 0.420629878802E-04 + 0.437064791003E-04 0.454027309241E-04 0.471532190199E-04 0.489594581571E-04 + 0.508230032169E-04 0.527454502295E-04 0.547284374366E-04 0.567736463820E-04 + 0.588828030295E-04 0.610576789096E-04 0.633000922950E-04 0.656119094069E-04 + 0.679950456508E-04 0.704514668852E-04 0.729831907215E-04 0.755922878576E-04 + 0.782808834452E-04 0.810511584922E-04 0.839053513006E-04 0.868457589407E-04 + 0.898747387635E-04 0.929947099510E-04 0.962081551062E-04 0.995176218837E-04 + 0.102925724661E-03 0.106435146253E-03 0.110048639670E-03 0.113769029920E-03 + 0.117599215858E-03 0.121542172080E-03 0.125600950866E-03 0.129778684174E-03 + 0.134078585684E-03 0.138503952889E-03 0.143058169249E-03 0.147744706389E-03 + 0.152567126361E-03 0.157529083955E-03 0.162634329080E-03 0.167886709193E-03 + 0.173290171799E-03 0.178848767007E-03 0.184566650159E-03 0.190448084516E-03 + 0.196497444018E-03 0.202719216115E-03 0.209118004664E-03 0.215698532905E-03 + 0.222465646505E-03 0.229424316690E-03 0.236579643443E-03 0.243936858795E-03 + 0.251501330188E-03 0.259278563931E-03 0.267274208741E-03 0.275494059370E-03 + 0.283944060329E-03 0.292630309701E-03 0.301559063051E-03 0.310736737439E-03 + 0.320169915525E-03 0.329865349787E-03 0.339829966840E-03 0.350070871863E-03 + 0.360595353140E-03 0.371410886710E-03 0.382525141143E-03 0.393945982428E-03 + 0.405681478984E-03 0.417739906801E-03 0.430129754706E-03 0.442859729763E-03 + 0.455938762811E-03 0.469376014131E-03 0.483180879266E-03 0.497362994979E-03 + 0.511932245367E-03 0.526898768117E-03 0.542272960931E-03 0.558065488100E-03 + 0.574287287251E-03 0.590949576256E-03 0.608063860316E-03 0.625641939220E-03 + 0.643695914788E-03 0.662238198493E-03 0.681281519280E-03 0.700838931572E-03 + 0.720923823479E-03 0.741549925213E-03 0.762731317701E-03 0.784482441427E-03 + 0.806818105478E-03 0.829753496827E-03 0.853304189830E-03 0.877486155974E-03 + 0.902315773857E-03 0.927809839409E-03 0.953985576380E-03 0.980860647067E-03 + 0.100845316333E-02 0.103678169783E-02 0.106586529564E-02 0.109572348599E-02 + 0.112637629448E-02 0.115784425542E-02 0.119014842461E-02 0.122331039231E-02 + 0.125735229666E-02 0.129229683731E-02 0.132816728945E-02 0.136498751814E-02 + 0.140278199300E-02 0.144157580333E-02 0.148139467342E-02 0.152226497845E-02 + 0.156421376059E-02 0.160726874560E-02 0.165145835976E-02 0.169681174729E-02 + 0.174335878809E-02 0.179113011598E-02 0.184015713733E-02 0.189047205019E-02 + 0.194210786380E-02 0.199509841864E-02 0.204947840692E-02 0.210528339354E-02 + 0.216254983758E-02 0.222131511428E-02 0.228161753756E-02 0.234349638304E-02 + 0.240699191160E-02 0.247214539354E-02 0.253899913323E-02 0.260759649444E-02 + 0.267798192613E-02 0.275020098894E-02 0.282430038225E-02 0.290032797190E-02 + 0.297833281848E-02 0.305836520633E-02 0.314047667322E-02 0.322472004063E-02 + 0.331114944479E-02 0.339982036837E-02 0.349078967297E-02 0.358411563224E-02 + 0.367985796581E-02 0.377807787397E-02 0.387883807308E-02 0.398220283185E-02 + 0.408823800836E-02 0.419701108788E-02 0.430859122158E-02 0.442304926605E-02 + 0.454045782367E-02 0.466089128390E-02 0.478442586537E-02 0.491113965898E-02 + 0.504111267185E-02 0.517442687219E-02 0.531116623519E-02 0.545141678977E-02 + 0.559526666639E-02 0.574280614579E-02 0.589412770880E-02 0.604932608704E-02 + 0.620849831479E-02 0.637174378184E-02 0.653916428732E-02 0.671086409477E-02 + 0.688694998808E-02 0.706753132870E-02 0.725272011384E-02 0.744263103581E-02 + 0.763738154248E-02 0.783709189888E-02 0.804188524993E-02 0.825188768428E-02 + 0.846722829937E-02 0.868803926757E-02 0.891445590354E-02 0.914661673273E-02 + 0.938466356104E-02 0.962874154565E-02 0.987899926705E-02 0.101355888021E-01 + 0.103986657987E-01 0.106683895506E-01 0.109449230749E-01 0.112284331891E-01 + 0.115190905903E-01 0.118170699354E-01 0.121225499218E-01 0.124357133700E-01 + 0.127567473067E-01 0.130858430491E-01 0.134231962901E-01 0.137690071850E-01 + 0.141234804382E-01 0.144868253917E-01 0.148592561143E-01 0.152409914910E-01 + 0.156322553139E-01 0.160332763735E-01 0.164442885508E-01 0.168655309099E-01 + 0.172972477909E-01 0.177396889038E-01 0.181931094226E-01 0.186577700790E-01 + 0.191339372574E-01 0.196218830894E-01 0.201218855480E-01 0.206342285423E-01 + 0.211592020118E-01 0.216971020195E-01 0.222482308459E-01 0.228128970812E-01 + 0.233914157168E-01 0.239841082365E-01 0.245913027054E-01 0.252133338584E-01 + 0.258505431863E-01 0.265032790210E-01 0.271718966175E-01 0.278567582343E-01 + 0.285582332115E-01 0.292766980451E-01 0.300125364590E-01 0.307661394732E-01 + 0.315379054684E-01 0.323282402459E-01 0.331375570839E-01 0.339662767882E-01 + 0.348148277379E-01 0.356836459252E-01 0.365731749895E-01 0.374838662442E-01 + 0.384161786967E-01 0.393705790609E-01 0.403475417610E-01 0.413475489272E-01 + 0.423710903810E-01 0.434186636116E-01 0.444907737407E-01 0.455879334766E-01 + 0.467106630555E-01 0.478594901703E-01 0.490349498859E-01 0.502375845398E-01 + 0.514679436270E-01 0.527265836691E-01 0.540140680664E-01 0.553309669310E-01 + 0.566778569013E-01 0.580553209363E-01 0.594639480882E-01 0.609043332531E-01 + 0.623770768971E-01 0.638827847586E-01 0.654220675235E-01 0.669955404742E-01 + 0.686038231083E-01 0.702475387283E-01 0.719273139998E-01 0.736437784753E-01 + 0.753975640855E-01 0.771893045927E-01 0.790196350078E-01 0.808891909675E-01 + 0.827986080706E-01 0.847485211721E-01 0.867395636330E-01 0.887723665237E-01 + 0.908475577806E-01 0.929657613123E-01 0.951275960557E-01 0.973336749783E-01 + 0.995846040265E-01 0.101880981017 0.104223394471 0.106612422388 + 0.109048630958 0.111532573210 0.114064787601 0.116645796531 + 0.119276104797 0.121956197978 0.124686540746 0.127467575110 + 0.130299718591 0.133183362321 0.136118869067 0.139106571192 + 0.142146768535 0.145239726221 0.148385672402 0.151584795926 + 0.154837243936 0.158143119404 0.161502478600 0.164915328494 + 0.168381624109 0.171901265809 0.175474096544 0.179099899044 + 0.182778392977 0.186509232075 0.190292001230 0.194126213575 + 0.198011307559 0.201946644018 0.205931503264 0.209965082193 + 0.214046491433 0.218174752547 0.222348795293 0.226567454973 + 0.230829469882 0.235133478869 0.239478019048 0.243861523650 + 0.248282320071 0.252738628116 0.257228558471 0.261750111427 + 0.266301175884 0.270879528660 0.275482834128 0.280108644217 + 0.284754398804 0.289417426515 0.294094945981 0.298784067563 + 0.303481795582 0.308185031075 0.312890575109 0.317595132679 + 0.322295317203 0.326987655640 0.331668594263 0.336334505069 + 0.340981692875 0.345606403079 0.350204830101 0.354773126503 + 0.359307412770 0.363803787747 0.368258339702 0.372667158000 + 0.377026345326 0.381332030440 0.385580381389 0.389767619122 + 0.393890031426 0.397943987118 0.401925950365 0.405832495067 + 0.409660319161 0.413406258723 0.417067301751 0.420640601457 + 0.424123488937 0.427513485040 0.430808311270 0.434005899547 + 0.437104400641 0.440102191083 0.442997878383 0.445790304351 + 0.448478546334 0.451061916191 0.453539956840 0.455912436183 + 0.458179338301 0.460340851743 0.462397354842 0.464349397939 + 0.466197682492 0.467943037053 0.469586390145 0.471128740130 + 0.472571122219 0.473914572847 0.475160091703 0.476308601801 + 0.477360908088 0.478317655172 0.479179284885 0.479945994527 + 0.480617696764 0.481193982306 0.481674086615 0.482056862058 + 0.482340757021 0.482523803624 0.482603615727 0.482577398951 + 0.482441974360 0.482193817305 0.481829112616 0.481343826889 + 0.480733797882 0.479994840121 0.479122864492 0.478114007910 + 0.476964766961 0.475672126666 0.474233672054 0.472647665983 + 0.470913070885 0.469029486199 0.466996982391 0.464815870018 + 0.462486580310 0.460009732923 0.457386090912 0.454616575315 + 0.451702265742 0.448644400990 0.445444380086 0.442103762753 + 0.438624269637 0.435007782252 0.431256342637 0.427372152711 + 0.423357573327 0.419215123017 0.414947476426 0.410557462424 + 0.406048061901 0.401422405240 0.396683769456 0.391835575024 + 0.386881382364 0.381824888011 0.376669920458 0.371420435675 + 0.366080512308 0.360654346573 0.355146246827 0.349560627845 + 0.343902004805 0.338174986971 0.332384271116 0.326534634661 + 0.320630928574 0.314678070008 0.308681034723 0.302644849286 + 0.296574583069 0.290475340066 0.284352250545 0.278210462548 + 0.272055133266 0.265891420306 0.259724472862 0.253559422831 + 0.247401375887 0.241255402527 0.235126529124 0.229019729013 + 0.222939913627 0.216891923710 0.210880520641 0.204910377884 + 0.198986072594 0.193112077405 0.187292752436 0.181532337514 + 0.175834944675 0.170204550934 0.164644991380 0.159159952589 + 0.153752966405 0.148427404095 0.143186470903 0.138033201031 + 0.132970453049 0.128000905774 0.123127054607 0.118351208375 + 0.113675486655 0.109101817627 0.104631936429 0.100267384058 + 0.960095067872E-01 0.918594561291E-01 0.878181893307E-01 0.838864704037E-01 + 0.800648716863E-01 0.763537759297E-01 0.727533789016E-01 0.692636924953E-01 + 0.658845483324E-01 0.626156018442E-01 0.594563368135E-01 0.564060703579E-01 + 0.534639583344E-01 0.506290011397E-01 0.479000498833E-01 0.452758129051E-01 + 0.427548626097E-01 0.403356425871E-01 0.380164749900E-01 0.357955681333E-01 + 0.336710242851E-01 0.316408476135E-01 0.297029522571E-01 0.278551704814E-01 + 0.260952608902E-01 0.244209166542E-01 0.228297737247E-01 0.213194189972E-01 + 0.198873983928E-01 0.185312248251E-01 0.172483860213E-01 0.160363521683E-01 + 0.148925833548E-01 0.138145367839E-01 0.127996737309E-01 0.118454662228E-01 + 0.109494034201E-01 0.101089976804E-01 0.932179028917E-02 0.858535684220E-02 + 0.789731226802E-02 0.725531548143E-02 0.665707366032E-02 0.610034614137E-02 + 0.558294793195E-02 0.510275283811E-02 0.465769621076E-02 0.424577731408E-02 + 0.386506132236E-02 0.351368095349E-02 0.318983774884E-02 0.289180301130E-02 + 0.261791841440E-02 0.236659629707E-02 0.213631965971E-02 0.192564187822E-02 + 0.173318615362E-02 0.155764471558E-02 0.139777779863E-02 0.125241241034E-02 + 0.112044091082E-02 0.100081942313E-02 0.892566093909E-03 0.794759223473E-03 + 0.706535284101E-03 0.627086844948E-03 0.555660421225E-03 0.491554264729E-03 + 0.434116111959E-03 0.382740905219E-03 0.336868501164E-03 0.295981380310E-03 + 0.259602369956E-03 0.227292391987E-03 0.198648245921E-03 0.173300436534E-03 + 0.150911054305E-03 0.131171715925E-03 0.113801571046E-03 0.985453804982E-04 + 0.851716702189E-04 0.734709642647E-04 0.632540993902E-04 0.543506228959E-04 + 0.466072746907E-04 0.398865538313E-04 0.340653691752E-04 0.290337732188E-04 + 0.246937776901E-04 0.209582490236E-04 0.177498814647E-04 0.150002452239E-04 + 0.126489068360E-04 0.106426186600E-04 0.893457429107E-05 0.748372653583E-05 + 0.625416452187E-05 0.521454647655E-05 0.433758470421E-05 0.359957931914E-05 + 0.297999734644E-05 0.246109388135E-05 0.202757209710E-05 0.166627900678E-05 + 0.136593401420E-05 0.111688742925E-05 0.910906270504E-06 0.740984831728E-06 + 0.601177644702E-06 0.486452628062E-06 0.392562368130E-06 0.315931631453E-06 + 0.253559358779E-06 0.202933535288E-06 0.161957471164E-06 0.128886159355E-06 + 0.102271503009E-06 0.809153233791E-07 0.638291695628E-07 0.502000542962E-07 + 0.393613351753E-07 0.307680481744E-07 0.239760804451E-07 0.186246423254E-07 + 0.144215645970E-07 0.111310066537E-07 0.856321476742E-08 0.656601745819E-08 + 0.501778751204E-08 0.382163784784E-08 0.290065162999E-08 0.219397615104E-08 + 0.165363545597E-08 0.124193881255E-08 0.929381299077E-09 0.692949305273E-09 + 0.514757927259E-09 0.380959360274E-09 0.280871708568E-09 0.206286370945E-09 + 0.150919531555E-09 0.109979475361E-09 0.798266226255E-10 0.577074839373E-10 + 0.415473062892E-10 0.297891247706E-10 0.212693520263E-10 0.151220139117E-10 + 0.107053479198E-10 0.754578353343E-11 0.529537384138E-11 0.369959051151E-11 + 0.257306732482E-11 0.178141255024E-11 0.122763375141E-11 0.842051897239E-12 + 0.574842771122E-12 0.390547257372E-12 0.264050022826E-12 0.177648027364E-12 + 0.118923931884E-12 0.792110200848E-13 0.524906403802E-13 0.346043062619E-13 + 0.226935361331E-13 0.148036678549E-13 0.960511666662E-14 0.619830243759E-14 + 0.397786438230E-14 0.253865789838E-14 0.161103477773E-14 0.101653262509E-14 + 0.637708422569E-15 0.397718479274E-15 0.246575620457E-15 0.151954233360E-15 + 0.930745459294E-16 0.566593040938E-16 0.342767824929E-16 0.206055046035E-16 + 0.123079667364E-16 0.730422684711E-17 0.430637311294E-17 0.252210207982E-17 + 0.146720552623E-17 0.847734320011E-18 0.486442890565E-18 0.277184878979E-18 + 0.156831974430E-18 0.881025392887E-19 0.491350989475E-19 0.272022731167E-19 + 0.149481817820E-19 0.815268589145E-20 0.441266599679E-20 0.236999664238E-20 + 0.126298598209E-20 0.667745114160E-21 0.350220062953E-21 0.182198844212E-21 + 0.940113161740E-22 0.481060428385E-22 0.244094851360E-22 0.122803576047E-22 + 0.612505736587E-23 0.302836915091E-23 0.148408620975E-23 0.720796487407E-24 + 0.346912820571E-24 0.165436950269E-24 0.781625736359E-25 0.365820814677E-25 + 0.169585850273E-25 0.778592494285E-26 0.353978846950E-26 0.159344594512E-26 + 0.710127023381E-27 0.313269769929E-27 0.136782031518E-27 0.591032535548E-28 + 0.252701870367E-28 0.106896252387E-28 0.447316537465E-29 0.185142717470E-29 + 0.757839992335E-30 0.306737485647E-30 0.122747626663E-30 0.485572362462E-31 + 0.189856870950E-31 0.733611747191E-32 0.280097426144E-32 0.105654817400E-32 + 0.393677381002E-33 0.144875644166E-33 0.526484979459E-34 0.188904952138E-34 + 0.669110184763E-35 0.233925828564E-35 0.807073987669E-36 0.274745538710E-36 + 0.922691751851E-37 0.305644755066E-37 0.998472848868E-38 0.321616483282E-38 + 0.102128232957E-38 0.319654325693E-39 0.985969264196E-40 0.299649774875E-40 + 0.897121090900E-41 0.264540652596E-41 0.768165292472E-42 0.219610677678E-42 + 0.618021048583E-43 0.171166027298E-43 0.466453883997E-44 0.125051219512E-44 + 0.329735218728E-45 0.854968083364E-46 0.217946276313E-46 0.546098077905E-47 + 0.134468007021E-47 0.325310967627E-48 0.773059547242E-49 0.180411230173E-49 + 0.413381662674E-50 0.929769442524E-51 0.205226716905E-51 0.444451088876E-52 + 0.944150224497E-53 0.196688780105E-53 0.401728312796E-54 0.804250532496E-55 + 0.157778094020E-55 0.303240720362E-56 0.570823032720E-57 0.105214342172E-57 + 0.189842243025E-58 0.335226864593E-59 0.579155310744E-60 0.978683662235E-61 + 0.161718679843E-61 0.261232053326E-62 0.412399442134E-63 0.636077593677E-64 + 0.958246688009E-65 0.140953257072E-65 0.202436545755E-66 0.284273825438E-67 + 0.389458372654E-68 0.520387124545E-69 0.677948621583E-70 diff --git a/aiida_defects/formation_energy_siesta/pseudos/H.psf b/aiida_defects/formation_energy_siesta/pseudos/H.psf new file mode 100644 index 0000000..25a223e --- /dev/null +++ b/aiida_defects/formation_energy_siesta/pseudos/H.psf @@ -0,0 +1,1527 @@ + H ca nrl nc + ATM3 19-FEB-98 Troullier-Martins + 1s 1.00 r= 1.25/2p 0.00 r= 1.25/3d 0.00 r= 1.25/4f 0.00 r= 1.25/ + 4 0 863 0.247875217667E-02 0.125000000000E-01 1.00000000000 + Radial grid follows + 0.311788641354E-04 0.627499101025E-04 0.947180709413E-04 0.127088341742E-03 + 0.159865780426E-03 0.193055508533E-03 0.226662712027E-03 0.260692642102E-03 + 0.295150616003E-03 0.330042017859E-03 0.365372299523E-03 0.401146981422E-03 + 0.437371653424E-03 0.474051975707E-03 0.511193679647E-03 0.548802568709E-03 + 0.586884519361E-03 0.625445481983E-03 0.664491481805E-03 0.704028619843E-03 + 0.744063073857E-03 0.784601099310E-03 0.825649030352E-03 0.867213280805E-03 + 0.909300345168E-03 0.951916799631E-03 0.995069303102E-03 0.103876459825E-02 + 0.108300951254E-02 0.112781095935E-02 0.117317593898E-02 0.121911153982E-02 + 0.126562493938E-02 0.131272340548E-02 0.136041429736E-02 0.140870506681E-02 + 0.145760325936E-02 0.150711651546E-02 0.155725257165E-02 0.160801926180E-02 + 0.165942451829E-02 0.171147637332E-02 0.176418296008E-02 0.181755251409E-02 + 0.187159337444E-02 0.192631398514E-02 0.198172289639E-02 0.203782876595E-02 + 0.209464036046E-02 0.215216655687E-02 0.221041634375E-02 0.226939882275E-02 + 0.232912321000E-02 0.238959883756E-02 0.245083515488E-02 0.251284173024E-02 + 0.257562825231E-02 0.263920453161E-02 0.270358050205E-02 0.276876622252E-02 + 0.283477187841E-02 0.290160778324E-02 0.296928438027E-02 0.303781224409E-02 + 0.310720208233E-02 0.317746473729E-02 0.324861118764E-02 0.332065255018E-02 + 0.339360008150E-02 0.346746517981E-02 0.354225938667E-02 0.361799438885E-02 + 0.369468202008E-02 0.377233426296E-02 0.385096325082E-02 0.393058126959E-02 + 0.401120075975E-02 0.409283431826E-02 0.417549470053E-02 0.425919482242E-02 + 0.434394776223E-02 0.442976676279E-02 0.451666523349E-02 0.460465675239E-02 + 0.469375506834E-02 0.478397410315E-02 0.487532795371E-02 0.496783089426E-02 + 0.506149737856E-02 0.515634204219E-02 0.525237970483E-02 0.534962537256E-02 + 0.544809424020E-02 0.554780169373E-02 0.564876331263E-02 0.575099487235E-02 + 0.585451234680E-02 0.595933191079E-02 0.606546994257E-02 0.617294302645E-02 + 0.628176795531E-02 0.639196173326E-02 0.650354157831E-02 0.661652492503E-02 + 0.673092942730E-02 0.684677296106E-02 0.696407362710E-02 0.708284975388E-02 + 0.720311990041E-02 0.732490285916E-02 0.744821765894E-02 0.757308356797E-02 + 0.769952009678E-02 0.782754700133E-02 0.795718428611E-02 0.808845220719E-02 + 0.822137127545E-02 0.835596225977E-02 0.849224619027E-02 0.863024436158E-02 + 0.876997833620E-02 0.891146994785E-02 0.905474130488E-02 0.919981479373E-02 + 0.934671308243E-02 0.949545912414E-02 0.964607616072E-02 0.979858772640E-02 + 0.995301765142E-02 0.101093900658E-01 0.102677294030E-01 0.104280604038E-01 + 0.105904081204E-01 0.107547979199E-01 0.109212554885E-01 0.110898068355E-01 + 0.112604782975E-01 0.114332965423E-01 0.116082885729E-01 0.117854817323E-01 + 0.119649037073E-01 0.121465825329E-01 0.123305465968E-01 0.125168246438E-01 + 0.127054457802E-01 0.128964394784E-01 0.130898355815E-01 0.132856643082E-01 + 0.134839562570E-01 0.136847424115E-01 0.138880541449E-01 0.140939232251E-01 + 0.143023818195E-01 0.145134625003E-01 0.147271982492E-01 0.149436224628E-01 + 0.151627689580E-01 0.153846719766E-01 0.156093661917E-01 0.158368867121E-01 + 0.160672690883E-01 0.163005493180E-01 0.165367638518E-01 0.167759495987E-01 + 0.170181439319E-01 0.172633846948E-01 0.175117102068E-01 0.177631592691E-01 + 0.180177711713E-01 0.182755856970E-01 0.185366431302E-01 0.188009842617E-01 + 0.190686503953E-01 0.193396833544E-01 0.196141254884E-01 0.198920196795E-01 + 0.201734093492E-01 0.204583384653E-01 0.207468515484E-01 0.210389936793E-01 + 0.213348105059E-01 0.216343482502E-01 0.219376537154E-01 0.222447742937E-01 + 0.225557579733E-01 0.228706533461E-01 0.231895096150E-01 0.235123766021E-01 + 0.238393047559E-01 0.241703451597E-01 0.245055495391E-01 0.248449702706E-01 + 0.251886603893E-01 0.255366735976E-01 0.258890642730E-01 0.262458874776E-01 + 0.266071989655E-01 0.269730551924E-01 0.273435133242E-01 0.277186312457E-01 + 0.280984675697E-01 0.284830816465E-01 0.288725335729E-01 0.292668842014E-01 + 0.296661951502E-01 0.300705288124E-01 0.304799483660E-01 0.308945177837E-01 + 0.313143018426E-01 0.317393661350E-01 0.321697770780E-01 0.326056019242E-01 + 0.330469087721E-01 0.334937665768E-01 0.339462451607E-01 0.344044152246E-01 + 0.348683483584E-01 0.353381170527E-01 0.358137947097E-01 0.362954556551E-01 + 0.367831751493E-01 0.372770293996E-01 0.377770955716E-01 0.382834518017E-01 + 0.387961772091E-01 0.393153519083E-01 0.398410570212E-01 0.403733746904E-01 + 0.409123880916E-01 0.414581814467E-01 0.420108400372E-01 0.425704502169E-01 + 0.431370994261E-01 0.437108762050E-01 0.442918702073E-01 0.448801722145E-01 + 0.454758741499E-01 0.460790690933E-01 0.466898512951E-01 0.473083161912E-01 + 0.479345604180E-01 0.485686818275E-01 0.492107795024E-01 0.498609537718E-01 + 0.505193062267E-01 0.511859397361E-01 0.518609584627E-01 0.525444678797E-01 + 0.532365747868E-01 0.539373873271E-01 0.546470150040E-01 0.553655686982E-01 + 0.560931606852E-01 0.568299046528E-01 0.575759157186E-01 0.583313104486E-01 + 0.590962068745E-01 0.598707245130E-01 0.606549843841E-01 0.614491090300E-01 + 0.622532225343E-01 0.630674505414E-01 0.638919202759E-01 0.647267605631E-01 + 0.655721018483E-01 0.664280762180E-01 0.672948174198E-01 0.681724608838E-01 + 0.690611437435E-01 0.699610048576E-01 0.708721848311E-01 0.717948260377E-01 + 0.727290726420E-01 0.736750706219E-01 0.746329677917E-01 0.756029138245E-01 + 0.765850602765E-01 0.775795606101E-01 0.785865702179E-01 0.796062464472E-01 + 0.806387486246E-01 0.816842380806E-01 0.827428781751E-01 0.838148343227E-01 + 0.849002740188E-01 0.859993668654E-01 0.871122845982E-01 0.882392011127E-01 + 0.893802924921E-01 0.905357370340E-01 0.917057152791E-01 0.928904100389E-01 + 0.940900064243E-01 0.953046918747E-01 0.965346561872E-01 0.977800915461E-01 + 0.990411925534E-01 0.100318156259 0.101611182190 0.102920472385 + 0.104246231424 0.105588666458 0.106947987247 0.108324406186 + 0.109718138344 0.111129401494 0.112558416150 0.114005405597 + 0.115470595931 0.116954216090 0.118456497894 0.119977676076 + 0.121517988325 0.123077675317 0.124656980755 0.126256151411 + 0.127875437158 0.129515091011 0.131175369171 0.132856531060 + 0.134558839362 0.136282560066 0.138027962508 0.139795319410 + 0.141584906925 0.143397004680 0.145231895818 0.147089867046 + 0.148971208675 0.150876214668 0.152805182687 0.154758414137 + 0.156736214214 0.158738891953 0.160766760277 0.162820136045 + 0.164899340100 0.167004697323 0.169136536679 0.171295191274 + 0.173480998400 0.175694299596 0.177935440694 0.180204771876 + 0.182502647731 0.184829427305 0.187185474164 0.189571156444 + 0.191986846913 0.194432923028 0.196909766992 0.199417765818 + 0.201957311386 0.204528800504 0.207132634974 0.209769221650 + 0.212438972503 0.215142304689 0.217879640607 0.220651407972 + 0.223458039878 0.226299974869 0.229177657000 0.232091535917 + 0.235042066919 0.238029711032 0.241054935081 0.244118211765 + 0.247220019726 0.250360843628 0.253541174231 0.256761508469 + 0.260022349525 0.263324206912 0.266667596553 0.270053040857 + 0.273481068809 0.276952216045 0.280467024937 0.284026044684 + 0.287629831387 0.291278948147 0.294973965145 0.298715459736 + 0.302504016534 0.306340227511 0.310224692082 0.314158017202 + 0.318140817462 0.322173715182 0.326257340510 0.330392331521 + 0.334579334317 0.338819003124 0.343112000400 0.347458996934 + 0.351860671954 0.356317713229 0.360830817182 0.365400688995 + 0.370028042718 0.374713601386 0.379458097127 0.384262271278 + 0.389126874500 0.394052666898 0.399040418138 0.404090907564 + 0.409204924327 0.414383267502 0.419626746215 0.424936179772 + 0.430312397781 0.435756240288 0.441268557904 0.446850211941 + 0.452502074542 0.458225028822 0.464019969006 0.469887800564 + 0.475829440357 0.481845816779 0.487937869899 0.494106551615 + 0.500352825794 0.506677668431 0.513082067794 0.519567024584 + 0.526133552089 0.532782676342 0.539515436283 0.546332883917 + 0.553236084487 0.560226116630 0.567304072554 0.574471058204 + 0.581728193435 0.589076612190 0.596517462674 0.604051907536 + 0.611681124047 0.619406304288 0.627228655335 0.635149399445 + 0.643169774251 0.651291032953 0.659514444514 0.667841293859 + 0.676272882075 0.684810526614 0.693455561502 0.702209337542 + 0.711073222530 0.720048601465 0.729136876770 0.738339468505 + 0.747657814594 0.757093371048 0.766647612192 0.776322030895 + 0.786118138804 0.796037466583 0.806081564145 0.816252000901 + 0.826550366004 0.836978268593 0.847537338049 0.858229224248 + 0.869055597820 0.880018150408 0.891118594932 0.902358665859 + 0.913740119474 0.925264734152 0.936934310637 0.948750672324 + 0.960715665544 0.972831159852 0.985099048317 0.997521247823 + 1.01009969936 1.02283636835 1.03573324491 1.04879234420 + 1.06201570674 1.07540539871 1.08896351227 1.10269216590 + 1.11659350474 1.13066970089 1.14492295380 1.15935549055 + 1.17396956627 1.18876746444 1.20375149724 1.21892400598 + 1.23428736139 1.24984396402 1.26559624461 1.28154666451 + 1.29769771599 1.31405192269 1.33061183999 1.34738005540 + 1.36435918900 1.38155189380 1.39896085622 1.41658879642 + 1.43443846881 1.45251266244 1.47081420144 1.48934594546 + 1.50811079013 1.52711166749 1.54635154646 1.56583343331 + 1.58556037214 1.60553544531 1.62576177397 1.64624251852 + 1.66698087913 1.68798009620 1.70924345091 1.73077426569 + 1.75257590478 1.77465177474 1.79700532495 1.81964004821 + 1.84255948125 1.86576720526 1.88926684650 1.91306207684 + 1.93715661433 1.96155422379 1.98625871741 2.01127395529 + 2.03660384614 2.06225234779 2.08822346788 2.11452126444 + 2.14114984656 2.16811337501 2.19541606289 2.22306217632 + 2.25105603504 2.27940201315 2.30810453978 2.33716809975 + 2.36659723430 2.39639654179 2.42657067843 2.45712435898 + 2.48806235752 2.51938950818 2.55111070589 2.58323090714 + 2.61575513079 2.64868845881 2.68203603710 2.71580307628 + 2.74999485254 2.78461670839 2.81967405358 2.85517236589 + 2.89111719200 2.92751414836 2.96436892207 3.00168727177 + 3.03947502852 3.07773809674 3.11648245511 3.15571415751 + 3.19543933398 3.23566419166 3.27639501576 3.31763817056 + 3.35940010038 3.40168733061 3.44450646872 3.48786420529 + 3.53176731504 3.57622265792 3.62123718019 3.66681791544 + 3.71297198576 3.75970660282 3.80702906900 3.85494677852 + 3.90346721863 3.95259797074 4.00234671164 4.05272121467 + 4.10372935094 4.15537909058 4.20767850397 4.26063576299 + 4.31425914233 4.36855702075 4.42353788241 4.47921031816 + 4.53558302695 4.59266481713 4.65046460784 4.70899143041 + 4.76825442979 4.82826286593 4.88902611528 4.95055367222 + 5.01285515055 5.07594028500 5.13981893277 5.20450107500 + 5.26999681843 5.33631639690 5.40347017296 5.47146863955 + 5.54032242155 5.61004227752 5.68063910131 5.75212392383 + 5.82450791472 5.89780238414 5.97201878449 6.04716871224 + 6.12326390971 6.20031626693 6.27833782349 6.35734077043 + 6.43733745210 6.51834036815 6.60036217546 6.68341569010 + 6.76751388935 6.85266991372 6.93889706902 7.02620882841 + 7.11461883454 7.20414090164 7.29478901773 7.38657734675 + 7.47952023083 7.57363219246 7.66892793684 7.76542235413 + 7.86313052177 7.96206770686 8.06224936854 8.16369116039 + 8.26640893291 8.37041873595 8.47573682126 8.58237964500 + 8.69036387033 8.79970637001 8.91042422902 9.02253474726 + 9.13605544221 9.25100405173 9.36739853676 9.48525708418 + 9.60459810963 9.72544026038 9.84780241827 9.97170370264 + 10.0971634733 10.2242013336 10.3528371335 10.4830909726 + 10.6149832032 10.7485344339 10.8837655323 11.0206976285 + 11.1593521184 11.2997506671 11.4419152122 11.5858679670 + 11.7316314247 11.8792283609 12.0286818381 12.1800152085 + 12.3332521185 12.4884165114 12.6455326322 12.8046250305 + 12.9657185648 13.1288384063 13.2940100429 13.4612592828 + 13.6306122593 13.8020954339 13.9757356013 14.1515598932 + 14.3295957824 14.5098710874 14.6924139766 14.8772529727 + 15.0644169571 15.2539351747 15.4458372379 15.6401531320 + 15.8369132191 16.0361482435 16.2378893359 16.4421680189 + 16.6490162114 16.8584662339 17.0705508133 17.2853030884 + 17.5027566145 17.7229453693 17.9459037576 18.1716666173 + 18.4002692241 18.6317472977 18.8661370071 19.1034749761 + 19.3437982892 19.5871444974 19.8335516242 20.0830581710 + 20.3357031239 20.5915259590 20.8505666493 21.1128656704 + 21.3784640069 21.6474031593 21.9197251498 22.1954725293 + 22.4746883838 22.7574163414 23.0437005789 23.3335858288 + 23.6271173862 23.9243411162 24.2253034604 24.5300514449 + 24.8386326872 25.1510954036 25.4674884172 25.7878611650 + 26.1122637059 26.4407467284 26.7733615587 27.1101601685 + 27.4511951833 27.7965198905 28.1461882478 28.5002548916 + 28.8587751455 29.2218050291 29.5894012664 29.9616212952 + 30.3385232756 30.7201660993 31.1066093988 31.4979135566 + 31.8941397147 32.2953497844 32.7016064555 33.1129732065 + 33.5295143142 33.9512948641 34.3783807601 34.8108387354 + 35.2487363624 35.6921420635 36.1411251217 36.5957556915 + 37.0561048099 37.5222444074 37.9942473193 38.4721872969 + 38.9561390193 39.4461781050 39.9423811236 40.4448256079 + 40.9535900657 41.4687539927 41.9903978841 42.5186032479 + 43.0534526173 43.5950295635 44.1434187092 44.6987057411 + 45.2609774241 45.8303216142 46.4068272725 46.9905844794 + 47.5816844480 48.1802195389 48.7862832745 49.3999703534 + 50.0213766654 50.6505993067 51.2877365944 51.9328880827 + 52.5861545776 53.2476381536 53.9174421686 54.5956712810 + 55.2824314654 55.9778300295 56.6819756307 57.3949782933 + 58.1169494253 58.8480018362 59.5882497544 60.3378088452 + 61.0967962287 61.8653304982 62.6435317388 63.4315215459 + 64.2294230447 65.0373609088 65.8554613802 66.6838522887 + 67.5226630722 68.3720247964 69.2320701759 70.1029335945 + 70.9847511265 71.8776605575 72.7818014065 73.6973149474 + 74.6243442310 75.5630341076 76.5135312492 77.4759841731 + 78.4505432644 79.4373608001 80.4365909723 81.4483899128 + 82.4729157172 83.5103284699 84.5607902685 85.6244652500 + 86.7015196157 87.7921216576 88.8964417844 90.0146525483 + 91.1469286722 92.2934470765 93.4543869069 94.6299295627 + 95.8202587249 97.0255603848 98.2460228731 99.4818368898 + 100.733195533 102.000294331 103.283331269 104.582506825 + 105.898023998 107.230088340 108.578907989 109.944693700 + 111.327658881 112.728019622 114.145994733 115.581805775 + 117.035677097 118.507835869 119.998512118 + Down Pseudopotential follows (l on next line) + 0 + -0.194762529562E-03 -0.391974870160E-03 -0.591667836617E-03 -0.793872631361E-03 + -0.998620849296E-03 -0.120594448274E-02 -0.141587592643E-02 -0.162844798257E-02 + -0.184369386597E-02 -0.206164720924E-02 -0.228234206800E-02 -0.250581292628E-02 + -0.273209470185E-02 -0.296122275167E-02 -0.319323287747E-02 -0.342816133128E-02 + -0.366604482114E-02 -0.390692051682E-02 -0.415082605562E-02 -0.439779954827E-02 + -0.464787958486E-02 -0.490110524088E-02 -0.515751608334E-02 -0.541715217695E-02 + -0.568005409035E-02 -0.594626290247E-02 -0.621582020897E-02 -0.648876812870E-02 + -0.676514931030E-02 -0.704500693888E-02 -0.732838474272E-02 -0.761532700016E-02 + -0.790587854648E-02 -0.820008478092E-02 -0.849799167377E-02 -0.879964577356E-02 + -0.910509421431E-02 -0.941438472292E-02 -0.972756562664E-02 -0.100446858606E-01 + -0.103657949753E-01 -0.106909431449E-01 -0.110201811742E-01 -0.113535605073E-01 + -0.116911332354E-01 -0.120329521049E-01 -0.123790705255E-01 -0.127295425790E-01 + -0.130844230272E-01 -0.134437673208E-01 -0.138076316081E-01 -0.141760727436E-01 + -0.145491482967E-01 -0.149269165614E-01 -0.153094365644E-01 -0.156967680753E-01 + -0.160889716154E-01 -0.164861084670E-01 -0.168882406836E-01 -0.172954310990E-01 + -0.177077433375E-01 -0.181252418235E-01 -0.185479917919E-01 -0.189760592981E-01 + -0.194095112284E-01 -0.198484153105E-01 -0.202928401237E-01 -0.207428551103E-01 + -0.211985305858E-01 -0.216599377502E-01 -0.221271486993E-01 -0.226002364354E-01 + -0.230792748793E-01 -0.235643388815E-01 -0.240555042341E-01 -0.245528476824E-01 + -0.250564469370E-01 -0.255663806862E-01 -0.260827286079E-01 -0.266055713821E-01 + -0.271349907039E-01 -0.276710692958E-01 -0.282138909209E-01 -0.287635403958E-01 + -0.293201036040E-01 -0.298836675093E-01 -0.304543201693E-01 -0.310321507493E-01 + -0.316172495360E-01 -0.322097079519E-01 -0.328096185693E-01 -0.334170751251E-01 + -0.340321725351E-01 -0.346550069089E-01 -0.352856755651E-01 -0.359242770464E-01 + -0.365709111350E-01 -0.372256788682E-01 -0.378886825541E-01 -0.385600257875E-01 + -0.392398134667E-01 -0.399281518089E-01 -0.406251483677E-01 -0.413309120494E-01 + -0.420455531300E-01 -0.427691832727E-01 -0.435019155454E-01 -0.442438644377E-01 + -0.449951458798E-01 -0.457558772597E-01 -0.465261774420E-01 -0.473061667866E-01 + -0.480959671669E-01 -0.488957019896E-01 -0.497054962133E-01 -0.505254763687E-01 + -0.513557705775E-01 -0.521965085735E-01 -0.530478217217E-01 -0.539098430398E-01 + -0.547827072184E-01 -0.556665506423E-01 -0.565615114116E-01 -0.574677293636E-01 + -0.583853460943E-01 -0.593145049806E-01 -0.602553512030E-01 -0.612080317677E-01 + -0.621726955301E-01 -0.631494932179E-01 -0.641385774545E-01 -0.651401027828E-01 + -0.661542256898E-01 -0.671811046303E-01 -0.682209000524E-01 -0.692737744221E-01 + -0.703398922486E-01 -0.714194201105E-01 -0.725125266812E-01 -0.736193827558E-01 + -0.747401612773E-01 -0.758750373639E-01 -0.770241883364E-01 -0.781877937454E-01 + -0.793660354000E-01 -0.805590973957E-01 -0.817671661434E-01 -0.829904303985E-01 + -0.842290812900E-01 -0.854833123510E-01 -0.867533195482E-01 -0.880393013131E-01 + -0.893414585725E-01 -0.906599947802E-01 -0.919951159485E-01 -0.933470306807E-01 + -0.947159502032E-01 -0.961020883988E-01 -0.975056618399E-01 -0.989268898224E-01 + -0.100365994400 -0.101823200419 -0.103298735551 -0.104792830335 + -0.106305718203 -0.107837635528 -0.109388821651 -0.110959518924 + -0.112549972747 -0.114160431605 -0.115791147105 -0.117442374021 + -0.119114370328 -0.120807397245 -0.122521719275 -0.124257604246 + -0.126015323354 -0.127795151202 -0.129597365848 -0.131422248843 + -0.133270085277 -0.135141163824 -0.137035776788 -0.138954220144 + -0.140896793589 -0.142863800586 -0.144855548410 -0.146872348199 + -0.148914515000 -0.150982367820 -0.153076229673 -0.155196427631 + -0.157343292876 -0.159517160749 -0.161718370805 -0.163947266863 + -0.166204197062 -0.168489513911 -0.170803574346 -0.173146739787 + -0.175519376190 -0.177921854106 -0.180354548738 -0.182817839999 + -0.185312112568 -0.187837755955 -0.190395164554 -0.192984737710 + -0.195606879776 -0.198262000178 -0.200950513476 -0.203672839428 + -0.206429403055 -0.209220634707 -0.212046970126 -0.214908850515 + -0.217806722603 -0.220741038718 -0.223712256850 -0.226720840723 + -0.229767259867 -0.232851989688 -0.235975511537 -0.239138312790 + -0.242340886912 -0.245583733541 -0.248867358556 -0.252192274155 + -0.255558998935 -0.258968057962 -0.262419982858 -0.265915311874 + -0.269454589971 -0.273038368901 -0.276667207291 -0.280341670720 + -0.284062331804 -0.287829770283 -0.291644573098 -0.295507334485 + -0.299418656053 -0.303379146874 -0.307389423570 -0.311450110401 + -0.315561839351 -0.319725250222 -0.323940990717 -0.328209716536 + -0.332532091465 -0.336908787466 -0.341340484768 -0.345827871964 + -0.350371646098 -0.354972512762 -0.359631186186 -0.364348389335 + -0.369124853999 -0.373961320892 -0.378858539738 -0.383817269375 + -0.388838277840 -0.393922342468 -0.399070249986 -0.404282796601 + -0.409560788098 -0.414905039931 -0.420316377315 -0.425795635314 + -0.431343658934 -0.436961303214 -0.442649433309 -0.448408924579 + -0.454240662674 -0.460145543617 -0.466124473889 -0.472178370500 + -0.478308161075 -0.484514783924 -0.490799188114 -0.497162333541 + -0.503605190988 -0.510128742196 -0.516733979917 -0.523421907964 + -0.530193541267 -0.537049905913 -0.543992039183 -0.551020989585 + -0.558137816883 -0.565343592111 -0.572639397588 -0.580026326919 + -0.587505484991 -0.595077987960 -0.602744963225 -0.610507549390 + -0.618366896224 -0.626324164598 -0.634380526413 -0.642537164515 + -0.650795272594 -0.659156055069 -0.667620726951 -0.676190513691 + -0.684866651009 -0.693650384702 -0.702542970427 -0.711545673465 + -0.720659768455 -0.729886539103 -0.739227277864 -0.748683285595 + -0.758255871165 -0.767946351046 -0.777756048857 -0.787686294872 + -0.797738425485 -0.807913782637 -0.818213713186 -0.828639568239 + -0.839192702424 -0.849874473107 -0.860686239555 -0.871629362029 + -0.882705200816 -0.893915115190 -0.905260462298 -0.916742595966 + -0.928362865421 -0.940122613932 -0.952023177348 -0.964065882543 + -0.976252045755 -0.988582970817 -1.00105994727 -1.01368424835 + -1.02645712885 -1.03937982286 -1.05245354131 -1.06567946944 + -1.07905876404 -1.09259255057 -1.10628192006 -1.12012792586 + -1.13413158017 -1.14829385038 -1.16261565520 -1.17709786051 + -1.19174127502 -1.20654664569 -1.22151465286 -1.23664590505 + -1.25194093363 -1.26740018699 -1.28302402455 -1.29881271035 + -1.31476640633 -1.33088516528 -1.34716892330 -1.36361749204 + -1.38023055036 -1.39700763571 -1.41394813495 -1.43105127484 + -1.44831611191 -1.46574152198 -1.48332618906 -1.50106859384 + -1.51896700151 -1.53701944917 -1.55522373251 -1.57357739208 + -1.59207769880 -1.61072163897 -1.62950589859 -1.64842684709 + -1.66748052042 -1.68666260343 -1.70596841165 -1.72539287244 + -1.74493050538 -1.76457540215 -1.78432120562 -1.80416108844 + -1.82408773091 -1.84409329832 -1.86416941769 -1.88430715400 + -1.90449698587 -1.92472878086 -1.94499177033 -1.96527452397 + -1.98556492413 -2.00585013987 -2.02611660103 -2.04634997233 + -2.06653512754 -2.08665612400 -2.10669617764 -2.12663763848 + -2.14646196701 -2.16614971161 -2.18568048708 -2.20503295477 + -2.22418480441 -2.24311273792 -2.26179245573 -2.28019864564 + -2.29830497488 -2.31608408563 -2.33350759440 -2.35054609586 + -2.36716917152 -2.38334540376 -2.39904239592 -2.41422679881 + -2.42886434452 -2.44291988792 -2.45635745680 -2.46914031110 + -2.48123101224 -2.49259150308 -2.50318319943 -2.51296709391 + -2.52190387294 -2.52995404775 -2.53707810010 -2.54323664379 + -2.54839060250 -2.55250140496 -2.55553119804 -2.55744307860 + -2.55820134465 -2.55777176648 -2.55612187808 -2.55322128934 + -2.54904201922 -2.54355884980 -2.53674970129 -2.52859602746 + -2.51908323087 -2.50820109716 -2.49594424696 -2.48231260388 + -2.46731187667 -2.45095405283 -2.43325790086 -2.41424947744 + -2.39396263533 -2.37243952709 -2.34973109881 -2.32589756734 + -2.30100887342 -2.27514510226 -2.24839686178 -2.22086560771 + -2.19266390333 -2.16391560019 -2.13475592487 -2.10533145483 + -2.07579996517 -2.04633012619 -2.01710102967 -1.98830152040 + -1.96012930749 -1.93278982840 -1.90649483737 -1.88146068872 + -1.85790628503 -1.83605066032 -1.81611016941 -1.79829525701 + -1.78280678442 -1.76983189745 -1.75953942893 -1.75207484099 + -1.74755473005 -1.74606093907 -1.74763435140 -1.75226847712 + -1.75990299000 -1.77041743150 -1.78362537071 -1.79926939758 + -1.81701743465 -1.83646098262 -1.85711607103 -1.87842787192 + -1.89978015569 -1.92051103067 -1.93993671843 -1.95738548285 + -1.97224426393 -1.98402107934 -1.99242686316 -1.99748113219 + -1.99967284813 -1.99999990846 -2.00000001587 -2.00000001441 + -2.00000001306 -2.00000001183 -2.00000001069 -2.00000000965 + -2.00000000870 -2.00000000783 -2.00000000704 -2.00000000632 + -2.00000000567 -2.00000000507 -2.00000000453 -2.00000000404 + -2.00000000360 -2.00000000320 -2.00000000284 -2.00000000252 + -2.00000000223 -2.00000000197 -2.00000000174 -2.00000000153 + -2.00000000134 -2.00000000118 -2.00000000103 -2.00000000090 + -2.00000000079 -2.00000000069 -2.00000000060 -2.00000000052 + -2.00000000045 -2.00000000039 -2.00000000034 -2.00000000029 + -2.00000000025 -2.00000000022 -2.00000000019 -2.00000000016 + -2.00000000014 -2.00000000012 -2.00000000010 -2.00000000009 + -2.00000000007 -2.00000000006 -2.00000000005 -2.00000000005 + -2.00000000004 -2.00000000003 -2.00000000003 -2.00000000002 + -2.00000000002 -2.00000000002 -2.00000000002 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 + Down Pseudopotential follows (l on next line) + 1 + -0.136130541247E-03 -0.273973393905E-03 -0.413550096195E-03 -0.554882457257E-03 + -0.697992560553E-03 -0.842902767322E-03 -0.989635720071E-03 -0.113821434612E-02 + -0.128866186116E-02 -0.144100177293E-02 -0.159525788484E-02 -0.175145429970E-02 + -0.190961542352E-02 -0.206976596928E-02 -0.223193096083E-02 -0.239613573675E-02 + -0.256240595437E-02 -0.273076759373E-02 -0.290124696167E-02 -0.307387069592E-02 + -0.324866576928E-02 -0.342565949381E-02 -0.360487952514E-02 -0.378635386672E-02 + -0.397011087429E-02 -0.415617926022E-02 -0.434458809806E-02 -0.453536682705E-02 + -0.472854525673E-02 -0.492415357160E-02 -0.512222233583E-02 -0.532278249803E-02 + -0.552586539612E-02 -0.573150276218E-02 -0.593972672744E-02 -0.615056982727E-02 + -0.636406500630E-02 -0.658024562356E-02 -0.679914545767E-02 -0.702079871212E-02 + -0.724524002065E-02 -0.747250445263E-02 -0.770262751853E-02 -0.793564517550E-02 + -0.817159383298E-02 -0.841051035836E-02 -0.865243208278E-02 -0.889739680695E-02 + -0.914544280703E-02 -0.939660884066E-02 -0.965093415295E-02 -0.990845848270E-02 + -0.101692220685E-01 -0.104332656552E-01 -0.107006304999E-01 -0.109713583790E-01 + -0.112454915941E-01 -0.115230729789E-01 -0.118041459061E-01 -0.120887542937E-01 + -0.123769426123E-01 -0.126687558918E-01 -0.129642397284E-01 -0.132634402921E-01 + -0.135664043333E-01 -0.138731791906E-01 -0.141838127982E-01 -0.144983536930E-01 + -0.148168510225E-01 -0.151393545523E-01 -0.154659146743E-01 -0.157965824137E-01 + -0.161314094381E-01 -0.164704480645E-01 -0.168137512682E-01 -0.171613726910E-01 + -0.175133666490E-01 -0.178697881418E-01 -0.182306928608E-01 -0.185961371978E-01 + -0.189661782539E-01 -0.193408738486E-01 -0.197202825284E-01 -0.201044635766E-01 + -0.204934770217E-01 -0.208873836477E-01 -0.212862450029E-01 -0.216901234098E-01 + -0.220990819748E-01 -0.225131845983E-01 -0.229324959841E-01 -0.233570816500E-01 + -0.237870079380E-01 -0.242223420245E-01 -0.246631519308E-01 -0.251095065338E-01 + -0.255614755768E-01 -0.260191296803E-01 -0.264825403532E-01 -0.269517800036E-01 + -0.274269219506E-01 -0.279080404354E-01 -0.283952106331E-01 -0.288885086641E-01 + -0.293880116067E-01 -0.298937975082E-01 -0.304059453981E-01 -0.309245352995E-01 + -0.314496482423E-01 -0.319813662754E-01 -0.325197724800E-01 -0.330649509819E-01 + -0.336169869655E-01 -0.341759666862E-01 -0.347419774846E-01 -0.353151077998E-01 + -0.358954471834E-01 -0.364830863130E-01 -0.370781170071E-01 -0.376806322391E-01 + -0.382907261514E-01 -0.389084940711E-01 -0.395340325237E-01 -0.401674392493E-01 + -0.408088132170E-01 -0.414582546408E-01 -0.421158649954E-01 -0.427817470314E-01 + -0.434560047922E-01 -0.441387436294E-01 -0.448300702201E-01 -0.455300925827E-01 + -0.462389200946E-01 -0.469566635088E-01 -0.476834349710E-01 -0.484193480379E-01 + -0.491645176940E-01 -0.499190603703E-01 -0.506830939621E-01 -0.514567378475E-01 + -0.522401129060E-01 -0.530333415376E-01 -0.538365476815E-01 -0.546498568360E-01 + -0.554733960775E-01 -0.563072940808E-01 -0.571516811391E-01 -0.580066891842E-01 + -0.588724518072E-01 -0.597491042793E-01 -0.606367835730E-01 -0.615356283836E-01 + -0.624457791506E-01 -0.633673780796E-01 -0.643005691648E-01 -0.652454982114E-01 + -0.662023128582E-01 -0.671711626006E-01 -0.681521988143E-01 -0.691455747785E-01 + -0.701514457002E-01 -0.711699687382E-01 -0.722013030276E-01 -0.732456097049E-01 + -0.743030519326E-01 -0.753737949255E-01 -0.764580059756E-01 -0.775558544788E-01 + -0.786675119613E-01 -0.797931521058E-01 -0.809329507793E-01 -0.820870860603E-01 + -0.832557382661E-01 -0.844390899817E-01 -0.856373260878E-01 -0.868506337897E-01 + -0.880792026466E-01 -0.893232246011E-01 -0.905828940088E-01 -0.918584076694E-01 + -0.931499648565E-01 -0.944577673492E-01 -0.957820194633E-01 -0.971229280832E-01 + -0.984807026942E-01 -0.998555554151E-01 -0.101247701031 -0.102657357027 + -0.104084743623 -0.105530083805 -0.106993603363 -0.108475530926 + -0.109976097993 -0.111495538978 -0.113034091235 -0.114591995105 + -0.116169493948 -0.117766834181 -0.119384265320 -0.121022040013 + -0.122680414083 -0.124359646570 -0.126059999764 -0.127781739253 + -0.129525133958 -0.131290456182 -0.133077981645 -0.134887989530 + -0.136720762526 -0.138576586873 -0.140455752403 -0.142358552587 + -0.144285284582 -0.146236249272 -0.148211751321 -0.150212099212 + -0.152237605304 -0.154288585871 -0.156365361155 -0.158468255419 + -0.160597596988 -0.162753718307 -0.164936955990 -0.167147650867 + -0.169386148044 -0.171652796951 -0.173947951396 -0.176271969619 + -0.178625214346 -0.181008052849 -0.183420856993 -0.185864003302 + -0.188337873009 -0.190842852117 -0.193379331458 -0.195947706749 + -0.198548378654 -0.201181752845 -0.203848240061 -0.206548256169 + -0.209282222228 -0.212050564552 -0.214853714772 -0.217692109900 + -0.220566192396 -0.223476410229 -0.226423216949 -0.229407071748 + -0.232428439529 -0.235487790977 -0.238585602620 -0.241722356908 + -0.244898542271 -0.248114653200 -0.251371190309 -0.254668660413 + -0.258007576595 -0.261388458279 -0.264811831304 -0.268278227998 + -0.271788187249 -0.275342254579 -0.278940982222 -0.282584929195 + -0.286274661374 -0.290010751570 -0.293793779606 -0.297624332390 + -0.301503003992 -0.305430395720 -0.309407116200 -0.313433781445 + -0.317511014937 -0.321639447701 -0.325819718382 -0.330052473318 + -0.334338366620 -0.338678060242 -0.343072224059 -0.347521535938 + -0.352026681815 -0.356588355764 -0.361207260069 -0.365884105297 + -0.370619610363 -0.375414502603 -0.380269517833 -0.385185400424 + -0.390162903355 -0.395202788280 -0.400305825584 -0.405472794442 + -0.410704482868 -0.416001687772 -0.421365215003 -0.426795879392 + -0.432294504799 -0.437861924142 -0.443498979436 -0.449206521813 + -0.454985411553 -0.460836518092 -0.466760720040 -0.472758905183 + -0.478831970478 -0.484980822051 -0.491206375171 -0.497509554231 + -0.503891292711 -0.510352533132 -0.516894227005 -0.523517334760 + -0.530222825677 -0.537011677785 -0.543884877768 -0.550843420841 + -0.557888310622 -0.565020558976 -0.572241185853 -0.579551219101 + -0.586951694262 -0.594443654341 -0.602028149565 -0.609706237103 + -0.617478980774 -0.625347450718 -0.633312723047 -0.641375879459 + -0.649538006823 -0.657800196730 -0.666163545004 -0.674629151185 + -0.683198117955 -0.691871550535 -0.700650556032 -0.709536242734 + -0.718529719356 -0.727632094237 -0.736844474470 -0.746167964978 + -0.755603667527 -0.765152679665 -0.774816093594 -0.784594994967 + -0.794490461602 -0.804503562116 -0.814635354466 -0.824886884397 + -0.835259183800 -0.845753268950 -0.856370138650 -0.867110772254 + -0.877976127565 -0.888967138614 -0.900084713300 -0.911329730890 + -0.922703039374 -0.934205452663 -0.945837747629 -0.957600660968 + -0.969494885896 -0.981521068645 -0.993679804780 -1.00597163530 + -1.01839704253 -1.03095644580 -1.04365019689 -1.05647857521 + -1.06944178278 -1.08253993888 -1.09577307453 -1.10914112656 + -1.12264393152 -1.13628121920 -1.15005260587 -1.16395758719 + -1.17799553081 -1.19216566863 -1.20646708864 -1.22089872654 + -1.23545935684 -1.25014758369 -1.26496183131 -1.27990033396 + -1.29496112564 -1.31014202931 -1.32544064568 -1.34085434172 + -1.35638023865 -1.37201519959 -1.38775581681 -1.40359839862 + -1.41953895579 -1.43557318777 -1.45169646838 -1.46790383135 + -1.48418995542 -1.50054914928 -1.51697533619 -1.53346203845 + -1.55000236173 -1.56658897928 -1.58321411610 -1.59986953318 + -1.61654651181 -1.63323583811 -1.64992778781 -1.66661211148 + -1.68327802026 -1.69991417217 -1.71650865927 -1.73304899575 + -1.74952210710 -1.76591432056 -1.78221135711 -1.79839832514 + -1.81445971605 -1.83037940206 -1.84614063652 -1.86172605688 + -1.87711769085 -1.89229696586 -1.90724472234 -1.92194123103 + -1.93636621491 -1.95049887596 -1.96431792731 -1.97780163116 + -1.99092784300 -2.00367406251 -2.01601749173 -2.02793510095 + -2.03940370278 -2.05040003501 -2.06090085266 -2.07088302977 + -2.08032367139 -2.08920023617 -2.09749067004 -2.10517355129 + -2.11222824732 -2.11863508341 -2.12437552349 -2.12943236308 + -2.13378993425 -2.13743432227 -2.14035359367 -2.14253803497 + -2.14398040128 -2.14467617353 -2.14462382298 -2.14382508123 + -2.14228521337 -2.14001329189 -2.13702246807 -2.13333023718 + -2.12895869340 -2.12393476939 -2.11829045502 -2.11206298885 + -2.10529501515 -2.09803469854 -2.09033578715 -2.08225761461 + -2.07386502991 -2.06522824351 -2.05642257719 -2.04752810398 + -2.03862916446 -2.02981374473 -2.02117270151 -2.01279881991 + -2.00478569029 -1.99722639192 -1.99021197376 -1.98382972566 + -1.97816123883 -1.97328026028 -1.96925035553 -1.96612240480 + -1.96393197306 -1.96269661302 -1.96241318385 -1.96305529778 + -1.96457104347 -1.96688117982 -1.96987804864 -1.97342552174 + -1.97736037848 -1.98149560791 -1.98562624689 -1.98953850677 + -1.99302311021 -1.99589396179 -1.99801351736 -1.99937570793 + -1.99991758633 -2.00000016366 -2.00000001471 -2.00000001335 + -2.00000001211 -2.00000001096 -2.00000000991 -2.00000000895 + -2.00000000807 -2.00000000726 -2.00000000653 -2.00000000586 + -2.00000000525 -2.00000000470 -2.00000000420 -2.00000000375 + -2.00000000334 -2.00000000297 -2.00000000263 -2.00000000234 + -2.00000000207 -2.00000000183 -2.00000000161 -2.00000000142 + -2.00000000125 -2.00000000109 -2.00000000096 -2.00000000084 + -2.00000000073 -2.00000000064 -2.00000000056 -2.00000000048 + -2.00000000042 -2.00000000036 -2.00000000031 -2.00000000027 + -2.00000000023 -2.00000000020 -2.00000000017 -2.00000000015 + -2.00000000013 -2.00000000011 -2.00000000009 -2.00000000008 + -2.00000000007 -2.00000000006 -2.00000000005 -2.00000000004 + -2.00000000004 -2.00000000003 -2.00000000003 -2.00000000002 + -2.00000000002 -2.00000000002 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 + Down Pseudopotential follows (l on next line) + 2 + -0.119484445649E-03 -0.240471820603E-03 -0.362981029380E-03 -0.487031214288E-03 + -0.612641758414E-03 -0.739832288657E-03 -0.868622678788E-03 -0.999033052560E-03 + -0.113108378685E-02 -0.126479551485E-02 -0.140018912928E-02 -0.153728578566E-02 + -0.167610690561E-02 -0.181667418020E-02 -0.195900957334E-02 -0.210313532521E-02 + -0.224907395576E-02 -0.239684826816E-02 -0.254648135245E-02 -0.269799658908E-02 + -0.285141765260E-02 -0.300676851535E-02 -0.316407345120E-02 -0.332335703935E-02 + -0.348464416816E-02 -0.364796003906E-02 -0.381333017046E-02 -0.398078040175E-02 + -0.415033689736E-02 -0.432202615081E-02 -0.449587498886E-02 -0.467191057572E-02 + -0.485016041728E-02 -0.503065236541E-02 -0.521341462232E-02 -0.539847574493E-02 + -0.558586464941E-02 -0.577561061559E-02 -0.596774329165E-02 -0.616229269866E-02 + -0.635928923531E-02 -0.655876368268E-02 -0.676074720899E-02 -0.696527137455E-02 + -0.717236813661E-02 -0.738206985440E-02 -0.759440929420E-02 -0.780941963441E-02 + -0.802713447077E-02 -0.824758782160E-02 -0.847081413312E-02 -0.869684828482E-02 + -0.892572559491E-02 -0.915748182587E-02 -0.939215318999E-02 -0.962977635507E-02 + -0.987038845011E-02 -0.101140270712E-01 -0.103607302871E-01 -0.106105366458E-01 + -0.108634851798E-01 -0.111196154128E-01 -0.113789673655E-01 -0.116415815620E-01 + -0.119074990363E-01 -0.121767613383E-01 -0.124494105407E-01 -0.127254892452E-01 + -0.130050405897E-01 -0.132881082545E-01 -0.135747364691E-01 -0.138649700198E-01 + -0.141588542559E-01 -0.144564350972E-01 -0.147577590412E-01 -0.150628731700E-01 + -0.153718251582E-01 -0.156846632800E-01 -0.160014364166E-01 -0.163221940643E-01 + -0.166469863418E-01 -0.169758639983E-01 -0.173088784214E-01 -0.176460816449E-01 + -0.179875263572E-01 -0.183332659094E-01 -0.186833543236E-01 -0.190378463016E-01 + -0.193967972330E-01 -0.197602632042E-01 -0.201283010073E-01 -0.205009681483E-01 + -0.208783228569E-01 -0.212604240950E-01 -0.216473315662E-01 -0.220391057252E-01 + -0.224358077868E-01 -0.228374997361E-01 -0.232442443376E-01 -0.236561051455E-01 + -0.240731465132E-01 -0.244954336036E-01 -0.249230323992E-01 -0.253560097126E-01 + -0.257944331965E-01 -0.262383713548E-01 -0.266878935528E-01 -0.271430700285E-01 + -0.276039719033E-01 -0.280706711931E-01 -0.285432408197E-01 -0.290217546219E-01 + -0.295062873676E-01 -0.299969147649E-01 -0.304937134741E-01 -0.309967611199E-01 + -0.315061363032E-01 -0.320219186137E-01 -0.325441886421E-01 -0.330730279926E-01 + -0.336085192961E-01 -0.341507462225E-01 -0.346997934944E-01 -0.352557468998E-01 + -0.358186933059E-01 -0.363887206722E-01 -0.369659180649E-01 -0.375503756702E-01 + -0.381421848086E-01 -0.387414379495E-01 -0.393482287250E-01 -0.399626519450E-01 + -0.405848036120E-01 -0.412147809358E-01 -0.418526823489E-01 -0.424986075219E-01 + -0.431526573789E-01 -0.438149341134E-01 -0.444855412044E-01 -0.451645834321E-01 + -0.458521668947E-01 -0.465483990248E-01 -0.472533886062E-01 -0.479672457910E-01 + -0.486900821165E-01 -0.494220105230E-01 -0.501631453711E-01 -0.509136024598E-01 + -0.516734990445E-01 -0.524429538552E-01 -0.532220871152E-01 -0.540110205600E-01 + -0.548098774559E-01 -0.556187826195E-01 -0.564378624371E-01 -0.572672448849E-01 + -0.581070595480E-01 -0.589574376416E-01 -0.598185120310E-01 -0.606904172524E-01 + -0.615732895340E-01 -0.624672668170E-01 -0.633724887777E-01 -0.642890968486E-01 + -0.652172342410E-01 -0.661570459671E-01 -0.671086788627E-01 -0.680722816102E-01 + -0.690480047616E-01 -0.700360007622E-01 -0.710364239741E-01 -0.720494307008E-01 + -0.730751792110E-01 -0.741138297636E-01 -0.751655446329E-01 -0.762304881333E-01 + -0.773088266455E-01 -0.784007286424E-01 -0.795063647149E-01 -0.806259075991E-01 + -0.817595322027E-01 -0.829074156327E-01 -0.840697372229E-01 -0.852466785616E-01 + -0.864384235202E-01 -0.876451582818E-01 -0.888670713701E-01 -0.901043536789E-01 + -0.913571985016E-01 -0.926258015616E-01 -0.939103610428E-01 -0.952110776201E-01 + -0.965281544910E-01 -0.978617974071E-01 -0.992122147061E-01 -0.100579617344 + -0.101964218929 -0.103366235753 -0.104785886827 -0.106223393913 + -0.107678981560 -0.109152877141 -0.110645310884 -0.112156515908 + -0.113686728265 -0.115236186970 -0.116805134040 -0.118393814536 + -0.120002476593 -0.121631371466 -0.123280753563 -0.124950880489 + -0.126642013083 -0.128354415460 -0.130088355052 -0.131844102646 + -0.133621932432 -0.135422122038 -0.137244952581 -0.139090708702 + -0.140959678617 -0.142852154157 -0.144768430815 -0.146708807790 + -0.148673588036 -0.150663078303 -0.152677589191 -0.154717435192 + -0.156782934743 -0.158874410270 -0.160992188240 -0.163136599211 + -0.165307977882 -0.167506663144 -0.169732998132 -0.171987330276 + -0.174270011355 -0.176581397552 -0.178921849503 -0.181291732356 + -0.183691415825 -0.186121274247 -0.188581686633 -0.191073036733 + -0.193595713087 -0.196150109087 -0.198736623031 -0.201355658191 + -0.204007622862 -0.206692930433 -0.209411999439 -0.212165253630 + -0.214953122028 -0.217776038993 -0.220634444285 -0.223528783130 + -0.226459506281 -0.229427070086 -0.232431936552 -0.235474573413 + -0.238555454195 -0.241675058284 -0.244833870992 -0.248032383630 + -0.251271093569 -0.254550504316 -0.257871125580 -0.261233473341 + -0.264638069924 -0.268085444066 -0.271576130987 -0.275110672463 + -0.278689616898 -0.282313519390 -0.285982941810 -0.289698452870 + -0.293460628193 -0.297270050389 -0.301127309124 -0.305033001194 + -0.308987730593 -0.312992108588 -0.317046753787 -0.321152292212 + -0.325309357368 -0.329518590312 -0.333780639723 -0.338096161968 + -0.342465821172 -0.346890289283 -0.351370246136 -0.355906379518 + -0.360499385230 -0.365149967147 -0.369858837278 -0.374626715825 + -0.379454331232 -0.384342420245 -0.389291727957 -0.394303007858 + -0.399377021878 -0.404514540430 -0.409716342444 -0.414983215407 + -0.420315955386 -0.425715367058 -0.431182263729 -0.436717467347 + -0.442321808516 -0.447996126498 -0.453741269207 -0.459558093205 + -0.465447463681 -0.471410254426 -0.477447347801 -0.483559634696 + -0.489748014473 -0.496013394905 -0.502356692105 -0.508778830435 + -0.515280742411 -0.521863368590 -0.528527657443 -0.535274565213 + -0.542105055756 -0.549020100366 -0.556020677581 -0.563107772966 + -0.570282378881 -0.577545494219 -0.584898124132 -0.592341279713 + -0.599875977674 -0.607503239975 -0.615224093436 -0.623039569313 + -0.630950702837 -0.638958532721 -0.647064100629 -0.655268450598 + -0.663572628430 -0.671977681023 -0.680484655667 -0.689094599283 + -0.697808557608 -0.706627574327 -0.715552690144 -0.724584941786 + -0.733725360943 -0.742974973143 -0.752334796541 -0.761805840640 + -0.771389104926 -0.781085577414 -0.790896233103 -0.800822032341 + -0.810863919077 -0.821022819017 -0.831299637665 -0.841695258242 + -0.852210539484 -0.862846313316 -0.873603382382 -0.884482517437 + -0.895484454587 -0.906609892376 -0.917859488710 -0.929233857606 + -0.940733565768 -0.952359128972 -0.964111008263 -0.975989605944 + -0.987995261361 -1.00012824646 -1.01238876113 -1.02477692831 + -1.03729278881 -1.04993629596 -1.06270730993 -1.07560559180 + -1.08863079736 -1.10178247062 -1.11506003702 -1.12846279632 + -1.14198991527 -1.15564041981 -1.16941318711 -1.18330693716 + -1.19732022411 -1.21145142723 -1.22569874156 -1.24006016818 + -1.25453350421 -1.26911633242 -1.28380601051 -1.29859966013 + -1.31349415547 -1.32848611167 -1.34357187284 -1.35874749986 + -1.37400875793 -1.38935110383 -1.40476967306 -1.42025926679 + -1.43581433862 -1.45142898139 -1.46709691381 -1.48281146722 + -1.49856557242 -1.51435174663 -1.53016208071 -1.54598822674 + -1.56182138598 -1.57765229742 -1.59347122692 -1.60926795726 + -1.62503177897 -1.64075148236 -1.65641535078 -1.67201115531 + -1.68752615108 -1.70294707548 -1.71826014841 -1.73345107488 + -1.74850505017 -1.76340676790 -1.77814043122 -1.79268976745 + -1.80703804660 -1.82116810389 -1.83506236690 -1.84870288752 + -1.86207137909 -1.87514925930 -1.88791769902 -1.90035767758 + -1.91245004495 -1.92417559110 -1.93551512300 -1.94644954962 + -1.95695997528 -1.96702780173 -1.97663483902 -1.98576342576 + -1.99439655853 -2.00251803085 -2.01011258144 -2.01716605191 + -2.02366555334 -2.02959964160 -2.03495850066 -2.03973413318 + -2.04392055727 -2.04751400830 -2.05051314393 -2.05291925071 + -2.05473644972 -2.05597189871 -2.05663598747 -2.05674252293 + -2.05630889960 -2.05535625082 -2.05390957528 -2.05199783293 + -2.04965400362 -2.04691510106 -2.04382213423 -2.04042000767 + -2.03675735125 -2.03288627011 -2.02886200443 -2.02474248914 + -2.02058780338 -2.01645950029 -2.01241980842 -2.00853069774 + -2.00485280558 -2.00144422086 -1.99835912979 -1.99564633185 + -1.99334764297 -1.99149621264 -1.99011479470 -1.98921402759 + -1.98879080005 -1.98882680336 -1.98928740206 -1.99012099306 + -1.99125906914 -1.99261725937 -1.99409768678 -1.99559306622 + -1.99699306407 -1.99819356069 -1.99917387050 -1.99973594752 + -1.99996465494 -2.00000014812 -2.00000001365 -2.00000001239 + -2.00000001123 -2.00000001017 -2.00000000920 -2.00000000830 + -2.00000000748 -2.00000000674 -2.00000000606 -2.00000000544 + -2.00000000487 -2.00000000436 -2.00000000390 -2.00000000348 + -2.00000000310 -2.00000000275 -2.00000000244 -2.00000000217 + -2.00000000192 -2.00000000169 -2.00000000149 -2.00000000132 + -2.00000000116 -2.00000000102 -2.00000000089 -2.00000000078 + -2.00000000068 -2.00000000059 -2.00000000052 -2.00000000045 + -2.00000000039 -2.00000000034 -2.00000000029 -2.00000000025 + -2.00000000022 -2.00000000019 -2.00000000016 -2.00000000014 + -2.00000000012 -2.00000000010 -2.00000000009 -2.00000000007 + -2.00000000006 -2.00000000005 -2.00000000005 -2.00000000004 + -2.00000000003 -2.00000000003 -2.00000000002 -2.00000000002 + -2.00000000002 -2.00000000002 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 + Down Pseudopotential follows (l on next line) + 3 + -0.111619570255E-03 -0.224643141861E-03 -0.339088374976E-03 -0.454973151894E-03 + -0.572315579843E-03 -0.691133993809E-03 -0.811446959404E-03 -0.933273275767E-03 + -0.105663197850E-02 -0.118154234264E-02 -0.130802388569E-02 -0.143609637062E-02 + -0.156577980902E-02 -0.169709446418E-02 -0.183006085426E-02 -0.196469975553E-02 + -0.210103220557E-02 -0.223907950660E-02 -0.237886322878E-02 -0.252040521357E-02 + -0.266372757718E-02 -0.280885271402E-02 -0.295580330017E-02 -0.310460229692E-02 + -0.325527295441E-02 -0.340783881522E-02 -0.356232371804E-02 -0.371875180145E-02 + -0.387714750761E-02 -0.403753558616E-02 -0.419994109803E-02 -0.436438941940E-02 + -0.453090624560E-02 -0.469951759521E-02 -0.487024981407E-02 -0.504312957938E-02 + -0.521818390394E-02 -0.539544014029E-02 -0.557492598506E-02 -0.575666948322E-02 + -0.594069903252E-02 -0.612704338791E-02 -0.631573166603E-02 -0.650679334976E-02 + -0.670025829281E-02 -0.689615672443E-02 -0.709451925408E-02 -0.729537687626E-02 + -0.749876097531E-02 -0.770470333035E-02 -0.791323612021E-02 -0.812439192851E-02 + -0.833820374869E-02 -0.855470498920E-02 -0.877392947871E-02 -0.899591147142E-02 + -0.922068565236E-02 -0.944828714288E-02 -0.967875150605E-02 -0.991211475231E-02 + -0.101484133450E-01 -0.103876842062E-01 -0.106299647223E-01 -0.108752927501E-01 + -0.111237066223E-01 -0.113752451541E-01 -0.116299476486E-01 -0.118878539036E-01 + -0.121490042172E-01 -0.124134393946E-01 -0.126812007541E-01 -0.129523301337E-01 + -0.132268698979E-01 -0.135048629439E-01 -0.137863527083E-01 -0.140713831744E-01 + -0.143599988785E-01 -0.146522449172E-01 -0.149481669543E-01 -0.152478112279E-01 + -0.155512245578E-01 -0.158584543526E-01 -0.161695486175E-01 -0.164845559611E-01 + -0.168035256038E-01 -0.171265073848E-01 -0.174535517704E-01 -0.177847098615E-01 + -0.181200334019E-01 -0.184595747863E-01 -0.188033870682E-01 -0.191515239686E-01 + -0.195040398841E-01 -0.198609898957E-01 -0.202224297770E-01 -0.205884160032E-01 + -0.209590057599E-01 -0.213342569519E-01 -0.217142282126E-01 -0.220989789124E-01 + -0.224885691690E-01 -0.228830598559E-01 -0.232825126124E-01 -0.236869898532E-01 + -0.240965547779E-01 -0.245112713811E-01 -0.249312044622E-01 -0.253564196360E-01 + -0.257869833422E-01 -0.262229628564E-01 -0.266644263003E-01 -0.271114426525E-01 + -0.275640817593E-01 -0.280224143453E-01 -0.284865120247E-01 -0.289564473127E-01 + -0.294322936364E-01 -0.299141253464E-01 -0.304020177286E-01 -0.308960470158E-01 + -0.313962903996E-01 -0.319028260427E-01 -0.324157330906E-01 -0.329350916844E-01 + -0.334609829734E-01 -0.339934891272E-01 -0.345326933492E-01 -0.350786798893E-01 + -0.356315340568E-01 -0.361913422343E-01 -0.367581918907E-01 -0.373321715951E-01 + -0.379133710307E-01 -0.385018810084E-01 -0.390977934815E-01 -0.397012015599E-01 + -0.403121995243E-01 -0.409308828416E-01 -0.415573481790E-01 -0.421916934198E-01 + -0.428340176783E-01 -0.434844213155E-01 -0.441430059545E-01 -0.448098744967E-01 + -0.454851311374E-01 -0.461688813828E-01 -0.468612320656E-01 -0.475622913626E-01 + -0.482721688109E-01 -0.489909753250E-01 -0.497188232148E-01 -0.504558262024E-01 + -0.512020994403E-01 -0.519577595292E-01 -0.527229245360E-01 -0.534977140129E-01 + -0.542822490153E-01 -0.550766521212E-01 -0.558810474501E-01 -0.566955606825E-01 + -0.575203190796E-01 -0.583554515028E-01 -0.592010884341E-01 -0.600573619966E-01 + -0.609244059749E-01 -0.618023558359E-01 -0.626913487502E-01 -0.635915236132E-01 + -0.645030210674E-01 -0.654259835234E-01 -0.663605551829E-01 -0.673068820609E-01 + -0.682651120086E-01 -0.692353947361E-01 -0.702178818365E-01 -0.712127268086E-01 + -0.722200850818E-01 -0.732401140395E-01 -0.742729730443E-01 -0.753188234625E-01 + -0.763778286893E-01 -0.774501541744E-01 -0.785359674477E-01 -0.796354381455E-01 + -0.807487380368E-01 -0.818760410502E-01 -0.830175233011E-01 -0.841733631190E-01 + -0.853437410751E-01 -0.865288400109E-01 -0.877288450664E-01 -0.889439437088E-01 + -0.901743257622E-01 -0.914201834365E-01 -0.926817113579E-01 -0.939591065989E-01 + -0.952525687090E-01 -0.965622997459E-01 -0.978885043067E-01 -0.992313895600E-01 + -0.100591165278 -0.101968043869 -0.103362240410 -0.104773972683 + -0.106203461203 -0.107650929259 -0.109116602943 -0.110600711189 + -0.112103485807 -0.113625161518 -0.115165975994 -0.116726169889 + -0.118305986882 -0.119905673712 -0.121525480217 -0.123165659371 + -0.124826467326 -0.126508163450 -0.128211010366 -0.129935273994 + -0.131681223595 -0.133449131805 -0.135239274685 -0.137051931759 + -0.138887386058 -0.140745924164 -0.142627836255 -0.144533416147 + -0.146462961342 -0.148416773073 -0.150395156347 -0.152398419999 + -0.154426876730 -0.156480843163 -0.158560639888 -0.160666591508 + -0.162799026694 -0.164958278234 -0.167144683079 -0.169358582400 + -0.171600321636 -0.173870250548 -0.176168723273 -0.178496098373 + -0.180852738895 -0.183239012423 -0.185655291130 -0.188101951841 + -0.190579376082 -0.193087950142 -0.195628065130 -0.198200117030 + -0.200804506763 -0.203441640245 -0.206111928447 -0.208815787455 + -0.211553638534 -0.214325908183 -0.217133028204 -0.219975435763 + -0.222853573449 -0.225767889343 -0.228718837079 -0.231706875911 + -0.234732470777 -0.237796092365 -0.240898217178 -0.244039327604 + -0.247219911978 -0.250440464655 -0.253701486075 -0.257003482830 + -0.260346967736 -0.263732459898 -0.267160484785 -0.270631574291 + -0.274146266813 -0.277705107316 -0.281308647404 -0.284957445390 + -0.288652066366 -0.292393082274 -0.296181071975 -0.300016621320 + -0.303900323215 -0.307832777700 -0.311814592006 -0.315846380634 + -0.319928765417 -0.324062375588 -0.328247847851 -0.332485826441 + -0.336776963195 -0.341121917609 -0.345521356908 -0.349975956103 + -0.354486398054 -0.359053373524 -0.363677581240 -0.368359727948 + -0.373100528462 -0.377900705715 -0.382760990810 -0.387682123063 + -0.392664850043 -0.397709927613 -0.402818119964 -0.407990199646 + -0.413226947598 -0.418529153164 -0.423897614118 -0.429333136672 + -0.434836535483 -0.440408633656 -0.446050262737 -0.451762262700 + -0.457545481928 -0.463400777185 -0.469329013576 -0.475331064508 + -0.481407811628 -0.487560144759 -0.493788961826 -0.500095168761 + -0.506479679407 -0.512943415398 -0.519487306033 -0.526112288128 + -0.532819305855 -0.539609310564 -0.546483260585 -0.553442121007 + -0.560486863446 -0.567618465780 -0.574837911863 -0.582146191219 + -0.589544298704 -0.597033234141 -0.604614001925 -0.612287610596 + -0.620055072378 -0.627917402684 -0.635875619579 -0.643930743208 + -0.652083795177 -0.660335797890 -0.668687773840 -0.677140744851 + -0.685695731260 -0.694353751050 -0.703115818921 -0.711982945298 + -0.720956135272 -0.730036387475 -0.739224692876 -0.748522033506 + -0.757929381094 -0.767447695623 -0.777077923794 -0.786820997395 + -0.796677831567 -0.806649322968 -0.816736347829 -0.826939759888 + -0.837260388205 -0.847699034856 -0.858256472481 -0.868933441701 + -0.879730648391 -0.890648760790 -0.901688406460 -0.912850169074 + -0.924134585033 -0.935542139897 -0.947073264630 -0.958728331649 + -0.970507650666 -0.982411464322 -0.994439943592 -1.00659318297 + -1.01887119543 -1.03127390710 -1.04380115174 -1.05645266491 + -1.06922807792 -1.08212691146 -1.09514856898 -1.10829232979 + -1.12155734179 -1.13494261405 -1.14844700891 -1.16206923394 + -1.17580783344 -1.18966117976 -1.20362746421 -1.21770468773 + -1.23189065119 -1.24618294546 -1.26057894107 -1.27507577774 + -1.28967035347 -1.30435931350 -1.31913903893 -1.33400563518 + -1.34895492019 -1.36398241252 -1.37908331925 -1.39425252381 + -1.40948457374 -1.42477366846 -1.44011364706 -1.45549797622 + -1.47091973832 -1.48637161976 -1.50184589969 -1.51733443911 + -1.53282867058 -1.54831958851 -1.56379774030 -1.57925321836 + -1.59467565322 -1.61005420784 -1.62537757337 -1.64063396644 + -1.65581112829 -1.67089632588 -1.68587635530 -1.70073754755 + -1.71546577717 -1.73004647386 -1.74446463738 -1.75870485610 + -1.77275132946 -1.78658789470 -1.80019805816 -1.81356503154 + -1.82667177347 -1.83950103669 -1.85203542125 -1.86425743410 + -1.87614955535 -1.88769431155 -1.89887435629 -1.90967255846 + -1.92007209834 -1.93005657161 -1.93961010171 -1.94871746025 + -1.95736419569 -1.96553677004 -1.97322270331 -1.98041072541 + -1.98709093479 -1.99325496322 -1.99889614556 -2.00400969353 + -2.00859287178 -2.01264517460 -2.01616850114 -2.01916732657 + -2.02164886640 -2.02362323052 -2.02510356316 -2.02610616461 + -2.02665058962 -2.02675971746 -2.02645978733 -2.02578039308 + -2.02475442998 -2.02341798628 -2.02181017171 -2.01997287488 + -2.01795044134 -2.01578926438 -2.01353728081 -2.01124336503 + -2.00895661586 -2.00672553267 -2.00459707998 -2.00261564368 + -2.00082188694 -1.99925152038 -1.99793400978 -1.99689125513 + -1.99613628865 -1.99567205615 -1.99549036741 -1.99557112714 + -1.99588199005 -1.99637862261 -1.99700580137 -1.99769963559 + -1.99839127112 -1.99908294242 -1.99957256569 -1.99986106869 + -1.99998115880 -2.00000013158 -2.00000001268 -2.00000001151 + -2.00000001043 -2.00000000944 -2.00000000854 -2.00000000771 + -2.00000000695 -2.00000000626 -2.00000000562 -2.00000000505 + -2.00000000452 -2.00000000405 -2.00000000362 -2.00000000323 + -2.00000000287 -2.00000000256 -2.00000000227 -2.00000000201 + -2.00000000178 -2.00000000157 -2.00000000139 -2.00000000122 + -2.00000000107 -2.00000000094 -2.00000000083 -2.00000000072 + -2.00000000063 -2.00000000055 -2.00000000048 -2.00000000042 + -2.00000000036 -2.00000000031 -2.00000000027 -2.00000000023 + -2.00000000020 -2.00000000017 -2.00000000015 -2.00000000013 + -2.00000000011 -2.00000000009 -2.00000000008 -2.00000000007 + -2.00000000006 -2.00000000005 -2.00000000004 -2.00000000004 + -2.00000000003 -2.00000000003 -2.00000000002 -2.00000000002 + -2.00000000002 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 + -2.00000000000 -2.00000000000 -2.00000000000 + Core charge follows + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 + Valence charge follows + 0.192859942394E-08 0.781173797153E-08 0.177986530177E-07 0.320429777590E-07 + 0.507028602581E-07 0.739410855989E-07 0.101925201233E-06 0.134827645597E-06 + 0.172825880089E-06 0.216102524489E-06 0.264845495903E-06 0.319248151340E-06 + 0.379509433995E-06 0.445834023349E-06 0.518432489170E-06 0.597521449530E-06 + 0.683323732926E-06 0.776068544625E-06 0.875991637323E-06 0.983335486252E-06 + 0.109834946882E-05 0.122129004895E-05 0.135242096614E-05 0.149201342952E-05 + 0.164034631684E-05 0.179770637873E-05 0.196438844814E-05 0.214069565534E-05 + 0.232693964833E-05 0.252344081913E-05 0.273052853577E-05 0.294854138044E-05 + 0.317782739366E-05 0.341874432486E-05 0.367165988941E-05 0.393695203229E-05 + 0.421500919859E-05 0.450623061099E-05 0.481102655440E-05 0.512981866796E-05 + 0.546304024460E-05 0.581113653829E-05 0.617456507923E-05 0.655379599720E-05 + 0.694931235324E-05 0.736161047981E-05 0.779120032985E-05 0.823860583470E-05 + 0.870436527134E-05 0.918903163903E-05 0.969317304571E-05 0.102173731042E-04 + 0.107622313389E-04 0.113283636025E-04 0.119164025038E-04 0.125269978465E-04 + 0.131608170789E-04 0.138185457558E-04 0.145008880115E-04 0.152085670456E-04 + 0.159423256210E-04 0.167029265745E-04 0.174911533412E-04 0.183078104914E-04 + 0.191537242818E-04 0.200297432214E-04 0.209367386506E-04 0.218756053360E-04 + 0.228472620808E-04 0.238526523500E-04 0.248927449119E-04 0.259685344964E-04 + 0.270810424697E-04 0.282313175266E-04 0.294204364004E-04 0.306495045908E-04 + 0.319196571109E-04 0.332320592526E-04 0.345879073726E-04 0.359884296973E-04 + 0.374348871494E-04 0.389285741946E-04 0.404708197112E-04 0.420629878802E-04 + 0.437064791003E-04 0.454027309241E-04 0.471532190199E-04 0.489594581571E-04 + 0.508230032169E-04 0.527454502295E-04 0.547284374366E-04 0.567736463820E-04 + 0.588828030295E-04 0.610576789096E-04 0.633000922950E-04 0.656119094069E-04 + 0.679950456508E-04 0.704514668852E-04 0.729831907215E-04 0.755922878576E-04 + 0.782808834452E-04 0.810511584922E-04 0.839053513006E-04 0.868457589407E-04 + 0.898747387635E-04 0.929947099510E-04 0.962081551062E-04 0.995176218837E-04 + 0.102925724661E-03 0.106435146253E-03 0.110048639670E-03 0.113769029920E-03 + 0.117599215858E-03 0.121542172080E-03 0.125600950866E-03 0.129778684174E-03 + 0.134078585684E-03 0.138503952889E-03 0.143058169249E-03 0.147744706389E-03 + 0.152567126361E-03 0.157529083955E-03 0.162634329080E-03 0.167886709193E-03 + 0.173290171799E-03 0.178848767007E-03 0.184566650159E-03 0.190448084516E-03 + 0.196497444018E-03 0.202719216115E-03 0.209118004664E-03 0.215698532905E-03 + 0.222465646505E-03 0.229424316690E-03 0.236579643443E-03 0.243936858795E-03 + 0.251501330188E-03 0.259278563931E-03 0.267274208741E-03 0.275494059370E-03 + 0.283944060329E-03 0.292630309701E-03 0.301559063051E-03 0.310736737439E-03 + 0.320169915525E-03 0.329865349787E-03 0.339829966840E-03 0.350070871863E-03 + 0.360595353140E-03 0.371410886710E-03 0.382525141143E-03 0.393945982428E-03 + 0.405681478984E-03 0.417739906801E-03 0.430129754706E-03 0.442859729763E-03 + 0.455938762811E-03 0.469376014131E-03 0.483180879266E-03 0.497362994979E-03 + 0.511932245367E-03 0.526898768117E-03 0.542272960931E-03 0.558065488100E-03 + 0.574287287251E-03 0.590949576256E-03 0.608063860316E-03 0.625641939220E-03 + 0.643695914788E-03 0.662238198493E-03 0.681281519280E-03 0.700838931572E-03 + 0.720923823479E-03 0.741549925213E-03 0.762731317701E-03 0.784482441427E-03 + 0.806818105478E-03 0.829753496827E-03 0.853304189830E-03 0.877486155974E-03 + 0.902315773857E-03 0.927809839409E-03 0.953985576380E-03 0.980860647067E-03 + 0.100845316333E-02 0.103678169783E-02 0.106586529564E-02 0.109572348599E-02 + 0.112637629448E-02 0.115784425542E-02 0.119014842461E-02 0.122331039231E-02 + 0.125735229666E-02 0.129229683731E-02 0.132816728945E-02 0.136498751814E-02 + 0.140278199300E-02 0.144157580333E-02 0.148139467342E-02 0.152226497845E-02 + 0.156421376059E-02 0.160726874560E-02 0.165145835976E-02 0.169681174729E-02 + 0.174335878809E-02 0.179113011598E-02 0.184015713733E-02 0.189047205019E-02 + 0.194210786380E-02 0.199509841864E-02 0.204947840692E-02 0.210528339354E-02 + 0.216254983758E-02 0.222131511428E-02 0.228161753756E-02 0.234349638304E-02 + 0.240699191160E-02 0.247214539354E-02 0.253899913323E-02 0.260759649444E-02 + 0.267798192613E-02 0.275020098894E-02 0.282430038225E-02 0.290032797190E-02 + 0.297833281848E-02 0.305836520633E-02 0.314047667322E-02 0.322472004063E-02 + 0.331114944479E-02 0.339982036837E-02 0.349078967297E-02 0.358411563224E-02 + 0.367985796581E-02 0.377807787397E-02 0.387883807308E-02 0.398220283185E-02 + 0.408823800836E-02 0.419701108788E-02 0.430859122158E-02 0.442304926605E-02 + 0.454045782367E-02 0.466089128390E-02 0.478442586537E-02 0.491113965898E-02 + 0.504111267185E-02 0.517442687219E-02 0.531116623519E-02 0.545141678977E-02 + 0.559526666639E-02 0.574280614579E-02 0.589412770880E-02 0.604932608704E-02 + 0.620849831479E-02 0.637174378184E-02 0.653916428732E-02 0.671086409477E-02 + 0.688694998808E-02 0.706753132870E-02 0.725272011384E-02 0.744263103581E-02 + 0.763738154248E-02 0.783709189888E-02 0.804188524993E-02 0.825188768428E-02 + 0.846722829937E-02 0.868803926757E-02 0.891445590354E-02 0.914661673273E-02 + 0.938466356104E-02 0.962874154565E-02 0.987899926705E-02 0.101355888021E-01 + 0.103986657987E-01 0.106683895506E-01 0.109449230749E-01 0.112284331891E-01 + 0.115190905903E-01 0.118170699354E-01 0.121225499218E-01 0.124357133700E-01 + 0.127567473067E-01 0.130858430491E-01 0.134231962901E-01 0.137690071850E-01 + 0.141234804382E-01 0.144868253917E-01 0.148592561143E-01 0.152409914910E-01 + 0.156322553139E-01 0.160332763735E-01 0.164442885508E-01 0.168655309099E-01 + 0.172972477909E-01 0.177396889038E-01 0.181931094226E-01 0.186577700790E-01 + 0.191339372574E-01 0.196218830894E-01 0.201218855480E-01 0.206342285423E-01 + 0.211592020118E-01 0.216971020195E-01 0.222482308459E-01 0.228128970812E-01 + 0.233914157168E-01 0.239841082365E-01 0.245913027054E-01 0.252133338584E-01 + 0.258505431863E-01 0.265032790210E-01 0.271718966175E-01 0.278567582343E-01 + 0.285582332115E-01 0.292766980451E-01 0.300125364590E-01 0.307661394732E-01 + 0.315379054684E-01 0.323282402459E-01 0.331375570839E-01 0.339662767882E-01 + 0.348148277379E-01 0.356836459252E-01 0.365731749895E-01 0.374838662442E-01 + 0.384161786967E-01 0.393705790609E-01 0.403475417610E-01 0.413475489272E-01 + 0.423710903810E-01 0.434186636116E-01 0.444907737407E-01 0.455879334766E-01 + 0.467106630555E-01 0.478594901703E-01 0.490349498859E-01 0.502375845398E-01 + 0.514679436270E-01 0.527265836691E-01 0.540140680664E-01 0.553309669310E-01 + 0.566778569013E-01 0.580553209363E-01 0.594639480882E-01 0.609043332531E-01 + 0.623770768971E-01 0.638827847586E-01 0.654220675235E-01 0.669955404742E-01 + 0.686038231083E-01 0.702475387283E-01 0.719273139998E-01 0.736437784753E-01 + 0.753975640855E-01 0.771893045927E-01 0.790196350078E-01 0.808891909675E-01 + 0.827986080706E-01 0.847485211721E-01 0.867395636330E-01 0.887723665237E-01 + 0.908475577806E-01 0.929657613123E-01 0.951275960557E-01 0.973336749783E-01 + 0.995846040265E-01 0.101880981017 0.104223394471 0.106612422388 + 0.109048630958 0.111532573210 0.114064787601 0.116645796531 + 0.119276104797 0.121956197978 0.124686540746 0.127467575110 + 0.130299718591 0.133183362321 0.136118869067 0.139106571192 + 0.142146768535 0.145239726221 0.148385672402 0.151584795926 + 0.154837243936 0.158143119404 0.161502478600 0.164915328494 + 0.168381624109 0.171901265809 0.175474096544 0.179099899044 + 0.182778392977 0.186509232075 0.190292001230 0.194126213575 + 0.198011307559 0.201946644018 0.205931503264 0.209965082193 + 0.214046491433 0.218174752547 0.222348795293 0.226567454973 + 0.230829469882 0.235133478869 0.239478019048 0.243861523650 + 0.248282320071 0.252738628116 0.257228558471 0.261750111427 + 0.266301175884 0.270879528660 0.275482834128 0.280108644217 + 0.284754398804 0.289417426515 0.294094945981 0.298784067563 + 0.303481795582 0.308185031075 0.312890575109 0.317595132679 + 0.322295317203 0.326987655640 0.331668594263 0.336334505069 + 0.340981692875 0.345606403079 0.350204830101 0.354773126503 + 0.359307412770 0.363803787747 0.368258339702 0.372667158000 + 0.377026345326 0.381332030440 0.385580381389 0.389767619122 + 0.393890031426 0.397943987118 0.401925950365 0.405832495067 + 0.409660319161 0.413406258723 0.417067301751 0.420640601457 + 0.424123488937 0.427513485040 0.430808311270 0.434005899547 + 0.437104400641 0.440102191083 0.442997878383 0.445790304351 + 0.448478546334 0.451061916191 0.453539956840 0.455912436183 + 0.458179338301 0.460340851743 0.462397354842 0.464349397939 + 0.466197682492 0.467943037053 0.469586390145 0.471128740130 + 0.472571122219 0.473914572847 0.475160091703 0.476308601801 + 0.477360908088 0.478317655172 0.479179284885 0.479945994527 + 0.480617696764 0.481193982306 0.481674086615 0.482056862058 + 0.482340757021 0.482523803624 0.482603615727 0.482577398951 + 0.482441974360 0.482193817305 0.481829112616 0.481343826889 + 0.480733797882 0.479994840121 0.479122864492 0.478114007910 + 0.476964766961 0.475672126666 0.474233672054 0.472647665983 + 0.470913070885 0.469029486199 0.466996982391 0.464815870018 + 0.462486580310 0.460009732923 0.457386090912 0.454616575315 + 0.451702265742 0.448644400990 0.445444380086 0.442103762753 + 0.438624269637 0.435007782252 0.431256342637 0.427372152711 + 0.423357573327 0.419215123017 0.414947476426 0.410557462424 + 0.406048061901 0.401422405240 0.396683769456 0.391835575024 + 0.386881382364 0.381824888011 0.376669920458 0.371420435675 + 0.366080512308 0.360654346573 0.355146246827 0.349560627845 + 0.343902004805 0.338174986971 0.332384271116 0.326534634661 + 0.320630928574 0.314678070008 0.308681034723 0.302644849286 + 0.296574583069 0.290475340066 0.284352250545 0.278210462548 + 0.272055133266 0.265891420306 0.259724472862 0.253559422831 + 0.247401375887 0.241255402527 0.235126529124 0.229019729013 + 0.222939913627 0.216891923710 0.210880520641 0.204910377884 + 0.198986072594 0.193112077405 0.187292752436 0.181532337514 + 0.175834944675 0.170204550934 0.164644991380 0.159159952589 + 0.153752966405 0.148427404095 0.143186470903 0.138033201031 + 0.132970453049 0.128000905774 0.123127054607 0.118351208375 + 0.113675486655 0.109101817627 0.104631936429 0.100267384058 + 0.960095067872E-01 0.918594561291E-01 0.878181893307E-01 0.838864704037E-01 + 0.800648716863E-01 0.763537759297E-01 0.727533789016E-01 0.692636924953E-01 + 0.658845483324E-01 0.626156018442E-01 0.594563368135E-01 0.564060703579E-01 + 0.534639583344E-01 0.506290011397E-01 0.479000498833E-01 0.452758129051E-01 + 0.427548626097E-01 0.403356425871E-01 0.380164749900E-01 0.357955681333E-01 + 0.336710242851E-01 0.316408476135E-01 0.297029522571E-01 0.278551704814E-01 + 0.260952608902E-01 0.244209166542E-01 0.228297737247E-01 0.213194189972E-01 + 0.198873983928E-01 0.185312248251E-01 0.172483860213E-01 0.160363521683E-01 + 0.148925833548E-01 0.138145367839E-01 0.127996737309E-01 0.118454662228E-01 + 0.109494034201E-01 0.101089976804E-01 0.932179028917E-02 0.858535684220E-02 + 0.789731226802E-02 0.725531548143E-02 0.665707366032E-02 0.610034614137E-02 + 0.558294793195E-02 0.510275283811E-02 0.465769621076E-02 0.424577731408E-02 + 0.386506132236E-02 0.351368095349E-02 0.318983774884E-02 0.289180301130E-02 + 0.261791841440E-02 0.236659629707E-02 0.213631965971E-02 0.192564187822E-02 + 0.173318615362E-02 0.155764471558E-02 0.139777779863E-02 0.125241241034E-02 + 0.112044091082E-02 0.100081942313E-02 0.892566093909E-03 0.794759223473E-03 + 0.706535284101E-03 0.627086844948E-03 0.555660421225E-03 0.491554264729E-03 + 0.434116111959E-03 0.382740905219E-03 0.336868501164E-03 0.295981380310E-03 + 0.259602369956E-03 0.227292391987E-03 0.198648245921E-03 0.173300436534E-03 + 0.150911054305E-03 0.131171715925E-03 0.113801571046E-03 0.985453804982E-04 + 0.851716702189E-04 0.734709642647E-04 0.632540993902E-04 0.543506228959E-04 + 0.466072746907E-04 0.398865538313E-04 0.340653691752E-04 0.290337732188E-04 + 0.246937776901E-04 0.209582490236E-04 0.177498814647E-04 0.150002452239E-04 + 0.126489068360E-04 0.106426186600E-04 0.893457429107E-05 0.748372653583E-05 + 0.625416452187E-05 0.521454647655E-05 0.433758470421E-05 0.359957931914E-05 + 0.297999734644E-05 0.246109388135E-05 0.202757209710E-05 0.166627900678E-05 + 0.136593401420E-05 0.111688742925E-05 0.910906270504E-06 0.740984831728E-06 + 0.601177644702E-06 0.486452628062E-06 0.392562368130E-06 0.315931631453E-06 + 0.253559358779E-06 0.202933535288E-06 0.161957471164E-06 0.128886159355E-06 + 0.102271503009E-06 0.809153233791E-07 0.638291695628E-07 0.502000542962E-07 + 0.393613351753E-07 0.307680481744E-07 0.239760804451E-07 0.186246423254E-07 + 0.144215645970E-07 0.111310066537E-07 0.856321476742E-08 0.656601745819E-08 + 0.501778751204E-08 0.382163784784E-08 0.290065162999E-08 0.219397615104E-08 + 0.165363545597E-08 0.124193881255E-08 0.929381299077E-09 0.692949305273E-09 + 0.514757927259E-09 0.380959360274E-09 0.280871708568E-09 0.206286370945E-09 + 0.150919531555E-09 0.109979475361E-09 0.798266226255E-10 0.577074839373E-10 + 0.415473062892E-10 0.297891247706E-10 0.212693520263E-10 0.151220139117E-10 + 0.107053479198E-10 0.754578353343E-11 0.529537384138E-11 0.369959051151E-11 + 0.257306732482E-11 0.178141255024E-11 0.122763375141E-11 0.842051897239E-12 + 0.574842771122E-12 0.390547257372E-12 0.264050022826E-12 0.177648027364E-12 + 0.118923931884E-12 0.792110200848E-13 0.524906403802E-13 0.346043062619E-13 + 0.226935361331E-13 0.148036678549E-13 0.960511666662E-14 0.619830243759E-14 + 0.397786438230E-14 0.253865789838E-14 0.161103477773E-14 0.101653262509E-14 + 0.637708422569E-15 0.397718479274E-15 0.246575620457E-15 0.151954233360E-15 + 0.930745459294E-16 0.566593040938E-16 0.342767824929E-16 0.206055046035E-16 + 0.123079667364E-16 0.730422684711E-17 0.430637311294E-17 0.252210207982E-17 + 0.146720552623E-17 0.847734320011E-18 0.486442890565E-18 0.277184878979E-18 + 0.156831974430E-18 0.881025392887E-19 0.491350989475E-19 0.272022731167E-19 + 0.149481817820E-19 0.815268589145E-20 0.441266599679E-20 0.236999664238E-20 + 0.126298598209E-20 0.667745114160E-21 0.350220062953E-21 0.182198844212E-21 + 0.940113161740E-22 0.481060428385E-22 0.244094851360E-22 0.122803576047E-22 + 0.612505736587E-23 0.302836915091E-23 0.148408620975E-23 0.720796487407E-24 + 0.346912820571E-24 0.165436950269E-24 0.781625736359E-25 0.365820814677E-25 + 0.169585850273E-25 0.778592494285E-26 0.353978846950E-26 0.159344594512E-26 + 0.710127023381E-27 0.313269769929E-27 0.136782031518E-27 0.591032535548E-28 + 0.252701870367E-28 0.106896252387E-28 0.447316537465E-29 0.185142717470E-29 + 0.757839992335E-30 0.306737485647E-30 0.122747626663E-30 0.485572362462E-31 + 0.189856870950E-31 0.733611747191E-32 0.280097426144E-32 0.105654817400E-32 + 0.393677381002E-33 0.144875644166E-33 0.526484979459E-34 0.188904952138E-34 + 0.669110184763E-35 0.233925828564E-35 0.807073987669E-36 0.274745538710E-36 + 0.922691751851E-37 0.305644755066E-37 0.998472848868E-38 0.321616483282E-38 + 0.102128232957E-38 0.319654325693E-39 0.985969264196E-40 0.299649774875E-40 + 0.897121090900E-41 0.264540652596E-41 0.768165292472E-42 0.219610677678E-42 + 0.618021048583E-43 0.171166027298E-43 0.466453883997E-44 0.125051219512E-44 + 0.329735218728E-45 0.854968083364E-46 0.217946276313E-46 0.546098077905E-47 + 0.134468007021E-47 0.325310967627E-48 0.773059547242E-49 0.180411230173E-49 + 0.413381662674E-50 0.929769442524E-51 0.205226716905E-51 0.444451088876E-52 + 0.944150224497E-53 0.196688780105E-53 0.401728312796E-54 0.804250532496E-55 + 0.157778094020E-55 0.303240720362E-56 0.570823032720E-57 0.105214342172E-57 + 0.189842243025E-58 0.335226864593E-59 0.579155310744E-60 0.978683662235E-61 + 0.161718679843E-61 0.261232053326E-62 0.412399442134E-63 0.636077593677E-64 + 0.958246688009E-65 0.140953257072E-65 0.202436545755E-66 0.284273825438E-67 + 0.389458372654E-68 0.520387124545E-69 0.677948621583E-70 diff --git a/aiida_defects/formation_energy_siesta/pseudos/O.psf b/aiida_defects/formation_energy_siesta/pseudos/O.psf new file mode 100644 index 0000000..4185405 --- /dev/null +++ b/aiida_defects/formation_energy_siesta/pseudos/O.psf @@ -0,0 +1,1821 @@ + O ca nrl nc + ATM3 19-FEB-98 Troullier-Martins + 2s 2.00 r= 1.14/2p 4.00 r= 1.14/3d 0.00 r= 1.14/4f 0.00 r= 1.14/ + 4 0 1029 0.309844022083E-03 0.125000000000E-01 6.00000000000 + Radial grid follows + 0.389735801693E-05 0.784373876281E-05 0.118397588677E-04 0.158860427178E-04 + 0.199832225532E-04 0.241319385666E-04 0.283328390034E-04 0.325865802628E-04 + 0.368938270004E-04 0.412552522324E-04 0.456715374403E-04 0.501433726777E-04 + 0.546714566780E-04 0.592564969634E-04 0.638992099558E-04 0.686003210887E-04 + 0.733605649201E-04 0.781806852479E-04 0.830614352256E-04 0.880035774804E-04 + 0.930078842321E-04 0.980751374137E-04 0.103206128794E-03 0.108401660101E-03 + 0.113662543146E-03 0.118989599954E-03 0.124383662888E-03 0.129845574781E-03 + 0.135376189068E-03 0.140976369919E-03 0.146646992373E-03 0.152388942477E-03 + 0.158203117422E-03 0.164090425685E-03 0.170051787170E-03 0.176088133351E-03 + 0.182200407420E-03 0.188389564433E-03 0.194656571457E-03 0.201002407725E-03 + 0.207428064787E-03 0.213934546665E-03 0.220522870010E-03 0.227194064261E-03 + 0.233949171805E-03 0.240789248143E-03 0.247715362049E-03 0.254728595743E-03 + 0.261830045058E-03 0.269020819608E-03 0.276302042968E-03 0.283674852843E-03 + 0.291140401250E-03 0.298699854695E-03 0.306354394360E-03 0.314105216280E-03 + 0.321953531539E-03 0.329900566451E-03 0.337947562756E-03 0.346095777814E-03 + 0.354346484801E-03 0.362700972906E-03 0.371160547534E-03 0.379726530512E-03 + 0.388400260291E-03 0.397183092161E-03 0.406076398455E-03 0.415081568772E-03 + 0.424200010187E-03 0.433433147476E-03 0.442782423334E-03 0.452249298606E-03 + 0.461835252510E-03 0.471541782870E-03 0.481370406352E-03 0.491322658699E-03 + 0.501400094969E-03 0.511604289783E-03 0.521936837567E-03 0.532399352802E-03 + 0.542993470279E-03 0.553720845349E-03 0.564583154186E-03 0.575582094048E-03 + 0.586719383543E-03 0.597996762894E-03 0.609415994214E-03 0.620978861782E-03 + 0.632687172320E-03 0.644542755274E-03 0.656547463104E-03 0.668703171570E-03 + 0.681011780026E-03 0.693475211716E-03 0.706095414078E-03 0.718874359044E-03 + 0.731814043350E-03 0.744916488848E-03 0.758183742822E-03 0.771617878307E-03 + 0.785220994414E-03 0.798995216658E-03 0.812942697289E-03 0.827065615629E-03 + 0.841366178413E-03 0.855846620133E-03 0.870509203387E-03 0.885356219235E-03 + 0.900389987551E-03 0.915612857394E-03 0.931027207368E-03 0.946635445996E-03 + 0.962440012097E-03 0.978443375167E-03 0.994648035764E-03 0.101105652590E-02 + 0.102767140943E-02 0.104449528247E-02 0.106153077378E-02 0.107878054520E-02 + 0.109624729202E-02 0.111393374348E-02 0.113184266311E-02 0.114997684922E-02 + 0.116833913530E-02 0.118693239052E-02 0.120575952009E-02 0.122482346580E-02 + 0.124412720643E-02 0.126367375822E-02 0.128346617537E-02 0.130350755048E-02 + 0.132380101505E-02 0.134434973998E-02 0.136515693606E-02 0.138622585444E-02 + 0.140755978719E-02 0.142916206778E-02 0.145103607161E-02 0.147318521654E-02 + 0.149561296342E-02 0.151832281662E-02 0.154131832460E-02 0.156460308048E-02 + 0.158818072252E-02 0.161205493479E-02 0.163622944769E-02 0.166070803852E-02 + 0.168549453213E-02 0.171059280144E-02 0.173600676811E-02 0.176174040314E-02 + 0.178779772744E-02 0.181418281254E-02 0.184089978115E-02 0.186795280785E-02 + 0.189534611974E-02 0.192308399708E-02 0.195117077396E-02 0.197961083901E-02 + 0.200840863603E-02 0.203756866475E-02 0.206709548148E-02 0.209699369984E-02 + 0.212726799149E-02 0.215792308685E-02 0.218896377585E-02 0.222039490864E-02 + 0.225222139642E-02 0.228444821213E-02 0.231708039128E-02 0.235012303271E-02 + 0.238358129941E-02 0.241746041930E-02 0.245176568605E-02 0.248650245994E-02 + 0.252167616865E-02 0.255729230816E-02 0.259335644355E-02 0.262987420992E-02 + 0.266685131324E-02 0.270429353127E-02 0.274220671442E-02 0.278059678671E-02 + 0.281946974666E-02 0.285883166826E-02 0.289868870188E-02 0.293904707526E-02 + 0.297991309449E-02 0.302129314496E-02 0.306319369239E-02 0.310562128383E-02 + 0.314858254867E-02 0.319208419969E-02 0.323613303413E-02 0.328073593470E-02 + 0.332589987069E-02 0.337163189906E-02 0.341793916553E-02 0.346482890571E-02 + 0.351230844621E-02 0.356038520581E-02 0.360906669661E-02 0.365836052518E-02 + 0.370827439378E-02 0.375881610155E-02 0.380999354576E-02 0.386181472296E-02 + 0.391428773033E-02 0.396742076687E-02 0.402122213475E-02 0.407570024052E-02 + 0.413086359651E-02 0.418672082210E-02 0.424328064509E-02 0.430055190307E-02 + 0.435854354480E-02 0.441726463158E-02 0.447672433871E-02 0.453693195688E-02 + 0.459789689366E-02 0.465962867494E-02 0.472213694645E-02 0.478543147521E-02 + 0.484952215114E-02 0.491441898853E-02 0.498013212765E-02 0.504667183630E-02 + 0.511404851145E-02 0.518227268084E-02 0.525135500465E-02 0.532130627711E-02 + 0.539213742827E-02 0.546385952563E-02 0.553648377591E-02 0.561002152681E-02 + 0.568448426874E-02 0.575988363667E-02 0.583623141189E-02 0.591353952390E-02 + 0.599182005225E-02 0.607108522844E-02 0.615134743780E-02 0.623261922147E-02 + 0.631491327834E-02 0.639824246701E-02 0.648261980784E-02 0.656805848497E-02 + 0.665457184835E-02 0.674217341589E-02 0.683087687550E-02 0.692069608727E-02 + 0.701164508565E-02 0.710373808160E-02 0.719698946483E-02 0.729141380607E-02 + 0.738702585931E-02 0.748384056413E-02 0.758187304802E-02 0.768113862876E-02 + 0.778165281679E-02 0.788343131767E-02 0.798649003449E-02 0.809084507039E-02 + 0.819651273104E-02 0.830350952725E-02 0.841185217747E-02 0.852155761047E-02 + 0.863264296794E-02 0.874512560720E-02 0.885902310388E-02 0.897435325471E-02 + 0.909113408025E-02 0.920938382774E-02 0.932912097396E-02 0.945036422806E-02 + 0.957313253456E-02 0.969744507626E-02 0.982332127723E-02 0.995078080590E-02 + 0.100798435781E-01 0.102105297601E-01 0.103428597719E-01 0.104768542903E-01 + 0.106125342523E-01 0.107499208582E-01 0.108890355748E-01 0.110299001391E-01 + 0.111725365615E-01 0.113169671292E-01 0.114632144099E-01 0.116113012549E-01 + 0.117612508030E-01 0.119130864843E-01 0.120668320234E-01 0.122225114433E-01 + 0.123801490692E-01 0.125397695323E-01 0.127013977737E-01 0.128650590481E-01 + 0.130307789280E-01 0.131985833073E-01 0.133684984058E-01 0.135405507732E-01 + 0.137147672930E-01 0.138911751868E-01 0.140698020187E-01 0.142506756996E-01 + 0.144338244913E-01 0.146192770113E-01 0.148070622367E-01 0.149972095095E-01 + 0.151897485406E-01 0.153847094146E-01 0.155821225944E-01 0.157820189264E-01 + 0.159844296447E-01 0.161893863764E-01 0.163969211464E-01 0.166070663825E-01 + 0.168198549202E-01 0.170353200083E-01 0.172534953135E-01 0.174744149262E-01 + 0.176981133656E-01 0.179246255849E-01 0.181539869773E-01 0.183862333807E-01 + 0.186214010844E-01 0.188595268335E-01 0.191006478359E-01 0.193448017671E-01 + 0.195920267767E-01 0.198423614941E-01 0.200958450347E-01 0.203525170056E-01 + 0.206124175125E-01 0.208755871654E-01 0.211420670849E-01 0.214118989092E-01 + 0.216851248001E-01 0.219617874495E-01 0.222419300867E-01 0.225255964845E-01 + 0.228128309663E-01 0.231036784132E-01 0.233981842705E-01 0.236963945555E-01 + 0.239983558641E-01 0.243041153784E-01 0.246137208740E-01 0.249272207272E-01 + 0.252446639232E-01 0.255661000631E-01 0.258915793718E-01 0.262211527063E-01 + 0.265548715629E-01 0.268927880861E-01 0.272349550758E-01 0.275814259965E-01 + 0.279322549848E-01 0.282874968586E-01 0.286472071250E-01 0.290114419896E-01 + 0.293802583648E-01 0.297537138790E-01 0.301318668852E-01 0.305147764706E-01 + 0.309025024657E-01 0.312951054535E-01 0.316926467789E-01 0.320951885587E-01 + 0.325027936906E-01 0.329155258640E-01 0.333334495691E-01 0.337566301072E-01 + 0.341851336012E-01 0.346190270056E-01 0.350583781172E-01 0.355032555854E-01 + 0.359537289234E-01 0.364098685184E-01 0.368717456431E-01 0.373394324669E-01 + 0.378130020668E-01 0.382925284389E-01 0.387780865103E-01 0.392697521503E-01 + 0.397676021828E-01 0.402717143977E-01 0.407821675637E-01 0.412990414402E-01 + 0.418224167896E-01 0.423523753905E-01 0.428890000500E-01 0.434323746168E-01 + 0.439825839942E-01 0.445397141537E-01 0.451038521478E-01 0.456750861243E-01 + 0.462535053398E-01 0.468392001733E-01 0.474322621409E-01 0.480327839097E-01 + 0.486408593125E-01 0.492565833623E-01 0.498800522672E-01 0.505113634455E-01 + 0.511506155409E-01 0.517979084377E-01 0.524533432769E-01 0.531170224715E-01 + 0.537890497227E-01 0.544695300360E-01 0.551585697381E-01 0.558562764926E-01 + 0.565627593177E-01 0.572781286028E-01 0.580024961258E-01 0.587359750705E-01 + 0.594786800447E-01 0.602307270973E-01 0.609922337374E-01 0.617633189518E-01 + 0.625441032243E-01 0.633347085539E-01 0.641352584743E-01 0.649458780730E-01 + 0.657666940112E-01 0.665978345428E-01 0.674394295353E-01 0.682916104897E-01 + 0.691545105609E-01 0.700282645788E-01 0.709130090693E-01 0.718088822755E-01 + 0.727160241794E-01 0.736345765238E-01 0.745646828343E-01 0.755064884420E-01 + 0.764601405059E-01 0.774257880360E-01 0.784035819169E-01 0.793936749306E-01 + 0.803962217814E-01 0.814113791191E-01 0.824393055643E-01 0.834801617324E-01 + 0.845341102593E-01 0.856013158268E-01 0.866819451877E-01 0.877761671928E-01 + 0.888841528162E-01 0.900060751832E-01 0.911421095962E-01 0.922924335631E-01 + 0.934572268243E-01 0.946366713810E-01 0.958309515240E-01 0.970402538618E-01 + 0.982647673506E-01 0.995046833228E-01 0.100760195518 0.102031500113 + 0.103318795750 0.104622283574 0.105942167256 0.107278653031 + 0.108631949728 0.110002268801 0.111389824366 0.112794833232 + 0.114217514934 0.115658091769 0.117116788830 0.118593834041 + 0.120089458193 0.121603894981 0.123137381040 0.124690155978 + 0.126262462420 0.127854546043 0.129466655613 0.131099043025 + 0.132751963343 0.134425674838 0.136120439033 0.137836520737 + 0.139574188092 0.141333712611 0.143115369224 0.144919436319 + 0.146746195784 0.148595933054 0.150468937156 0.152365500748 + 0.154285920174 0.156230495502 0.158199530577 0.160193333064 + 0.162212214499 0.164256490336 0.166326479998 0.168422506925 + 0.170544898625 0.172693986726 0.174870107027 0.177073599552 + 0.179304808601 0.181564082805 0.183851775180 0.186168243183 + 0.188513848766 0.190888958436 0.193293943307 0.195729179164 + 0.198195046517 0.200691930664 0.203220221746 0.205780314815 + 0.208372609891 0.210997512025 0.213655431364 0.216346783211 + 0.219071988098 0.221831471842 0.224625665619 0.227455006027 + 0.230319935156 0.233220900657 0.236158355812 0.239132759605 + 0.242144576791 0.245194277974 0.248282339676 0.251409244412 + 0.254575480767 0.257781543474 0.261027933484 0.264315158055 + 0.267643730820 0.271014171876 0.274427007862 0.277882772039 + 0.281382004380 0.284925251644 0.288513067473 0.292146012469 + 0.295824654287 0.299549567724 0.303321334803 0.307140544873 + 0.311007794690 0.314923688523 0.318888838236 0.322903863392 + 0.326969391348 0.331086057351 0.335254504637 0.339475384535 + 0.343749356567 0.348077088549 0.352459256697 0.356896545736 + 0.361389648999 0.365939268545 0.370546115259 0.375210908971 + 0.379934378565 0.384717262093 0.389560306889 0.394464269689 + 0.399429916748 0.404458023958 0.409549376970 0.414704771320 + 0.419925012548 0.425210916327 0.430563308590 0.435983025661 + 0.441470914379 0.447027832241 0.452654647524 0.458352239430 + 0.464121498221 0.469963325353 0.475878633625 0.481868347315 + 0.487933402329 0.494074746343 0.500293338955 0.506590151834 + 0.512966168867 0.519422386322 0.525959812996 0.532579470374 + 0.539282392792 0.546069627594 0.552942235301 0.559901289770 + 0.566947878369 0.574083102141 0.581308075980 0.588623928802 + 0.596031803724 0.603532858242 0.611128264410 0.618819209027 + 0.626606893818 0.634492535625 0.642477366596 0.650562634375 + 0.658749602304 0.667039549612 0.675433771621 0.683933579944 + 0.692540302694 0.701255284690 0.710079887664 0.719015490479 + 0.728063489341 0.737225298018 0.746502348061 0.755896089030 + 0.765407988713 0.775039533366 0.784792227937 0.794667596303 + 0.804667181512 0.814792546019 0.825045271933 0.835426961263 + 0.845939236169 0.856583739215 0.867362133628 0.878276103552 + 0.889327354317 0.900517612705 0.911848627216 0.923322168344 + 0.934940028853 0.946704024058 0.958615992105 0.970677794266 + 0.982891315221 0.995258463357 1.00778117107 1.02046139505 + 1.03330111661 1.04630234199 1.05946710266 1.07279745563 + 1.08629548379 1.09996329625 1.11380302863 1.12781684341 + 1.14200693028 1.15637550647 1.17092481710 1.18565713552 + 1.20057476370 1.21568003255 1.23097530228 1.24646296283 + 1.26214543416 1.27802516670 1.29410464169 1.31038637157 + 1.32687290040 1.34356680424 1.36047069153 1.37758720356 + 1.39491901480 1.41246883339 1.43023940152 1.44823349588 + 1.46645392809 1.48490354512 1.50358522976 1.52250190107 + 1.54165651481 1.56105206393 1.58069157903 1.60057812881 + 1.62071482060 1.64110480079 1.66175125536 1.68265741035 + 1.70382653241 1.72526192924 1.74696695017 1.76894498665 + 1.79119947280 1.81373388593 1.83655174708 1.85965662159 + 1.88305211964 1.90674189684 1.93072965474 1.95501914150 + 1.97961415239 2.00451853043 2.02973616699 2.05527100237 + 2.08112702643 2.10730827924 2.13381885167 2.16066288605 + 2.18784457681 2.21536817116 2.24323796970 2.27145832716 + 2.30003365301 2.32896841222 2.35826712589 2.38793437201 + 2.41797478615 2.44839306218 2.47919395302 2.51038227138 + 2.54196289048 2.57394074488 2.60632083116 2.63910820880 + 2.67230800087 2.70592539492 2.73996564373 2.77443406616 + 2.80933604797 2.84467704267 2.88046257236 2.91669822860 + 2.95338967328 2.99054263952 3.02816293255 3.06625643062 + 3.10482908590 3.14388692546 3.18343605215 3.22348264563 + 3.26403296324 3.30509334105 3.34667019483 3.38877002106 + 3.43139939791 3.47456498631 3.51827353097 3.56253186145 + 3.60734689319 3.65272562863 3.69867515830 3.74520266190 + 3.79231540945 3.84002076242 3.88832617485 3.93723919457 + 3.98676746434 4.03691872305 4.08770080694 4.13912165081 + 4.19118928928 4.24391185801 4.29729759502 4.35135484193 + 4.40609204530 4.46151775793 4.51764064021 4.57446946144 + 4.63201310124 4.69028055093 4.74928091491 4.80902341211 + 4.86951737741 4.93077226313 4.99279764046 5.05560320099 + 5.11919875822 5.18359424908 5.24879973551 5.31482540599 + 5.38168157716 5.44937869544 5.51792733865 5.58733821764 + 5.65762217801 5.72879020177 5.80085340907 5.87382305993 + 5.94771055600 6.02252744237 6.09828540931 6.17499629417 + 6.25267208318 6.33132491333 6.41096707430 6.49161101033 + 6.57326932220 6.65595476919 6.73968027107 6.82445891012 + 6.91030393317 6.99722875368 7.08524695384 7.17437228666 + 7.26461867816 7.35600022952 7.44853121930 7.54222610565 + 7.63709952858 7.73316631227 7.83044146735 7.92894019324 + 8.02867788059 8.12967011361 8.23193267253 8.33548153609 + 8.44033288402 8.54650309955 8.65400877199 8.76286669931 + 8.87309389081 8.98470756969 9.09772517582 9.21216436843 + 9.32804302888 9.44537926344 9.56419140615 9.68449802164 + 9.80631790805 9.92967010001 10.0545738715 10.1810487391 + 10.3091144647 10.4387910587 10.5700987836 10.7030581563 + 10.8376899520 10.9740152072 11.1120552230 11.2518315685 + 11.3933660840 11.5366808846 11.6817983634 11.8287411953 + 11.9775323406 12.1281950481 12.2807528591 12.4352296112 + 12.5916494416 12.7500367913 12.9104164086 13.0728133531 + 13.2372529997 13.4037610425 13.5723634986 13.7430867125 + 13.9159573601 14.0910024527 14.2682493416 14.4477257219 + 14.6294596371 14.8134794836 14.9998140148 15.1884923458 + 15.3795439581 15.5729987039 15.7688868108 15.9672388867 + 16.1680859247 16.3714593073 16.5773908122 16.7859126166 + 16.9970573024 17.2108578613 17.4273477003 17.6465606462 + 17.8685309515 18.0932932995 18.3208828098 18.5513350438 + 18.7846860100 19.0209721701 19.2602304441 19.5024982168 + 19.7478133429 19.9962141534 20.2477394615 20.5024285685 + 20.7603212700 21.0214578625 21.2858791489 21.5536264456 + 21.8247415887 22.0992669405 22.3772453962 22.6587203904 + 22.9437359041 23.2323364717 23.5245671876 23.8204737133 + 24.1201022849 24.4234997200 24.7307134251 25.0417914028 + 25.3567822598 25.6757352141 25.9987001026 26.3257273893 + 26.6568681729 26.9921741948 27.3316978472 27.6754921815 + 28.0236109161 28.3761084454 28.7330398477 29.0944608944 + 29.4604280583 29.8309985223 30.2062301890 30.5861816890 + 30.9709123906 31.3604824086 31.7549526142 32.1543846442 + 32.5588409106 32.9683846106 33.3830797362 33.8029910842 + 34.2281842669 34.6587257214 35.0946827207 35.5361233840 + 35.9831166873 36.4357324741 36.8940414668 37.3581152769 + 37.8280264169 38.3038483114 38.7856553086 39.2735226917 + 39.7675266911 40.2677444958 40.7742542659 41.2871351447 + 41.8064672707 42.3323317907 42.8648108721 43.4039877158 + 43.9499465693 44.5027727398 45.0625526075 45.6293736391 + 46.2033244017 46.7844945760 47.3729749712 47.9688575386 + 48.5722353860 49.1832027924 49.8018552227 50.4282893426 + 51.0626030337 51.7048954089 52.3552668275 53.0138189116 + 53.6806545611 54.3558779705 55.0395946449 55.7319114163 + 56.4329364607 57.1427793146 57.8615508925 58.5893635038 + 59.3263308708 60.0725681461 60.8281919308 61.5933202926 + 62.3680727845 63.1525704631 63.9469359077 64.7512932395 + 65.5657681411 66.3904878757 67.2255813076 68.0711789217 + 68.9274128445 69.7944168641 70.6723264518 71.5612787827 + 72.4614127574 73.3728690237 74.2957899985 75.2303198900 + 76.1766047205 77.1347923488 78.1050324938 79.0874767575 + 80.0822786487 81.0895936073 82.1095790283 83.1423942865 + 84.1882007614 85.2471618623 86.3194430541 87.4052118830 + 88.5046380024 89.6178932000 90.7451514241 91.8865888112 + 93.0423837132 94.2127167253 95.3977707145 96.5977308479 + 97.8127846216 99.0431218904 100.288934897 101.550418302 + 102.827769215 104.121187224 105.430874429 106.757035472 + 108.099877566 109.459610535 110.836446839 112.230601612 + 113.642292693 115.071740662 116.519168873 117.984803490 + 119.468873521 + Down Pseudopotential follows (l on next line) + 0 + -0.477757180914E-04 -0.961523807311E-04 -0.145137546864E-03 -0.194738870515E-03 + -0.244964101984E-03 -0.295821089056E-03 -0.347317778231E-03 -0.399462215960E-03 + -0.452262549909E-03 -0.505727030225E-03 -0.559864010830E-03 -0.614681950726E-03 + -0.670189415314E-03 -0.726395077733E-03 -0.783307720218E-03 -0.840936235469E-03 + -0.899289628041E-03 -0.958377015754E-03 -0.101820763111E-02 -0.107879082275E-02 + -0.114013605690E-02 -0.120225291885E-02 -0.126515111446E-02 -0.132884047168E-02 + -0.139333094208E-02 -0.145863260239E-02 -0.152475565611E-02 -0.159171043506E-02 + -0.165950740103E-02 -0.172815714740E-02 -0.179767040080E-02 -0.186805802278E-02 + -0.193933101151E-02 -0.201150050348E-02 -0.208457777530E-02 -0.215857424539E-02 + -0.223350147579E-02 -0.230937117398E-02 -0.238619519472E-02 -0.246398554185E-02 + -0.254275437021E-02 -0.262251398753E-02 -0.270327685634E-02 -0.278505559595E-02 + -0.286786298438E-02 -0.295171196036E-02 -0.303661562541E-02 -0.312258724580E-02 + -0.320964025469E-02 -0.329778825420E-02 -0.338704501754E-02 -0.347742449116E-02 + -0.356894079694E-02 -0.366160823437E-02 -0.375544128281E-02 -0.385045460376E-02 + -0.394666304312E-02 -0.404408163351E-02 -0.414272559666E-02 -0.424261034574E-02 + -0.434375148780E-02 -0.444616482620E-02 -0.454986636306E-02 -0.465487230179E-02 + -0.476119904960E-02 -0.486886322009E-02 -0.497788163580E-02 -0.508827133089E-02 + -0.520004955374E-02 -0.531323376973E-02 -0.542784166387E-02 -0.554389114366E-02 + -0.566140034180E-02 -0.578038761909E-02 -0.590087156725E-02 -0.602287101187E-02 + -0.614640501530E-02 -0.627149287968E-02 -0.639815414991E-02 -0.652640861674E-02 + -0.665627631983E-02 -0.678777755092E-02 -0.692093285695E-02 -0.705576304331E-02 + -0.719228917707E-02 -0.733053259028E-02 -0.747051488331E-02 -0.761225792819E-02 + -0.775578387208E-02 -0.790111514068E-02 -0.804827444176E-02 -0.819728476870E-02 + -0.834816940409E-02 -0.850095192334E-02 -0.865565619841E-02 -0.881230640149E-02 + -0.897092700881E-02 -0.913154280445E-02 -0.929417888420E-02 -0.945886065950E-02 + -0.962561386141E-02 -0.979446454460E-02 -0.996543909147E-02 -0.101385642162E-01 + -0.103138669690E-01 -0.104913747403E-01 -0.106711152651E-01 -0.108531166269E-01 + -0.110374072629E-01 -0.112240159677E-01 -0.114129718979E-01 -0.116043045771E-01 + -0.117980439001E-01 -0.119942201377E-01 -0.121928639414E-01 -0.123940063481E-01 + -0.125976787853E-01 -0.128039130756E-01 -0.130127414418E-01 -0.132241965120E-01 + -0.134383113247E-01 -0.136551193339E-01 -0.138746544143E-01 -0.140969508666E-01 + -0.143220434230E-01 -0.145499672525E-01 -0.147807579662E-01 -0.150144516233E-01 + -0.152510847365E-01 -0.154906942774E-01 -0.157333176828E-01 -0.159789928605E-01 + -0.162277581946E-01 -0.164796525521E-01 -0.167347152890E-01 -0.169929862560E-01 + -0.172545058050E-01 -0.175193147955E-01 -0.177874546005E-01 -0.180589671137E-01 + -0.183338947554E-01 -0.186122804794E-01 -0.188941677797E-01 -0.191796006973E-01 + -0.194686238268E-01 -0.197612823239E-01 -0.200576219120E-01 -0.203576888894E-01 + -0.206615301366E-01 -0.209691931238E-01 -0.212807259180E-01 -0.215961771905E-01 + -0.219155962250E-01 -0.222390329244E-01 -0.225665378196E-01 -0.228981620765E-01 + -0.232339575046E-01 -0.235739765648E-01 -0.239182723777E-01 -0.242668987315E-01 + -0.246199100913E-01 -0.249773616064E-01 -0.253393091200E-01 -0.257058091772E-01 + -0.260769190340E-01 -0.264526966665E-01 -0.268332007795E-01 -0.272184908161E-01 + -0.276086269666E-01 -0.280036701781E-01 -0.284036821638E-01 -0.288087254131E-01 + -0.292188632006E-01 -0.296341595967E-01 -0.300546794772E-01 -0.304804885333E-01 + -0.309116532823E-01 -0.313482410775E-01 -0.317903201190E-01 -0.322379594641E-01 + -0.326912290382E-01 -0.331501996459E-01 -0.336149429815E-01 -0.340855316408E-01 + -0.345620391319E-01 -0.350445398868E-01 -0.355331092733E-01 -0.360278236063E-01 + -0.365287601600E-01 -0.370359971796E-01 -0.375496138939E-01 -0.380696905275E-01 + -0.385963083130E-01 -0.391295495040E-01 -0.396694973879E-01 -0.402162362986E-01 + -0.407698516298E-01 -0.413304298483E-01 -0.418980585076E-01 -0.424728262609E-01 + -0.430548228759E-01 -0.436441392479E-01 -0.442408674142E-01 -0.448451005687E-01 + -0.454569330760E-01 -0.460764604864E-01 -0.467037795504E-01 -0.473389882341E-01 + -0.479821857342E-01 -0.486334724935E-01 -0.492929502165E-01 -0.499607218853E-01 + -0.506368917754E-01 -0.513215654719E-01 -0.520148498862E-01 -0.527168532725E-01 + -0.534276852441E-01 -0.541474567913E-01 -0.548762802979E-01 -0.556142695589E-01 + -0.563615397983E-01 -0.571182076867E-01 -0.578843913598E-01 -0.586602104360E-01 + -0.594457860359E-01 -0.602412408003E-01 -0.610466989095E-01 -0.618622861028E-01 + -0.626881296972E-01 -0.635243586083E-01 -0.643711033691E-01 -0.652284961509E-01 + -0.660966707836E-01 -0.669757627764E-01 -0.678659093386E-01 -0.687672494012E-01 + -0.696799236380E-01 -0.706040744876E-01 -0.715398461752E-01 -0.724873847353E-01 + -0.734468380336E-01 -0.744183557904E-01 -0.754020896036E-01 -0.763981929719E-01 + -0.774068213185E-01 -0.784281320154E-01 -0.794622844073E-01 -0.805094398362E-01 + -0.815697616667E-01 -0.826434153104E-01 -0.837305682520E-01 -0.848313900749E-01 + -0.859460524872E-01 -0.870747293480E-01 -0.882175966946E-01 -0.893748327690E-01 + -0.905466180456E-01 -0.917331352588E-01 -0.929345694312E-01 -0.941511079016E-01 + -0.953829403542E-01 -0.966302588473E-01 -0.978932578429E-01 -0.991721342366E-01 + -0.100467087387 -0.101778319148 -0.103106033897 -0.104450438568 + -0.105811742683 -0.107190158384 -0.108585900463 -0.109999186400 + -0.111430236391 -0.112879273384 -0.114346523111 -0.115832214125 + -0.117336577833 -0.118859848532 -0.120402263444 -0.121964062750 + -0.123545489632 -0.125146790303 -0.126768214048 -0.128410013262 + -0.130072443488 -0.131755763452 -0.133460235107 -0.135186123670 + -0.136933697659 -0.138703228941 -0.140494992765 -0.142309267808 + -0.144146336215 -0.146006483640 -0.147889999292 -0.149797175975 + -0.151728310136 -0.153683701901 -0.155663655130 -0.157668477453 + -0.159698480324 -0.161753979058 -0.163835292887 -0.165942744999 + -0.168076662593 -0.170237376920 -0.172425223340 -0.174640541362 + -0.176883674703 -0.179154971330 -0.181454783519 -0.183783467899 + -0.186141385510 -0.188528901851 -0.190946386937 -0.193394215349 + -0.195872766291 -0.198382423645 -0.200923576022 -0.203496616825 + -0.206101944300 -0.208739961595 -0.211411076816 -0.214115703091 + -0.216854258620 -0.219627166742 -0.222434855991 -0.225277760159 + -0.228156318355 -0.231070975068 -0.234022180229 -0.237010389275 + -0.240036063213 -0.243099668679 -0.246201678012 -0.249342569312 + -0.252522826507 -0.255742939424 -0.259003403852 -0.262304721611 + -0.265647400620 -0.269031954968 -0.272458904982 -0.275928777297 + -0.279442104929 -0.282999427344 -0.286601290530 -0.290248247072 + -0.293940856226 -0.297679683987 -0.301465303170 -0.305298293482 + -0.309179241599 -0.313108741239 -0.317087393243 -0.321115805652 + -0.325194593781 -0.329324380301 -0.333505795319 -0.337739476455 + -0.342026068922 -0.346366225609 -0.350760607164 -0.355209882071 + -0.359714726734 -0.364275825563 -0.368893871056 -0.373569563880 + -0.378303612960 -0.383096735562 -0.387949657380 -0.392863112617 + -0.397837844081 -0.402874603262 -0.407974150428 -0.413137254707 + -0.418364694179 -0.423657255964 -0.429015736311 -0.434440940689 + -0.439933683876 -0.445494790053 -0.451125092889 -0.456825435641 + -0.462596671241 -0.468439662387 -0.474355281642 -0.480344411524 + -0.486407944598 -0.492546783576 -0.498761841405 -0.505054041370 + -0.511424317183 -0.517873613083 -0.524402883932 -0.531013095311 + -0.537705223619 -0.544480256173 -0.551339191303 -0.558283038452 + -0.565312818279 -0.572429562757 -0.579634315275 -0.586928130738 + -0.594312075674 -0.601787228332 -0.609354678788 -0.617015529052 + -0.624770893173 -0.632621897342 -0.640569680005 -0.648615391969 + -0.656760196513 -0.665005269499 -0.673351799486 -0.681800987842 + -0.690354048860 -0.699012209880 -0.707776711400 -0.716648807206 + -0.725629764490 -0.734720863976 -0.743923400052 -0.753238680895 + -0.762668028610 -0.772212779363 -0.781874283523 -0.791653905805 + -0.801553025418 -0.811573036215 -0.821715346849 -0.831981380934 + -0.842372577213 -0.852890389725 -0.863536287982 -0.874311757157 + -0.885218298268 -0.896257428378 -0.907430680798 -0.918739605302 + -0.930185768344 -0.941770753294 -0.953496160675 -0.965363608415 + -0.977374732111 -0.989531185302 -1.00183463976 -1.01428678578 + -1.02688933251 -1.03964400828 -1.05255256095 -1.06561675825 + -1.07883838822 -1.09221925956 -1.10576120208 -1.11946606714 + -1.13333572813 -1.14737208098 -1.16157704463 -1.17595256166 + -1.19050059880 -1.20522314759 -1.22012222501 -1.23519987418 + -1.25045816507 -1.26589919524 -1.28152509071 -1.29733800675 + -1.31334012880 -1.32953367343 -1.34592088931 -1.36250405832 + -1.37928549664 -1.39626755591 -1.41345262453 -1.43084312895 + -1.44844153506 -1.46625034968 -1.48427212211 -1.50250944579 + -1.52096496001 -1.53964135176 -1.55854135769 -1.57766776612 + -1.59702341923 -1.61661121535 -1.63643411135 -1.65649512521 + -1.67679733869 -1.69734390020 -1.71813802777 -1.73918301224 + -1.76048222056 -1.78203909938 -1.80385717869 -1.82594007583 + -1.84829149955 -1.87091525442 -1.89381524543 -1.91699548281 + -1.94046008719 -1.96421329496 -1.98825946397 -2.01260307950 + -2.03724876058 -2.06220126659 -2.08746550432 -2.11304653525 + -2.13894958335 -2.16518004320 -2.19174348854 -2.21864568133 + -2.24589258118 -2.27349035528 -2.30144538892 -2.32976429640 + -2.35845393260 -2.38752140503 -2.41697408655 -2.44681962865 + -2.47706597536 -2.50772137791 -2.53879440994 -2.57029398354 + -2.60222936597 -2.63461019713 -2.66744650782 -2.70074873880 + -2.73452776072 -2.76879489477 -2.80356193437 -2.83884116755 + -2.87464540037 -2.91098798121 -2.94788282590 -2.98534444390 + -3.02338796530 -3.06202916880 -3.10128451062 -3.14117115424 + -3.18170700113 -3.22291072225 -3.26480179043 -3.30740051348 + -3.35072806809 -3.39480653433 -3.43965893074 -3.48530924992 + -3.53178249445 -3.57910471313 -3.62730303719 -3.67640571652 + -3.72644215559 -3.77744294883 -3.82943991536 -3.88246613255 + -3.93655596833 -3.99174511172 -4.04807060131 -4.10557085114 + -4.16428567352 -4.22425629831 -4.28552538796 -4.34813704769 + -4.41213683009 -4.47757173337 -4.54449019223 -4.61294206065 + -4.68297858528 -4.75465236854 -4.82801732004 -4.90312859508 + -4.98004251873 -5.05881649405 -5.13950889274 -5.22217892643 + -5.30688649680 -5.39369202248 -5.48265624070 -5.57383998134 + -5.66730391115 -5.76310824569 -5.86131242639 -5.96197476025 + -6.06515201932 -6.17089899740 -6.27926802116 -6.39030841295 + -6.50406590253 -6.62058198533 -6.73989322455 -6.86203049509 + -6.98701816709 -7.11487322769 -7.24560433970 -7.37921083664 + -7.51568165404 -7.65499419812 -7.79711315340 -7.94198923219 + -8.08955787024 -8.23973787416 -8.39243002780 -8.54751566713 + -8.70485523471 -8.86428682761 -9.02562475529 -9.18865812644 + -9.35314948743 -9.51883353807 -9.68541595405 -9.85257234936 + -10.0199474159 -10.1871542814 -10.3537741320 -10.5193561475 + -10.6834178055 -10.8454456089 -11.0048963010 -11.1611986293 + -11.3137557261 -11.4619481716 -11.6051378080 -11.7426723696 + -11.8738909916 -11.9981306552 -12.1147336171 -12.2230558628 + -12.3224766073 -12.4124088496 -12.4923109642 -12.5616992881 + -12.6201616241 -12.6673715480 -12.7031033570 -12.7272474441 + -12.7398258192 -12.7410074226 -12.7311227892 -12.7106775188 + -12.6803638820 -12.6410697488 -12.5938838468 -12.5400961475 + -12.4811919163 -12.4188376534 -12.3548567654 -12.2911923440 + -12.2298538615 -12.1728439116 -12.1220603046 -12.0791678588 + -12.0454330966 -12.0215137394 -12.0071934010 -12.0010501896 + -12.0000428749 -12.0000340386 -12.0000269757 -12.0000213201 + -12.0000168039 -12.0000132077 -12.0000103523 -12.0000080915 + -12.0000063067 -12.0000049017 -12.0000037991 -12.0000029363 + -12.0000022632 -12.0000017396 -12.0000013335 -12.0000010196 + -12.0000007776 -12.0000005916 -12.0000004491 -12.0000003402 + -12.0000002572 -12.0000001942 -12.0000001464 -12.0000001103 + -12.0000000831 -12.0000000626 -12.0000000472 -12.0000000357 + -12.0000000270 -12.0000000205 -12.0000000157 -12.0000000120 + -12.0000000093 -12.0000000073 -12.0000000057 -12.0000000045 + -12.0000000036 -12.0000000029 -12.0000000024 -12.0000000019 + -12.0000000016 -12.0000000013 -12.0000000011 -12.0000000009 + -12.0000000008 -12.0000000007 -12.0000000006 -12.0000000005 + -12.0000000004 -12.0000000003 -12.0000000003 -12.0000000003 + -12.0000000002 -12.0000000002 -12.0000000002 -12.0000000001 + -12.0000000001 -12.0000000001 -12.0000000001 -12.0000000001 + -12.0000000001 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 + Down Pseudopotential follows (l on next line) + 1 + -0.144057762305E-03 -0.289927548186E-03 -0.437632150086E-03 -0.587194647143E-03 + -0.738638408794E-03 -0.891987098425E-03 -0.104726467707E-02 -0.120449540716E-02 + -0.136370385631E-02 -0.152491490114E-02 -0.168815373121E-02 -0.185344585289E-02 + -0.202081709340E-02 -0.219029360484E-02 -0.236190186822E-02 -0.253566869767E-02 + -0.271162124461E-02 -0.288978700195E-02 -0.307019380844E-02 -0.325286985299E-02 + -0.343784367907E-02 -0.362514418922E-02 -0.381480064947E-02 -0.400684269403E-02 + -0.420130032982E-02 -0.439820394122E-02 -0.459758429479E-02 -0.479947254408E-02 + -0.500390023450E-02 -0.521089930828E-02 -0.542050210939E-02 -0.563274138867E-02 + -0.584765030889E-02 -0.606526244997E-02 -0.628561181420E-02 -0.650873283158E-02 + -0.673466036516E-02 -0.696342971654E-02 -0.719507663133E-02 -0.742963730479E-02 + -0.766714838743E-02 -0.790764699079E-02 -0.815117069318E-02 -0.839775754563E-02 + -0.864744607776E-02 -0.890027530382E-02 -0.915628472883E-02 -0.941551435470E-02 + -0.967800468649E-02 -0.994379673877E-02 -0.102129320420E-01 -0.104854526490E-01 + -0.107614011415E-01 -0.110408206371E-01 -0.113237547954E-01 -0.116102478253E-01 + -0.119003444919E-01 -0.121940901231E-01 -0.124915306173E-01 -0.127927124500E-01 + -0.130976826813E-01 -0.134064889632E-01 -0.137191795472E-01 -0.140358032917E-01 + -0.143564096696E-01 -0.146810487761E-01 -0.150097713366E-01 -0.153426287143E-01 + -0.156796729188E-01 -0.160209566137E-01 -0.163665331249E-01 -0.167164564494E-01 + -0.170707812630E-01 -0.174295629296E-01 -0.177928575091E-01 -0.181607217668E-01 + -0.185332131820E-01 -0.189103899568E-01 -0.192923110257E-01 -0.196790360641E-01 + -0.200706254984E-01 -0.204671405148E-01 -0.208686430692E-01 -0.212751958968E-01 + -0.216868625218E-01 -0.221037072677E-01 -0.225257952667E-01 -0.229531924705E-01 + -0.233859656603E-01 -0.238241824574E-01 -0.242679113333E-01 -0.247172216211E-01 + -0.251721835258E-01 -0.256328681356E-01 -0.260993474328E-01 -0.265716943049E-01 + -0.270499825566E-01 -0.275342869206E-01 -0.280246830696E-01 -0.285212476283E-01 + -0.290240581852E-01 -0.295331933045E-01 -0.300487325387E-01 -0.305707564411E-01 + -0.310993465779E-01 -0.316345855414E-01 -0.321765569628E-01 -0.327253455251E-01 + -0.332810369766E-01 -0.338437181440E-01 -0.344134769461E-01 -0.349904024077E-01 + -0.355745846732E-01 -0.361661150208E-01 -0.367650858771E-01 -0.373715908309E-01 + -0.379857246484E-01 -0.386075832874E-01 -0.392372639131E-01 -0.398748649126E-01 + -0.405204859105E-01 -0.411742277845E-01 -0.418361926812E-01 -0.425064840318E-01 + -0.431852065686E-01 -0.438724663411E-01 -0.445683707329E-01 -0.452730284778E-01 + -0.459865496778E-01 -0.467090458192E-01 -0.474406297909E-01 -0.481814159015E-01 + -0.489315198974E-01 -0.496910589809E-01 -0.504601518283E-01 -0.512389186086E-01 + -0.520274810022E-01 -0.528259622202E-01 -0.536344870230E-01 -0.544531817405E-01 + -0.552821742913E-01 -0.561215942031E-01 -0.569715726324E-01 -0.578322423858E-01 + -0.587037379398E-01 -0.595861954624E-01 -0.604797528345E-01 -0.613845496709E-01 + -0.623007273423E-01 -0.632284289977E-01 -0.641677995863E-01 -0.651189858807E-01 + -0.660821364990E-01 -0.670574019289E-01 -0.680449345505E-01 -0.690448886607E-01 + -0.700574204967E-01 -0.710826882609E-01 -0.721208521453E-01 -0.731720743566E-01 + -0.742365191416E-01 -0.753143528129E-01 -0.764057437747E-01 -0.775108625490E-01 + -0.786298818027E-01 -0.797629763741E-01 -0.809103233004E-01 -0.820721018454E-01 + -0.832484935273E-01 -0.844396821472E-01 -0.856458538177E-01 -0.868671969922E-01 + -0.881039024939E-01 -0.893561635461E-01 -0.906241758018E-01 -0.919081373750E-01 + -0.932082488707E-01 -0.945247134170E-01 -0.958577366965E-01 -0.972075269785E-01 + -0.985742951512E-01 -0.999582547551E-01 -0.101359622016 -0.102778615879 + -0.104215458043 -0.105670372993 -0.107143588040 -0.108635333350 + -0.110145841987 -0.111675349943 -0.113224096179 -0.114792322661 + -0.116380274396 -0.117988199473 -0.119616349103 -0.121264977652 + -0.122934342686 -0.124624705011 -0.126336328711 -0.128069481190 + -0.129824433217 -0.131601458963 -0.133400836047 -0.135222845580 + -0.137067772206 -0.138935904149 -0.140827533257 -0.142742955046 + -0.144682468749 -0.146646377361 -0.148634987686 -0.150648610385 + -0.152687560026 -0.154752155132 -0.156842718229 -0.158959575898 + -0.161103058827 -0.163273501860 -0.165471244053 -0.167696628720 + -0.169950003494 -0.172231720379 -0.174542135800 -0.176881610667 + -0.179250510422 -0.181649205106 -0.184078069407 -0.186537482726 + -0.189027829229 -0.191549497914 -0.194102882667 -0.196688382326 + -0.199306400740 -0.201957346834 -0.204641634674 -0.207359683528 + -0.210111917933 -0.212898767764 -0.215720668295 -0.218578060271 + -0.221471389977 -0.224401109305 -0.227367675823 -0.230371552853 + -0.233413209535 -0.236493120905 -0.239611767968 -0.242769637772 + -0.245967223483 -0.249205024464 -0.252483546351 -0.255803301132 + -0.259164807227 -0.262568589568 -0.266015179680 -0.269505115765 + -0.273038942786 -0.276617212548 -0.280240483790 -0.283909322264 + -0.287624300830 -0.291385999540 -0.295195005733 -0.299051914118 + -0.302957326876 -0.306911853746 -0.310916112125 -0.314970727157 + -0.319076331838 -0.323233567107 -0.327443081952 -0.331705533504 + -0.336021587143 -0.340391916600 -0.344817204061 -0.349298140273 + -0.353835424650 -0.358429765384 -0.363081879550 -0.367792493221 + -0.372562341579 -0.377392169028 -0.382282729308 -0.387234785616 + -0.392249110718 -0.397326487073 -0.402467706949 -0.407673572553 + -0.412944896145 -0.418282500170 -0.423687217385 -0.429159890982 + -0.434701374723 -0.440312533070 -0.445994241316 -0.451747385724 + -0.457572863658 -0.463471583726 -0.469444465917 -0.475492441741 + -0.481616454377 -0.487817458811 -0.494096421990 -0.500454322962 + -0.506892153036 -0.513410915923 -0.520011627899 -0.526695317954 + -0.533463027954 -0.540315812799 -0.547254740580 -0.554280892749 + -0.561395364280 -0.568599263837 -0.575893713942 -0.583279851148 + -0.590758826209 -0.598331804260 -0.605999964988 -0.613764502817 + -0.621626627085 -0.629587562230 -0.637648547976 -0.645810839517 + -0.654075707713 -0.662444439277 -0.670918336971 -0.679498719804 + -0.688186923231 -0.696984299352 -0.705892217118 -0.714912062534 + -0.724045238872 -0.733293166878 -0.742657284985 -0.752139049531 + -0.761739934975 -0.771461434118 -0.781305058327 -0.791272337758 + -0.801364821586 -0.811584078235 -0.821931695612 -0.832409281339 + -0.843018462997 -0.853760888362 -0.864638225651 -0.875652163768 + -0.886804412553 -0.898096703031 -0.909530787672 -0.921108440641 + -0.932831458065 -0.944701658289 -0.956720882147 -0.968890993224 + -0.981213878135 -0.993691446792 -1.00632563268 -1.01911839315 + -1.03207170968 -1.04518758818 -1.05846805925 -1.07191517853 + -1.08553102693 -1.09931771096 -1.11327736301 -1.12741214169 + -1.14172423210 -1.15621584615 -1.17088922287 -1.18574662872 + -1.20079035794 -1.21602273280 -1.23144610402 -1.24706285100 + -1.26287538221 -1.27888613550 -1.29509757845 -1.31151220869 + -1.32813255423 -1.34496117386 -1.36200065742 -1.37925362620 + -1.39672273329 -1.41441066390 -1.43232013577 -1.45045389946 + -1.46881473878 -1.48740547112 -1.50622894783 -1.52528805458 + -1.54458571173 -1.56412487472 -1.58390853444 -1.60393971760 + -1.62422148713 -1.64475694254 -1.66554922033 -1.68660149436 + -1.70791697623 -1.72949891571 -1.75135060109 -1.77347535958 + -1.79587655774 -1.81855760181 -1.84152193819 -1.86477305376 + -1.88831447631 -1.91214977495 -1.93628256049 -1.96071648584 + -1.98545524640 -2.01050258050 -2.03586226972 -2.06153813934 + -2.08753405874 -2.11385394175 -2.14050174705 -2.16748147859 + -2.19479718592 -2.22245296463 -2.25045295667 -2.27880135074 + -2.30750238268 -2.33656033579 -2.36597954123 -2.39576437832 + -2.42591927492 -2.45644870772 -2.48735720262 -2.51864933499 + -2.55032973000 -2.58240306290 -2.61487405931 -2.64774749548 + -2.68102819852 -2.71472104667 -2.74883096948 -2.78336294804 + -2.81832201513 -2.85371325541 -2.88954180550 -2.92581285414 + -2.96253164225 -2.99970346298 -3.03733366173 -3.07542763615 + -3.11399083607 -3.15302876345 -3.19254697222 -3.23255106812 + -3.27304670848 -3.31403960199 -3.35553550832 -3.39754023778 + -3.44005965088 -3.48309965783 -3.52666621797 -3.57076533909 + -3.61540307676 -3.66058553350 -3.70631885788 -3.75260924351 + -3.79946292799 -3.84688619168 -3.89488535639 -3.94346678394 + -3.99263687461 -4.04240206540 -4.09276882820 -4.14374366781 + -4.19533311968 -4.24754374767 -4.30038214140 -4.35385491363 + -4.40796869719 -4.46273014192 -4.51814591120 -4.57422267829 + -4.63096712243 -4.68838592464 -4.74648576317 -4.80527330870 + -4.86475521920 -4.92493813438 -4.98582866983 -5.04743341070 + -5.10975890503 -5.17281165657 -5.23659811717 -5.30112467867 + -5.36639766423 -5.43242331920 -5.49920780128 -5.56675717016 + -5.63507737651 -5.70417425023 -5.77405348800 -5.84472064015 + -5.91618109660 -5.98844007210 -6.06150259047 -6.13537346802 + -6.21005729593 -6.28555842162 -6.36188092908 -6.43902861809 + -6.51700498220 -6.59581318555 -6.67545603837 -6.75593597117 + -6.83725500747 -6.91941473516 -7.00241627619 -7.08626025485 + -7.17094676424 -7.25647533108 -7.34284487876 -7.43005368846 + -7.51809935842 -7.60697876116 -7.69668799867 -7.78722235547 + -7.87857624943 -7.97074318043 -8.06371567656 -8.15748523808 + -8.25204227881 -8.34737606515 -8.44347465243 -8.54032481882 + -8.63791199645 -8.73622020005 -8.83523195280 -8.93492820957 + -9.03528827743 -9.13628973352 -9.23790834033 -9.34011795829 + -9.44289045592 -9.54619561747 -9.65000104829 -9.75427207792 + -9.85897166113 -9.96406027716 -10.0694958272 -10.1752335305 + -10.2812258196 -10.3874222341 -10.4937693150 -10.6002104983 + -10.7066860093 -10.8131327583 -10.9194842371 -11.0256704187 + -11.1316176596 -11.2372486054 -11.3424821021 -11.4472331123 + -11.5514126382 -11.6549276522 -11.7576810370 -11.8595715357 + -11.9604937132 -12.0603379319 -12.1589903407 -12.2563328820 + -12.3522433160 -12.4465952660 -12.5392582853 -12.6300979490 + -12.7189759721 -12.8057503571 -12.8902755716 -12.9724027616 + -13.0519799990 -13.1288525695 -13.2028633014 -13.2738529381 + -13.3416605577 -13.4061240418 -13.4670805962 -13.5243673245 + -13.5778218602 -13.6272830552 -13.6725917301 -13.7135914857 + -13.7501295783 -13.7820578588 -13.8092337767 -13.8315214493 + -13.8487927938 -13.8609287241 -13.8678204074 -13.8693705799 + -13.8654949174 -13.8561234564 -13.8412020603 -13.8206939244 + -13.7945811122 -13.7628661128 -13.7255734118 -13.6827510618 + -13.6344722405 -13.5808367829 -13.5219726699 -13.4580374572 + -13.3892196252 -13.3157398283 -13.2378520221 -13.1558444434 + -13.0700404164 -12.9807989581 -12.8885151516 -12.7936202538 + -12.6965815048 -12.5979015988 -12.4981177774 -12.3978005006 + -12.2975516496 -12.1980022086 -12.0998093716 -12.0036530147 + -11.9102314696 -11.8202565302 -11.7344476190 -11.6535250379 + -11.5782022255 -11.5091769409 -11.4471213003 -11.3926705974 + -11.3464108537 -11.3088650658 -11.2804781507 -11.2616006359 + -11.2524712079 -11.2531983166 -11.2637411520 -11.2838904519 + -11.3132497905 -11.3512182260 -11.3969754736 -11.4494711156 + -11.5074197752 -11.5693046734 -11.6333925701 -11.6977637624 + -11.7603616049 -11.8190669232 -11.8718037527 -11.9166840656 + -11.9522005986 -11.9774786127 -11.9925994747 -11.9990783357 + -12.0000399633 -12.0000317352 -12.0000251502 -12.0000198773 + -12.0000156668 -12.0000123140 -12.0000096517 -12.0000075439 + -12.0000058799 -12.0000045700 -12.0000035420 -12.0000027376 + -12.0000021100 -12.0000016218 -12.0000012433 -12.0000009506 + -12.0000007250 -12.0000005516 -12.0000004187 -12.0000003172 + -12.0000002398 -12.0000001810 -12.0000001365 -12.0000001029 + -12.0000000775 -12.0000000584 -12.0000000440 -12.0000000333 + -12.0000000252 -12.0000000192 -12.0000000146 -12.0000000112 + -12.0000000087 -12.0000000068 -12.0000000053 -12.0000000042 + -12.0000000034 -12.0000000027 -12.0000000022 -12.0000000018 + -12.0000000015 -12.0000000012 -12.0000000010 -12.0000000009 + -12.0000000007 -12.0000000006 -12.0000000005 -12.0000000004 + -12.0000000004 -12.0000000003 -12.0000000003 -12.0000000002 + -12.0000000002 -12.0000000002 -12.0000000001 -12.0000000001 + -12.0000000001 -12.0000000001 -12.0000000001 -12.0000000001 + -12.0000000001 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 + Down Pseudopotential follows (l on next line) + 2 + -0.109804095643E-03 -0.220989356775E-03 -0.333573156314E-03 -0.447573085698E-03 + -0.563006957642E-03 -0.679892808913E-03 -0.798248903156E-03 -0.918093733740E-03 + -0.103944602665E-02 -0.116232474343E-02 -0.128674908410E-02 -0.141273849022E-02 + -0.154031264787E-02 -0.166949149075E-02 -0.180029520332E-02 -0.193274422390E-02 + -0.206685924789E-02 -0.220266123104E-02 -0.234017139266E-02 -0.247941121896E-02 + -0.262040246644E-02 -0.276316716524E-02 -0.290772762261E-02 -0.305410642639E-02 + -0.320232644855E-02 -0.335241084873E-02 -0.350438307790E-02 -0.365826688199E-02 + -0.381408630564E-02 -0.397186569591E-02 -0.413162970611E-02 -0.429340329966E-02 + -0.445721175397E-02 -0.462308066440E-02 -0.479103594827E-02 -0.496110384888E-02 + -0.513331093964E-02 -0.530768412821E-02 -0.548425066069E-02 -0.566303812592E-02 + -0.584407445973E-02 -0.602738794937E-02 -0.621300723787E-02 -0.640096132856E-02 + -0.659127958957E-02 -0.678399175844E-02 -0.697912794677E-02 -0.717671864489E-02 + -0.737679472668E-02 -0.757938745433E-02 -0.778452848327E-02 -0.799224986712E-02 + -0.820258406265E-02 -0.841556393491E-02 -0.863122276231E-02 -0.884959424188E-02 + -0.907071249447E-02 -0.929461207012E-02 -0.952132795348E-02 -0.975089556922E-02 + -0.998335078759E-02 -0.102187299300E-01 -0.104570697749E-01 -0.106984075630E-01 + -0.109427810038E-01 -0.111902282809E-01 -0.114407880582E-01 -0.116944994861E-01 + -0.119514022072E-01 -0.122115363630E-01 -0.124749425995E-01 -0.127416620745E-01 + -0.130117364630E-01 -0.132852079646E-01 -0.135621193093E-01 -0.138425137650E-01 + -0.141264351434E-01 -0.144139278076E-01 -0.147050366785E-01 -0.149998072423E-01 + -0.152982855569E-01 -0.156005182599E-01 -0.159065525755E-01 -0.162164363216E-01 + -0.165302179178E-01 -0.168479463927E-01 -0.171696713916E-01 -0.174954431841E-01 + -0.178253126724E-01 -0.181593313986E-01 -0.184975515533E-01 -0.188400259836E-01 + -0.191868082012E-01 -0.195379523908E-01 -0.198935134190E-01 -0.202535468421E-01 + -0.206181089154E-01 -0.209872566018E-01 -0.213610475806E-01 -0.217395402566E-01 + -0.221227937692E-01 -0.225108680018E-01 -0.229038235909E-01 -0.233017219356E-01 + -0.237046252075E-01 -0.241125963599E-01 -0.245256991383E-01 -0.249439980896E-01 + -0.253675585727E-01 -0.257964467688E-01 -0.262307296913E-01 -0.266704751964E-01 + -0.271157519939E-01 -0.275666296580E-01 -0.280231786378E-01 -0.284854702683E-01 + -0.289535767822E-01 -0.294275713204E-01 -0.299075279438E-01 -0.303935216449E-01 + -0.308856283593E-01 -0.313839249778E-01 -0.318884893584E-01 -0.323994003382E-01 + -0.329167377459E-01 -0.334405824143E-01 -0.339710161929E-01 -0.345081219607E-01 + -0.350519836391E-01 -0.356026862048E-01 -0.361603157036E-01 -0.367249592635E-01 + -0.372967051082E-01 -0.378756425710E-01 -0.384618621090E-01 -0.390554553169E-01 + -0.396565149414E-01 -0.402651348956E-01 -0.408814102740E-01 -0.415054373670E-01 + -0.421373136761E-01 -0.427771379290E-01 -0.434250100952E-01 -0.440810314015E-01 + -0.447453043479E-01 -0.454179327235E-01 -0.460990216228E-01 -0.467886774619E-01 + -0.474870079955E-01 -0.481941223334E-01 -0.489101309577E-01 -0.496351457400E-01 + -0.503692799590E-01 -0.511126483178E-01 -0.518653669624E-01 -0.526275534992E-01 + -0.533993270140E-01 -0.541808080901E-01 -0.549721188273E-01 -0.557733828612E-01 + -0.565847253820E-01 -0.574062731545E-01 -0.582381545377E-01 -0.590804995049E-01 + -0.599334396639E-01 -0.607971082775E-01 -0.616716402848E-01 -0.625571723216E-01 + -0.634538427419E-01 -0.643617916399E-01 -0.652811608715E-01 -0.662120940765E-01 + -0.671547367011E-01 -0.681092360205E-01 -0.690757411621E-01 -0.700544031284E-01 + -0.710453748210E-01 -0.720488110643E-01 -0.730648686295E-01 -0.740937062593E-01 + -0.751354846925E-01 -0.761903666894E-01 -0.772585170567E-01 -0.783401026736E-01 + -0.794352925178E-01 -0.805442576918E-01 -0.816671714496E-01 -0.828042092237E-01 + -0.839555486525E-01 -0.851213696082E-01 -0.863018542247E-01 -0.874971869257E-01 + -0.887075544543E-01 -0.899331459012E-01 -0.911741527349E-01 -0.924307688313E-01 + -0.937031905037E-01 -0.949916165339E-01 -0.962962482029E-01 -0.976172893225E-01 + -0.989549462668E-01 -0.100309428004 -0.101680946132 -0.103069714905 + -0.104475951274 -0.105899874915 -0.107341708269 -0.108801676571 + -0.110280007888 -0.111776933153 -0.113292686205 -0.114827503819 + -0.116381625750 -0.117955294763 -0.119548756678 -0.121162260404 + -0.122796057976 -0.124450404602 -0.126125558693 -0.127821781911 + -0.129539339205 -0.131278498856 -0.133039532516 -0.134822715249 + -0.136628325580 -0.138456645532 -0.140307960671 -0.142182560154 + -0.144080736772 -0.146002786993 -0.147949011012 -0.149919712797 + -0.151915200134 -0.153935784676 -0.155981781994 -0.158053511622 + -0.160151297110 -0.162275466071 -0.164426350237 -0.166604285504 + -0.168809611991 -0.171042674088 -0.173303820512 -0.175593404357 + -0.177911783158 -0.180259318936 -0.182636378261 -0.185043332306 + -0.187480556907 -0.189948432619 -0.192447344776 -0.194977683551 + -0.197539844016 -0.200134226205 -0.202761235173 -0.205421281061 + -0.208114779161 -0.210842149977 -0.213603819291 -0.216400218232 + -0.219231783339 -0.222098956630 -0.225002185672 -0.227941923649 + -0.230918629432 -0.233932767648 -0.236984808757 -0.240075229121 + -0.243204511079 -0.246373143020 -0.249581619461 -0.252830441121 + -0.256120115000 -0.259451154458 -0.262824079292 -0.266239415817 + -0.269697696949 -0.273199462284 -0.276745258184 -0.280335637861 + -0.283971161460 -0.287652396149 -0.291379916203 -0.295154303093 + -0.298976145578 -0.302846039792 -0.306764589338 -0.310732405382 + -0.314750106742 -0.318818319990 -0.322937679540 -0.327108827755 + -0.331332415036 -0.335609099929 -0.339939549220 -0.344324438045 + -0.348764449983 -0.353260277171 -0.357812620402 -0.362422189237 + -0.367089702110 -0.371815886441 -0.376601478744 -0.381447224742 + -0.386353879479 -0.391322207434 -0.396352982641 -0.401446988804 + -0.406605019415 -0.411827877879 -0.417116377631 -0.422471342264 + -0.427893605649 -0.433384012066 -0.438943416328 -0.444572683915 + -0.450272691099 -0.456044325079 -0.461888484119 -0.467806077674 + -0.473798026536 -0.479865262970 -0.486008730849 -0.492229385805 + -0.498528195363 -0.504906139093 -0.511364208754 -0.517903408441 + -0.524524754738 -0.531229276868 -0.538018016846 -0.544892029635 + -0.551852383303 -0.558900159183 -0.566036452028 -0.573262370182 + -0.580579035736 -0.587987584697 -0.595489167157 -0.603084947460 + -0.610776104377 -0.618563831272 -0.626449336286 -0.634433842509 + -0.642518588158 -0.650704826762 -0.658993827340 -0.667386874589 + -0.675885269070 -0.684490327395 -0.693203382420 -0.702025783436 + -0.710958896364 -0.720004103952 -0.729162805971 -0.738436419422 + -0.747826378730 -0.757334135956 -0.766961161000 -0.776708941812 + -0.786578984600 -0.796572814046 -0.806691973521 -0.816938025300 + -0.827312550781 -0.837817150711 -0.848453445403 -0.859223074969 + -0.870127699541 -0.881168999504 -0.892348675728 -0.903668449802 + -0.915130064271 -0.926735282871 -0.938485890774 -0.950383694829 + -0.962430523803 -0.974628228635 -0.986978682680 -0.999483781959 + -1.01214544542 -1.02496561517 -1.03794625679 -1.05108935950 + -1.06439693652 -1.07787102526 -1.09151368764 -1.10532701030 + -1.11931310493 -1.13347410848 -1.14781218351 -1.16232951838 + -1.17702832759 -1.19191085202 -1.20697935927 -1.22223614384 + -1.23768352753 -1.25332385965 -1.26915951732 -1.28519290579 + -1.30142645871 -1.31786263841 -1.33450393623 -1.35135287277 + -1.36841199823 -1.38568389271 -1.40317116644 -1.42087646019 + -1.43880244547 -1.45695182491 -1.47532733253 -1.49393173404 + -1.51276782715 -1.53183844190 -1.55114644096 -1.57069471989 + -1.59048620753 -1.61052386625 -1.63081069227 -1.65134971599 + -1.67214400228 -1.69319665080 -1.71451079629 -1.73608960890 + -1.75793629450 -1.78005409494 -1.80244628842 -1.82511618975 + -1.84806715067 -1.87130256014 -1.89482584463 -1.91864046846 + -1.94274993402 -1.96715778212 -1.99186759226 -2.01688298287 + -2.04220761167 -2.06784517585 -2.09379941243 -2.12007409843 + -2.14667305119 -2.17360012861 -2.20085922935 -2.22845429314 + -2.25638930090 -2.28466827507 -2.31329527971 -2.34227442079 + -2.37160984629 -2.40130574642 -2.43136635376 -2.46179594340 + -2.49259883306 -2.52377938321 -2.55534199715 -2.58729112108 + -2.61963124415 -2.65236689847 -2.68550265914 -2.71904314420 + -2.75299301456 -2.78735697396 -2.82213976880 -2.85734618803 + -2.89298106294 -2.92904926690 -2.96555571517 -3.00250536447 + -3.03990321272 -3.07775429852 -3.11606370076 -3.15483653804 + -3.19407796806 -3.23379318700 -3.27398742874 -3.31466596405 + -3.35583409973 -3.39749717757 -3.43966057331 -3.48232969545 + -3.52550998398 -3.56920690898 -3.61342596909 -3.65817268990 + -3.70345262216 -3.74927133985 -3.79563443816 -3.84254753119 + -3.89001624962 -3.93804623807 -3.98664315236 -4.03581265653 + -4.08556041962 -4.13589211228 -4.18681340308 -4.23832995460 + -4.29044741923 -4.34317143470 -4.39650761926 -4.45046156664 + -4.50503884053 -4.56024496884 -4.61608543746 -4.67256568374 + -4.72969108945 -4.78746697334 -4.84589858326 -4.90499108771 + -4.96474956694 -5.02517900350 -5.08628427217 -5.14807012935 + -5.21054120174 -5.27370197446 -5.33755677836 -5.40210977666 + -5.46736495086 -5.53332608573 -5.59999675362 -5.66738029770 + -5.73547981449 -5.80429813525 -5.87383780649 -5.94410106937 + -6.01508983805 -6.08680567690 -6.15924977650 -6.23242292850 + -6.30632549913 -6.38095740141 -6.45631806608 -6.53240641103 + -6.60922080929 -6.68675905563 -6.76501833146 -6.84399516829 + -6.92368540949 -7.00408417041 -7.08518579683 -7.16698382163 + -7.24947091977 -7.33263886141 -7.41647846331 -7.50097953837 + -7.58613084335 -7.67192002477 -7.75833356304 -7.84535671471 + -7.93297345307 -8.02116640689 -8.10991679762 -8.19920437491 + -8.28900735061 -8.37930233140 -8.47006425006 -8.56126629564 + -8.65287984261 -8.74487437920 -8.83721743514 -8.92987450911 + -9.02280899605 -9.11598211476 -9.20935283604 -9.30287781185 + -9.39651130580 -9.49020512555 -9.58390855756 -9.67756830477 + -9.77112842783 -9.86453029058 -9.95771251047 -10.0506109147 + -10.1431585028 -10.2352854172 -10.3269189214 -10.4179833889 + -10.5084003014 -10.5980882595 -10.6869630071 -10.7749374688 + -10.8619218045 -10.9478234800 -11.0325473578 -11.1159958070 + -11.1980688362 -11.2786642496 -11.3576778290 -11.4350035431 + -11.5105337857 -11.5841596453 -11.6557712072 -11.7252578904 + -11.7925088213 -11.8574132449 -11.9198609770 -11.9797428963 + -12.0369514810 -12.0913813883 -12.1429300796 -12.1914984913 + -12.2369917520 -12.2793199463 -12.3183989246 -12.3541511575 + -12.3865066351 -12.4154038073 -12.4407905632 -12.4626252459 + -12.4808776976 -12.4955303306 -12.5065792153 -12.5140351787 + -12.5179249029 -12.5182920123 -12.5151981361 -12.5087239313 + -12.4989700471 -12.4860580136 -12.4701310283 -12.4513546176 + -12.4299171435 -12.4060301229 -12.3799283242 -12.3518696020 + -12.3221344258 -12.2910250566 -12.2588643205 -12.2259939243 + -12.1927722581 -12.1595716242 -12.1267748344 -12.0947711156 + -12.0639512706 -12.0347020430 -12.0073996514 -11.9824024693 + -11.9600428522 -11.9406181470 -11.9243809566 -11.9115287931 + -11.9021933215 -11.8964294896 -11.8942049538 -11.8953903548 + -11.8997511767 -11.9069421387 -11.9165053353 -11.9278736670 + -11.9403814869 -11.9532848616 -11.9657944055 -11.9771243203 + -11.9865620795 -11.9935641627 -11.9978844060 -11.9997603153 + -12.0000392409 -12.0000317352 -12.0000251502 -12.0000198773 + -12.0000156668 -12.0000123140 -12.0000096517 -12.0000075439 + -12.0000058799 -12.0000045700 -12.0000035420 -12.0000027376 + -12.0000021100 -12.0000016218 -12.0000012433 -12.0000009506 + -12.0000007250 -12.0000005516 -12.0000004187 -12.0000003172 + -12.0000002398 -12.0000001810 -12.0000001365 -12.0000001029 + -12.0000000775 -12.0000000584 -12.0000000440 -12.0000000333 + -12.0000000252 -12.0000000192 -12.0000000146 -12.0000000112 + -12.0000000087 -12.0000000068 -12.0000000053 -12.0000000042 + -12.0000000034 -12.0000000027 -12.0000000022 -12.0000000018 + -12.0000000015 -12.0000000012 -12.0000000010 -12.0000000009 + -12.0000000007 -12.0000000006 -12.0000000005 -12.0000000004 + -12.0000000004 -12.0000000003 -12.0000000003 -12.0000000002 + -12.0000000002 -12.0000000002 -12.0000000001 -12.0000000001 + -12.0000000001 -12.0000000001 -12.0000000001 -12.0000000001 + -12.0000000001 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 + Down Pseudopotential follows (l on next line) + 3 + -0.997906871301E-04 -0.200836586576E-03 -0.303153486958E-03 -0.406757375493E-03 + -0.511664440491E-03 -0.617891073886E-03 -0.725453873796E-03 -0.834369647118E-03 + -0.944655412153E-03 -0.105632840126E-02 -0.116940606357E-02 -0.128390606768E-02 + -0.139984630443E-02 -0.151724488971E-02 -0.163612016727E-02 -0.175649071160E-02 + -0.187837533082E-02 -0.200179306964E-02 -0.212676321231E-02 -0.225330528564E-02 + -0.238143906208E-02 -0.251118456277E-02 -0.264256206067E-02 -0.277559208377E-02 + -0.291029541825E-02 -0.304669311176E-02 -0.318480647667E-02 -0.332465709346E-02 + -0.346626681404E-02 -0.360965776517E-02 -0.375485235196E-02 -0.390187326130E-02 + -0.405074346548E-02 -0.420148622574E-02 -0.435412509587E-02 -0.450868392599E-02 + -0.466518686616E-02 -0.482365837024E-02 -0.498412319967E-02 -0.514660642735E-02 + -0.531113344156E-02 -0.547772994992E-02 -0.564642198339E-02 -0.581723590040E-02 + -0.599019839088E-02 -0.616533648052E-02 -0.634267753490E-02 -0.652224926384E-02 + -0.670407972572E-02 -0.688819733182E-02 -0.707463085079E-02 -0.726340941316E-02 + -0.745456251584E-02 -0.764812002681E-02 -0.784411218969E-02 -0.804256962855E-02 + -0.824352335264E-02 -0.844700476125E-02 -0.865304564863E-02 -0.886167820896E-02 + -0.907293504134E-02 -0.928684915493E-02 -0.950345397408E-02 -0.972278334357E-02 + -0.994487153387E-02 -0.101697532465E-01 -0.103974636196E-01 -0.106280382331E-01 + -0.108615131145E-01 -0.110979247446E-01 -0.113373100629E-01 -0.115797064736E-01 + -0.118251518514E-01 -0.120736845474E-01 -0.123253433950E-01 -0.125801677163E-01 + -0.128381973276E-01 -0.130994725463E-01 -0.133640341969E-01 -0.136319236174E-01 + -0.139031826656E-01 -0.141778537261E-01 -0.144559797162E-01 -0.147376040933E-01 + -0.150227708615E-01 -0.153115245782E-01 -0.156039103612E-01 -0.158999738960E-01 + -0.161997614426E-01 -0.165033198430E-01 -0.168106965281E-01 -0.171219395256E-01 + -0.174370974674E-01 -0.177562195969E-01 -0.180793557770E-01 -0.184065564976E-01 + -0.187378728838E-01 -0.190733567039E-01 -0.194130603770E-01 -0.197570369819E-01 + -0.201053402646E-01 -0.204580246476E-01 -0.208151452375E-01 -0.211767578343E-01 + -0.215429189396E-01 -0.219136857661E-01 -0.222891162455E-01 -0.226692690388E-01 + -0.230542035443E-01 -0.234439799078E-01 -0.238386590313E-01 -0.242383025830E-01 + -0.246429730067E-01 -0.250527335316E-01 -0.254676481822E-01 -0.258877817883E-01 + -0.263131999950E-01 -0.267439692732E-01 -0.271801569298E-01 -0.276218311182E-01 + -0.280690608491E-01 -0.285219160013E-01 -0.289804673321E-01 -0.294447864892E-01 + -0.299149460213E-01 -0.303910193895E-01 -0.308730809789E-01 -0.313612061102E-01 + -0.318554710515E-01 -0.323559530300E-01 -0.328627302445E-01 -0.333758818769E-01 + -0.338954881055E-01 -0.344216301166E-01 -0.349543901178E-01 -0.354938513507E-01 + -0.360400981038E-01 -0.365932157256E-01 -0.371532906381E-01 -0.377204103505E-01 + -0.382946634721E-01 -0.388761397271E-01 -0.394649299680E-01 -0.400611261898E-01 + -0.406648215449E-01 -0.412761103568E-01 -0.418950881356E-01 -0.425218515926E-01 + -0.431564986552E-01 -0.437991284828E-01 -0.444498414814E-01 -0.451087393203E-01 + -0.457759249469E-01 -0.464515026039E-01 -0.471355778444E-01 -0.478282575496E-01 + -0.485296499444E-01 -0.492398646149E-01 -0.499590125257E-01 -0.506872060364E-01 + -0.514245589200E-01 -0.521711863803E-01 -0.529272050698E-01 -0.536927331080E-01 + -0.544678901000E-01 -0.552527971549E-01 -0.560475769050E-01 -0.568523535246E-01 + -0.576672527497E-01 -0.584924018975E-01 -0.593279298863E-01 -0.601739672555E-01 + -0.610306461860E-01 -0.618981005213E-01 -0.627764657876E-01 -0.636658792155E-01 + -0.645664797614E-01 -0.654784081288E-01 -0.664018067907E-01 -0.673368200118E-01 + -0.682835938705E-01 -0.692422762824E-01 -0.702130170229E-01 -0.711959677509E-01 + -0.721912820319E-01 -0.731991153629E-01 -0.742196251956E-01 -0.752529709619E-01 + -0.762993140981E-01 -0.773588180704E-01 -0.784316484004E-01 -0.795179726908E-01 + -0.806179606518E-01 -0.817317841271E-01 -0.828596171213E-01 -0.840016358264E-01 + -0.851580186499E-01 -0.863289462422E-01 -0.875146015250E-01 -0.887151697197E-01 + -0.899308383763E-01 -0.911617974026E-01 -0.924082390941E-01 -0.936703581636E-01 + -0.949483517716E-01 -0.962424195575E-01 -0.975527636701E-01 -0.988795887994E-01 + -0.100223102209 -0.101583513767 -0.102961035980 -0.104355884026 + -0.105768275787 -0.107198431886 -0.108646575716 -0.110112933480 + -0.111597734224 -0.113101209871 -0.114623595260 -0.116165128183 + -0.117726049418 -0.119306602771 -0.120907035111 -0.122527596409 + -0.124168539779 -0.125830121514 -0.127512601129 -0.129216241399 + -0.130941308402 -0.132688071557 -0.134456803671 -0.136247780978 + -0.138061283181 -0.139897593500 -0.141756998709 -0.143639789190 + -0.145546258969 -0.147476705767 -0.149431431045 -0.151410740051 + -0.153414941866 -0.155444349455 -0.157499279713 -0.159580053514 + -0.161686995764 -0.163820435447 -0.165980705682 -0.168168143767 + -0.170383091238 -0.172625893919 -0.174896901976 -0.177196469972 + -0.179524956921 -0.181882726345 -0.184270146327 -0.186687589573 + -0.189135433467 -0.191614060129 -0.194123856476 -0.196665214280 + -0.199238530231 -0.201844205994 -0.204482648277 -0.207154268891 + -0.209859484812 -0.212598718249 -0.215372396706 -0.218180953052 + -0.221024825582 -0.223904458092 -0.226820299941 -0.229772806125 + -0.232762437344 -0.235789660076 -0.238854946647 -0.241958775302 + -0.245101630285 -0.248284001906 -0.251506386623 -0.254769287113 + -0.258073212355 -0.261418677703 -0.264806204967 -0.268236322497 + -0.271709565259 -0.275226474918 -0.278787599924 -0.282393495596 + -0.286044724202 -0.289741855052 -0.293485464582 -0.297276136442 + -0.301114461585 -0.305001038360 -0.308936472602 -0.312921377724 + -0.316956374811 -0.321042092715 -0.325179168153 -0.329368245801 + -0.333609978394 -0.337905026823 -0.342254060242 -0.346657756163 + -0.351116800560 -0.355631887978 -0.360203721633 -0.364833013523 + -0.369520484532 -0.374266864543 -0.379072892546 -0.383939316749 + -0.388866894696 -0.393856393376 -0.398908589341 -0.404024268822 + -0.409204227852 -0.414449272378 -0.419760218389 -0.425137892035 + -0.430583129753 -0.436096778392 -0.441679695336 -0.447332748639 + -0.453056817151 -0.458852790648 -0.464721569968 -0.470664067143 + -0.476681205534 -0.482773919971 -0.488943156890 -0.495189874473 + -0.501515042791 -0.507919643947 -0.514404672219 -0.520971134211 + -0.527620048996 -0.534352448272 -0.541169376507 -0.548071891097 + -0.555061062516 -0.562137974479 -0.569303724093 -0.576559422023 + -0.583906192649 -0.591345174231 -0.598877519074 -0.606504393693 + -0.614226978985 -0.622046470395 -0.629964078090 -0.637981027134 + -0.646098557659 -0.654317925048 -0.662640400107 -0.671067269254 + -0.679599834694 -0.688239414608 -0.696987343339 -0.705844971578 + -0.714813666553 -0.723894812227 -0.733089809483 -0.742400076326 + -0.751827048077 -0.761372177573 -0.771036935370 -0.780822809941 + -0.790731307885 -0.800763954133 -0.810922292153 -0.821207884168 + -0.831622311357 -0.842167174081 -0.852844092089 -0.863654704742 + -0.874600671232 -0.885683670798 -0.896905402959 -0.908267587729 + -0.919771965852 -0.931420299027 -0.943214370138 -0.955155983489 + -0.967246965040 -0.979489162635 -0.991884446251 -1.00443470823 + -1.01714186352 -1.03000784992 -1.04303462834 -1.05622418302 + -1.06957852178 -1.08309967631 -1.09678970238 -1.11065068011 + -1.12468471420 -1.13889393425 -1.15328049494 -1.16784657634 + -1.18259438416 -1.19752615000 -1.21264413164 -1.22795061327 + -1.24344790579 -1.25913834705 -1.27502430215 -1.29110816368 + -1.30739235202 -1.32387931558 -1.34057153110 -1.35747150393 + -1.37458176828 -1.39190488750 -1.40944345440 -1.42720009146 + -1.44517745118 -1.46337821630 -1.48180510011 -1.50046084675 + -1.51934823144 -1.53847006080 -1.55782917312 -1.57742843865 + -1.59727075987 -1.61735907177 -1.63769634214 -1.65828557186 + -1.67912979516 -1.70023207989 -1.72159552785 -1.74322327499 + -1.76511849177 -1.78728438338 -1.80972419000 -1.83244118714 + -1.85543868582 -1.87872003292 -1.90228861138 -1.92614784049 + -1.95030117614 -1.97475211108 -1.99950417515 -2.02456093554 + -2.04992599703 -2.07560300222 -2.10159563175 -2.12790760454 + -2.15454267797 -2.18150464814 -2.20879735001 -2.23642465763 + -2.26439048431 -2.29269878277 -2.32135354534 -2.35035880406 + -2.37971863082 -2.40943713752 -2.43951847613 -2.46996683877 + -2.50078645782 -2.53198160594 -2.56355659609 -2.59551578157 + -2.62786355598 -2.66060435316 -2.69374264717 -2.72728295212 + -2.76122982212 -2.79558785104 -2.83036167235 -2.86555595889 + -2.90117542255 -2.93722481395 -2.97370892212 -3.01063257399 + -3.04800063399 -3.08581800346 -3.12408962009 -3.16282045723 + -3.20201552315 -3.24167986027 -3.28181854421 -3.32243668289 + -3.36353941539 -3.40513191084 -3.44721936711 -3.48980700949 + -3.53290008915 -3.57650388155 -3.62062368467 -3.66526481715 + -3.71043261624 -3.75613243560 -3.80236964295 -3.84914961753 + -3.89647774735 -3.94435942630 -3.99280005099 -4.04180501738 + -4.09137971720 -4.14152953408 -4.19225983943 -4.24357598809 + -4.29548331356 -4.34798712303 -4.40109269207 -4.45480525888 + -4.50913001827 -4.56407211520 -4.61963663792 -4.67582861069 + -4.73265298602 -4.79011463645 -4.84821834583 -4.90696880004 + -4.96637057719 -5.02642813721 -5.08714581082 -5.14852778791 + -5.21057810514 -5.27330063297 -5.33669906179 -5.40077688743 + -5.46553739575 -5.53098364640 -5.59711845576 -5.66394437890 + -5.73146369054 -5.79967836512 -5.86859005573 -5.93820007202 + -6.00850935693 -6.07951846228 -6.15122752318 -6.22363623119 + -6.29674380608 -6.37054896645 -6.44504989879 -6.52024422528 + -6.59612897003 -6.67270052392 -6.74995460787 -6.82788623457 + -6.90648966866 -6.98575838531 -7.06568502712 -7.14626135948 + -7.22747822419 -7.30932549152 -7.39179201053 -7.47486555787 + -7.55853278489 -7.64277916315 -7.72758892851 -7.81294502360 + -7.89882903899 -7.98522115295 -8.07210007002 -8.15944295846 + -8.24722538678 -8.33542125933 -8.42400275143 -8.51294024394 + -8.60220225776 -8.69175538836 -8.78156424067 -8.87159136479 + -8.96179719269 -9.05213997649 -9.14257572863 -9.23305816455 + -9.32353864831 -9.41396614187 -9.50428715852 -9.59444572132 + -9.68438332722 -9.77403891767 -9.86334885664 -9.95224691703 + -10.0406642764 -10.1285295230 -10.2157686739 -10.3023052051 + -10.3880600963 -10.4729518913 -10.5568967746 -10.6398086669 + -10.7215993400 -10.8021785539 -10.8814542165 -10.9593325680 + -11.0357183925 -11.1105152572 -11.1836257819 -11.2549519404 + -11.3243953954 -11.3918578677 -11.4572415433 -11.5204495174 + -11.5813862785 -11.6399582325 -11.6960742686 -11.7496463664 + -11.8005902456 -11.8488260572 -11.8942791164 -11.9368806746 + -11.9765687303 -12.0132888747 -12.0469951691 -12.0776510501 + -12.1052302561 -12.1297177684 -12.1511107589 -12.1694195354 + -12.1846684703 -12.1968969033 -12.2061599984 -12.2125295414 + -12.2160946542 -12.2169624071 -12.2152582995 -12.2111265852 + -12.2047304067 -12.1962517088 -12.1858908917 -12.1738661644 + -12.1604125580 -12.1457805534 -12.1302342794 -12.1140492357 + -12.0975094973 -12.0809043600 -12.0645243920 -12.0486568663 + -12.0335805605 -12.0195599304 -12.0068386875 -11.9956328433 + -11.9861233263 -11.9784483328 -11.9726956408 -11.9688952048 + -11.9670124588 -11.9669428853 -11.9685085801 -11.9714577369 + -11.9754682273 -11.9801567454 -11.9850953470 -11.9898376444 + -11.9939574386 -11.9971031932 -11.9991345136 -11.9999230921 + -12.0000373010 -12.0000296134 -12.0000234687 -12.0000185484 + -12.0000146193 -12.0000114907 -12.0000090064 -12.0000070395 + -12.0000054868 -12.0000042645 -12.0000033052 -12.0000025546 + -12.0000019689 -12.0000015134 -12.0000011601 -12.0000008870 + -12.0000006765 -12.0000005147 -12.0000003907 -12.0000002960 + -12.0000002238 -12.0000001689 -12.0000001274 -12.0000000960 + -12.0000000723 -12.0000000545 -12.0000000411 -12.0000000310 + -12.0000000235 -12.0000000179 -12.0000000137 -12.0000000105 + -12.0000000081 -12.0000000063 -12.0000000050 -12.0000000039 + -12.0000000031 -12.0000000025 -12.0000000021 -12.0000000017 + -12.0000000014 -12.0000000012 -12.0000000010 -12.0000000008 + -12.0000000007 -12.0000000006 -12.0000000005 -12.0000000004 + -12.0000000004 -12.0000000003 -12.0000000003 -12.0000000002 + -12.0000000002 -12.0000000002 -12.0000000001 -12.0000000001 + -12.0000000001 -12.0000000001 -12.0000000001 -12.0000000001 + -12.0000000001 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 + -12.0000000000 + Core charge follows + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 0.00000000000 0.00000000000 0.00000000000 + 0.00000000000 + Valence charge follows + 0.492067138083E-10 0.199310418009E-09 0.454118792434E-09 0.817551676193E-09 + 0.129364410540E-08 0.188654943031E-08 0.260054251385E-08 0.344002301379E-08 + 0.440951875045E-08 0.551368916247E-08 0.675732885253E-08 0.814537122571E-08 + 0.968289222256E-08 0.113751141495E-07 0.132274096089E-07 0.152453055317E-07 + 0.174344873149E-07 0.198008030662E-07 0.223502679600E-07 0.250890687061E-07 + 0.280235681343E-07 0.311603098984E-07 0.345060233031E-07 0.380676282544E-07 + 0.418522403407E-07 0.458671760441E-07 0.501199580876E-07 0.546183209208E-07 + 0.593702163479E-07 0.643838193018E-07 0.696675337669E-07 0.752299988566E-07 + 0.810800950472E-07 0.872269505734E-07 0.936799479897E-07 0.100448730901E-06 + 0.107543210869E-06 0.114973574491E-06 0.122750290675E-06 0.130884118085E-06 + 0.139386112795E-06 0.148267636130E-06 0.157540362713E-06 0.167216288724E-06 + 0.177307740364E-06 0.187827382542E-06 0.198788227788E-06 0.210203645393E-06 + 0.222087370783E-06 0.234453515142E-06 0.247316575271E-06 0.260691443715E-06 + 0.274593419142E-06 0.289038216989E-06 0.304041980389E-06 0.319621291371E-06 + 0.335793182355E-06 0.352575147941E-06 0.369985156997E-06 0.388041665068E-06 + 0.406763627091E-06 0.426170510450E-06 0.446282308355E-06 0.467119553576E-06 + 0.488703332524E-06 0.511055299691E-06 0.534197692468E-06 0.558153346340E-06 + 0.582945710472E-06 0.608598863694E-06 0.635137530898E-06 0.662587099859E-06 + 0.690973638478E-06 0.720323912479E-06 0.750665403555E-06 0.782026327979E-06 + 0.814435655691E-06 0.847923129883E-06 0.882519287074E-06 0.918255477711E-06 + 0.955163887291E-06 0.993277558026E-06 0.103263041107E-05 0.107325726930E-05 + 0.111519388071E-05 0.115847694236E-05 0.120314412497E-05 0.124923409818E-05 + 0.129678655633E-05 0.134584224508E-05 0.139644298856E-05 0.144863171727E-05 + 0.150245249674E-05 0.155795055682E-05 0.161517232186E-05 0.167416544149E-05 + 0.173497882236E-05 0.179766266058E-05 0.186226847501E-05 0.192884914143E-05 + 0.199745892760E-05 0.206815352911E-05 0.214099010632E-05 0.221602732205E-05 + 0.229332538042E-05 0.237294606653E-05 0.245495278726E-05 0.253941061305E-05 + 0.262638632079E-05 0.271594843779E-05 0.280816728683E-05 0.290311503248E-05 + 0.300086572846E-05 0.310149536631E-05 0.320508192528E-05 0.331170542345E-05 + 0.342144797026E-05 0.353439382025E-05 0.365062942827E-05 0.377024350609E-05 + 0.389332708039E-05 0.401997355235E-05 0.415027875860E-05 0.428434103391E-05 + 0.442226127534E-05 0.456414300807E-05 0.471009245297E-05 0.486021859581E-05 + 0.501463325830E-05 0.517345117089E-05 0.533679004749E-05 0.550477066206E-05 + 0.567751692718E-05 0.585515597457E-05 0.603781823776E-05 0.622563753681E-05 + 0.641875116518E-05 0.661729997888E-05 0.682142848784E-05 0.703128494965E-05 + 0.724702146568E-05 0.746879407965E-05 0.769676287874E-05 0.793109209725E-05 + 0.817195022295E-05 0.841951010611E-05 0.867394907134E-05 0.893544903226E-05 + 0.920419660915E-05 0.948038324954E-05 0.976420535195E-05 0.100558643928E-04 + 0.103555670563E-04 0.106635253682E-04 0.109799568324E-04 0.113050845716E-04 + 0.116391374708E-04 0.119823503252E-04 0.123349639915E-04 0.126972255432E-04 + 0.130693884300E-04 0.134517126406E-04 0.138444648708E-04 0.142479186948E-04 + 0.146623547415E-04 0.150880608754E-04 0.155253323816E-04 0.159744721557E-04 + 0.164357908993E-04 0.169096073193E-04 0.173962483330E-04 0.178960492786E-04 + 0.184093541309E-04 0.189365157218E-04 0.194778959680E-04 0.200338661031E-04 + 0.206048069163E-04 0.211911089971E-04 0.217931729865E-04 0.224114098343E-04 + 0.230462410629E-04 0.236980990384E-04 0.243674272484E-04 0.250546805865E-04 + 0.257603256450E-04 0.264848410142E-04 0.272287175897E-04 0.279924588884E-04 + 0.287765813709E-04 0.295816147739E-04 0.304081024504E-04 0.312566017181E-04 + 0.321276842180E-04 0.330219362812E-04 0.339399593058E-04 0.348823701426E-04 + 0.358498014923E-04 0.368429023109E-04 0.378623382275E-04 0.389087919715E-04 + 0.399829638115E-04 0.410855720054E-04 0.422173532617E-04 0.433790632134E-04 + 0.445714769038E-04 0.457953892845E-04 0.470516157271E-04 0.483409925473E-04 + 0.496643775429E-04 0.510226505460E-04 0.524167139892E-04 0.538474934862E-04 + 0.553159384280E-04 0.568230225944E-04 0.583697447810E-04 0.599571294430E-04 + 0.615862273553E-04 0.632581162902E-04 0.649739017122E-04 0.667347174912E-04 + 0.685417266343E-04 0.703961220364E-04 0.722991272508E-04 0.742519972794E-04 + 0.762560193837E-04 0.783125139174E-04 0.804228351799E-04 0.825883722933E-04 + 0.848105501008E-04 0.870908300904E-04 0.894307113414E-04 0.918317314961E-04 + 0.942954677579E-04 0.968235379142E-04 0.994176013871E-04 0.102079360312E-03 + 0.104810560643E-03 0.107612993290E-03 0.110488495283E-03 0.113438950971E-03 + 0.116466293248E-03 0.119572504813E-03 0.122759619466E-03 0.126029723436E-03 + 0.129384956744E-03 0.132827514603E-03 0.136359648857E-03 0.139983669452E-03 + 0.143701945954E-03 0.147516909107E-03 0.151431052423E-03 0.155446933826E-03 + 0.159567177336E-03 0.163794474794E-03 0.168131587640E-03 0.172581348737E-03 + 0.177146664240E-03 0.181830515518E-03 0.186635961131E-03 0.191566138860E-03 + 0.196624267781E-03 0.201813650414E-03 0.207137674916E-03 0.212599817338E-03 + 0.218203643944E-03 0.223952813593E-03 0.229851080191E-03 0.235902295196E-03 + 0.242110410211E-03 0.248479479633E-03 0.255013663380E-03 0.261717229699E-03 + 0.268594558041E-03 0.275650142024E-03 0.282888592474E-03 0.290314640554E-03 + 0.297933140975E-03 0.305749075304E-03 0.313767555357E-03 0.321993826691E-03 + 0.330433272196E-03 0.339091415783E-03 0.347973926182E-03 0.357086620841E-03 + 0.366435469944E-03 0.376026600532E-03 0.385866300755E-03 0.395961024231E-03 + 0.406317394545E-03 0.416942209860E-03 0.427842447679E-03 0.439025269729E-03 + 0.450498026997E-03 0.462268264905E-03 0.474343728639E-03 0.486732368634E-03 + 0.499442346218E-03 0.512482039422E-03 0.525860048960E-03 0.539585204385E-03 + 0.553666570433E-03 0.568113453547E-03 0.582935408602E-03 0.598142245822E-03 + 0.613744037919E-03 0.629751127431E-03 0.646174134289E-03 0.663023963614E-03 + 0.680311813747E-03 0.698049184526E-03 0.716247885813E-03 0.734920046285E-03 + 0.754078122494E-03 0.773734908208E-03 0.793903544042E-03 0.814597527383E-03 + 0.835830722629E-03 0.857617371751E-03 0.879972105181E-03 0.902909953045E-03 + 0.926446356756E-03 0.950597180967E-03 0.975378725913E-03 0.100080774014E-02 + 0.102690143366E-02 0.105367749151E-02 0.108115408773E-02 0.110934989988E-02 + 0.113828412393E-02 0.116797648970E-02 0.119844727677E-02 0.122971733095E-02 + 0.126180808129E-02 0.129474155762E-02 0.132854040870E-02 0.136322792101E-02 + 0.139882803814E-02 0.143536538078E-02 0.147286526753E-02 0.151135373629E-02 + 0.155085756642E-02 0.159140430172E-02 0.163302227408E-02 0.167574062809E-02 + 0.171958934640E-02 0.176459927601E-02 0.181080215550E-02 0.185823064315E-02 + 0.190691834614E-02 0.195689985074E-02 0.200821075356E-02 0.206088769395E-02 + 0.211496838758E-02 0.217049166118E-02 0.222749748857E-02 0.228602702799E-02 + 0.234612266084E-02 0.240782803174E-02 0.247118809016E-02 0.253624913355E-02 + 0.260305885208E-02 0.267166637502E-02 0.274212231887E-02 0.281447883733E-02 + 0.288878967312E-02 0.296511021172E-02 0.304349753723E-02 0.312401049032E-02 + 0.320670972840E-02 0.329165778805E-02 0.337891914998E-02 0.346856030636E-02 + 0.356064983085E-02 0.365525845133E-02 0.375245912547E-02 0.385232711927E-02 + 0.395494008868E-02 0.406037816446E-02 0.416872404034E-02 0.428006306480E-02 + 0.439448333638E-02 0.451207580285E-02 0.463293436441E-02 0.475715598095E-02 + 0.488484078369E-02 0.501609219132E-02 0.515101703085E-02 0.528972566340E-02 + 0.543233211511E-02 0.557895421334E-02 0.572971372860E-02 0.588473652216E-02 + 0.604415269985E-02 0.620809677216E-02 0.637670782102E-02 0.655012967344E-02 + 0.672851108243E-02 0.691200591544E-02 0.710077335066E-02 0.729497808160E-02 + 0.749479053015E-02 0.770038706870E-02 0.791195025155E-02 0.812966905610E-02 + 0.835373913423E-02 0.858436307433E-02 0.882175067440E-02 0.906611922679E-02 + 0.931769381501E-02 0.957670762319E-02 0.984340225871E-02 0.101180280886E-01 + 0.104008445903E-01 0.106921207175E-01 0.109921352814E-01 0.113011773486E-01 + 0.116195466556E-01 0.119475540419E-01 0.122855219006E-01 0.126337846489E-01 + 0.129926892193E-01 0.133625955705E-01 0.137438772220E-01 0.141369218101E-01 + 0.145421316685E-01 0.149599244340E-01 0.153907336779E-01 0.158350095643E-01 + 0.162932195372E-01 0.167658490362E-01 0.172534022441E-01 0.177564028652E-01 + 0.182753949375E-01 0.188109436796E-01 0.193636363739E-01 0.199340832866E-01 + 0.205229186279E-01 0.211308015522E-01 0.217584172011E-01 0.224064777903E-01 + 0.230757237425E-01 0.237669248682E-01 0.244808815957E-01 0.252184262532E-01 + 0.259804244041E-01 0.267677762382E-01 0.275814180207E-01 0.284223236008E-01 + 0.292915059839E-01 0.301900189664E-01 0.311189588398E-01 0.320794661626E-01 + 0.330727276048E-01 0.340999778676E-01 0.351625016793E-01 0.362616358722E-01 + 0.373987715415E-01 0.385753562902E-01 0.397928965620E-01 0.410529600660E-01 + 0.423571782954E-01 0.437072491434E-01 0.451049396194E-01 0.465520886685E-01 + 0.480506100979E-01 0.496024956112E-01 0.512098179574E-01 0.528747341930E-01 + 0.545994890649E-01 0.563864185130E-01 0.582379532984E-01 0.601566227584E-01 + 0.621450586919E-01 0.642059993774E-01 0.663422937265E-01 0.685569055749E-01 + 0.708529181140E-01 0.732335384636E-01 0.757021023898E-01 0.782620791668E-01 + 0.809170765870E-01 0.836708461174E-01 0.865272882051E-01 0.894904577308E-01 + 0.925645696109E-01 0.957540045462E-01 0.990633149169E-01 0.102497230822 + 0.106060666260 0.109758725445 0.113596709263 0.117580121849 + 0.121714677291 0.126006306451 0.130461163890 0.135085634890 + 0.139886342569 0.144870155065 0.150044192782 0.155415835687 + 0.160992730627 0.166782798660 0.172794242379 0.179035553190 + 0.185515518542 0.192243229057 0.199228085549 0.206479805888 + 0.214008431673 0.221824334681 0.229938223042 0.238361147097 + 0.247104504893 0.256180047256 0.265599882383 0.275376479910 + 0.285522674357 0.296051667916 0.306977032482 0.318312710863 + 0.330073017079 0.342272635658 0.354926619848 0.368050388635 + 0.381659722469 0.395770757591 0.410399978842 0.425564210848 + 0.441280607445 0.457566639229 0.474440079091 0.491918985611 + 0.510021684163 0.528766745600 0.548172962370 0.568259321916 + 0.589044977219 0.610549214330 0.632791416759 0.655791026560 + 0.679567501983 0.704140271557 0.729528684466 0.755751957110 + 0.782829115719 0.810778934941 0.839619872303 0.869369998471 + 0.900046923277 0.931667717455 0.964248830099 0.997806001852 + 1.03235417388 1.06790739272 1.10447871109 1.14208008487 + 1.18072226639 1.22041469435 1.26116538063 1.30298079424 + 1.34586574303 1.38982325343 1.43485444883 1.48095842711 + 1.52813213812 1.57637026161 1.62566508655 1.67600639262 + 1.72738133475 1.77977433171 1.83316695973 1.88753785230 + 1.94286260710 1.99911370140 2.05626041706 2.11426877616 + 2.17310148880 2.23271791391 2.29307403456 2.35412244869 + 2.41581237648 2.47808968531 2.54089693326 2.60417343186 + 2.66785532896 2.73187571190 2.79616473160 2.86064974751 + 2.92525549331 2.98990426307 3.05451611718 3.11900910724 + 3.18329951858 3.24730212917 3.31093048295 3.37409717567 + 3.43671415091 3.49869300374 3.55994528916 3.62038283249 + 3.67991803844 3.73846419577 3.79593577419 3.85224871027 + 3.90732067927 3.96107134979 4.01342261853 4.06429882274 + 4.11362692821 4.16133669127 4.20736079363 4.25163494961 + 4.29409798580 4.33469189396 4.37336185843 4.41005626012 + 4.44472665979 4.47732776356 4.50781737440 4.53615633346 + 4.56230845529 4.58624046122 4.60792191475 4.62732516275 + 4.64442528556 4.65920005848 4.67162992619 4.68169799093 + 4.68939001375 4.69469442739 4.69760235820 4.69810765343 + 4.69620690965 4.69189949733 4.68518757689 4.67607610157 + 4.66457280356 4.65068816116 4.63443534695 4.61583015916 + 4.59489094172 4.57163850139 4.54609603353 4.51828907108 + 4.48824547317 4.45599547098 4.42157178748 4.38500984471 + 4.34634806684 4.30562827773 4.26289617956 4.21820188173 + 4.17160042837 4.12315224651 4.07292340562 4.02098553498 + 3.96741520785 3.91229270410 3.85570039022 3.79772183704 + 3.73844220461 3.67794751735 3.61632467743 3.55366118319 + 3.49004493484 3.42556402346 3.36030652592 3.29436030323 + 3.22781280335 3.16075086907 3.09326055139 3.02542692910 + 2.95733393492 2.88906418864 2.82069883781 2.75231740615 + 2.68399765019 2.61581542427 2.54784455424 2.48015672003 + 2.41282134725 2.34590550793 2.27947383050 2.21358841904 + 2.14830878184 2.08369176910 2.01979151997 1.95665941851 + 1.89434405873 1.83289121832 1.77234384105 1.71274202751 + 1.65412303402 1.59652127942 1.53996835945 1.48449306846 + 1.43012142805 1.37687672242 1.32477954001 1.27384782105 + 1.22409691075 1.17553961764 1.12818627686 1.08204481776 + 1.03712083564 0.993417667225 0.950936469352 0.909676300637 + 0.869634205674 0.830805301416 0.793182865369 0.756758425238 + 0.721521849691 0.687461439890 0.654564021475 0.622815036670 + 0.592198636236 0.562697770947 0.534294282351 0.506968992525 + 0.480701792602 0.455471729826 0.431257092922 0.408035495597 + 0.385783957966 0.364478985760 0.344096647145 0.324612647041 + 0.306002398794 0.288241093127 0.271303764262 0.255165353147 + 0.239800767736 0.225184940264 0.211292881502 0.198099731964 + 0.185580810065 0.173711657235 0.162468080012 0.151826189135 + 0.141762435681 0.132253644289 0.123277043532 0.114810293494 + 0.106831510624 0.993192899499E-01 0.922527247176E-01 0.856114235606E-01 + 0.793755252759E-01 0.735257113068E-01 0.680432160256E-01 0.629098349172E-01 + 0.581079307604E-01 0.536204379104E-01 0.494308647818E-01 0.455232946350E-01 + 0.418823847648E-01 0.384933641941E-01 0.353420299687E-01 0.324147421527E-01 + 0.296984176190E-01 0.271805227286E-01 0.248490649910E-01 0.226925837928E-01 + 0.207001402830E-01 0.188613064967E-01 0.171661537993E-01 0.156052407289E-01 + 0.141696003109E-01 0.128507269183E-01 0.116405627456E-01 0.105314839628E-01 + 0.951628661145E-02 0.858817230414E-02 0.774073378304E-02 0.696794039176E-02 + 0.626412351155E-02 0.562396200967E-02 0.504246774497E-02 0.451497117308E-02 + 0.403710709027E-02 0.360480055288E-02 0.321425300589E-02 0.286192865197E-02 + 0.254454108916E-02 0.225904024338E-02 0.200259961863E-02 0.177260388584E-02 + 0.156663682850E-02 0.138246966090E-02 0.121804973242E-02 0.107148962905E-02 + 0.941056680999E-03 0.825162883251E-03 0.722355233771E-03 0.631306492009E-03 + 0.550806358615E-03 0.479753075379E-03 0.417145442735E-03 0.362075250607E-03 + 0.313720116855E-03 0.271336726278E-03 0.234254461811E-03 0.201869418488E-03 + 0.173638789701E-03 0.149075614399E-03 0.127743873121E-03 0.109253920075E-03 + 0.932582379717E-04 0.794475018827E-04 0.675469380753E-04 0.573129635841E-04 + 0.485300921564E-04 0.410080921990E-04 0.345793824258E-04 0.290966510552E-04 + 0.244306846351E-04 0.204683928657E-04 0.171110161383E-04 0.142725029168E-04 + 0.118780445310E-04 0.986275543852E-05 0.817048752447E-05 0.675276754701E-05 + 0.556784739077E-05 0.457985735540E-05 0.375805327709E-05 0.307614885108E-05 + 0.251172508931E-05 0.204570940360E-05 0.166191734962E-05 0.134665059473E-05 + 0.108834518340E-05 0.877264662498E-06 0.705233096067E-06 0.565403441574E-06 + 0.452057178061E-06 0.360431469062E-06 0.286570510258E-06 0.227198053263E-06 + 0.179608413059E-06 0.141573558050E-06 0.111264149079E-06 0.871826381400E-07 + 0.681067597077E-07 0.530419490085E-07 0.411814030886E-07 0.318726636740E-07 + 0.245897466955E-07 0.189099733068E-07 0.144947725022E-07 0.110738272879E-07 + 0.843202596278E-08 0.639875858379E-08 0.483916721040E-08 0.364701806971E-08 + 0.273891533023E-08 0.204962060172E-08 0.152828042193E-08 0.113539660121E-08 + 0.840402060306E-09 0.619728337900E-09 0.455270821748E-09 0.333174470034E-09 + 0.242876783297E-09 0.176356454175E-09 0.127545807959E-09 0.918731534478E-10 + 0.659077533626E-10 0.470855238045E-10 0.334979781014E-10 0.237305092574E-10 + 0.167389992590E-10 0.117560732930E-10 0.822018397683E-11 0.572220007784E-11 + 0.396535681355E-11 0.273535948917E-11 0.187816745983E-11 0.128356100872E-11 + 0.873042207831E-12 0.590968561572E-12 0.398086537087E-12 0.266838079980E-12 + 0.177970581346E-12 0.118100374875E-12 0.779702958636E-13 0.512098838857E-13 + 0.334577400567E-13 0.217434652220E-13 0.140546823862E-13 0.903532640701E-14 + 0.577653260680E-14 0.367249190037E-14 0.232163520229E-14 0.145926956738E-14 + 0.911914218636E-15 0.566522907139E-15 0.349859521425E-15 0.214758300607E-15 + 0.131024693049E-15 0.794455821451E-16 0.478702634244E-16 0.286620320988E-16 + 0.170513367862E-16 0.100782457013E-16 0.591767113103E-17 0.345159598746E-17 + 0.199965810434E-17 0.115059149725E-17 0.657474155631E-18 0.373070016172E-18 + 0.210192726827E-18 0.117576834047E-18 0.652924778228E-19 0.359916639436E-19 + 0.196923551975E-19 0.106932426660E-19 0.576229862932E-20 0.308116323951E-20 + 0.163464617449E-20 0.860359369591E-21 0.449199768652E-21 0.232626150035E-21 + 0.119479182375E-21 0.608548798448E-22 0.307342220241E-22 0.153895634017E-22 + 0.763942482449E-23 0.375904692604E-23 0.183328249803E-23 0.886067537413E-24 + 0.424366078290E-24 0.201372837587E-24 0.946666200135E-25 0.440836277434E-25 + 0.203324788198E-25 0.928716786551E-26 0.420051926337E-26 0.188102888672E-26 + 0.833884973106E-27 0.365914599940E-27 0.158913299884E-27 0.682953245443E-28 + 0.290411964045E-28 0.122172284825E-28 0.508401321599E-29 0.209245826429E-29 + 0.851653071919E-30 0.342738794473E-30 0.136362993829E-30 0.536290125591E-31 + 0.208453688437E-31 0.800684778133E-32 0.303871971308E-32 0.113928098483E-32 + 0.421905710048E-33 0.154303817980E-33 0.557244976820E-34 0.198680164185E-34 + 0.699248382637E-35 0.242887913960E-35 0.832541269225E-36 0.281551670887E-36 + 0.939266932370E-37 0.309046419097E-37 0.100273547372E-37 0.320774827979E-38 + 0.101155080901E-38 0.314390876899E-39 0.962869150208E-40 0.290535357024E-40 + 0.863541762028E-41 0.252776994572E-41 0.728580853639E-42 0.206737407810E-42 + 0.577398300452E-43 0.158693809563E-43 0.429125521306E-44 0.114145628155E-44 + 0.298603144914E-45 0.768065153929E-46 0.194212694338E-46 0.482657587449E-47 + 0.117865732555E-47 0.282765622000E-48 0.666283105990E-49 0.154164876475E-49 + 0.350192293450E-50 0.780766289609E-51 0.170815157143E-51 0.366622337929E-52 + 0.771780157692E-53 0.159310415172E-53 0.322376223484E-54 0.639353712209E-55 + 0.124242014288E-55 0.236501169680E-56 0.440882316895E-57 0.804678407904E-58 + 0.143752904980E-58 0.251297681757E-59 0.429753553997E-60 0.718769753007E-61 + 0.117537976705E-61 0.187872019796E-62 0.293438733657E-63 0.447732651291E-64 + 0.667174161330E-65 0.970622839045E-66 0.137823387979E-66 0.190952492052E-67 + 0.258062668805E-68 0.340085800650E-69 0.436897851065E-70 0.546968808210E-71 + 0.667111386677E-72 0.792405437701E-73 0.916366802295E-74 0.103138442652E-74 + 0.112943105187E-75 0.120292104147E-76 0.124570818703E-77 0.125376680381E-78 + 0.122655219192E-79 0.116821097577E-80 0.108021194521E-81 0.969365470990E-83 + 0.843904678479E-84 diff --git a/aiida_defects/formation_energy_siesta/utils.py b/aiida_defects/formation_energy_siesta/utils.py new file mode 100644 index 0000000..fd980ee --- /dev/null +++ b/aiida_defects/formation_energy_siesta/utils.py @@ -0,0 +1,132 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida.engine import calcfunction + + +#def run_pw_calculation(pw_inputs, structure, charge): +# """ +# Run a QuantumESPRESSO PW.x calculation by invoking the appropriate workchain. +# The user is not restricted in how they set up the PW calculation. +# This function simply acts as a wrapper to run a user-configured generic pw.x builder object +# +# Parameters +# ---------- +# pw_builder : AiiDA ProcessBuilder +# An AiiDA ProcessBuilder object for the desired QuantumEspresso workchain +# structure: AiiDA StructureData +# The required structure +# charge: AiiDA Float +# The required total system charge. Adding an electron is negative by convention + +# Returns +# ------- +# future +# A future representing the submitted calculation +# """ +# from aiida.engine import submit +# from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain +# from aiida_quantumespresso.workflows.pw.relax import PwRelaxWorkChain +# +# # Add the appropriate system charge and structure +# pw_inputs['structure'] = structure +# +# pw_inputs['parameters']['SYSTEM']['tot_charge'] = charge +# +# future = submit(PwBaseWorkChain, **pw_inputs) +# +# return future + + +#def run_siesta_calculation(pw_inputs, structure, charge): +# """ +# +# """ +# +# from aiida.engine import submit +# from aiida_siesta.workflows.base import SiestaBaseWorkChain +# from aiida_quantumespresso.workflows.pw.relax import PwRelaxWorkChain + +@calcfunction +def get_raw_formation_energy(defect_energy, host_energy, chemical_potential, + charge, fermi_energy, valence_band_maximum): + """ + Compute the formation energy without correction + """ + e_f_uncorrected = defect_energy - host_energy - chemical_potential + ( + charge * (valence_band_maximum + fermi_energy)) + return e_f_uncorrected + + +@calcfunction +def get_corrected_formation_energy(e_f_uncorrected, correction): + """ + Compute the formation energy with correction + """ + e_f_corrected = e_f_uncorrected + correction + return e_f_corrected + + +@calcfunction +def get_corrected_aligned_formation_energy(e_f_corrected, alignment): + """ + Compute the formation energy with correction and aligned + """ + e_f_corrected_aligned = e_f_corrected + alignment + return e_f_corrected_aligned + + +# def run_pw_calculation(pw_inputs, charge, run_type, additional_inputs=None): +# """ +# Run a QuantumESPRESSO PW.x calculation by invoking the PW workchain + +# Parameters +# ---------- +# pw_inputs : AiiDA Dict +# A : AiiDA Float +# The required total system charge. Adding an electron is negative by convention +# run_type: AiiDA String +# The desired type of calculation. Allowed values: 'scf', 'relax', 'vc-relax' + +# Returns +# ------- +# pw_object? +# A future representing the submitted calculation +# """ + +# required_keys = [ +# 'code', 'pseudos', 'parameters', 'settings', 'metadata', +# 'structure' +# ] + +# # Validate builder dictionary +# for key in required_keys: +# if key not in pw_inputs: +# raise KeyError( +# "Required key, '{}' not found in input dictionary".format(key)) + +# # Validate 'run_type' +# if run_type not in ['scf', 'relax', 'vc-relax']: +# raise ValueError("Run type, '{}', not recognised".format(run_type)) + +# builder['parameters']['SYSTEM']['tot_charge'] = charge + +# if run_type == 'relax' or run_type == 'vc-relax': +# pw_inputs['relaxation_scheme'] = run_type +# running = submit(PwRelaxWorkChain, **inputs) +# self.report( +# 'Launching PwRelaxWorkChain for structure, {}, with charge {} (PK={})' +# .format(pw_inputs.structure, charge, running.pid)) +# return running +# else: +# future = submit(PwBaseWorkChain, **inputs) +# self.report( +# 'Launching PwBaseWorkChain for structure, {}, with charge {} (PK={})' +# .format(pw_inputs.structure, charge, future.pid))s +# return future From c2ceddf229c3eea3313cbb75abc579047c2f9ad1 Mon Sep 17 00:00:00 2001 From: ConradJohnston <40352432+ConradJohnston@users.noreply.github.com> Date: Thu, 3 Sep 2020 14:54:07 +0100 Subject: [PATCH 16/60] Revert "Adding siesta-dev branch" --- .../DefectWorkflowExample.ipynb | 823 -------- .../DefectWorkflowExample.py | 322 --- .../formation_energy_siesta/__init__.py | 7 - .../gaussian/gaussian_countercharge.py | 338 --- .../formation_energy_base.py | 364 ---- .../formation_energy_siesta.py | 314 --- .../formation_energy_siesta.py-backup | 340 --- .../pseudos/GhostH.psf | 1527 -------------- .../formation_energy_siesta/pseudos/H.psf | 1527 -------------- .../formation_energy_siesta/pseudos/O.psf | 1821 ----------------- .../formation_energy_siesta/utils.py | 132 -- 11 files changed, 7515 deletions(-) delete mode 100644 aiida_defects/formation_energy_siesta/DefectWorkflowExample.ipynb delete mode 100644 aiida_defects/formation_energy_siesta/DefectWorkflowExample.py delete mode 100644 aiida_defects/formation_energy_siesta/__init__.py delete mode 100644 aiida_defects/formation_energy_siesta/corrections/gaussian/gaussian_countercharge.py delete mode 100644 aiida_defects/formation_energy_siesta/formation_energy_base.py delete mode 100644 aiida_defects/formation_energy_siesta/formation_energy_siesta.py delete mode 100644 aiida_defects/formation_energy_siesta/formation_energy_siesta.py-backup delete mode 100644 aiida_defects/formation_energy_siesta/pseudos/GhostH.psf delete mode 100644 aiida_defects/formation_energy_siesta/pseudos/H.psf delete mode 100644 aiida_defects/formation_energy_siesta/pseudos/O.psf delete mode 100644 aiida_defects/formation_energy_siesta/utils.py diff --git a/aiida_defects/formation_energy_siesta/DefectWorkflowExample.ipynb b/aiida_defects/formation_energy_siesta/DefectWorkflowExample.ipynb deleted file mode 100644 index b670818..0000000 --- a/aiida_defects/formation_energy_siesta/DefectWorkflowExample.ipynb +++ /dev/null @@ -1,823 +0,0 @@ -{ - "cells": [ - { - "cell_type": "code", - "execution_count": 1, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from __future__ import absolute_import\n", - "import aiida" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from aiida import load_profile\n", - "load_profile()\n", - "\n", - "# Import commonly used functionality\n", - "import numpy as np\n", - "from aiida import orm, engine, common\n", - "from aiida.plugins import WorkflowFactory\n", - "from aiida.orm import Code\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "#!pwd" - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "!reentry scan" - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[22mRestarting the daemon... \u001b[0m\u001b[32m\u001b[1mOK\u001b[0m\n" - ] - } - ], - "source": [ - "!verdi daemon restart\n", - "#!verdi daemon restart\n", - "#!$JUPYTER_PATH\n", - "#!export JUPYTER_PATH=\"/home/aakhtar/Projects/aiida-defects-siesta/siesta-defect-formation/aiida-workflow/formation_energy/;$JUPYTER_PATH\"" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from aiida_siesta.workflows.defect_formation.formation_energy_siesta import FormationEnergyWorkchainSIESTA\n", - "#import .formation_energy_siesta\n", - "#!pwd" - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from aiida.orm import StructureData\n", - "#Structure Pure\n", - "cell = [[15.0, 0.0, 0.0,],\n", - " [ 0.0,15.0, 0.0,],\n", - " [ 0.0, 0.0,15.0,],\n", - " ]\n", - "pure = StructureData(cell=cell)\n", - "pure.append_atom(position=( 0.000 , 0.000 , 0.000 ),symbols=['O']) #1\n", - "#pure.append_atom(position=( 0.757 , 0.586 , 0.000 ),symbols=['H']) #2\n", - "#pure.append_atom(position=(-0.757 , 0.586 , 0.000),symbols=['H']) #3 \n", - "#pure.append_atom(position=( 0.000 , 3.500 , 0.000),symbols=['O']) #4\n", - "#pure.append_atom(position=( 0.757 , 2.914 , 0.000 ),symbols=['H']) #5\n", - "#pure.append_atom(position=(-0.757 , 2.914 , 0.000),symbols=['H']) #6\n", - "\n", - "\n", - "defect=StructureData(cell=cell)\n", - "defect.append_atom(position=( 0.000 , 0.000 , 0.000 ),symbols=['O']) #1\n", - "#defect.append_atom(position=( 0.757 , 0.586 , 0.000 ),symbols=['H']) #2\n", - "#defect.append_atom(position=(-0.757 , 0.586 , 0.000),symbols=['H']) #3 \n", - "#defect.append_atom(position=( 0.000 , 3.500 , 0.000),symbols=['O']) #4\n", - "#defect.append_atom(position=( 0.757 , 2.914 , 0.000 ),symbols=['H']) #5\n", - "#defect.append_atom(position=(-0.757 , 2.914 , 0.000),symbols=['H'],name=\"GhostH\") #6" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "code = Code.get_from_string('siesta-psml-lua@N552VW')\n", - "charge=-2" - ] - }, - { - "cell_type": "code", - "execution_count": 9, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from aiida.orm import Dict\n", - "parameters_host = Dict(dict={\n", - " \"mesh-cutoff\": \"250 Ry\",\n", - " \"dm-tolerance\": \"0.0001\",\n", - " \"MD-TypeOfRun\": \"cg\",\n", - " \"MD-NumCGsteps\": \"5000\",\n", - " #\"LUA-script\": \"neb.lua\",\n", - " \"DM-NumberPulay \": \"3\",\n", - " \"DM-History-Depth\": \"0\",\n", - " \"SCF-Mixer-weight\": \"0.02\",\n", - " \"SCF-Mix\": \"density\",\n", - " \"SCF-Mixer-kick\": \"35\",\n", - " \"MD-VariableCell\": \"F\",\n", - " \"MD-MaxCGDispl\": \"0.3 Bohr\",\n", - " \"MD-MaxForceTol\": \" 0.04000 eV/Ang\", \n", - " })\n", - "parameters_defect_q0 = Dict(dict={\n", - " \"mesh-cutoff\": \"250 Ry\",\n", - " \"dm-tolerance\": \"0.0001\",\n", - " \"MD-TypeOfRun\": \"cg\",\n", - " \"MD-NumCGsteps\": \"5000\",\n", - " #\"LUA-script\": \"neb.lua\",\n", - " \"DM-NumberPulay \": \"3\",\n", - " \"DM-History-Depth\": \"0\",\n", - " \"SCF-Mixer-weight\": \"0.02\",\n", - " \"SCF-Mix\": \"density\",\n", - " \"SCF-Mixer-kick\": \"35\",\n", - " \"MD-VariableCell\": \"F\",\n", - " \"MD-MaxCGDispl\": \"0.3 Bohr\",\n", - " \"MD-MaxForceTol\": \" 0.04000 eV/Ang\", \n", - " \"NetCharge\": \"0\",\n", - " })\n", - "parameters_defect_q = Dict(dict={\n", - " \"mesh-cutoff\": \"250 Ry\",\n", - " \"dm-tolerance\": \"0.0001\",\n", - " \"MD-TypeOfRun\": \"cg\",\n", - " \"MD-NumCGsteps\": \"5000\",\n", - " #\"LUA-script\": \"neb.lua\",\n", - " \"DM-NumberPulay \": \"3\",\n", - " \"DM-History-Depth\": \"0\",\n", - " \"SCF-Mixer-weight\": \"0.02\",\n", - " \"SCF-Mix\": \"density\",\n", - " \"SCF-Mixer-kick\": \"35\",\n", - " \"MD-VariableCell\": \"F\",\n", - " \"MD-MaxCGDispl\": \"0.3 Bohr\",\n", - " \"MD-MaxForceTol\": \" 0.04000 eV/Ang\",\n", - " \"NetCharge\": str(charge),\n", - " })\n", - "#options_host=Dict(dict={'options':{\"max_wallclock_seconds\": 360},\n", - "# \"resources\":{\"num_machines\": 1,\n", - "# \"num_mpiprocs_per_machine\": 1}\n", - "# })\n", - "options_host=Dict(dict={\n", - " \"max_wallclock_seconds\": 360000,\n", - " #'withmpi': True,\n", - " #'account': \"tcphy113c\",\n", - " #'queue_name': \"DevQ\",\n", - " \"resources\": {\n", - " \"num_machines\": 1,\n", - " \"num_mpiprocs_per_machine\": 1,\n", - " }\n", - " })\n", - "options_defect_q0=Dict(dict={\n", - " \"max_wallclock_seconds\": 360000,\n", - " #'withmpi': True,\n", - " #'account': \"tcphy113c\",\n", - " #'queue_name': \"DevQ\",\n", - " \"resources\": {\n", - " \"num_machines\": 1,\n", - " \"num_mpiprocs_per_machine\": 1,\n", - " }\n", - " })\n", - "options_defect_q=Dict(dict={\n", - " \"max_wallclock_seconds\": 360000,\n", - " #'withmpi': True,\n", - " #'account': \"tcphy113c\",\n", - " #'queue_name': \"DevQ\",\n", - " \"resources\": {\n", - " \"num_machines\": 1,\n", - " \"num_mpiprocs_per_machine\": 1,\n", - " }\n", - " })\n", - "\n" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "basis_dict_host =Dict(dict= {\n", - "'pao-basistype':'split',\n", - "'pao-splitnorm': 0.150,\n", - "'pao-energyshift': '0.020 Ry',\n", - "'%block pao-basis-sizes':\n", - "\"\"\"\n", - "O DZP\n", - "#H DZP\n", - "%endblock pao-basis-sizes\"\"\",\n", - "})\n", - "basis_dict_defect_q0 = Dict(dict= {\n", - "'pao-basistype':'split',\n", - "'pao-splitnorm': 0.150,\n", - "'pao-energyshift': '0.020 Ry',\n", - "'%block pao-basis-sizes':\n", - "\"\"\"\n", - "O DZP\n", - "#GhostH DZP\n", - "#H DZP\n", - "%endblock pao-basis-sizes\"\"\",\n", - "})\n", - "basis_dict_defect_q =Dict(dict= {\n", - "'pao-basistype':'split',\n", - "'pao-splitnorm': 0.150,\n", - "'pao-energyshift': '0.020 Ry',\n", - "'%block pao-basis-sizes':\n", - "\"\"\"\n", - "O DZP\n", - "#GhostH DZP\n", - "#H DZP\n", - "%endblock pao-basis-sizes\"\"\",\n", - "})" - ] - }, - { - "cell_type": "code", - "execution_count": 11, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'mesh-cutoff': '250 Ry',\n", - " 'dm-tolerance': '0.0001',\n", - " 'MD-TypeOfRun': 'cg',\n", - " 'MD-NumCGsteps': '5000',\n", - " 'DM-NumberPulay ': '3',\n", - " 'DM-History-Depth': '0',\n", - " 'SCF-Mixer-weight': '0.02',\n", - " 'SCF-Mix': 'density',\n", - " 'SCF-Mixer-kick': '35',\n", - " 'MD-VariableCell': 'F',\n", - " 'MD-MaxCGDispl': '0.3 Bohr',\n", - " 'MD-MaxForceTol': ' 0.04000 eV/Ang',\n", - " 'NetCharge': '0'}" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "parameters_defect_q0.get_dict()" - ] - }, - { - "cell_type": "code", - "execution_count": 12, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "kpoints_host = orm.KpointsData()\n", - "kpoints_host.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly\n", - "kpoints_defect_q0 = orm.KpointsData()\n", - "kpoints_defect_q0.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly\n", - "kpoints_defect_q = orm.KpointsData()\n", - "kpoints_defect_q.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly" - ] - }, - { - "cell_type": "code", - "execution_count": 13, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'O': }" - ] - }, - "execution_count": 13, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "import os\n", - "from aiida_siesta.data.psf import PsfData\n", - "pseudo_file_to_species_map = [ (\"O.psf\", ['O'])]\n", - "#pseudo_file_to_species_map = [ (\"H.psf\", ['H']),(\"O.psf\", ['O'])]\n", - "#pseudo_file_to_species_map = [ (\"H.psf\",[\"H\"]),(\"GhostH.psf\",[\"GhostH\"]),(\"O.psf\", ['O'])]\n", - "pseudos_dict_host = {}\n", - "for fname, kinds, in pseudo_file_to_species_map:\n", - " absname = os.path.realpath(os.path.join(\"./pseudos\",fname))\n", - " pseudo, created = PsfData.get_or_create(absname, use_first=True)\n", - " for j in kinds:\n", - " pseudos_dict_host[j]=pseudo \n", - "pseudos_dict_host\n" - ] - }, - { - "cell_type": "code", - "execution_count": 14, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'O': }" - ] - }, - "execution_count": 14, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "pseudo_file_to_species_map = [(\"O.psf\", ['O'])]\n", - "#pseudo_file_to_species_map = [ (\"H.psf\", ['GhostH','H']),(\"O.psf\", ['O'])]\n", - "pseudos_dict_defect = {}\n", - "for fname, kinds, in pseudo_file_to_species_map:\n", - " absname = os.path.realpath(os.path.join(\"./pseudos\",fname))\n", - " pseudo, created = PsfData.get_or_create(absname, use_first=True)\n", - " for j in kinds:\n", - " pseudos_dict_defect[j]=pseudo\n", - "pseudos_dict_defect" - ] - }, - { - "cell_type": "code", - "execution_count": 15, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "inputs = {\n", - " # Structures\n", - " 'host_structure': pure,\n", - " 'defect_structure': defect,\n", - " # Defect information \n", - " #'defect_charge' : orm.Float(-2.),\n", - " 'defect_charge' : orm.Float(charge),\n", - " 'defect_site' : orm.List(list=[-0.757 , 2.914 , 0.000]), # Position of the defect in crystal coordinates\n", - " 'fermi_level' : orm.Float(0.0), # Position of the Fermi level, with respect to the valence band maximum \n", - " 'chemical_potential' : orm.Float(250.709), # eV, the chemical potentical of a C atom\n", - " 'gaussian_sigma':orm.Float(0.5),\n", - " 'correction_scheme' : orm.Str('none'),\n", - " \"epsilon\":orm.Float(1.0),\n", - " \"pseudos_host\":pseudos_dict_host,\n", - " \"pseudos_defect\":pseudos_dict_defect,\n", - " #\"pseudos_q0\":pseudos_dict,\n", - " #\"pseudos_q\":pseudos_dict,\n", - " # Computational (chosen code is QE)\n", - " 'siesta' : { 'dft': {'supercell_host':{'code': code, 'kpoints': kpoints_host, 'parameters' : parameters_host,\n", - " 'options':options_host,\"basis\": basis_dict_host},\n", - " 'supercell_defect_q0':{'code': code, 'kpoints': kpoints_defect_q,'parameters' : parameters_defect_q0,\n", - " 'options':options_defect_q0,\"basis\": basis_dict_defect_q0},\n", - " 'supercell_defect_q':{'code': code, 'kpoints': kpoints_defect_q,'parameters' : parameters_defect_q,\n", - " 'options':options_defect_q,\"basis\": basis_dict_defect_q}\n", - "}}}" - ] - }, - { - "cell_type": "code", - "execution_count": 16, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "{'host_structure': ,\n", - " 'defect_structure': ,\n", - " 'defect_charge': ,\n", - " 'defect_site': ,\n", - " 'fermi_level': ,\n", - " 'chemical_potential': ,\n", - " 'gaussian_sigma': ,\n", - " 'correction_scheme': ,\n", - " 'epsilon': ,\n", - " 'pseudos_host': {'O': },\n", - " 'pseudos_defect': {'O': },\n", - " 'siesta': {'dft': {'supercell_host': {'code': ,\n", - " 'kpoints': ,\n", - " 'parameters': ,\n", - " 'options': ,\n", - " 'basis': },\n", - " 'supercell_defect_q0': {'code': ,\n", - " 'kpoints': ,\n", - " 'parameters': ,\n", - " 'options': ,\n", - " 'basis': },\n", - " 'supercell_defect_q': {'code': ,\n", - " 'kpoints': ,\n", - " 'parameters': ,\n", - " 'options': ,\n", - " 'basis': }}}}" - ] - }, - "execution_count": 16, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "inputs" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "metadata": { - "scrolled": false - }, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/home/aakhtar/venv/aiida/lib/python3.6/site-packages/aiida/engine/processes/ports.py:111: UserWarning: default of input port `fermi_level` is a `Node` instance, which can lead to unexpected side effects. It is advised to use a lambda instead, e.g.: `default=lambda: orm.Int(5)`.\n", - " warnings.warn(UserWarning(message)) # pylint: disable=no-member\n" - ] - } - ], - "source": [ - "workchain_future = engine.submit(FormationEnergyWorkchainSIESTA, **inputs)" - ] - }, - { - "cell_type": "code", - "execution_count": 18, - "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 18, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "workchain_future" - ] - }, - { - "cell_type": "code", - "execution_count": 19, - "metadata": { - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[22m PK Created Process label Process State Process status\n", - "---- --------- ------------------------------ ---------------- ---------------------------------------------\n", - "2411 23h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", - "2412 23h ago SiestaCalculation ☠ Killed Killed by parent<2411>\n", - "2413 23h ago SiestaCalculation ☠ Killed Killed by parent<2411>\n", - "2414 23h ago SiestaCalculation ☠ Killed Killed by parent<2411>\n", - "2438 23h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", - "2439 23h ago SiestaCalculation ☠ Killed Killed by parent<2438>\n", - "2440 23h ago SiestaCalculation ☠ Killed Killed by parent<2438>\n", - "2442 23h ago SiestaCalculation ☠ Killed Killed by parent<2438>\n", - "2465 23h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", - "2466 23h ago SiestaCalculation ☠ Killed Killed by parent<2465>\n", - "2467 23h ago SiestaCalculation ☠ Killed Killed by parent<2465>\n", - "2469 23h ago SiestaCalculation ☠ Killed Killed by parent<2465>\n", - "2492 23h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", - "2493 23h ago SiestaCalculation ☠ Killed Killed by parent<2492>\n", - "2494 23h ago SiestaCalculation ☠ Killed Killed by parent<2492>\n", - "2496 23h ago SiestaCalculation ☠ Killed Killed by parent<2492>\n", - "2519 22h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", - "2520 22h ago SiestaCalculation ☠ Killed Killed by parent<2519>\n", - "2521 22h ago SiestaCalculation ☠ Killed Killed by parent<2519>\n", - "2522 22h ago SiestaCalculation ☠ Killed Killed by parent<2519>\n", - "2546 22h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", - "2547 22h ago SiestaCalculation ☠ Killed Killed by parent<2546>\n", - "2548 22h ago SiestaCalculation ☠ Killed Killed by parent<2546>\n", - "2550 22h ago SiestaCalculation ☠ Killed Killed by parent<2546>\n", - "2573 22h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", - "2574 22h ago SiestaCalculation ☠ Killed Killed by parent<2573>\n", - "2575 22h ago SiestaCalculation ☠ Killed Killed by parent<2573>\n", - "2576 22h ago SiestaCalculation ☠ Killed Killed by parent<2573>\n", - "2600 22h ago FormationEnergyWorkchainSIESTA ☠ Killed Killed through `verdi process kill`\n", - "2601 22h ago SiestaCalculation ☠ Killed Killed by parent<2600>\n", - "2602 22h ago SiestaCalculation ☠ Killed Killed by parent<2600>\n", - "2604 22h ago SiestaCalculation ☠ Killed Killed by parent<2600>\n", - "2627 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", - "2648 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", - "2669 3h ago FormationEnergyWorkchainSIESTA ⏹ Finished [403]\n", - "2670 3h ago SiestaCalculation ⨯ Excepted Waiting for transport task: upload\n", - "2671 3h ago SiestaCalculation ⨯ Excepted Waiting for transport task: upload\n", - "2672 3h ago SiestaCalculation ⨯ Excepted Waiting for transport task: upload\n", - "2693 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", - "2694 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2695 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2696 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2732 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", - "2733 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2734 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2735 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2774 3h ago FormationEnergyWorkchainSIESTA ⨯ Excepted\n", - "2775 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2776 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2777 3h ago SiestaCalculation ⏹ Finished [0]\n", - "2816 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", - "2817 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2818 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2819 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2839 2h ago get_raw_formation_energy ⏹ Finished [0]\n", - "2861 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", - "2862 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2863 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2864 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2884 2h ago get_raw_formation_energy ⏹ Finished [0]\n", - "2906 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", - "2907 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2908 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2909 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2929 2h ago get_raw_formation_energy ⏹ Finished [0]\n", - "2951 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", - "2952 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2953 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2954 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2974 2h ago get_raw_formation_energy ⏹ Finished [0]\n", - "2996 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", - "2997 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2998 2h ago SiestaCalculation ⏹ Finished [0]\n", - "2999 2h ago SiestaCalculation ⏹ Finished [0]\n", - "3019 2h ago get_raw_formation_energy ⏹ Finished [0]\n", - "3021 2h ago get_raw_formation_energy ⏹ Finished [0]\n", - "3043 2h ago FormationEnergyWorkchainSIESTA ⏹ Finished [0]\n", - "3044 2h ago SiestaCalculation ⏹ Finished [0]\n", - "3045 2h ago SiestaCalculation ⏹ Finished [0]\n", - "3046 2h ago SiestaCalculation ⏹ Finished [0]\n", - "3066 2h ago get_raw_formation_energy ⏹ Finished [0]\n", - "3068 2h ago get_raw_formation_energy ⏹ Finished [0]\n", - "3074 1h ago SiestaCalculation ⨯ Excepted\n", - "3077 1h ago SiestaCalculation ⨯ Excepted\n", - "3084 1h ago SiestaCalculation ⨯ Excepted\n", - "3089 1h ago SiestaCalculation ⨯ Excepted\n", - "3094 1h ago SiestaCalculation ⨯ Excepted\n", - "3101 1h ago SiestaCalculation ⨯ Excepted\n", - "3108 1h ago SiestaCalculation ⏹ Finished [350]\n", - "3116 1h ago SiestaCalculation ⏹ Finished [0]\n", - "3125 1h ago SiestaCalculation ⏹ Finished [0]\n", - "3135 1h ago SiestaCalculation ⏹ Finished [0]\n", - "3160 5s ago FormationEnergyWorkchainSIESTA ⏵ Waiting Waiting for child processes: 3161, 3162, 3163\n", - "3161 3s ago SiestaCalculation ⏵ Waiting Monitoring scheduler: job state RUNNING\n", - "3162 3s ago SiestaCalculation ⏵ Waiting Monitoring scheduler: job state RUNNING\n", - "3163 3s ago SiestaCalculation ⏵ Waiting Monitoring scheduler: job state RUNNING\u001b[0m\n", - "\u001b[22m\n", - "Total results: 96\n", - "\u001b[0m\n", - "\u001b[34m\u001b[1mInfo: \u001b[0m\u001b[22mlast time an entry changed state: 1s ago (at 11:47:58 on 2020-07-17)\u001b[0m\n" - ] - } - ], - "source": [ - "!verdi process list -a -p 1" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#!verdi process kill 2669" - ] - }, - { - "cell_type": "code", - "execution_count": 20, - "metadata": { - "scrolled": true - }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[22mProperty Value\n", - "----------- ------------------------------------\n", - "type FormationEnergyWorkchainSIESTA\n", - "state Waiting\n", - "pk 3160\n", - "uuid 24c9a196-77f2-4f18-a105-378bf00e105b\n", - "label\n", - "description\n", - "ctime 2020-07-17 11:47:54.819648+00:00\n", - "mtime 2020-07-17 11:47:56.908830+00:00\n", - "computer [1] N552VW\n", - "\n", - "Inputs PK Type\n", - "--------------------------- ---- -------------\n", - "pseudos_defect\n", - " O 3 PsfData\n", - "pseudos_host\n", - " O 3 PsfData\n", - "siesta\n", - " dft\n", - " supercell_defect_q\n", - " basis 3159 Dict\n", - " options 3158 Dict\n", - " parameters 3157 Dict\n", - " kpoints 3153 KpointsData\n", - " code 403 Code\n", - " supercell_defect_q0\n", - " basis 3156 Dict\n", - " options 3155 Dict\n", - " parameters 3154 Dict\n", - " kpoints 3153 KpointsData\n", - " code 403 Code\n", - " supercell_host\n", - " basis 3152 Dict\n", - " options 3151 Dict\n", - " parameters 3150 Dict\n", - " kpoints 3149 KpointsData\n", - " code 403 Code\n", - "chemical_potential 3145 Float\n", - "correction_scheme 3147 Str\n", - "defect_charge 3142 Float\n", - "defect_site 3143 List\n", - "defect_structure 3141 StructureData\n", - "epsilon 3148 Float\n", - "fermi_level 3144 Float\n", - "gaussian_sigma 3146 Float\n", - "host_structure 3140 StructureData\n", - "\n", - "Called PK Type\n", - "-------- ---- -----------\n", - "CALL 3163 CalcJobNode\n", - "CALL 3162 CalcJobNode\n", - "CALL 3161 CalcJobNode\n", - "\n", - "Log messages\n", - "---------------------------------------------\n", - "There are 5 log messages for this calculation\n", - "Run 'verdi process report 3160' to see them\u001b[0m\n" - ] - } - ], - "source": [ - "!verdi process show 3160" - ] - }, - { - "cell_type": "code", - "execution_count": 22, - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[22m2020-07-17 11:47:56 [613 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|setup]: Checking Formation Scheme\n", - "2020-07-17 11:47:56 [614 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|run_dft_calcs]: Setting Up the No correction Formation Energy Workchain \n", - "2020-07-17 11:47:56 [615 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|run_dft_calcs]: Workflow Launching SIESTA for host structure (PK=3140) (PK=3161)\n", - "2020-07-17 11:47:56 [616 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|run_dft_calcs]: Launching SIESTA for defect structure (PK=3141) with charge 0.0 (PK=3162)\n", - "2020-07-17 11:47:56 [617 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|run_dft_calcs]: Launching SIESTA for defect structure (PK=3141) with charge -2.0 (PK=3163)\n", - "2020-07-17 11:48:39 [618 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|correction_required]: Ther will be no Corrections applied\n", - "2020-07-17 11:48:40 [619 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|check_dft_calcs]: Checking Up Whether DFT Caclucations are Finished \n", - "2020-07-17 11:48:40 [620 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|compute_neutral_formation_energy]: The computed neutral formation energy without correction is -250.709 eV\n", - "2020-07-17 11:48:41 [621 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|compute_charged_formation_energy_no_corre]: The computed charge -2.0 e formation energy without correction is -236.278591 eV\n", - "2020-07-17 11:48:41 [622 | REPORT]: [3160|FormationEnergyWorkchainSIESTA|compute_charged_formation_energy_no_corre]: The Grid Units is 13.605814541346533\u001b[0m\n" - ] - } - ], - "source": [ - "!verdi process report 3160" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "#workchain_future.outputs.formation_energy_uncorrected.value #.outputs.formation_energy_uncorrected.value\n", - "from aiida.orm import load_node\n", - "results=load_node('2952')" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "results.outputs['output_parameters'].get_dict()#['Etot']\n", - "#results['forces_and_stress']" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "results.outputs.output_parameters.get_dict()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "code" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "from aiida_siesta.calculations.siesta import SiestaCalculation\n", - "builder = SiestaCalculation.get_builder()" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [ - "builder.metadata" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "collapsed": true - }, - "outputs": [], - "source": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.6.9" - } - }, - "nbformat": 4, - "nbformat_minor": 4 -} diff --git a/aiida_defects/formation_energy_siesta/DefectWorkflowExample.py b/aiida_defects/formation_energy_siesta/DefectWorkflowExample.py deleted file mode 100644 index 34ea0e3..0000000 --- a/aiida_defects/formation_energy_siesta/DefectWorkflowExample.py +++ /dev/null @@ -1,322 +0,0 @@ -#!/usr/bin/env python -# coding: utf-8 - -# In[1]: - - -from __future__ import absolute_import -import aiida - - -# In[2]: - - -#from aiida import load_profile -#load_profile() - -# Import commonly used functionality -import numpy as np -from aiida import orm, engine, common -from aiida.plugins import WorkflowFactory -from aiida.orm import Code - - -# In[3]: - - -#get_ipython().system('pwd') - - -# In[8]: - - -#!$JUPYTER_PATH -#!export JUPYTER_PATH="/home/aakhtar/Projects/aiida-defects-siesta/siesta-defect-formation/aiida-workflow/formation_energy/;$JUPYTER_PATH" - - -# In[5]: - - -from aiida_siesta.workflows.defect_formation.formation_energy_siesta import FormationEnergyWorkchainSIESTA -#import .formation_energy_siesta -#!pwd - - -# In[6]: - - -from aiida.orm import StructureData -#Structure Pure -cell = [[15.0, 0.0, 0.0,], - [ 0.0,15.0, 0.0,], - [ 0.0, 0.0,15.0,], - ] -pure = StructureData(cell=cell) -pure.append_atom(position=( 0.000 , 0.000 , 0.000 ),symbols=['O']) #1 -pure.append_atom(position=( 0.757 , 0.586 , 0.000 ),symbols=['H']) #2 -pure.append_atom(position=(-0.757 , 0.586 , 0.000),symbols=['H']) #3 -pure.append_atom(position=( 0.000 , 3.500 , 0.000),symbols=['O']) #4 -pure.append_atom(position=( 0.757 , 2.914 , 0.000 ),symbols=['H']) #5 -pure.append_atom(position=(-0.757 , 2.914 , 0.000),symbols=['H']) #6 - - -defect=StructureData(cell=cell) -defect.append_atom(position=( 0.000 , 0.000 , 0.000 ),symbols=['O']) #1 -defect.append_atom(position=( 0.757 , 0.586 , 0.000 ),symbols=['H']) #2 -defect.append_atom(position=(-0.757 , 0.586 , 0.000),symbols=['H']) #3 -defect.append_atom(position=( 0.000 , 3.500 , 0.000),symbols=['O']) #4 -defect.append_atom(position=( 0.757 , 2.914 , 0.000 ),symbols=['H']) #5 -defect.append_atom(position=(-0.757 , 2.914 , 0.000),symbols=['H'],name="GhostH") #6 - - -# In[7]: - - -code = Code.get_from_string('siesta-psml-lua@N552VW') -charge=-2 - - -# In[8]: - - -from aiida.orm import Dict -parameters_host = Dict(dict={ - "mesh-cutoff": "250 Ry", - "dm-tolerance": "0.0001", - "MD-TypeOfRun": "LUA", - "LUA-script": "neb.lua", - "DM-NumberPulay ": "3", - "DM-History-Depth": "0", - "SCF-Mixer-weight": "0.02", - "SCF-Mix": "density", - "SCF-Mixer-kick": "35", - "MD-VariableCell": "F", - "MD-MaxCGDispl": "0.3 Bohr", - "MD-MaxForceTol": " 0.04000 eV/Ang", - }) -parameters_defect_q0 = Dict(dict={ - "mesh-cutoff": "250 Ry", - "dm-tolerance": "0.0001", - "MD-TypeOfRun": "LUA", - "LUA-script": "neb.lua", - "DM-NumberPulay ": "3", - "DM-History-Depth": "0", - "SCF-Mixer-weight": "0.02", - "SCF-Mix": "density", - "SCF-Mixer-kick": "35", - "MD-VariableCell": "F", - "MD-MaxCGDispl": "0.3 Bohr", - "MD-MaxForceTol": " 0.04000 eV/Ang", - "NetCharge": "0", - }) -parameters_defect_q = Dict(dict={ - "mesh-cutoff": "250 Ry", - "dm-tolerance": "0.0001", - "MD-TypeOfRun": "LUA", - "LUA-script": "neb.lua", - "DM-NumberPulay ": "3", - "DM-History-Depth": "0", - "SCF-Mixer-weight": "0.02", - "SCF-Mix": "density", - "SCF-Mixer-kick": "35", - "MD-VariableCell": "F", - "MD-MaxCGDispl": "0.3 Bohr", - "MD-MaxForceTol": " 0.04000 eV/Ang", - "NetCharge": str(charge), - }) -options_host=Dict( - dict={ - "max_wallclock_seconds": 360, - #'withmpi': True, - #'account': "tcphy113c", - #'queue_name': "DevQ", - "resources": { - "num_machines": 1, - "num_mpiprocs_per_machine": 1, - } - } -) -options_defect_q0=Dict( - dict={ - "max_wallclock_seconds": 360, - #'withmpi': True, - #'account': "tcphy113c", - #'queue_name': "DevQ", - "resources": { - "num_machines": 1, - "num_mpiprocs_per_machine": 1, - } - } -) -options_defect_q=Dict( - dict={ - "max_wallclock_seconds": 360, - #'withmpi': True, - #'account': "tcphy113c", - #'queue_name': "DevQ", - "resources": { - "num_machines": 1, - "num_mpiprocs_per_machine": 1, - } - } -) - - -# In[9]: - - -basis_dict_host =Dict(dict= { -'pao-basistype':'split', -'pao-splitnorm': 0.150, -'pao-energyshift': '0.020 Ry', -'%block pao-basis-sizes': -""" -GhostH DZP -H DZP -%endblock pao-basis-sizes""", -}) -basis_dict_defect_q0 = Dict(dict= { -'pao-basistype':'split', -'pao-splitnorm': 0.150, -'pao-energyshift': '0.020 Ry', -'%block pao-basis-sizes': -""" -GhostH DZP -H DZP -%endblock pao-basis-sizes""", -}) -basis_dict_defect_q =Dict(dict= { -'pao-basistype':'split', -'pao-splitnorm': 0.150, -'pao-energyshift': '0.020 Ry', -'%block pao-basis-sizes': -""" -GhostH DZP -H DZP -%endblock pao-basis-sizes""", -}) - - -# In[10]: - - -parameters_defect_q0.get_dict() - - -# In[11]: - - -kpoints_host = orm.KpointsData() -kpoints_host.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly -kpoints_defect_q0 = orm.KpointsData() -kpoints_defect_q0.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly -kpoints_defect_q = orm.KpointsData() -kpoints_defect_q.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly - - -# In[12]: - - -import os -from aiida_siesta.data.psf import PsfData -pseudo_file_to_species_map = [ ("H.psf", ['GhostH','H']),("O.psf", ['O'])] -pseudos_dict = {} -for fname, kinds, in pseudo_file_to_species_map: - absname = os.path.realpath(os.path.join("./aiida_siesta/workflows/defect_formation/pseudos",fname)) - pseudo, created = PsfData.get_or_create(absname, use_first=True) - for j in kinds: - pseudos_dict[j]=pseudo -pseudos_dict - - -# In[13]: - - -inputs = { - # Structures - 'host_structure': pure, - 'defect_structure': defect, - # Defect information - 'defect_charge' : orm.Float(-2.), - 'defect_site' : orm.List(list=[-0.757 , 2.914 , 0.000]), # Position of the defect in crystal coordinates - 'fermi_level' : orm.Float(0.0), # Position of the Fermi level, with respect to the valence band maximum - 'chemical_potential' : orm.Float(250.709), # eV, the chemical potentical of a C atom - 'gaussian_sigma':orm.Float(0.5), - 'correction_scheme' : orm.Str('gaussian'), - "epsilon":orm.Float(1.0), - # Computational (chosen code is QE) - 'siesta' : { 'dft': {'supercell_host':{'code': code, 'kpoints': kpoints_host, 'parameters' : parameters_host, - 'options':options_host,"basis": basis_dict_host}, - 'supercell_defect_q0':{'code': code, 'kpoints': kpoints_defect_q,'parameters' : parameters_defect_q0, - 'options':options_defect_q0,"basis": basis_dict_defect_q0}, - 'supercell_defect_q':{'code': code, 'kpoints': kpoints_defect_q,'parameters' : parameters_defect_q, - 'options':options_defect_q,"basis": basis_dict_defect_q} -}}} - - -# In[14]: - - -inputs - - -# In[15]: - - -workchain_future = engine.submit(FormationEnergyWorkchainSIESTA, **inputs) - - -# In[16]: - - -workchain_future - - -# In[17]: - - -#get_ipython().system('verdi process list -a') - - -# In[18]: - - -#get_ipython().system('verdi process show 799') - - -# In[ ]: - - -#get_ipython().system('verdi process report 584') - - -# In[ ]: - - -#from aiida.orm import load_node -#results=load_node('584') - - -# In[ ]: - - -#results.outputs['output_parameters'.get_dict()] - - -# In[ ]: - - -#results.outputs.output_parameters.get_dict() - - -# In[ ]: - - -#code - - -# In[ ]: - - - - diff --git a/aiida_defects/formation_energy_siesta/__init__.py b/aiida_defects/formation_energy_siesta/__init__.py deleted file mode 100644 index 4d27567..0000000 --- a/aiida_defects/formation_energy_siesta/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## diff --git a/aiida_defects/formation_energy_siesta/corrections/gaussian/gaussian_countercharge.py b/aiida_defects/formation_energy_siesta/corrections/gaussian/gaussian_countercharge.py deleted file mode 100644 index 672f0b7..0000000 --- a/aiida_defects/formation_energy_siesta/corrections/gaussian/gaussian_countercharge.py +++ /dev/null @@ -1,338 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## -from __future__ import absolute_import - -from aiida.engine import WorkChain, calcfunction, ToContext, while_ -from aiida import orm - -from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain -from .model_potential.model_potential import ModelPotentialWorkchain -from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference -from aiida_defects.formation_energy.corrections.gaussian_countercharge.utils import get_total_correction, get_total_alignment - -from .utils import fit_energies, calc_correction - - -class GaussianCounterChargeWorkchain(WorkChain): - """ - Compute the electrostatic correction for charged defects according to the - Guassian counter-charge method. - Here we implement the Komsa-Pasquarello method (https://doi.org/10.1103/PhysRevLett.110.095505), - which is itself based on the Freysoldt method - (https://doi.org/10.1103/PhysRevLett.102.016402). - """ - @classmethod - def define(cls, spec): - super(GaussianCounterChargeWorkchain, cls).define(spec) - - spec.input("v_host", - valid_type=orm.ArrayData, - help="Host VT array readed by sisl") - spec.input("v_defect_q0", - valid_type=orm.ArrayData - help="Defect VT array readed by sisl") - spec.input("v_defect_q", - valid_type=orm.ArrayData - help="Defect with charge VT array readed by sisl") - spec.input("defect_charge", - valid_type=orm.Float - help="Defect charge") - spec.input("defect_site", - valid_type=orm.List, - help="Defect site position in crystal coordinates") - spec.input("host_structure", - valid_type=orm.StructureData - help="Host Structure") - spec.input("epsilon", - valid_type=orm.Float, - help="Dielectric constant for the host material") -# spec.input("model_iterations_required", -# valid_type=orm.Int, -# default=orm.Int(3)) -# spec.input("cutoff", -# valid_type=orm.Float, -# default=orm.Float(40.), -# help="Plane wave cutoff for electrostatic model") -#aakhtar - spec.outline( -# cls.setup, -# while_(cls.should_run_model)( -# cls.compute_model_potential, -# ), - cls.compute_model_potential, -#aakhtar - cls.check_model_potential_workchains, - cls.compute_dft_difference_potential, - cls.submit_alignment_workchains, - cls.check_alignment_workchains, - cls.get_isolated_energy, - cls.get_model_corrections, - cls.compute_correction, - ) - spec.output('v_dft_difference', valid_type=orm.ArrayData) - spec.output('alignment_q0_to_host', valid_type=orm.Float) - spec.output('alignment_dft_to_model', valid_type=orm.Float) - spec.output('total_alignment', valid_type=orm.Float, required=True) - spec.output('total_correction', valid_type=orm.Float) - spec.output('electrostatic_correction', valid_type=orm.Float) - # spec.output('isolated_energy', valid_type=orm.Float, required=True) # Not sure if anyone would use this - # spec.output('model_correction_energies', valid_type=orm.Dict, required=True) # Again, not sure if useful - spec.exit_code( - 401, - 'ERROR_INVALID_INPUT_ARRAY', - message='the input ArrayData object can only contain one array') - spec.exit_code( - 409, - 'ERROR_SUB_PROCESS_FAILED_ALIGNMENT', - message='the electrostatic potentials could not be aligned') - spec.exit_code( - 413, - 'ERROR_SUB_PROCESS_FAILED_MODEL_POTENTIAL', - message='The model electrostatic potential could not be computed') - spec.exit_code( - 410, - 'ERROR_SUB_PROCESS_FAILED_FINAL_SCF', - message='the final scf PwBaseWorkChain sub process failed') - spec.exit_code( - 411, - 'ERROR_BAD_INPUT_ITERATIONS_REQUIRED', - message='The required number of iterations must be at least 3') - - - def setup(self): - """ - Setup the calculation - """ - -# ## Verification -# if self.inputs.model_iterations_required < 3: -# self.report('The requested number of iterations, {}, is too low. At least 3 are required to achieve an #adequate data fit'.format(self.inputs.model_iterations_required.value)) -# return self.exit_codes.ERROR_BAD_INPUT_ITERATIONS_REQUIRED - - # Track iteration number -# self.ctx.model_iteration = orm.Int(0) - - # Check that the input ArrayData objects contain only one array - for arraydata in [ - self.inputs.v_host, self.inputs.v_defect_q0, - self.inputs.v_defect_q - ]: - if len(arraydata.get_arraynames()) != 1: - self.report('Input array is invalid') - return self.exit_codes.ERROR_INVALID_INPUT_ARRAY - - v_defect_q0 = self.inputs.v_defect_q0 - self.ctx.v_defect_q0_array = v_defect_q0.get_array( - v_defect_q0.get_arraynames()[0]) - - v_defect_q = self.inputs.v_defect_q - self.ctx.v_defect_q_array = v_defect_q.get_array( - v_defect_q.get_arraynames()[0]) - - # Dict to store model energies - self.ctx.model_energies = {} - - # Dict to store model structures - self.ctx.model_structures = {} - - # Dict to store correction energies - self.ctx.model_correction_energies = {} - - return - - # def should_run_model(self): - # """ - # Return whether a model workchain should be run, which is dependant on the number of model energies computed - # with respect to to the total number of model energies needed. - # """ - # return self.ctx.model_iteration < self.inputs.model_iterations_required - - def compute_model_potential(self): - """ - Compute the potential for the system using a model charge distribution - """ -# self.ctx.model_iteration += 1 -# scale_factor = self.ctx.model_iteration - - self.report("Computing model potential for scale factor {}".format( - scale_factor.value)) - - inputs = { - 'defect_charge': self.inputs.defect_charge, -# 'scale_factor': scale_factor, - 'host_structure': self.inputs.host_structure, - 'defect_site': self.inputs.defect_site, - # 'cutoff': self.inputs.cutoff, - 'epsilon': self.inputs.epsilon, - } - workchain_future = self.submit(ModelPotentialWorkchain, **inputs) - label = 'model_potential_scale_factor_{}'.format(scale_factor.value) - self.to_context(**{label: workchain_future}) - - def check_model_potential_workchains(self): - """ - Check if the model potential alignment workchains have finished correctly. - If yes, assign the outputs to the context - """ - # for ii in range(self.inputs.model_iterations_required.value): - # scale_factor = ii + 1 - # label = 'model_potential_scale_factor_{}'.format(scale_factor) - label="model_potential" - model_workchain = self.ctx[label] - if not model_workchain.is_finished_ok: - self.report( - 'Model potential workchain failed with status {}'.format(model_workchain.exit_status)) -# 'Model potential workchain for scale factor {} failed with status {}' -# .format(model_workchain.scale_factor, -# model_workchain.exit_status)) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_MODEL_POTENTIAL - else: - self.ctx.v_model = model_workchain.outputs.model_potential - self.ctx.model_energies= model_workchain.outputs.model_energy - self.ctx.model_structures= model_workchain.outputs.model_structure - -# if scale_factor == 1: -# self.ctx.v_model = model_workchain.outputs.model_potential -# self.ctx.model_energies[str( -# scale_factor)] = model_workchain.outputs.model_energy -# self.ctx.model_structures[str( -# scale_factor)] = model_workchain.outputs.model_structure - - def compute_dft_difference_potential(self): - """ - Compute the difference in the DFT potentials for the cases of q=q and q=0 - """ - self.ctx.v_defect_q_q0 = get_potential_difference( - self.inputs.v_defect_q, self.inputs.v_defect_q0) - self.out('v_dft_difference', self.ctx.v_defect_q_q0) - - def submit_alignment_workchains(self): - """ - Align the electrostatic potential of the defective material in the q=0 charge - state with the pristine host system - """ - - # Compute the alignment between the defect, in q=0, and the host - inputs = { - "first_potential": self.inputs.v_defect_q0, - "second_potential": self.inputs.v_host - } - workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) - label = 'workchain_alignment_q0_to_host' - self.to_context(**{label: workchain_future}) - - # Compute the alignment between the defect DFT difference potential, and the model - inputs = { - "first_potential": self.ctx.v_defect_q_q0, - "second_potential": self.ctx.v_model, - "interpolate": - orm.Bool(True) # This will more or less always be required - } - workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) - label = 'workchain_alignment_dft_to_model' - self.to_context(**{label: workchain_future}) - - def check_alignment_workchains(self): - """ - Check if the potential alignment workchains have finished correctly. - If yes, assign the outputs to the context - """ - - # q0 to host - alignment_wc = self.ctx['workchain_alignment_q0_to_host'] - if not alignment_wc.is_finished_ok: - self.report( - 'Potential alignment workchain (defect q=0 to host) failed with status {}' - .format(alignment_wc.exit_status)) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT - else: - self.ctx.alignment_q0_to_host = alignment_wc.outputs.alignment_required - - # DFT diff to model - alignment_wc = self.ctx['workchain_alignment_dft_to_model'] - if not alignment_wc.is_finished_ok: - self.report( - 'Potential alignment workchain (DFT diff to model) failed with status {}' - .format(alignment_wc.exit_status)) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT - else: - self.ctx.alignment_dft_to_model = alignment_wc.outputs.alignment_required - - def get_isolated_energy(self): - """ - Without any fitting - """ - - self.ctx.isolated_energy = orm.Float(self.ctx.model_energies) - self.report("The isolated model energy is {} eV".format( - self.ctx.isolated_energy.value)) -# def get_isolated_energy(self): -# """ -# Fit the calculated model energies and obtain an estimate for the isolated model energy -# """ - - # Get the linear dimensions of the structures -# linear_dimensions = {} -# -# for scale, structure in self.ctx.model_structures.items(): -# volume = structure.get_cell_volume() -# linear_dimensions[scale] = 1 / (volume**(1 / 3.)) -# -# self.report( -# "Fitting the model energies to obtain the model energy for the isolated case" -# ) -# self.ctx.isolated_energy = fit_energies( -# orm.Dict(dict=linear_dimensions), -# orm.Dict(dict=self.ctx.model_energies)) -# self.report("The isolated model energy is {} eV".format( -# self.ctx.isolated_energy.value)) - - def get_model_corrections(self): - """ - Get the energy corrections for each model size - """ -# self.report("Computing the required correction for each model size") - -# for scale_factor, model_energy in self.ctx.model_energies.items(): -# self.ctx.model_correction_energies[scale_factor] = calc_correction( -# self.ctx.isolated_energy, model_energy) - self.ctx.model_energies = calc_correction( - self.ctx.isolated_energy, model_energy) - - def compute_correction(self): - """ - Compute the Gaussian Countercharge correction - """ - - electrostatic_correction = self.ctx.model_correction_energies['1'] - - total_alignment = get_total_alignment(self.ctx.alignment_dft_to_model, - self.ctx.alignment_q0_to_host, - self.inputs.defect_charge) - - total_correction = get_total_correction(electrostatic_correction, - total_alignment) - - self.report('The computed total alignment is {} eV'.format( - total_alignment.value)) - self.out('total_alignment', total_alignment) - - self.report('The computed electrostatic correction is {} eV'.format( - electrostatic_correction.value)) - self.out('electrostatic_correction', electrostatic_correction) - - self.report( - 'The computed total correction, including potential alignments, is {} eV' - .format(total_correction.value)) - self.out('total_correction', total_correction) - - # Store additional outputs - self.out('alignment_q0_to_host', self.ctx.alignment_q0_to_host) - self.out('alignment_dft_to_model', self.ctx.alignment_dft_to_model) - - self.report('Gaussian Countercharge workchain completed successfully') diff --git a/aiida_defects/formation_energy_siesta/formation_energy_base.py b/aiida_defects/formation_energy_siesta/formation_energy_base.py deleted file mode 100644 index 318ee6e..0000000 --- a/aiida_defects/formation_energy_siesta/formation_energy_base.py +++ /dev/null @@ -1,364 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## -from __future__ import absolute_import - -from aiida import orm -from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit - -from .utils import ( - get_raw_formation_energy, - get_corrected_formation_energy, - get_corrected_aligned_formation_energy, -) - - -class FormationEnergyWorkchainBase(WorkChain): - """ - The base class to compute the formation energy for a given defect, containing the - generic, code-agnostic methods, error codes, etc. - - Any computational code can be used to calculate the required energies and relative permittivity. - However, different codes must be setup in specific ways, and so separate classes are used to implement these - possibilities. This is an abstract class and should not be used directly, but rather the - concrete code-specific classes should be used instead. - """ - - @classmethod - def define(cls, spec): - super(FormationEnergyWorkchainBase, cls).define(spec) - # fmt: off - # Structures - spec.input( - "host_structure", - valid_type=orm.StructureData, - help="Pristine structure" - ) - spec.input( - "defect_structure", - valid_type=orm.StructureData, - help="Defective structure" - ) - - # aakhtar - # spec.input( - # "host_unitcell", - # valid_type=orm.StructureData, - # help="Pristine structure to use in the calculation of permittivity", - # required=False, - # ) - - # Defect details - spec.input( - "defect_charge", - valid_type=orm.Float, - help="Defect charge state") - spec.input( - "defect_site", - valid_type=orm.List, - help="Defect site position in crystal coordinates", - ) - spec.input( - "fermi_level", - valid_type=orm.Float, - default=orm.Float(0.0), - help="Fermi level position with respect to the valence band maximum", - ) - spec.input( - "chemical_potential", - valid_type=orm.Float, - help="The chemical potential of the given defect type. The convention is that removing an atom is positive", - ) - - # Methodology - spec.input( - "correction_scheme", - valid_type=orm.Str, - help="The correction scheme to apply", - ) - #aakhtar - spec.input( - "gaussian_sigma", - valid_type=orm.Float, - help="the width fo gaussian sigma", - ) - - spec.input( - "epsilon", - valid_type=orm.Float, - help="the width fo gaussian sigma", - ) - #aakhtar - - - # Outputs - spec.output("neutral_formation_energy_uncorrected", - valid_type=orm.Float, - required=False - ) - spec.output("charged_formation_energy_uncorrected", valid_type=orm.Float, required=False - ) - - spec.output( - "formation_energy_uncorrected", valid_type=orm.Float, required=False - ) - spec.output( - "formation_energy_corrected", valid_type=orm.Float, required=False - ) - spec.output( - "formation_energy_corrected_aligned", valid_type=orm.Float, required=False - ) - - # Error codes - spec.exit_code( 401, "ERROR_INVALID_CORRECTION", - message="The requested correction scheme is not recognised", - ) - spec.exit_code(402, "ERROR_CORRECTION_WORKCHAIN_FAILED", - message="The correction scheme sub-workchain failed", - ) - spec.exit_code(403, "ERROR_DFT_CALCULATION_FAILED", - message="DFT calculation failed", - ) - spec.exit_code(404, "ERROR_PP_CALCULATION_FAILED", - message="A post-processing calculation failed", - ) - spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", - message="Input parameter dictionary key cannot be set explicitly", - ) - spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", - message="The requested method is not yet implemented", - ) - # fmt: on - - def setup(self): - """ - Setup the workchain - """ - - # Check if correction scheme is valid: - self.report("Checking Formation Scheme") - correction_schemes_available = ["gaussian","point","none"] - if self.inputs.correction_scheme is not None: - if self.inputs.correction_scheme not in correction_schemes_available: - return self.exit_codes.ERROR_INVALID_CORRECTION - - - def correction_required(self): - """ - Check if correction is requested - """ - #if self.inputs.correction_scheme is not None: - if self.inputs.correction_scheme=="gaussian" or self.inputs.correction_scheme=="point": - self.report("Ther will be Corrections applied") - return True - else: - self.report("Ther will be no Corrections applied") - return False - - def is_gaussian_scheme(self): - """ - Check if Gaussian countercharge correction scheme is being used - """ - return self.inputs.correction_scheme == "gaussian" - - def is_point_scheme(self): - """ - Check if Point countercharge correction scheme is being used - """ - return self.inputs.correction_scheme == "point" - - def is_none_scheme(self): - """ - Check if there is none scheme for correction - """ - return self.inputs.correction_scheme == "none" - - def run_gaussian_correction_workchain(self): - """ - Run the workchain for the Gaussian Countercharge correction - """ - from .corrections.gaussian.gaussian_countercharge import ( - GaussianCounterChargeWorkchain, - ) - - self.report("Computing correction via the Gaussian Countercharge scheme") - - inputs = { - "v_host": self.ctx.v_host, - "v_defect_q0": self.ctx.v_defect_q0, - "v_defect_q": self.ctx.v_defect_q, - "defect_charge": self.inputs.defect_charge, - "defect_site": self.inputs.defect_site, - "host_structure": self.inputs.host_structure, - "epsilon": self.input.epsilon - # "epsilon": self.ctx.epsilon, - } - - workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) - label = "correction_workchain" - self.to_context(**{label: workchain_future}) - - def prepare_point_correction_workchain(self): - """ - Get the required inputs for the Point Countercharge correction workchain - - TODO: Finish implementing this interface - """ - return - - def run_point_correction_workchain(self): - """ - Run the workchain for the Point Countercharge correction - - TODO: Finish implementing this interface - """ - from .corrections.point_countercharge.point_countercharge import ( - PointCounterChargeWorkchain, - ) - - self.report("Computing correction via the Point Countercharge scheme") - - inputs = {} - - workchain_future = self.submit(PointCounterChargeWorkchain, **inputs) - label = "correction_workchain" - self.to_context(**{label: workchain_future}) - - def check_correction_workchain(self): - """ - Check if the potential alignment workchains have finished correctly. - If yes, assign the outputs to the context - """ - - correction_wc = self.ctx["correction_workchain"] - if not correction_wc.is_finished_ok: - self.report( - "Correction workchain failed with status {}".format( - correction_wc.exit_status - ) - ) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION - else: - self.ctx.total_correction = correction_wc.outputs.total_correction - self.ctx.electrostatic_correction = ( - correction_wc.outputs.electrostatic_correction - ) - self.ctx.total_alignment = correction_wc.outputs.total_alignment - - - - - #============================================ - # Compute Charged Formation Energy without Corrections - #============================================ - def compute_neutral_formation_energy(self): - """ - Compute the formation energy without Correction - """ - # Raw formation energy - self.ctx.n_f_uncorrected = get_raw_formation_energy( - self.ctx.defect_q0_energy, - self.ctx.host_energy, - self.inputs.chemical_potential, - self.inputs.defect_charge, - self.inputs.fermi_level, - self.ctx.host_vbm - ) - self.report( - "The computed neutral formation energy without correction is {} eV".format( - self.ctx.n_f_uncorrected.value - ) - ) - self.out("neutral_formation_energy_uncorrected", self.ctx.n_f_uncorrected) - - #============================================== - # Compute Charged Formation Energy without Corrections - #============================================= - def compute_charged_formation_energy_no_corre(self): - """ - Compute the formation energy without Correction - """ - # Raw formation energy - self.ctx.e_f_uncorrected = get_raw_formation_energy( - self.ctx.defect_q_energy, - self.ctx.host_energy, - self.inputs.chemical_potential, - self.inputs.defect_charge, - self.inputs.fermi_level, - self.ctx.host_vbm - ) - self.report( - "The computed charge {} e formation energy without correction is {} eV".format( - self.inputs.defect_charge.value ,self.ctx.e_f_uncorrected.value - ) - ) - - self.report( - "The Grid Units is {}".format( - self.ctx.host_VT.grid_unit - ) - ) - - - self.out("charged_formation_energy_uncorrected", self.ctx.e_f_uncorrected) - - - - - - - #============================================ - # Compute Formation Energy with Corrections - #============================================ - def compute_corrected_formation_energy(self): - """ - Compute the formation energy - """ - - # Raw formation energy - self.ctx.e_f_uncorrected = get_raw_formation_energy( - self.ctx.defect_energy, - self.ctx.host_energy, - self.inputs.chemical_potential, - self.inputs.defect_charge, - self.inputs.fermi_level, - self.ctx.host_vbm, - ) - self.report( - "The computed uncorrected formation energy is {} eV".format( - self.ctx.e_f_uncorrected.value - ) - ) - self.out("formation_energy_uncorrected", self.ctx.e_f_uncorrected) - - # Corrected formation energy - self.ctx.e_f_corrected = get_corrected_formation_energy( - self.ctx.e_f_uncorrected, self.ctx.electrostatic_correction - ) - self.report( - "The computed corrected formation energy is {} eV".format( - self.ctx.e_f_corrected.value - ) - ) - self.out("formation_energy_corrected", self.ctx.e_f_corrected) - - # Corrected formation energy with potential alignment - self.ctx.e_f_corrected_aligned = get_corrected_aligned_formation_energy( - self.ctx.e_f_corrected, self.ctx.total_alignment - ) - self.report( - "The computed corrected formation energy, including potential alignments, is {} eV".format( - self.ctx.e_f_corrected_aligned.value - ) - ) - self.out("formation_energy_corrected_aligned", self.ctx.e_f_corrected_aligned) - - def raise_not_implemented(self): - """ - Raise a not-implemented error - """ - return self.exit_codes.ERROR_NOT_IMPLEMENTED diff --git a/aiida_defects/formation_energy_siesta/formation_energy_siesta.py b/aiida_defects/formation_energy_siesta/formation_energy_siesta.py deleted file mode 100644 index 20b9cc3..0000000 --- a/aiida_defects/formation_energy_siesta/formation_energy_siesta.py +++ /dev/null @@ -1,314 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## -from __future__ import absolute_import - -import numpy as np - -from aiida import orm -from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit -from aiida.plugins import WorkflowFactory -from aiida_siesta.workflows.base import SiestaBaseWorkChain - -from .formation_energy_base import FormationEnergyWorkchainBase -#from .utils import run_siesta_calculation -from .utils import get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy - -from aiida.common import AttributeDict -from aiida_siesta.calculations.tkdict import FDFDict -#from aiida_siesta.data.common import get_pseudos_from_structure -#from aiida_siesta.data.psf import PsfData -#from aiida_siesta.data.psml import PsmlData -def prepare_pseudo_inputs(structure, pseudos): - """ - Reading Pseudos - """ - if pseudos is None : - raise ValueError('neither an explicit pseudos dictionary was specified') - for kind in structure.get_kind_names(): - if kind not in pseudos: - raise ValueError('no pseudo available for element {}'.format(kind)) - - return pseudos - - - -class FormationEnergyWorkchainSIESTA(FormationEnergyWorkchainBase): - """ - Compute the formation energy for a given defect using SIESTA - """ - @classmethod - def define(cls, spec): - super(FormationEnergyWorkchainSIESTA, cls).define(spec) - - # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here - # we keep track of things with two separate namespaces. An additional code, and an additional - # namespace, is used for postprocessing - #spec.expose_inputs(SiestaBaseWorkChain, exclude=('metadata',)) - #spec.inputs._ports['pseudos'].dynamic = True #Temporary fix to issue #135 plumpy - # spec.inputs._ports["pseudos.defect"].dynamic = True - # DFT inputs for Host (SIESTA) - spec.input_namespace("siesta.dft.supercell_host", - help="The siesta code to use for the calculations") - spec.input_namespace("siesta.dft.supercell_defect_q0", - help="The siesta code to use for the calculations") - spec.input_namespace("siesta.dft.supercell_defect_q", - help="The siesta code to use for the calculations") - spec.input_namespace('pseudos_host', required=False, dynamic=True) - spec.input_namespace('pseudos_defect', required=False, dynamic=True) - # HOST Inputs - spec.input("siesta.dft.supercell_host.code", - valid_type=orm.Code, - help="The siesta code to use for the calculations") - #spec.input_namespace('pseudos_host' - # valid_type=(PsfData,PsmlData), - # help='Input pseudo potentials',dynamic=True) - spec.input("siesta.dft.supercell_host.kpoints", - valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") - spec.input("siesta.dft.supercell_host.basis", - valid_type=orm.Dict, - help="The siesta basis to use for the host calculations") - spec.input("siesta.dft.supercell_host.parameters", - valid_type=orm.Dict, - help="Parameters for the SIESTA calcuations. Some will be set automatically") - spec.input("siesta.dft.supercell_host.options", - valid_type=orm.Dict, - help="options for the SIESTA calcuations") - # Defect_q0 without charge - spec.input("siesta.dft.supercell_defect_q0.code", - valid_type=orm.Code, - help="The siesta code to use for the calculations") - #spec.input_namespace('pseudos_q0', - # valid_type=(PsfData,PsmlData), - # help='Input pseudo potentials',dynamic=True) - spec.input("siesta.dft.supercell_defect_q0.kpoints", - valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") - spec.input("siesta.dft.supercell_defect_q0.basis", - valid_type=orm.Dict, - help="The siesta basis to use for the host calculations") - spec.input("siesta.dft.supercell_defect_q0.parameters", - valid_type=orm.Dict, - help="Parameters for the SIESTA calcuations. Some will be set automatically") - spec.input("siesta.dft.supercell_defect_q0.options", - valid_type=orm.Dict, - help="options for the SIESTA calcuations.") - # DFT inputs for Defect With Charge (SIESTA) - spec.input("siesta.dft.supercell_defect_q.code", - valid_type=orm.Code, - help="The siesta code to use for the calculations") - #spec.input_namespace('pseudos_q', - # valid_type=(PsfData,PsmlData), - # help='Input pseudo potentials',dynamic=True) - spec.input("siesta.dft.supercell_defect_q.kpoints", - valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") - spec.input("siesta.dft.supercell_defect_q.basis", - valid_type=orm.Dict, - help="The siesta basis to use for the host calculations") - spec.input("siesta.dft.supercell_defect_q.parameters", - valid_type=orm.Dict, - help="Parameters for the SIESTA calcuations. Some will be set automatically") - spec.input("siesta.dft.supercell_defect_q.options", - valid_type=orm.Dict, - help="options for the SIESTA calcuations.") - - #=================================================================== - # The Steps of Workflow - #=================================================================== - - spec.outline( - cls.setup, - cls.run_dft_calcs, - if_(cls.correction_required)( - if_(cls.is_gaussian_scheme)( - cls.raise_not_implemented - )).else_( - cls.check_dft_calcs, - cls.compute_neutral_formation_energy, - cls.compute_charged_formation_energy_no_corre)) - #if_(cls.is_none_scheme)( - # cls.check_dft_calcs, - # cls.compute_no_corrected_formation_energy)) - - - - #========================================================================= - # This function is for running Host and defect structure neutral & charge - #======================================================================== - def run_dft_calcs(self): - - """ - Submit All DFT Calculations - """ - self.report("Setting Up the No correction Formation Energy Workchain ") - #-------------- - # For the Host - #------------- - siesta_inputs = self.inputs.siesta.dft.supercell_host.code.get_builder() - #siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) For reusing - pseudos = None - if "pseudos_host" in self.inputs: #in case in the future Issue #142 will be solved - if self.inputs.pseudos_host: - pseudos = self.inputs.pseudos_host - #structure = None - structure = self.inputs.host_structure - siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) - siesta_inputs.structure = structure - siesta_inputs.parameters = self.inputs.siesta.dft.supercell_host.parameters - siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_host.kpoints - siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_host.options.get_dict() - siesta_inputs.basis = self.inputs.siesta.dft.supercell_host.basis #get_dict() - #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) - future = self.submit(siesta_inputs) - self.report( - 'Workflow Launching SIESTA for host structure (PK={}) (PK={})' - .format(structure.pk, future.pk)) - #.format(self.inputs.host_structure.pk, future.pk)) - self.to_context(**{'calc_host': future}) - #------------------------------------------- - # For Defect structure; neutral charge state - #------------------------------------------ - siesta_inputs = self.inputs.siesta.dft.supercell_defect_q0.code.get_builder() - #siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) - pseudos = None - if "pseudos_defect" in self.inputs: #in case in the future Issue #142 will be solved - if self.inputs.pseudos_defect: - pseudos = self.inputs.pseudos_defect - structure = self.inputs.defect_structure - siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) - siesta_inputs.structure = structure - siesta_inputs.parameters = self.inputs.siesta.dft.supercell_defect_q0.parameters - siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_defect_q0.kpoints - siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_defect_q0.options.get_dict() - siesta_inputs.basis = self.inputs.siesta.dft.supercell_defect_q0.basis - #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) - future = self.submit(siesta_inputs) - self.report( - 'Launching SIESTA for defect structure (PK={}) with charge {} (PK={})' - .format(structure.pk, "0.0", future.pk)) - self.to_context(**{'calc_defect_q0': future}) - #------------------------------------------ - # For Defect structure; target charge state - #----------------------------------------- - siesta_inputs = self.inputs.siesta.dft.supercell_defect_q.code.get_builder() - # siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) - pseudos = None - if "pseudos_defect" in self.inputs: #in case in the future Issue #142 will be solved - if self.inputs.pseudos_defect: - pseudos = self.inputs.pseudos_defect - structure = self.inputs.defect_structure - siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) - siesta_inputs.structure = structure - siesta_inputs.parameters = self.inputs.siesta.dft.supercell_defect_q.parameters - siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_defect_q.kpoints - siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_defect_q.options.get_dict() - siesta_inputs.basis = self.inputs.siesta.dft.supercell_defect_q.basis - #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) - future = self.submit(siesta_inputs) - self.report( - 'Launching SIESTA for defect structure (PK={}) with charge {} (PK={})' - .format(structure.pk, - self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'calc_defect_q': future}) - #========================================= - # Retrieving DFT Calculations results - #========================================= - def check_dft_calcs(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - import sisl - - # We used sisl library read the Potential Grids - - self.report("Checking Up Whether DFT Caclucations are Finished ") - # Host - host_calc = self.ctx['calc_host'] - if host_calc.is_finished_ok: - self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['E_KS']) # eV - self.ctx.host_vbm = orm.Float(0.0) - self.ctx.host_VT = sisl.get_sile(host_calc.outputs.remote_folder.get_remote_path()+"/aiida.VT") - # self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum - else: - self.report( - 'SIESTA for the host structure has failed with status {}'. - format(host_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - - # Defect (q=0) - defect_q0_calc = self.ctx['calc_defect_q0'] - if defect_q0_calc.is_finished_ok: - self.ctx.defect_q0_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['E_KS']) - self.ctx.defect_q0_VT = sisl.get_sile(calc_defect_q0.outputs.remote_folder.get_remote_path()+"/aiida.VT") - else: - self.report( - 'SIESTA for the defect structure (with charge 0) has failed with status {}' - .format(defect_q0_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - - # Defect (q=q) - defect_q_calc = self.ctx['calc_defect_q'] - if defect_q_calc.is_finished_ok: - self.ctx.defect_q_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['E_KS']) # eV - self.ctx.defect_q_VT = sisl.get_sile(calc_defect_q.outputs.remote_folder.get_remote_path()+"/aiida.VT") - else: - self.report( - 'SIESTA for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value, - defect_q_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - - - - def check_dft_potentials_gaussian_correction(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - - # Host - host_pp = self.ctx['pp_host'] - if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_host = v_data - else: - self.report( - 'Post processing for the host structure has failed with status {}' - .format(host_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defect (q=0) - defect_q0_pp = self.ctx['pp_defect_q0'] - if defect_q0_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q0 = v_data - else: - self.report( - 'Post processing for the defect structure (with charge 0) has failed with status {}' - .format(defect_q0_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defect (q=q) - defect_q_pp = self.ctx['pp_defect_q'] - if defect_q_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q = v_data - else: - self.report( - 'Post processing for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value, - defect_q_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED diff --git a/aiida_defects/formation_energy_siesta/formation_energy_siesta.py-backup b/aiida_defects/formation_energy_siesta/formation_energy_siesta.py-backup deleted file mode 100644 index 426ac8a..0000000 --- a/aiida_defects/formation_energy_siesta/formation_energy_siesta.py-backup +++ /dev/null @@ -1,340 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## -from __future__ import absolute_import - -import numpy as np - -from aiida import orm -from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit -from aiida.plugins import WorkflowFactory -from aiida_siesta.workflows.base import SiestaBaseWorkChain - -from .formation_energy_base import FormationEnergyWorkchainBase -#from .utils import run_siesta_calculation -from .utils import get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy - -from aiida.common import AttributeDict -from aiida_siesta.calculations.tkdict import FDFDict -#from aiida_siesta.data.common import get_pseudos_from_structure -#from aiida_siesta.data.psf import PsfData -#from aiida_siesta.data.psml import PsmlData -def prepare_pseudo_inputs(structure, pseudos): - """ - Reading Pseudos - """ - if pseudos is None : - raise ValueError('neither an explicit pseudos dictionary was specified') - for kind in structure.get_kind_names(): - if kind not in pseudos: - raise ValueError('no pseudo available for element {}'.format(kind)) - - return pseudos - - - -class FormationEnergyWorkchainSIESTA(FormationEnergyWorkchainBase): - """ - Compute the formation energy for a given defect using SIESTA - """ - @classmethod - def define(cls, spec): - super(FormationEnergyWorkchainSIESTA, cls).define(spec) - - # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here - # we keep track of things with two separate namespaces. An additional code, and an additional - # namespace, is used for postprocessing - #spec.expose_inputs(SiestaBaseWorkChain, exclude=('metadata',)) - #spec.inputs._ports['pseudos'].dynamic = True #Temporary fix to issue #135 plumpy - # spec.inputs._ports["pseudos.defect"].dynamic = True - # DFT inputs for Host (SIESTA) - spec.input_namespace("siesta.dft.supercell_host", - help="The siesta code to use for the calculations") - spec.input_namespace("siesta.dft.supercell_defect_q0", - help="The siesta code to use for the calculations") - spec.input_namespace("siesta.dft.supercell_defect_q", - help="The siesta code to use for the calculations") - spec.input_namespace('pseudos_host', required=False, dynamic=True) - spec.input_namespace('pseudos_defect', required=False, dynamic=True) - # HOST Inputs - spec.input("siesta.dft.supercell_host.code", - valid_type=orm.Code, - help="The siesta code to use for the calculations") - #spec.input_namespace('pseudos_host' - # valid_type=(PsfData,PsmlData), - # help='Input pseudo potentials',dynamic=True) - spec.input("siesta.dft.supercell_host.kpoints", - valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") - spec.input("siesta.dft.supercell_host.basis", - valid_type=orm.Dict, - help="The siesta basis to use for the host calculations") - spec.input("siesta.dft.supercell_host.parameters", - valid_type=orm.Dict, - help="Parameters for the SIESTA calcuations. Some will be set automatically") - spec.input("siesta.dft.supercell_host.options", - valid_type=orm.Dict, - help="options for the SIESTA calcuations") - # Defect_q0 without charge - spec.input("siesta.dft.supercell_defect_q0.code", - valid_type=orm.Code, - help="The siesta code to use for the calculations") - #spec.input_namespace('pseudos_q0', - # valid_type=(PsfData,PsmlData), - # help='Input pseudo potentials',dynamic=True) - spec.input("siesta.dft.supercell_defect_q0.kpoints", - valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") - spec.input("siesta.dft.supercell_defect_q0.basis", - valid_type=orm.Dict, - help="The siesta basis to use for the host calculations") - spec.input("siesta.dft.supercell_defect_q0.parameters", - valid_type=orm.Dict, - help="Parameters for the SIESTA calcuations. Some will be set automatically") - spec.input("siesta.dft.supercell_defect_q0.options", - valid_type=orm.Dict, - help="options for the SIESTA calcuations.") - # DFT inputs for Defect With Charge (SIESTA) - spec.input("siesta.dft.supercell_defect_q.code", - valid_type=orm.Code, - help="The siesta code to use for the calculations") - #spec.input_namespace('pseudos_q', - # valid_type=(PsfData,PsmlData), - # help='Input pseudo potentials',dynamic=True) - spec.input("siesta.dft.supercell_defect_q.kpoints", - valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") - spec.input("siesta.dft.supercell_defect_q.basis", - valid_type=orm.Dict, - help="The siesta basis to use for the host calculations") - spec.input("siesta.dft.supercell_defect_q.parameters", - valid_type=orm.Dict, - help="Parameters for the SIESTA calcuations. Some will be set automatically") - spec.input("siesta.dft.supercell_defect_q.options", - valid_type=orm.Dict, - help="options for the SIESTA calcuations.") - - #=================================================================== - # The Steps of Workflow - #=================================================================== - - spec.outline( - cls.setup, - #cls.run_dft_calcs, - if_(cls.correction_required)( - if_(cls.is_gaussian_scheme)( - cls.raise_not_implemented - )).else_( - cls.check_dft_calcs, - cls.compute_no_corrected_formation_energy)) - #if_(cls.is_none_scheme)( - # cls.check_dft_calcs, - # cls.compute_no_corrected_formation_energy)) - - - - #========================================================================= - # This function is for running Host and defect structure neutral & charge - #======================================================================== -# def run_dft_calcs(self): -# -# """ -# Submit All DFT Calculations -# """ -# self.report("Setting Up the No correction Formation Energy Workchain ") -# #-------------- -# # For the Host -# #------------- -# siesta_inputs = self.inputs.siesta.dft.supercell_host.code.get_builder() -# #siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) For reusing -# pseudos = None -# if "pseudos_host" in self.inputs: #in case in the future Issue #142 will be solved -# if self.inputs.pseudos_host: -# pseudos = self.inputs.pseudos_host -# #structure = None -# structure = self.inputs.host_structure -# siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) -# siesta_inputs.structure = structure -# siesta_inputs.parameters = self.inputs.siesta.dft.supercell_host.parameters -# siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_host.kpoints -# siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_host.options.get_dict() -# siesta_inputs.basis = self.inputs.siesta.dft.supercell_host.basis #get_dict() -# #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) -# future = self.submit(siesta_inputs) -# self.report( -# 'Launching SIESTA for host structure (PK={}) (PK={})' -# .format(structure.pk, future.pk)) -# #.format(self.inputs.host_structure.pk, future.pk)) -# self.to_context(**{'calc_host': future}) -# #------------------------------------------- -# # For Defect structure; neutral charge state -# #------------------------------------------ -# siesta_inputs = self.inputs.siesta.dft.supercell_defect_q0.code.get_builder() -# #siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) -# pseudos = None -# if "pseudos_defect" in self.inputs: #in case in the future Issue #142 will be solved -# if self.inputs.pseudos_defect: -# pseudos = self.inputs.pseudos_defect -# structure = self.inputs.defect_structure -# siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) -# siesta_inputs.structure = structure -# siesta_inputs.parameters = self.inputs.siesta.dft.supercell_defect_q0.parameters -# siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_defect_q0.kpoints -# siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_defect_q0.options.get_dict() -# siesta_inputs.basis = self.inputs.siesta.dft.supercell_defect_q0.basis -# #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) -# future = self.submit(siesta_inputs) -# self.report( -# 'Launching SIESTA for defect structure (PK={}) with charge {} (PK={})' -# .format(structure.pk, "0.0", future.pk)) -# self.to_context(**{'calc_defect_q0': future}) -# #------------------------------------------ -# # For Defect structure; target charge state -# #----------------------------------------- -# siesta_inputs = self.inputs.siesta.dft.supercell_defect_q.code.get_builder() -# # siesta_inputs = AttributeDict(self.exposed_inputs(SiestaBaseWorkChain)) -# pseudos = None -# if "pseudos_defect" in self.inputs: #in case in the future Issue #142 will be solved -# if self.inputs.pseudos_defect: -# pseudos = self.inputs.pseudos_defect -# structure = self.inputs.defect_structure -# siesta_inputs.pseudos = prepare_pseudo_inputs(structure, pseudos) -# siesta_inputs.structure = structure -# siesta_inputs.parameters = self.inputs.siesta.dft.supercell_defect_q.parameters -# siesta_inputs.kpoints = self.inputs.siesta.dft.supercell_defect_q.kpoints -# siesta_inputs.metadata["options"] = self.inputs.siesta.dft.supercell_defect_q.options.get_dict() -# siesta_inputs.basis = self.inputs.siesta.dft.supercell_defect_q.basis -# #future = self.submit(SiestaBaseWorkChain,**siesta_inputs) -# future = self.submit(siesta_inputs) -# self.report( -# 'Launching SIESTA for defect structure (PK={}) with charge {} (PK={})' -# .format(structure.pk, -# self.inputs.defect_charge.value, future.pk)) -# self.to_context(**{'calc_defect_q': future}) - - #========================================= - # Retrieving DFT Calculations results - #========================================= - def check_dft_calcs(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - self.report("Checking Up Whether DFT Caclucations are Finished ") - # Host - host_calc = self.ctx['calc_host'] - if host_calc.is_finished_ok: - self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV - self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum - else: - self.report( - 'SIESTA for the host structure has failed with status {}'. - format(host_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - - # Defect (q=0) - defect_q0_calc = self.ctx['calc_defect_q0'] - if not defect_q0_calc.is_finished_ok: - self.report( - 'SIESTA for the defect structure (with charge 0) has failed with status {}' - .format(defect_q0_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - - # Defect (q=q) - defect_q_calc = self.ctx['calc_defect_q'] - if defect_q_calc.is_finished_ok: - self.ctx.defect_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['energy']) # eV - else: - self.report( - 'SIESTA for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value, - defect_q_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - - -# def get_dft_potentials_gaussian_correction(self): -# """ -# Obtain the electrostatic potentials from the SIESTA calculations. -# """ - -# # User inputs -# pp_inputs = self.inputs.qe.pp.code.get_builder() -# pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() - -# # Fixed settings -# pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential -# pp_inputs.plot_dimension = orm.Int(3) # 3D - -# inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder -# future = self.submit(pp_inputs) -# self.report( -# 'Launching SIESTA VT retrieved for host structure (PK={}) with charge {} (PK={})'. -# format(self.inputs.host_structure.pk, "0.0", future.pk)) -# self.to_context(**{'pp_host': future}) - -# pp_inputs.parent_folder = self.ctx[ -# 'calc_defect_q0'].outputs.remote_folder -# future = self.submit(pp_inputs) -# self.report( -# 'Launching PP.x for defect structure (PK={}) with charge {} (PK={})' -# .format(self.inputs.defect_structure.pk, "0.0", future.pk)) -# self.to_context(**{'pp_defect_q0': future}) -# -# pp_inputs.parent_folder = self.ctx[ -# 'calc_defect_q'].outputs.remote_folder -# future = self.submit(pp_inputs) -# self.report( -# 'Launching PP.x for defect structure (PK={}) with charge {} (PK={})' -# .format(self.inputs.defect_structure.pk, -# self.inputs.defect_charge.value, future.pk)) -# self.to_context(**{'pp_defect_q': future}) - - def check_dft_potentials_gaussian_correction(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - - # Host - host_pp = self.ctx['pp_host'] - if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_host = v_data - else: - self.report( - 'Post processing for the host structure has failed with status {}' - .format(host_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defect (q=0) - defect_q0_pp = self.ctx['pp_defect_q0'] - if defect_q0_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q0 = v_data - else: - self.report( - 'Post processing for the defect structure (with charge 0) has failed with status {}' - .format(defect_q0_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defect (q=q) - defect_q_pp = self.ctx['pp_defect_q'] - if defect_q_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q = v_data - else: - self.report( - 'Post processing for the defect structure (with charge {}) has failed with status {}' - .format(self.inputs.defect_charge.value, - defect_q_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED diff --git a/aiida_defects/formation_energy_siesta/pseudos/GhostH.psf b/aiida_defects/formation_energy_siesta/pseudos/GhostH.psf deleted file mode 100644 index 25a223e..0000000 --- a/aiida_defects/formation_energy_siesta/pseudos/GhostH.psf +++ /dev/null @@ -1,1527 +0,0 @@ - H ca nrl nc - ATM3 19-FEB-98 Troullier-Martins - 1s 1.00 r= 1.25/2p 0.00 r= 1.25/3d 0.00 r= 1.25/4f 0.00 r= 1.25/ - 4 0 863 0.247875217667E-02 0.125000000000E-01 1.00000000000 - Radial grid follows - 0.311788641354E-04 0.627499101025E-04 0.947180709413E-04 0.127088341742E-03 - 0.159865780426E-03 0.193055508533E-03 0.226662712027E-03 0.260692642102E-03 - 0.295150616003E-03 0.330042017859E-03 0.365372299523E-03 0.401146981422E-03 - 0.437371653424E-03 0.474051975707E-03 0.511193679647E-03 0.548802568709E-03 - 0.586884519361E-03 0.625445481983E-03 0.664491481805E-03 0.704028619843E-03 - 0.744063073857E-03 0.784601099310E-03 0.825649030352E-03 0.867213280805E-03 - 0.909300345168E-03 0.951916799631E-03 0.995069303102E-03 0.103876459825E-02 - 0.108300951254E-02 0.112781095935E-02 0.117317593898E-02 0.121911153982E-02 - 0.126562493938E-02 0.131272340548E-02 0.136041429736E-02 0.140870506681E-02 - 0.145760325936E-02 0.150711651546E-02 0.155725257165E-02 0.160801926180E-02 - 0.165942451829E-02 0.171147637332E-02 0.176418296008E-02 0.181755251409E-02 - 0.187159337444E-02 0.192631398514E-02 0.198172289639E-02 0.203782876595E-02 - 0.209464036046E-02 0.215216655687E-02 0.221041634375E-02 0.226939882275E-02 - 0.232912321000E-02 0.238959883756E-02 0.245083515488E-02 0.251284173024E-02 - 0.257562825231E-02 0.263920453161E-02 0.270358050205E-02 0.276876622252E-02 - 0.283477187841E-02 0.290160778324E-02 0.296928438027E-02 0.303781224409E-02 - 0.310720208233E-02 0.317746473729E-02 0.324861118764E-02 0.332065255018E-02 - 0.339360008150E-02 0.346746517981E-02 0.354225938667E-02 0.361799438885E-02 - 0.369468202008E-02 0.377233426296E-02 0.385096325082E-02 0.393058126959E-02 - 0.401120075975E-02 0.409283431826E-02 0.417549470053E-02 0.425919482242E-02 - 0.434394776223E-02 0.442976676279E-02 0.451666523349E-02 0.460465675239E-02 - 0.469375506834E-02 0.478397410315E-02 0.487532795371E-02 0.496783089426E-02 - 0.506149737856E-02 0.515634204219E-02 0.525237970483E-02 0.534962537256E-02 - 0.544809424020E-02 0.554780169373E-02 0.564876331263E-02 0.575099487235E-02 - 0.585451234680E-02 0.595933191079E-02 0.606546994257E-02 0.617294302645E-02 - 0.628176795531E-02 0.639196173326E-02 0.650354157831E-02 0.661652492503E-02 - 0.673092942730E-02 0.684677296106E-02 0.696407362710E-02 0.708284975388E-02 - 0.720311990041E-02 0.732490285916E-02 0.744821765894E-02 0.757308356797E-02 - 0.769952009678E-02 0.782754700133E-02 0.795718428611E-02 0.808845220719E-02 - 0.822137127545E-02 0.835596225977E-02 0.849224619027E-02 0.863024436158E-02 - 0.876997833620E-02 0.891146994785E-02 0.905474130488E-02 0.919981479373E-02 - 0.934671308243E-02 0.949545912414E-02 0.964607616072E-02 0.979858772640E-02 - 0.995301765142E-02 0.101093900658E-01 0.102677294030E-01 0.104280604038E-01 - 0.105904081204E-01 0.107547979199E-01 0.109212554885E-01 0.110898068355E-01 - 0.112604782975E-01 0.114332965423E-01 0.116082885729E-01 0.117854817323E-01 - 0.119649037073E-01 0.121465825329E-01 0.123305465968E-01 0.125168246438E-01 - 0.127054457802E-01 0.128964394784E-01 0.130898355815E-01 0.132856643082E-01 - 0.134839562570E-01 0.136847424115E-01 0.138880541449E-01 0.140939232251E-01 - 0.143023818195E-01 0.145134625003E-01 0.147271982492E-01 0.149436224628E-01 - 0.151627689580E-01 0.153846719766E-01 0.156093661917E-01 0.158368867121E-01 - 0.160672690883E-01 0.163005493180E-01 0.165367638518E-01 0.167759495987E-01 - 0.170181439319E-01 0.172633846948E-01 0.175117102068E-01 0.177631592691E-01 - 0.180177711713E-01 0.182755856970E-01 0.185366431302E-01 0.188009842617E-01 - 0.190686503953E-01 0.193396833544E-01 0.196141254884E-01 0.198920196795E-01 - 0.201734093492E-01 0.204583384653E-01 0.207468515484E-01 0.210389936793E-01 - 0.213348105059E-01 0.216343482502E-01 0.219376537154E-01 0.222447742937E-01 - 0.225557579733E-01 0.228706533461E-01 0.231895096150E-01 0.235123766021E-01 - 0.238393047559E-01 0.241703451597E-01 0.245055495391E-01 0.248449702706E-01 - 0.251886603893E-01 0.255366735976E-01 0.258890642730E-01 0.262458874776E-01 - 0.266071989655E-01 0.269730551924E-01 0.273435133242E-01 0.277186312457E-01 - 0.280984675697E-01 0.284830816465E-01 0.288725335729E-01 0.292668842014E-01 - 0.296661951502E-01 0.300705288124E-01 0.304799483660E-01 0.308945177837E-01 - 0.313143018426E-01 0.317393661350E-01 0.321697770780E-01 0.326056019242E-01 - 0.330469087721E-01 0.334937665768E-01 0.339462451607E-01 0.344044152246E-01 - 0.348683483584E-01 0.353381170527E-01 0.358137947097E-01 0.362954556551E-01 - 0.367831751493E-01 0.372770293996E-01 0.377770955716E-01 0.382834518017E-01 - 0.387961772091E-01 0.393153519083E-01 0.398410570212E-01 0.403733746904E-01 - 0.409123880916E-01 0.414581814467E-01 0.420108400372E-01 0.425704502169E-01 - 0.431370994261E-01 0.437108762050E-01 0.442918702073E-01 0.448801722145E-01 - 0.454758741499E-01 0.460790690933E-01 0.466898512951E-01 0.473083161912E-01 - 0.479345604180E-01 0.485686818275E-01 0.492107795024E-01 0.498609537718E-01 - 0.505193062267E-01 0.511859397361E-01 0.518609584627E-01 0.525444678797E-01 - 0.532365747868E-01 0.539373873271E-01 0.546470150040E-01 0.553655686982E-01 - 0.560931606852E-01 0.568299046528E-01 0.575759157186E-01 0.583313104486E-01 - 0.590962068745E-01 0.598707245130E-01 0.606549843841E-01 0.614491090300E-01 - 0.622532225343E-01 0.630674505414E-01 0.638919202759E-01 0.647267605631E-01 - 0.655721018483E-01 0.664280762180E-01 0.672948174198E-01 0.681724608838E-01 - 0.690611437435E-01 0.699610048576E-01 0.708721848311E-01 0.717948260377E-01 - 0.727290726420E-01 0.736750706219E-01 0.746329677917E-01 0.756029138245E-01 - 0.765850602765E-01 0.775795606101E-01 0.785865702179E-01 0.796062464472E-01 - 0.806387486246E-01 0.816842380806E-01 0.827428781751E-01 0.838148343227E-01 - 0.849002740188E-01 0.859993668654E-01 0.871122845982E-01 0.882392011127E-01 - 0.893802924921E-01 0.905357370340E-01 0.917057152791E-01 0.928904100389E-01 - 0.940900064243E-01 0.953046918747E-01 0.965346561872E-01 0.977800915461E-01 - 0.990411925534E-01 0.100318156259 0.101611182190 0.102920472385 - 0.104246231424 0.105588666458 0.106947987247 0.108324406186 - 0.109718138344 0.111129401494 0.112558416150 0.114005405597 - 0.115470595931 0.116954216090 0.118456497894 0.119977676076 - 0.121517988325 0.123077675317 0.124656980755 0.126256151411 - 0.127875437158 0.129515091011 0.131175369171 0.132856531060 - 0.134558839362 0.136282560066 0.138027962508 0.139795319410 - 0.141584906925 0.143397004680 0.145231895818 0.147089867046 - 0.148971208675 0.150876214668 0.152805182687 0.154758414137 - 0.156736214214 0.158738891953 0.160766760277 0.162820136045 - 0.164899340100 0.167004697323 0.169136536679 0.171295191274 - 0.173480998400 0.175694299596 0.177935440694 0.180204771876 - 0.182502647731 0.184829427305 0.187185474164 0.189571156444 - 0.191986846913 0.194432923028 0.196909766992 0.199417765818 - 0.201957311386 0.204528800504 0.207132634974 0.209769221650 - 0.212438972503 0.215142304689 0.217879640607 0.220651407972 - 0.223458039878 0.226299974869 0.229177657000 0.232091535917 - 0.235042066919 0.238029711032 0.241054935081 0.244118211765 - 0.247220019726 0.250360843628 0.253541174231 0.256761508469 - 0.260022349525 0.263324206912 0.266667596553 0.270053040857 - 0.273481068809 0.276952216045 0.280467024937 0.284026044684 - 0.287629831387 0.291278948147 0.294973965145 0.298715459736 - 0.302504016534 0.306340227511 0.310224692082 0.314158017202 - 0.318140817462 0.322173715182 0.326257340510 0.330392331521 - 0.334579334317 0.338819003124 0.343112000400 0.347458996934 - 0.351860671954 0.356317713229 0.360830817182 0.365400688995 - 0.370028042718 0.374713601386 0.379458097127 0.384262271278 - 0.389126874500 0.394052666898 0.399040418138 0.404090907564 - 0.409204924327 0.414383267502 0.419626746215 0.424936179772 - 0.430312397781 0.435756240288 0.441268557904 0.446850211941 - 0.452502074542 0.458225028822 0.464019969006 0.469887800564 - 0.475829440357 0.481845816779 0.487937869899 0.494106551615 - 0.500352825794 0.506677668431 0.513082067794 0.519567024584 - 0.526133552089 0.532782676342 0.539515436283 0.546332883917 - 0.553236084487 0.560226116630 0.567304072554 0.574471058204 - 0.581728193435 0.589076612190 0.596517462674 0.604051907536 - 0.611681124047 0.619406304288 0.627228655335 0.635149399445 - 0.643169774251 0.651291032953 0.659514444514 0.667841293859 - 0.676272882075 0.684810526614 0.693455561502 0.702209337542 - 0.711073222530 0.720048601465 0.729136876770 0.738339468505 - 0.747657814594 0.757093371048 0.766647612192 0.776322030895 - 0.786118138804 0.796037466583 0.806081564145 0.816252000901 - 0.826550366004 0.836978268593 0.847537338049 0.858229224248 - 0.869055597820 0.880018150408 0.891118594932 0.902358665859 - 0.913740119474 0.925264734152 0.936934310637 0.948750672324 - 0.960715665544 0.972831159852 0.985099048317 0.997521247823 - 1.01009969936 1.02283636835 1.03573324491 1.04879234420 - 1.06201570674 1.07540539871 1.08896351227 1.10269216590 - 1.11659350474 1.13066970089 1.14492295380 1.15935549055 - 1.17396956627 1.18876746444 1.20375149724 1.21892400598 - 1.23428736139 1.24984396402 1.26559624461 1.28154666451 - 1.29769771599 1.31405192269 1.33061183999 1.34738005540 - 1.36435918900 1.38155189380 1.39896085622 1.41658879642 - 1.43443846881 1.45251266244 1.47081420144 1.48934594546 - 1.50811079013 1.52711166749 1.54635154646 1.56583343331 - 1.58556037214 1.60553544531 1.62576177397 1.64624251852 - 1.66698087913 1.68798009620 1.70924345091 1.73077426569 - 1.75257590478 1.77465177474 1.79700532495 1.81964004821 - 1.84255948125 1.86576720526 1.88926684650 1.91306207684 - 1.93715661433 1.96155422379 1.98625871741 2.01127395529 - 2.03660384614 2.06225234779 2.08822346788 2.11452126444 - 2.14114984656 2.16811337501 2.19541606289 2.22306217632 - 2.25105603504 2.27940201315 2.30810453978 2.33716809975 - 2.36659723430 2.39639654179 2.42657067843 2.45712435898 - 2.48806235752 2.51938950818 2.55111070589 2.58323090714 - 2.61575513079 2.64868845881 2.68203603710 2.71580307628 - 2.74999485254 2.78461670839 2.81967405358 2.85517236589 - 2.89111719200 2.92751414836 2.96436892207 3.00168727177 - 3.03947502852 3.07773809674 3.11648245511 3.15571415751 - 3.19543933398 3.23566419166 3.27639501576 3.31763817056 - 3.35940010038 3.40168733061 3.44450646872 3.48786420529 - 3.53176731504 3.57622265792 3.62123718019 3.66681791544 - 3.71297198576 3.75970660282 3.80702906900 3.85494677852 - 3.90346721863 3.95259797074 4.00234671164 4.05272121467 - 4.10372935094 4.15537909058 4.20767850397 4.26063576299 - 4.31425914233 4.36855702075 4.42353788241 4.47921031816 - 4.53558302695 4.59266481713 4.65046460784 4.70899143041 - 4.76825442979 4.82826286593 4.88902611528 4.95055367222 - 5.01285515055 5.07594028500 5.13981893277 5.20450107500 - 5.26999681843 5.33631639690 5.40347017296 5.47146863955 - 5.54032242155 5.61004227752 5.68063910131 5.75212392383 - 5.82450791472 5.89780238414 5.97201878449 6.04716871224 - 6.12326390971 6.20031626693 6.27833782349 6.35734077043 - 6.43733745210 6.51834036815 6.60036217546 6.68341569010 - 6.76751388935 6.85266991372 6.93889706902 7.02620882841 - 7.11461883454 7.20414090164 7.29478901773 7.38657734675 - 7.47952023083 7.57363219246 7.66892793684 7.76542235413 - 7.86313052177 7.96206770686 8.06224936854 8.16369116039 - 8.26640893291 8.37041873595 8.47573682126 8.58237964500 - 8.69036387033 8.79970637001 8.91042422902 9.02253474726 - 9.13605544221 9.25100405173 9.36739853676 9.48525708418 - 9.60459810963 9.72544026038 9.84780241827 9.97170370264 - 10.0971634733 10.2242013336 10.3528371335 10.4830909726 - 10.6149832032 10.7485344339 10.8837655323 11.0206976285 - 11.1593521184 11.2997506671 11.4419152122 11.5858679670 - 11.7316314247 11.8792283609 12.0286818381 12.1800152085 - 12.3332521185 12.4884165114 12.6455326322 12.8046250305 - 12.9657185648 13.1288384063 13.2940100429 13.4612592828 - 13.6306122593 13.8020954339 13.9757356013 14.1515598932 - 14.3295957824 14.5098710874 14.6924139766 14.8772529727 - 15.0644169571 15.2539351747 15.4458372379 15.6401531320 - 15.8369132191 16.0361482435 16.2378893359 16.4421680189 - 16.6490162114 16.8584662339 17.0705508133 17.2853030884 - 17.5027566145 17.7229453693 17.9459037576 18.1716666173 - 18.4002692241 18.6317472977 18.8661370071 19.1034749761 - 19.3437982892 19.5871444974 19.8335516242 20.0830581710 - 20.3357031239 20.5915259590 20.8505666493 21.1128656704 - 21.3784640069 21.6474031593 21.9197251498 22.1954725293 - 22.4746883838 22.7574163414 23.0437005789 23.3335858288 - 23.6271173862 23.9243411162 24.2253034604 24.5300514449 - 24.8386326872 25.1510954036 25.4674884172 25.7878611650 - 26.1122637059 26.4407467284 26.7733615587 27.1101601685 - 27.4511951833 27.7965198905 28.1461882478 28.5002548916 - 28.8587751455 29.2218050291 29.5894012664 29.9616212952 - 30.3385232756 30.7201660993 31.1066093988 31.4979135566 - 31.8941397147 32.2953497844 32.7016064555 33.1129732065 - 33.5295143142 33.9512948641 34.3783807601 34.8108387354 - 35.2487363624 35.6921420635 36.1411251217 36.5957556915 - 37.0561048099 37.5222444074 37.9942473193 38.4721872969 - 38.9561390193 39.4461781050 39.9423811236 40.4448256079 - 40.9535900657 41.4687539927 41.9903978841 42.5186032479 - 43.0534526173 43.5950295635 44.1434187092 44.6987057411 - 45.2609774241 45.8303216142 46.4068272725 46.9905844794 - 47.5816844480 48.1802195389 48.7862832745 49.3999703534 - 50.0213766654 50.6505993067 51.2877365944 51.9328880827 - 52.5861545776 53.2476381536 53.9174421686 54.5956712810 - 55.2824314654 55.9778300295 56.6819756307 57.3949782933 - 58.1169494253 58.8480018362 59.5882497544 60.3378088452 - 61.0967962287 61.8653304982 62.6435317388 63.4315215459 - 64.2294230447 65.0373609088 65.8554613802 66.6838522887 - 67.5226630722 68.3720247964 69.2320701759 70.1029335945 - 70.9847511265 71.8776605575 72.7818014065 73.6973149474 - 74.6243442310 75.5630341076 76.5135312492 77.4759841731 - 78.4505432644 79.4373608001 80.4365909723 81.4483899128 - 82.4729157172 83.5103284699 84.5607902685 85.6244652500 - 86.7015196157 87.7921216576 88.8964417844 90.0146525483 - 91.1469286722 92.2934470765 93.4543869069 94.6299295627 - 95.8202587249 97.0255603848 98.2460228731 99.4818368898 - 100.733195533 102.000294331 103.283331269 104.582506825 - 105.898023998 107.230088340 108.578907989 109.944693700 - 111.327658881 112.728019622 114.145994733 115.581805775 - 117.035677097 118.507835869 119.998512118 - Down Pseudopotential follows (l on next line) - 0 - -0.194762529562E-03 -0.391974870160E-03 -0.591667836617E-03 -0.793872631361E-03 - -0.998620849296E-03 -0.120594448274E-02 -0.141587592643E-02 -0.162844798257E-02 - -0.184369386597E-02 -0.206164720924E-02 -0.228234206800E-02 -0.250581292628E-02 - -0.273209470185E-02 -0.296122275167E-02 -0.319323287747E-02 -0.342816133128E-02 - -0.366604482114E-02 -0.390692051682E-02 -0.415082605562E-02 -0.439779954827E-02 - -0.464787958486E-02 -0.490110524088E-02 -0.515751608334E-02 -0.541715217695E-02 - -0.568005409035E-02 -0.594626290247E-02 -0.621582020897E-02 -0.648876812870E-02 - -0.676514931030E-02 -0.704500693888E-02 -0.732838474272E-02 -0.761532700016E-02 - -0.790587854648E-02 -0.820008478092E-02 -0.849799167377E-02 -0.879964577356E-02 - -0.910509421431E-02 -0.941438472292E-02 -0.972756562664E-02 -0.100446858606E-01 - -0.103657949753E-01 -0.106909431449E-01 -0.110201811742E-01 -0.113535605073E-01 - -0.116911332354E-01 -0.120329521049E-01 -0.123790705255E-01 -0.127295425790E-01 - -0.130844230272E-01 -0.134437673208E-01 -0.138076316081E-01 -0.141760727436E-01 - -0.145491482967E-01 -0.149269165614E-01 -0.153094365644E-01 -0.156967680753E-01 - -0.160889716154E-01 -0.164861084670E-01 -0.168882406836E-01 -0.172954310990E-01 - -0.177077433375E-01 -0.181252418235E-01 -0.185479917919E-01 -0.189760592981E-01 - -0.194095112284E-01 -0.198484153105E-01 -0.202928401237E-01 -0.207428551103E-01 - -0.211985305858E-01 -0.216599377502E-01 -0.221271486993E-01 -0.226002364354E-01 - -0.230792748793E-01 -0.235643388815E-01 -0.240555042341E-01 -0.245528476824E-01 - -0.250564469370E-01 -0.255663806862E-01 -0.260827286079E-01 -0.266055713821E-01 - -0.271349907039E-01 -0.276710692958E-01 -0.282138909209E-01 -0.287635403958E-01 - -0.293201036040E-01 -0.298836675093E-01 -0.304543201693E-01 -0.310321507493E-01 - -0.316172495360E-01 -0.322097079519E-01 -0.328096185693E-01 -0.334170751251E-01 - -0.340321725351E-01 -0.346550069089E-01 -0.352856755651E-01 -0.359242770464E-01 - -0.365709111350E-01 -0.372256788682E-01 -0.378886825541E-01 -0.385600257875E-01 - -0.392398134667E-01 -0.399281518089E-01 -0.406251483677E-01 -0.413309120494E-01 - -0.420455531300E-01 -0.427691832727E-01 -0.435019155454E-01 -0.442438644377E-01 - -0.449951458798E-01 -0.457558772597E-01 -0.465261774420E-01 -0.473061667866E-01 - -0.480959671669E-01 -0.488957019896E-01 -0.497054962133E-01 -0.505254763687E-01 - -0.513557705775E-01 -0.521965085735E-01 -0.530478217217E-01 -0.539098430398E-01 - -0.547827072184E-01 -0.556665506423E-01 -0.565615114116E-01 -0.574677293636E-01 - -0.583853460943E-01 -0.593145049806E-01 -0.602553512030E-01 -0.612080317677E-01 - -0.621726955301E-01 -0.631494932179E-01 -0.641385774545E-01 -0.651401027828E-01 - -0.661542256898E-01 -0.671811046303E-01 -0.682209000524E-01 -0.692737744221E-01 - -0.703398922486E-01 -0.714194201105E-01 -0.725125266812E-01 -0.736193827558E-01 - -0.747401612773E-01 -0.758750373639E-01 -0.770241883364E-01 -0.781877937454E-01 - -0.793660354000E-01 -0.805590973957E-01 -0.817671661434E-01 -0.829904303985E-01 - -0.842290812900E-01 -0.854833123510E-01 -0.867533195482E-01 -0.880393013131E-01 - -0.893414585725E-01 -0.906599947802E-01 -0.919951159485E-01 -0.933470306807E-01 - -0.947159502032E-01 -0.961020883988E-01 -0.975056618399E-01 -0.989268898224E-01 - -0.100365994400 -0.101823200419 -0.103298735551 -0.104792830335 - -0.106305718203 -0.107837635528 -0.109388821651 -0.110959518924 - -0.112549972747 -0.114160431605 -0.115791147105 -0.117442374021 - -0.119114370328 -0.120807397245 -0.122521719275 -0.124257604246 - -0.126015323354 -0.127795151202 -0.129597365848 -0.131422248843 - -0.133270085277 -0.135141163824 -0.137035776788 -0.138954220144 - -0.140896793589 -0.142863800586 -0.144855548410 -0.146872348199 - -0.148914515000 -0.150982367820 -0.153076229673 -0.155196427631 - -0.157343292876 -0.159517160749 -0.161718370805 -0.163947266863 - -0.166204197062 -0.168489513911 -0.170803574346 -0.173146739787 - -0.175519376190 -0.177921854106 -0.180354548738 -0.182817839999 - -0.185312112568 -0.187837755955 -0.190395164554 -0.192984737710 - -0.195606879776 -0.198262000178 -0.200950513476 -0.203672839428 - -0.206429403055 -0.209220634707 -0.212046970126 -0.214908850515 - -0.217806722603 -0.220741038718 -0.223712256850 -0.226720840723 - -0.229767259867 -0.232851989688 -0.235975511537 -0.239138312790 - -0.242340886912 -0.245583733541 -0.248867358556 -0.252192274155 - -0.255558998935 -0.258968057962 -0.262419982858 -0.265915311874 - -0.269454589971 -0.273038368901 -0.276667207291 -0.280341670720 - -0.284062331804 -0.287829770283 -0.291644573098 -0.295507334485 - -0.299418656053 -0.303379146874 -0.307389423570 -0.311450110401 - -0.315561839351 -0.319725250222 -0.323940990717 -0.328209716536 - -0.332532091465 -0.336908787466 -0.341340484768 -0.345827871964 - -0.350371646098 -0.354972512762 -0.359631186186 -0.364348389335 - -0.369124853999 -0.373961320892 -0.378858539738 -0.383817269375 - -0.388838277840 -0.393922342468 -0.399070249986 -0.404282796601 - -0.409560788098 -0.414905039931 -0.420316377315 -0.425795635314 - -0.431343658934 -0.436961303214 -0.442649433309 -0.448408924579 - -0.454240662674 -0.460145543617 -0.466124473889 -0.472178370500 - -0.478308161075 -0.484514783924 -0.490799188114 -0.497162333541 - -0.503605190988 -0.510128742196 -0.516733979917 -0.523421907964 - -0.530193541267 -0.537049905913 -0.543992039183 -0.551020989585 - -0.558137816883 -0.565343592111 -0.572639397588 -0.580026326919 - -0.587505484991 -0.595077987960 -0.602744963225 -0.610507549390 - -0.618366896224 -0.626324164598 -0.634380526413 -0.642537164515 - -0.650795272594 -0.659156055069 -0.667620726951 -0.676190513691 - -0.684866651009 -0.693650384702 -0.702542970427 -0.711545673465 - -0.720659768455 -0.729886539103 -0.739227277864 -0.748683285595 - -0.758255871165 -0.767946351046 -0.777756048857 -0.787686294872 - -0.797738425485 -0.807913782637 -0.818213713186 -0.828639568239 - -0.839192702424 -0.849874473107 -0.860686239555 -0.871629362029 - -0.882705200816 -0.893915115190 -0.905260462298 -0.916742595966 - -0.928362865421 -0.940122613932 -0.952023177348 -0.964065882543 - -0.976252045755 -0.988582970817 -1.00105994727 -1.01368424835 - -1.02645712885 -1.03937982286 -1.05245354131 -1.06567946944 - -1.07905876404 -1.09259255057 -1.10628192006 -1.12012792586 - -1.13413158017 -1.14829385038 -1.16261565520 -1.17709786051 - -1.19174127502 -1.20654664569 -1.22151465286 -1.23664590505 - -1.25194093363 -1.26740018699 -1.28302402455 -1.29881271035 - -1.31476640633 -1.33088516528 -1.34716892330 -1.36361749204 - -1.38023055036 -1.39700763571 -1.41394813495 -1.43105127484 - -1.44831611191 -1.46574152198 -1.48332618906 -1.50106859384 - -1.51896700151 -1.53701944917 -1.55522373251 -1.57357739208 - -1.59207769880 -1.61072163897 -1.62950589859 -1.64842684709 - -1.66748052042 -1.68666260343 -1.70596841165 -1.72539287244 - -1.74493050538 -1.76457540215 -1.78432120562 -1.80416108844 - -1.82408773091 -1.84409329832 -1.86416941769 -1.88430715400 - -1.90449698587 -1.92472878086 -1.94499177033 -1.96527452397 - -1.98556492413 -2.00585013987 -2.02611660103 -2.04634997233 - -2.06653512754 -2.08665612400 -2.10669617764 -2.12663763848 - -2.14646196701 -2.16614971161 -2.18568048708 -2.20503295477 - -2.22418480441 -2.24311273792 -2.26179245573 -2.28019864564 - -2.29830497488 -2.31608408563 -2.33350759440 -2.35054609586 - -2.36716917152 -2.38334540376 -2.39904239592 -2.41422679881 - -2.42886434452 -2.44291988792 -2.45635745680 -2.46914031110 - -2.48123101224 -2.49259150308 -2.50318319943 -2.51296709391 - -2.52190387294 -2.52995404775 -2.53707810010 -2.54323664379 - -2.54839060250 -2.55250140496 -2.55553119804 -2.55744307860 - -2.55820134465 -2.55777176648 -2.55612187808 -2.55322128934 - -2.54904201922 -2.54355884980 -2.53674970129 -2.52859602746 - -2.51908323087 -2.50820109716 -2.49594424696 -2.48231260388 - -2.46731187667 -2.45095405283 -2.43325790086 -2.41424947744 - -2.39396263533 -2.37243952709 -2.34973109881 -2.32589756734 - -2.30100887342 -2.27514510226 -2.24839686178 -2.22086560771 - -2.19266390333 -2.16391560019 -2.13475592487 -2.10533145483 - -2.07579996517 -2.04633012619 -2.01710102967 -1.98830152040 - -1.96012930749 -1.93278982840 -1.90649483737 -1.88146068872 - -1.85790628503 -1.83605066032 -1.81611016941 -1.79829525701 - -1.78280678442 -1.76983189745 -1.75953942893 -1.75207484099 - -1.74755473005 -1.74606093907 -1.74763435140 -1.75226847712 - -1.75990299000 -1.77041743150 -1.78362537071 -1.79926939758 - -1.81701743465 -1.83646098262 -1.85711607103 -1.87842787192 - -1.89978015569 -1.92051103067 -1.93993671843 -1.95738548285 - -1.97224426393 -1.98402107934 -1.99242686316 -1.99748113219 - -1.99967284813 -1.99999990846 -2.00000001587 -2.00000001441 - -2.00000001306 -2.00000001183 -2.00000001069 -2.00000000965 - -2.00000000870 -2.00000000783 -2.00000000704 -2.00000000632 - -2.00000000567 -2.00000000507 -2.00000000453 -2.00000000404 - -2.00000000360 -2.00000000320 -2.00000000284 -2.00000000252 - -2.00000000223 -2.00000000197 -2.00000000174 -2.00000000153 - -2.00000000134 -2.00000000118 -2.00000000103 -2.00000000090 - -2.00000000079 -2.00000000069 -2.00000000060 -2.00000000052 - -2.00000000045 -2.00000000039 -2.00000000034 -2.00000000029 - -2.00000000025 -2.00000000022 -2.00000000019 -2.00000000016 - -2.00000000014 -2.00000000012 -2.00000000010 -2.00000000009 - -2.00000000007 -2.00000000006 -2.00000000005 -2.00000000005 - -2.00000000004 -2.00000000003 -2.00000000003 -2.00000000002 - -2.00000000002 -2.00000000002 -2.00000000002 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 - Down Pseudopotential follows (l on next line) - 1 - -0.136130541247E-03 -0.273973393905E-03 -0.413550096195E-03 -0.554882457257E-03 - -0.697992560553E-03 -0.842902767322E-03 -0.989635720071E-03 -0.113821434612E-02 - -0.128866186116E-02 -0.144100177293E-02 -0.159525788484E-02 -0.175145429970E-02 - -0.190961542352E-02 -0.206976596928E-02 -0.223193096083E-02 -0.239613573675E-02 - -0.256240595437E-02 -0.273076759373E-02 -0.290124696167E-02 -0.307387069592E-02 - -0.324866576928E-02 -0.342565949381E-02 -0.360487952514E-02 -0.378635386672E-02 - -0.397011087429E-02 -0.415617926022E-02 -0.434458809806E-02 -0.453536682705E-02 - -0.472854525673E-02 -0.492415357160E-02 -0.512222233583E-02 -0.532278249803E-02 - -0.552586539612E-02 -0.573150276218E-02 -0.593972672744E-02 -0.615056982727E-02 - -0.636406500630E-02 -0.658024562356E-02 -0.679914545767E-02 -0.702079871212E-02 - -0.724524002065E-02 -0.747250445263E-02 -0.770262751853E-02 -0.793564517550E-02 - -0.817159383298E-02 -0.841051035836E-02 -0.865243208278E-02 -0.889739680695E-02 - -0.914544280703E-02 -0.939660884066E-02 -0.965093415295E-02 -0.990845848270E-02 - -0.101692220685E-01 -0.104332656552E-01 -0.107006304999E-01 -0.109713583790E-01 - -0.112454915941E-01 -0.115230729789E-01 -0.118041459061E-01 -0.120887542937E-01 - -0.123769426123E-01 -0.126687558918E-01 -0.129642397284E-01 -0.132634402921E-01 - -0.135664043333E-01 -0.138731791906E-01 -0.141838127982E-01 -0.144983536930E-01 - -0.148168510225E-01 -0.151393545523E-01 -0.154659146743E-01 -0.157965824137E-01 - -0.161314094381E-01 -0.164704480645E-01 -0.168137512682E-01 -0.171613726910E-01 - -0.175133666490E-01 -0.178697881418E-01 -0.182306928608E-01 -0.185961371978E-01 - -0.189661782539E-01 -0.193408738486E-01 -0.197202825284E-01 -0.201044635766E-01 - -0.204934770217E-01 -0.208873836477E-01 -0.212862450029E-01 -0.216901234098E-01 - -0.220990819748E-01 -0.225131845983E-01 -0.229324959841E-01 -0.233570816500E-01 - -0.237870079380E-01 -0.242223420245E-01 -0.246631519308E-01 -0.251095065338E-01 - -0.255614755768E-01 -0.260191296803E-01 -0.264825403532E-01 -0.269517800036E-01 - -0.274269219506E-01 -0.279080404354E-01 -0.283952106331E-01 -0.288885086641E-01 - -0.293880116067E-01 -0.298937975082E-01 -0.304059453981E-01 -0.309245352995E-01 - -0.314496482423E-01 -0.319813662754E-01 -0.325197724800E-01 -0.330649509819E-01 - -0.336169869655E-01 -0.341759666862E-01 -0.347419774846E-01 -0.353151077998E-01 - -0.358954471834E-01 -0.364830863130E-01 -0.370781170071E-01 -0.376806322391E-01 - -0.382907261514E-01 -0.389084940711E-01 -0.395340325237E-01 -0.401674392493E-01 - -0.408088132170E-01 -0.414582546408E-01 -0.421158649954E-01 -0.427817470314E-01 - -0.434560047922E-01 -0.441387436294E-01 -0.448300702201E-01 -0.455300925827E-01 - -0.462389200946E-01 -0.469566635088E-01 -0.476834349710E-01 -0.484193480379E-01 - -0.491645176940E-01 -0.499190603703E-01 -0.506830939621E-01 -0.514567378475E-01 - -0.522401129060E-01 -0.530333415376E-01 -0.538365476815E-01 -0.546498568360E-01 - -0.554733960775E-01 -0.563072940808E-01 -0.571516811391E-01 -0.580066891842E-01 - -0.588724518072E-01 -0.597491042793E-01 -0.606367835730E-01 -0.615356283836E-01 - -0.624457791506E-01 -0.633673780796E-01 -0.643005691648E-01 -0.652454982114E-01 - -0.662023128582E-01 -0.671711626006E-01 -0.681521988143E-01 -0.691455747785E-01 - -0.701514457002E-01 -0.711699687382E-01 -0.722013030276E-01 -0.732456097049E-01 - -0.743030519326E-01 -0.753737949255E-01 -0.764580059756E-01 -0.775558544788E-01 - -0.786675119613E-01 -0.797931521058E-01 -0.809329507793E-01 -0.820870860603E-01 - -0.832557382661E-01 -0.844390899817E-01 -0.856373260878E-01 -0.868506337897E-01 - -0.880792026466E-01 -0.893232246011E-01 -0.905828940088E-01 -0.918584076694E-01 - -0.931499648565E-01 -0.944577673492E-01 -0.957820194633E-01 -0.971229280832E-01 - -0.984807026942E-01 -0.998555554151E-01 -0.101247701031 -0.102657357027 - -0.104084743623 -0.105530083805 -0.106993603363 -0.108475530926 - -0.109976097993 -0.111495538978 -0.113034091235 -0.114591995105 - -0.116169493948 -0.117766834181 -0.119384265320 -0.121022040013 - -0.122680414083 -0.124359646570 -0.126059999764 -0.127781739253 - -0.129525133958 -0.131290456182 -0.133077981645 -0.134887989530 - -0.136720762526 -0.138576586873 -0.140455752403 -0.142358552587 - -0.144285284582 -0.146236249272 -0.148211751321 -0.150212099212 - -0.152237605304 -0.154288585871 -0.156365361155 -0.158468255419 - -0.160597596988 -0.162753718307 -0.164936955990 -0.167147650867 - -0.169386148044 -0.171652796951 -0.173947951396 -0.176271969619 - -0.178625214346 -0.181008052849 -0.183420856993 -0.185864003302 - -0.188337873009 -0.190842852117 -0.193379331458 -0.195947706749 - -0.198548378654 -0.201181752845 -0.203848240061 -0.206548256169 - -0.209282222228 -0.212050564552 -0.214853714772 -0.217692109900 - -0.220566192396 -0.223476410229 -0.226423216949 -0.229407071748 - -0.232428439529 -0.235487790977 -0.238585602620 -0.241722356908 - -0.244898542271 -0.248114653200 -0.251371190309 -0.254668660413 - -0.258007576595 -0.261388458279 -0.264811831304 -0.268278227998 - -0.271788187249 -0.275342254579 -0.278940982222 -0.282584929195 - -0.286274661374 -0.290010751570 -0.293793779606 -0.297624332390 - -0.301503003992 -0.305430395720 -0.309407116200 -0.313433781445 - -0.317511014937 -0.321639447701 -0.325819718382 -0.330052473318 - -0.334338366620 -0.338678060242 -0.343072224059 -0.347521535938 - -0.352026681815 -0.356588355764 -0.361207260069 -0.365884105297 - -0.370619610363 -0.375414502603 -0.380269517833 -0.385185400424 - -0.390162903355 -0.395202788280 -0.400305825584 -0.405472794442 - -0.410704482868 -0.416001687772 -0.421365215003 -0.426795879392 - -0.432294504799 -0.437861924142 -0.443498979436 -0.449206521813 - -0.454985411553 -0.460836518092 -0.466760720040 -0.472758905183 - -0.478831970478 -0.484980822051 -0.491206375171 -0.497509554231 - -0.503891292711 -0.510352533132 -0.516894227005 -0.523517334760 - -0.530222825677 -0.537011677785 -0.543884877768 -0.550843420841 - -0.557888310622 -0.565020558976 -0.572241185853 -0.579551219101 - -0.586951694262 -0.594443654341 -0.602028149565 -0.609706237103 - -0.617478980774 -0.625347450718 -0.633312723047 -0.641375879459 - -0.649538006823 -0.657800196730 -0.666163545004 -0.674629151185 - -0.683198117955 -0.691871550535 -0.700650556032 -0.709536242734 - -0.718529719356 -0.727632094237 -0.736844474470 -0.746167964978 - -0.755603667527 -0.765152679665 -0.774816093594 -0.784594994967 - -0.794490461602 -0.804503562116 -0.814635354466 -0.824886884397 - -0.835259183800 -0.845753268950 -0.856370138650 -0.867110772254 - -0.877976127565 -0.888967138614 -0.900084713300 -0.911329730890 - -0.922703039374 -0.934205452663 -0.945837747629 -0.957600660968 - -0.969494885896 -0.981521068645 -0.993679804780 -1.00597163530 - -1.01839704253 -1.03095644580 -1.04365019689 -1.05647857521 - -1.06944178278 -1.08253993888 -1.09577307453 -1.10914112656 - -1.12264393152 -1.13628121920 -1.15005260587 -1.16395758719 - -1.17799553081 -1.19216566863 -1.20646708864 -1.22089872654 - -1.23545935684 -1.25014758369 -1.26496183131 -1.27990033396 - -1.29496112564 -1.31014202931 -1.32544064568 -1.34085434172 - -1.35638023865 -1.37201519959 -1.38775581681 -1.40359839862 - -1.41953895579 -1.43557318777 -1.45169646838 -1.46790383135 - -1.48418995542 -1.50054914928 -1.51697533619 -1.53346203845 - -1.55000236173 -1.56658897928 -1.58321411610 -1.59986953318 - -1.61654651181 -1.63323583811 -1.64992778781 -1.66661211148 - -1.68327802026 -1.69991417217 -1.71650865927 -1.73304899575 - -1.74952210710 -1.76591432056 -1.78221135711 -1.79839832514 - -1.81445971605 -1.83037940206 -1.84614063652 -1.86172605688 - -1.87711769085 -1.89229696586 -1.90724472234 -1.92194123103 - -1.93636621491 -1.95049887596 -1.96431792731 -1.97780163116 - -1.99092784300 -2.00367406251 -2.01601749173 -2.02793510095 - -2.03940370278 -2.05040003501 -2.06090085266 -2.07088302977 - -2.08032367139 -2.08920023617 -2.09749067004 -2.10517355129 - -2.11222824732 -2.11863508341 -2.12437552349 -2.12943236308 - -2.13378993425 -2.13743432227 -2.14035359367 -2.14253803497 - -2.14398040128 -2.14467617353 -2.14462382298 -2.14382508123 - -2.14228521337 -2.14001329189 -2.13702246807 -2.13333023718 - -2.12895869340 -2.12393476939 -2.11829045502 -2.11206298885 - -2.10529501515 -2.09803469854 -2.09033578715 -2.08225761461 - -2.07386502991 -2.06522824351 -2.05642257719 -2.04752810398 - -2.03862916446 -2.02981374473 -2.02117270151 -2.01279881991 - -2.00478569029 -1.99722639192 -1.99021197376 -1.98382972566 - -1.97816123883 -1.97328026028 -1.96925035553 -1.96612240480 - -1.96393197306 -1.96269661302 -1.96241318385 -1.96305529778 - -1.96457104347 -1.96688117982 -1.96987804864 -1.97342552174 - -1.97736037848 -1.98149560791 -1.98562624689 -1.98953850677 - -1.99302311021 -1.99589396179 -1.99801351736 -1.99937570793 - -1.99991758633 -2.00000016366 -2.00000001471 -2.00000001335 - -2.00000001211 -2.00000001096 -2.00000000991 -2.00000000895 - -2.00000000807 -2.00000000726 -2.00000000653 -2.00000000586 - -2.00000000525 -2.00000000470 -2.00000000420 -2.00000000375 - -2.00000000334 -2.00000000297 -2.00000000263 -2.00000000234 - -2.00000000207 -2.00000000183 -2.00000000161 -2.00000000142 - -2.00000000125 -2.00000000109 -2.00000000096 -2.00000000084 - -2.00000000073 -2.00000000064 -2.00000000056 -2.00000000048 - -2.00000000042 -2.00000000036 -2.00000000031 -2.00000000027 - -2.00000000023 -2.00000000020 -2.00000000017 -2.00000000015 - -2.00000000013 -2.00000000011 -2.00000000009 -2.00000000008 - -2.00000000007 -2.00000000006 -2.00000000005 -2.00000000004 - -2.00000000004 -2.00000000003 -2.00000000003 -2.00000000002 - -2.00000000002 -2.00000000002 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 - Down Pseudopotential follows (l on next line) - 2 - -0.119484445649E-03 -0.240471820603E-03 -0.362981029380E-03 -0.487031214288E-03 - -0.612641758414E-03 -0.739832288657E-03 -0.868622678788E-03 -0.999033052560E-03 - -0.113108378685E-02 -0.126479551485E-02 -0.140018912928E-02 -0.153728578566E-02 - -0.167610690561E-02 -0.181667418020E-02 -0.195900957334E-02 -0.210313532521E-02 - -0.224907395576E-02 -0.239684826816E-02 -0.254648135245E-02 -0.269799658908E-02 - -0.285141765260E-02 -0.300676851535E-02 -0.316407345120E-02 -0.332335703935E-02 - -0.348464416816E-02 -0.364796003906E-02 -0.381333017046E-02 -0.398078040175E-02 - -0.415033689736E-02 -0.432202615081E-02 -0.449587498886E-02 -0.467191057572E-02 - -0.485016041728E-02 -0.503065236541E-02 -0.521341462232E-02 -0.539847574493E-02 - -0.558586464941E-02 -0.577561061559E-02 -0.596774329165E-02 -0.616229269866E-02 - -0.635928923531E-02 -0.655876368268E-02 -0.676074720899E-02 -0.696527137455E-02 - -0.717236813661E-02 -0.738206985440E-02 -0.759440929420E-02 -0.780941963441E-02 - -0.802713447077E-02 -0.824758782160E-02 -0.847081413312E-02 -0.869684828482E-02 - -0.892572559491E-02 -0.915748182587E-02 -0.939215318999E-02 -0.962977635507E-02 - -0.987038845011E-02 -0.101140270712E-01 -0.103607302871E-01 -0.106105366458E-01 - -0.108634851798E-01 -0.111196154128E-01 -0.113789673655E-01 -0.116415815620E-01 - -0.119074990363E-01 -0.121767613383E-01 -0.124494105407E-01 -0.127254892452E-01 - -0.130050405897E-01 -0.132881082545E-01 -0.135747364691E-01 -0.138649700198E-01 - -0.141588542559E-01 -0.144564350972E-01 -0.147577590412E-01 -0.150628731700E-01 - -0.153718251582E-01 -0.156846632800E-01 -0.160014364166E-01 -0.163221940643E-01 - -0.166469863418E-01 -0.169758639983E-01 -0.173088784214E-01 -0.176460816449E-01 - -0.179875263572E-01 -0.183332659094E-01 -0.186833543236E-01 -0.190378463016E-01 - -0.193967972330E-01 -0.197602632042E-01 -0.201283010073E-01 -0.205009681483E-01 - -0.208783228569E-01 -0.212604240950E-01 -0.216473315662E-01 -0.220391057252E-01 - -0.224358077868E-01 -0.228374997361E-01 -0.232442443376E-01 -0.236561051455E-01 - -0.240731465132E-01 -0.244954336036E-01 -0.249230323992E-01 -0.253560097126E-01 - -0.257944331965E-01 -0.262383713548E-01 -0.266878935528E-01 -0.271430700285E-01 - -0.276039719033E-01 -0.280706711931E-01 -0.285432408197E-01 -0.290217546219E-01 - -0.295062873676E-01 -0.299969147649E-01 -0.304937134741E-01 -0.309967611199E-01 - -0.315061363032E-01 -0.320219186137E-01 -0.325441886421E-01 -0.330730279926E-01 - -0.336085192961E-01 -0.341507462225E-01 -0.346997934944E-01 -0.352557468998E-01 - -0.358186933059E-01 -0.363887206722E-01 -0.369659180649E-01 -0.375503756702E-01 - -0.381421848086E-01 -0.387414379495E-01 -0.393482287250E-01 -0.399626519450E-01 - -0.405848036120E-01 -0.412147809358E-01 -0.418526823489E-01 -0.424986075219E-01 - -0.431526573789E-01 -0.438149341134E-01 -0.444855412044E-01 -0.451645834321E-01 - -0.458521668947E-01 -0.465483990248E-01 -0.472533886062E-01 -0.479672457910E-01 - -0.486900821165E-01 -0.494220105230E-01 -0.501631453711E-01 -0.509136024598E-01 - -0.516734990445E-01 -0.524429538552E-01 -0.532220871152E-01 -0.540110205600E-01 - -0.548098774559E-01 -0.556187826195E-01 -0.564378624371E-01 -0.572672448849E-01 - -0.581070595480E-01 -0.589574376416E-01 -0.598185120310E-01 -0.606904172524E-01 - -0.615732895340E-01 -0.624672668170E-01 -0.633724887777E-01 -0.642890968486E-01 - -0.652172342410E-01 -0.661570459671E-01 -0.671086788627E-01 -0.680722816102E-01 - -0.690480047616E-01 -0.700360007622E-01 -0.710364239741E-01 -0.720494307008E-01 - -0.730751792110E-01 -0.741138297636E-01 -0.751655446329E-01 -0.762304881333E-01 - -0.773088266455E-01 -0.784007286424E-01 -0.795063647149E-01 -0.806259075991E-01 - -0.817595322027E-01 -0.829074156327E-01 -0.840697372229E-01 -0.852466785616E-01 - -0.864384235202E-01 -0.876451582818E-01 -0.888670713701E-01 -0.901043536789E-01 - -0.913571985016E-01 -0.926258015616E-01 -0.939103610428E-01 -0.952110776201E-01 - -0.965281544910E-01 -0.978617974071E-01 -0.992122147061E-01 -0.100579617344 - -0.101964218929 -0.103366235753 -0.104785886827 -0.106223393913 - -0.107678981560 -0.109152877141 -0.110645310884 -0.112156515908 - -0.113686728265 -0.115236186970 -0.116805134040 -0.118393814536 - -0.120002476593 -0.121631371466 -0.123280753563 -0.124950880489 - -0.126642013083 -0.128354415460 -0.130088355052 -0.131844102646 - -0.133621932432 -0.135422122038 -0.137244952581 -0.139090708702 - -0.140959678617 -0.142852154157 -0.144768430815 -0.146708807790 - -0.148673588036 -0.150663078303 -0.152677589191 -0.154717435192 - -0.156782934743 -0.158874410270 -0.160992188240 -0.163136599211 - -0.165307977882 -0.167506663144 -0.169732998132 -0.171987330276 - -0.174270011355 -0.176581397552 -0.178921849503 -0.181291732356 - -0.183691415825 -0.186121274247 -0.188581686633 -0.191073036733 - -0.193595713087 -0.196150109087 -0.198736623031 -0.201355658191 - -0.204007622862 -0.206692930433 -0.209411999439 -0.212165253630 - -0.214953122028 -0.217776038993 -0.220634444285 -0.223528783130 - -0.226459506281 -0.229427070086 -0.232431936552 -0.235474573413 - -0.238555454195 -0.241675058284 -0.244833870992 -0.248032383630 - -0.251271093569 -0.254550504316 -0.257871125580 -0.261233473341 - -0.264638069924 -0.268085444066 -0.271576130987 -0.275110672463 - -0.278689616898 -0.282313519390 -0.285982941810 -0.289698452870 - -0.293460628193 -0.297270050389 -0.301127309124 -0.305033001194 - -0.308987730593 -0.312992108588 -0.317046753787 -0.321152292212 - -0.325309357368 -0.329518590312 -0.333780639723 -0.338096161968 - -0.342465821172 -0.346890289283 -0.351370246136 -0.355906379518 - -0.360499385230 -0.365149967147 -0.369858837278 -0.374626715825 - -0.379454331232 -0.384342420245 -0.389291727957 -0.394303007858 - -0.399377021878 -0.404514540430 -0.409716342444 -0.414983215407 - -0.420315955386 -0.425715367058 -0.431182263729 -0.436717467347 - -0.442321808516 -0.447996126498 -0.453741269207 -0.459558093205 - -0.465447463681 -0.471410254426 -0.477447347801 -0.483559634696 - -0.489748014473 -0.496013394905 -0.502356692105 -0.508778830435 - -0.515280742411 -0.521863368590 -0.528527657443 -0.535274565213 - -0.542105055756 -0.549020100366 -0.556020677581 -0.563107772966 - -0.570282378881 -0.577545494219 -0.584898124132 -0.592341279713 - -0.599875977674 -0.607503239975 -0.615224093436 -0.623039569313 - -0.630950702837 -0.638958532721 -0.647064100629 -0.655268450598 - -0.663572628430 -0.671977681023 -0.680484655667 -0.689094599283 - -0.697808557608 -0.706627574327 -0.715552690144 -0.724584941786 - -0.733725360943 -0.742974973143 -0.752334796541 -0.761805840640 - -0.771389104926 -0.781085577414 -0.790896233103 -0.800822032341 - -0.810863919077 -0.821022819017 -0.831299637665 -0.841695258242 - -0.852210539484 -0.862846313316 -0.873603382382 -0.884482517437 - -0.895484454587 -0.906609892376 -0.917859488710 -0.929233857606 - -0.940733565768 -0.952359128972 -0.964111008263 -0.975989605944 - -0.987995261361 -1.00012824646 -1.01238876113 -1.02477692831 - -1.03729278881 -1.04993629596 -1.06270730993 -1.07560559180 - -1.08863079736 -1.10178247062 -1.11506003702 -1.12846279632 - -1.14198991527 -1.15564041981 -1.16941318711 -1.18330693716 - -1.19732022411 -1.21145142723 -1.22569874156 -1.24006016818 - -1.25453350421 -1.26911633242 -1.28380601051 -1.29859966013 - -1.31349415547 -1.32848611167 -1.34357187284 -1.35874749986 - -1.37400875793 -1.38935110383 -1.40476967306 -1.42025926679 - -1.43581433862 -1.45142898139 -1.46709691381 -1.48281146722 - -1.49856557242 -1.51435174663 -1.53016208071 -1.54598822674 - -1.56182138598 -1.57765229742 -1.59347122692 -1.60926795726 - -1.62503177897 -1.64075148236 -1.65641535078 -1.67201115531 - -1.68752615108 -1.70294707548 -1.71826014841 -1.73345107488 - -1.74850505017 -1.76340676790 -1.77814043122 -1.79268976745 - -1.80703804660 -1.82116810389 -1.83506236690 -1.84870288752 - -1.86207137909 -1.87514925930 -1.88791769902 -1.90035767758 - -1.91245004495 -1.92417559110 -1.93551512300 -1.94644954962 - -1.95695997528 -1.96702780173 -1.97663483902 -1.98576342576 - -1.99439655853 -2.00251803085 -2.01011258144 -2.01716605191 - -2.02366555334 -2.02959964160 -2.03495850066 -2.03973413318 - -2.04392055727 -2.04751400830 -2.05051314393 -2.05291925071 - -2.05473644972 -2.05597189871 -2.05663598747 -2.05674252293 - -2.05630889960 -2.05535625082 -2.05390957528 -2.05199783293 - -2.04965400362 -2.04691510106 -2.04382213423 -2.04042000767 - -2.03675735125 -2.03288627011 -2.02886200443 -2.02474248914 - -2.02058780338 -2.01645950029 -2.01241980842 -2.00853069774 - -2.00485280558 -2.00144422086 -1.99835912979 -1.99564633185 - -1.99334764297 -1.99149621264 -1.99011479470 -1.98921402759 - -1.98879080005 -1.98882680336 -1.98928740206 -1.99012099306 - -1.99125906914 -1.99261725937 -1.99409768678 -1.99559306622 - -1.99699306407 -1.99819356069 -1.99917387050 -1.99973594752 - -1.99996465494 -2.00000014812 -2.00000001365 -2.00000001239 - -2.00000001123 -2.00000001017 -2.00000000920 -2.00000000830 - -2.00000000748 -2.00000000674 -2.00000000606 -2.00000000544 - -2.00000000487 -2.00000000436 -2.00000000390 -2.00000000348 - -2.00000000310 -2.00000000275 -2.00000000244 -2.00000000217 - -2.00000000192 -2.00000000169 -2.00000000149 -2.00000000132 - -2.00000000116 -2.00000000102 -2.00000000089 -2.00000000078 - -2.00000000068 -2.00000000059 -2.00000000052 -2.00000000045 - -2.00000000039 -2.00000000034 -2.00000000029 -2.00000000025 - -2.00000000022 -2.00000000019 -2.00000000016 -2.00000000014 - -2.00000000012 -2.00000000010 -2.00000000009 -2.00000000007 - -2.00000000006 -2.00000000005 -2.00000000005 -2.00000000004 - -2.00000000003 -2.00000000003 -2.00000000002 -2.00000000002 - -2.00000000002 -2.00000000002 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 - Down Pseudopotential follows (l on next line) - 3 - -0.111619570255E-03 -0.224643141861E-03 -0.339088374976E-03 -0.454973151894E-03 - -0.572315579843E-03 -0.691133993809E-03 -0.811446959404E-03 -0.933273275767E-03 - -0.105663197850E-02 -0.118154234264E-02 -0.130802388569E-02 -0.143609637062E-02 - -0.156577980902E-02 -0.169709446418E-02 -0.183006085426E-02 -0.196469975553E-02 - -0.210103220557E-02 -0.223907950660E-02 -0.237886322878E-02 -0.252040521357E-02 - -0.266372757718E-02 -0.280885271402E-02 -0.295580330017E-02 -0.310460229692E-02 - -0.325527295441E-02 -0.340783881522E-02 -0.356232371804E-02 -0.371875180145E-02 - -0.387714750761E-02 -0.403753558616E-02 -0.419994109803E-02 -0.436438941940E-02 - -0.453090624560E-02 -0.469951759521E-02 -0.487024981407E-02 -0.504312957938E-02 - -0.521818390394E-02 -0.539544014029E-02 -0.557492598506E-02 -0.575666948322E-02 - -0.594069903252E-02 -0.612704338791E-02 -0.631573166603E-02 -0.650679334976E-02 - -0.670025829281E-02 -0.689615672443E-02 -0.709451925408E-02 -0.729537687626E-02 - -0.749876097531E-02 -0.770470333035E-02 -0.791323612021E-02 -0.812439192851E-02 - -0.833820374869E-02 -0.855470498920E-02 -0.877392947871E-02 -0.899591147142E-02 - -0.922068565236E-02 -0.944828714288E-02 -0.967875150605E-02 -0.991211475231E-02 - -0.101484133450E-01 -0.103876842062E-01 -0.106299647223E-01 -0.108752927501E-01 - -0.111237066223E-01 -0.113752451541E-01 -0.116299476486E-01 -0.118878539036E-01 - -0.121490042172E-01 -0.124134393946E-01 -0.126812007541E-01 -0.129523301337E-01 - -0.132268698979E-01 -0.135048629439E-01 -0.137863527083E-01 -0.140713831744E-01 - -0.143599988785E-01 -0.146522449172E-01 -0.149481669543E-01 -0.152478112279E-01 - -0.155512245578E-01 -0.158584543526E-01 -0.161695486175E-01 -0.164845559611E-01 - -0.168035256038E-01 -0.171265073848E-01 -0.174535517704E-01 -0.177847098615E-01 - -0.181200334019E-01 -0.184595747863E-01 -0.188033870682E-01 -0.191515239686E-01 - -0.195040398841E-01 -0.198609898957E-01 -0.202224297770E-01 -0.205884160032E-01 - -0.209590057599E-01 -0.213342569519E-01 -0.217142282126E-01 -0.220989789124E-01 - -0.224885691690E-01 -0.228830598559E-01 -0.232825126124E-01 -0.236869898532E-01 - -0.240965547779E-01 -0.245112713811E-01 -0.249312044622E-01 -0.253564196360E-01 - -0.257869833422E-01 -0.262229628564E-01 -0.266644263003E-01 -0.271114426525E-01 - -0.275640817593E-01 -0.280224143453E-01 -0.284865120247E-01 -0.289564473127E-01 - -0.294322936364E-01 -0.299141253464E-01 -0.304020177286E-01 -0.308960470158E-01 - -0.313962903996E-01 -0.319028260427E-01 -0.324157330906E-01 -0.329350916844E-01 - -0.334609829734E-01 -0.339934891272E-01 -0.345326933492E-01 -0.350786798893E-01 - -0.356315340568E-01 -0.361913422343E-01 -0.367581918907E-01 -0.373321715951E-01 - -0.379133710307E-01 -0.385018810084E-01 -0.390977934815E-01 -0.397012015599E-01 - -0.403121995243E-01 -0.409308828416E-01 -0.415573481790E-01 -0.421916934198E-01 - -0.428340176783E-01 -0.434844213155E-01 -0.441430059545E-01 -0.448098744967E-01 - -0.454851311374E-01 -0.461688813828E-01 -0.468612320656E-01 -0.475622913626E-01 - -0.482721688109E-01 -0.489909753250E-01 -0.497188232148E-01 -0.504558262024E-01 - -0.512020994403E-01 -0.519577595292E-01 -0.527229245360E-01 -0.534977140129E-01 - -0.542822490153E-01 -0.550766521212E-01 -0.558810474501E-01 -0.566955606825E-01 - -0.575203190796E-01 -0.583554515028E-01 -0.592010884341E-01 -0.600573619966E-01 - -0.609244059749E-01 -0.618023558359E-01 -0.626913487502E-01 -0.635915236132E-01 - -0.645030210674E-01 -0.654259835234E-01 -0.663605551829E-01 -0.673068820609E-01 - -0.682651120086E-01 -0.692353947361E-01 -0.702178818365E-01 -0.712127268086E-01 - -0.722200850818E-01 -0.732401140395E-01 -0.742729730443E-01 -0.753188234625E-01 - -0.763778286893E-01 -0.774501541744E-01 -0.785359674477E-01 -0.796354381455E-01 - -0.807487380368E-01 -0.818760410502E-01 -0.830175233011E-01 -0.841733631190E-01 - -0.853437410751E-01 -0.865288400109E-01 -0.877288450664E-01 -0.889439437088E-01 - -0.901743257622E-01 -0.914201834365E-01 -0.926817113579E-01 -0.939591065989E-01 - -0.952525687090E-01 -0.965622997459E-01 -0.978885043067E-01 -0.992313895600E-01 - -0.100591165278 -0.101968043869 -0.103362240410 -0.104773972683 - -0.106203461203 -0.107650929259 -0.109116602943 -0.110600711189 - -0.112103485807 -0.113625161518 -0.115165975994 -0.116726169889 - -0.118305986882 -0.119905673712 -0.121525480217 -0.123165659371 - -0.124826467326 -0.126508163450 -0.128211010366 -0.129935273994 - -0.131681223595 -0.133449131805 -0.135239274685 -0.137051931759 - -0.138887386058 -0.140745924164 -0.142627836255 -0.144533416147 - -0.146462961342 -0.148416773073 -0.150395156347 -0.152398419999 - -0.154426876730 -0.156480843163 -0.158560639888 -0.160666591508 - -0.162799026694 -0.164958278234 -0.167144683079 -0.169358582400 - -0.171600321636 -0.173870250548 -0.176168723273 -0.178496098373 - -0.180852738895 -0.183239012423 -0.185655291130 -0.188101951841 - -0.190579376082 -0.193087950142 -0.195628065130 -0.198200117030 - -0.200804506763 -0.203441640245 -0.206111928447 -0.208815787455 - -0.211553638534 -0.214325908183 -0.217133028204 -0.219975435763 - -0.222853573449 -0.225767889343 -0.228718837079 -0.231706875911 - -0.234732470777 -0.237796092365 -0.240898217178 -0.244039327604 - -0.247219911978 -0.250440464655 -0.253701486075 -0.257003482830 - -0.260346967736 -0.263732459898 -0.267160484785 -0.270631574291 - -0.274146266813 -0.277705107316 -0.281308647404 -0.284957445390 - -0.288652066366 -0.292393082274 -0.296181071975 -0.300016621320 - -0.303900323215 -0.307832777700 -0.311814592006 -0.315846380634 - -0.319928765417 -0.324062375588 -0.328247847851 -0.332485826441 - -0.336776963195 -0.341121917609 -0.345521356908 -0.349975956103 - -0.354486398054 -0.359053373524 -0.363677581240 -0.368359727948 - -0.373100528462 -0.377900705715 -0.382760990810 -0.387682123063 - -0.392664850043 -0.397709927613 -0.402818119964 -0.407990199646 - -0.413226947598 -0.418529153164 -0.423897614118 -0.429333136672 - -0.434836535483 -0.440408633656 -0.446050262737 -0.451762262700 - -0.457545481928 -0.463400777185 -0.469329013576 -0.475331064508 - -0.481407811628 -0.487560144759 -0.493788961826 -0.500095168761 - -0.506479679407 -0.512943415398 -0.519487306033 -0.526112288128 - -0.532819305855 -0.539609310564 -0.546483260585 -0.553442121007 - -0.560486863446 -0.567618465780 -0.574837911863 -0.582146191219 - -0.589544298704 -0.597033234141 -0.604614001925 -0.612287610596 - -0.620055072378 -0.627917402684 -0.635875619579 -0.643930743208 - -0.652083795177 -0.660335797890 -0.668687773840 -0.677140744851 - -0.685695731260 -0.694353751050 -0.703115818921 -0.711982945298 - -0.720956135272 -0.730036387475 -0.739224692876 -0.748522033506 - -0.757929381094 -0.767447695623 -0.777077923794 -0.786820997395 - -0.796677831567 -0.806649322968 -0.816736347829 -0.826939759888 - -0.837260388205 -0.847699034856 -0.858256472481 -0.868933441701 - -0.879730648391 -0.890648760790 -0.901688406460 -0.912850169074 - -0.924134585033 -0.935542139897 -0.947073264630 -0.958728331649 - -0.970507650666 -0.982411464322 -0.994439943592 -1.00659318297 - -1.01887119543 -1.03127390710 -1.04380115174 -1.05645266491 - -1.06922807792 -1.08212691146 -1.09514856898 -1.10829232979 - -1.12155734179 -1.13494261405 -1.14844700891 -1.16206923394 - -1.17580783344 -1.18966117976 -1.20362746421 -1.21770468773 - -1.23189065119 -1.24618294546 -1.26057894107 -1.27507577774 - -1.28967035347 -1.30435931350 -1.31913903893 -1.33400563518 - -1.34895492019 -1.36398241252 -1.37908331925 -1.39425252381 - -1.40948457374 -1.42477366846 -1.44011364706 -1.45549797622 - -1.47091973832 -1.48637161976 -1.50184589969 -1.51733443911 - -1.53282867058 -1.54831958851 -1.56379774030 -1.57925321836 - -1.59467565322 -1.61005420784 -1.62537757337 -1.64063396644 - -1.65581112829 -1.67089632588 -1.68587635530 -1.70073754755 - -1.71546577717 -1.73004647386 -1.74446463738 -1.75870485610 - -1.77275132946 -1.78658789470 -1.80019805816 -1.81356503154 - -1.82667177347 -1.83950103669 -1.85203542125 -1.86425743410 - -1.87614955535 -1.88769431155 -1.89887435629 -1.90967255846 - -1.92007209834 -1.93005657161 -1.93961010171 -1.94871746025 - -1.95736419569 -1.96553677004 -1.97322270331 -1.98041072541 - -1.98709093479 -1.99325496322 -1.99889614556 -2.00400969353 - -2.00859287178 -2.01264517460 -2.01616850114 -2.01916732657 - -2.02164886640 -2.02362323052 -2.02510356316 -2.02610616461 - -2.02665058962 -2.02675971746 -2.02645978733 -2.02578039308 - -2.02475442998 -2.02341798628 -2.02181017171 -2.01997287488 - -2.01795044134 -2.01578926438 -2.01353728081 -2.01124336503 - -2.00895661586 -2.00672553267 -2.00459707998 -2.00261564368 - -2.00082188694 -1.99925152038 -1.99793400978 -1.99689125513 - -1.99613628865 -1.99567205615 -1.99549036741 -1.99557112714 - -1.99588199005 -1.99637862261 -1.99700580137 -1.99769963559 - -1.99839127112 -1.99908294242 -1.99957256569 -1.99986106869 - -1.99998115880 -2.00000013158 -2.00000001268 -2.00000001151 - -2.00000001043 -2.00000000944 -2.00000000854 -2.00000000771 - -2.00000000695 -2.00000000626 -2.00000000562 -2.00000000505 - -2.00000000452 -2.00000000405 -2.00000000362 -2.00000000323 - -2.00000000287 -2.00000000256 -2.00000000227 -2.00000000201 - -2.00000000178 -2.00000000157 -2.00000000139 -2.00000000122 - -2.00000000107 -2.00000000094 -2.00000000083 -2.00000000072 - -2.00000000063 -2.00000000055 -2.00000000048 -2.00000000042 - -2.00000000036 -2.00000000031 -2.00000000027 -2.00000000023 - -2.00000000020 -2.00000000017 -2.00000000015 -2.00000000013 - -2.00000000011 -2.00000000009 -2.00000000008 -2.00000000007 - -2.00000000006 -2.00000000005 -2.00000000004 -2.00000000004 - -2.00000000003 -2.00000000003 -2.00000000002 -2.00000000002 - -2.00000000002 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 - Core charge follows - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 - Valence charge follows - 0.192859942394E-08 0.781173797153E-08 0.177986530177E-07 0.320429777590E-07 - 0.507028602581E-07 0.739410855989E-07 0.101925201233E-06 0.134827645597E-06 - 0.172825880089E-06 0.216102524489E-06 0.264845495903E-06 0.319248151340E-06 - 0.379509433995E-06 0.445834023349E-06 0.518432489170E-06 0.597521449530E-06 - 0.683323732926E-06 0.776068544625E-06 0.875991637323E-06 0.983335486252E-06 - 0.109834946882E-05 0.122129004895E-05 0.135242096614E-05 0.149201342952E-05 - 0.164034631684E-05 0.179770637873E-05 0.196438844814E-05 0.214069565534E-05 - 0.232693964833E-05 0.252344081913E-05 0.273052853577E-05 0.294854138044E-05 - 0.317782739366E-05 0.341874432486E-05 0.367165988941E-05 0.393695203229E-05 - 0.421500919859E-05 0.450623061099E-05 0.481102655440E-05 0.512981866796E-05 - 0.546304024460E-05 0.581113653829E-05 0.617456507923E-05 0.655379599720E-05 - 0.694931235324E-05 0.736161047981E-05 0.779120032985E-05 0.823860583470E-05 - 0.870436527134E-05 0.918903163903E-05 0.969317304571E-05 0.102173731042E-04 - 0.107622313389E-04 0.113283636025E-04 0.119164025038E-04 0.125269978465E-04 - 0.131608170789E-04 0.138185457558E-04 0.145008880115E-04 0.152085670456E-04 - 0.159423256210E-04 0.167029265745E-04 0.174911533412E-04 0.183078104914E-04 - 0.191537242818E-04 0.200297432214E-04 0.209367386506E-04 0.218756053360E-04 - 0.228472620808E-04 0.238526523500E-04 0.248927449119E-04 0.259685344964E-04 - 0.270810424697E-04 0.282313175266E-04 0.294204364004E-04 0.306495045908E-04 - 0.319196571109E-04 0.332320592526E-04 0.345879073726E-04 0.359884296973E-04 - 0.374348871494E-04 0.389285741946E-04 0.404708197112E-04 0.420629878802E-04 - 0.437064791003E-04 0.454027309241E-04 0.471532190199E-04 0.489594581571E-04 - 0.508230032169E-04 0.527454502295E-04 0.547284374366E-04 0.567736463820E-04 - 0.588828030295E-04 0.610576789096E-04 0.633000922950E-04 0.656119094069E-04 - 0.679950456508E-04 0.704514668852E-04 0.729831907215E-04 0.755922878576E-04 - 0.782808834452E-04 0.810511584922E-04 0.839053513006E-04 0.868457589407E-04 - 0.898747387635E-04 0.929947099510E-04 0.962081551062E-04 0.995176218837E-04 - 0.102925724661E-03 0.106435146253E-03 0.110048639670E-03 0.113769029920E-03 - 0.117599215858E-03 0.121542172080E-03 0.125600950866E-03 0.129778684174E-03 - 0.134078585684E-03 0.138503952889E-03 0.143058169249E-03 0.147744706389E-03 - 0.152567126361E-03 0.157529083955E-03 0.162634329080E-03 0.167886709193E-03 - 0.173290171799E-03 0.178848767007E-03 0.184566650159E-03 0.190448084516E-03 - 0.196497444018E-03 0.202719216115E-03 0.209118004664E-03 0.215698532905E-03 - 0.222465646505E-03 0.229424316690E-03 0.236579643443E-03 0.243936858795E-03 - 0.251501330188E-03 0.259278563931E-03 0.267274208741E-03 0.275494059370E-03 - 0.283944060329E-03 0.292630309701E-03 0.301559063051E-03 0.310736737439E-03 - 0.320169915525E-03 0.329865349787E-03 0.339829966840E-03 0.350070871863E-03 - 0.360595353140E-03 0.371410886710E-03 0.382525141143E-03 0.393945982428E-03 - 0.405681478984E-03 0.417739906801E-03 0.430129754706E-03 0.442859729763E-03 - 0.455938762811E-03 0.469376014131E-03 0.483180879266E-03 0.497362994979E-03 - 0.511932245367E-03 0.526898768117E-03 0.542272960931E-03 0.558065488100E-03 - 0.574287287251E-03 0.590949576256E-03 0.608063860316E-03 0.625641939220E-03 - 0.643695914788E-03 0.662238198493E-03 0.681281519280E-03 0.700838931572E-03 - 0.720923823479E-03 0.741549925213E-03 0.762731317701E-03 0.784482441427E-03 - 0.806818105478E-03 0.829753496827E-03 0.853304189830E-03 0.877486155974E-03 - 0.902315773857E-03 0.927809839409E-03 0.953985576380E-03 0.980860647067E-03 - 0.100845316333E-02 0.103678169783E-02 0.106586529564E-02 0.109572348599E-02 - 0.112637629448E-02 0.115784425542E-02 0.119014842461E-02 0.122331039231E-02 - 0.125735229666E-02 0.129229683731E-02 0.132816728945E-02 0.136498751814E-02 - 0.140278199300E-02 0.144157580333E-02 0.148139467342E-02 0.152226497845E-02 - 0.156421376059E-02 0.160726874560E-02 0.165145835976E-02 0.169681174729E-02 - 0.174335878809E-02 0.179113011598E-02 0.184015713733E-02 0.189047205019E-02 - 0.194210786380E-02 0.199509841864E-02 0.204947840692E-02 0.210528339354E-02 - 0.216254983758E-02 0.222131511428E-02 0.228161753756E-02 0.234349638304E-02 - 0.240699191160E-02 0.247214539354E-02 0.253899913323E-02 0.260759649444E-02 - 0.267798192613E-02 0.275020098894E-02 0.282430038225E-02 0.290032797190E-02 - 0.297833281848E-02 0.305836520633E-02 0.314047667322E-02 0.322472004063E-02 - 0.331114944479E-02 0.339982036837E-02 0.349078967297E-02 0.358411563224E-02 - 0.367985796581E-02 0.377807787397E-02 0.387883807308E-02 0.398220283185E-02 - 0.408823800836E-02 0.419701108788E-02 0.430859122158E-02 0.442304926605E-02 - 0.454045782367E-02 0.466089128390E-02 0.478442586537E-02 0.491113965898E-02 - 0.504111267185E-02 0.517442687219E-02 0.531116623519E-02 0.545141678977E-02 - 0.559526666639E-02 0.574280614579E-02 0.589412770880E-02 0.604932608704E-02 - 0.620849831479E-02 0.637174378184E-02 0.653916428732E-02 0.671086409477E-02 - 0.688694998808E-02 0.706753132870E-02 0.725272011384E-02 0.744263103581E-02 - 0.763738154248E-02 0.783709189888E-02 0.804188524993E-02 0.825188768428E-02 - 0.846722829937E-02 0.868803926757E-02 0.891445590354E-02 0.914661673273E-02 - 0.938466356104E-02 0.962874154565E-02 0.987899926705E-02 0.101355888021E-01 - 0.103986657987E-01 0.106683895506E-01 0.109449230749E-01 0.112284331891E-01 - 0.115190905903E-01 0.118170699354E-01 0.121225499218E-01 0.124357133700E-01 - 0.127567473067E-01 0.130858430491E-01 0.134231962901E-01 0.137690071850E-01 - 0.141234804382E-01 0.144868253917E-01 0.148592561143E-01 0.152409914910E-01 - 0.156322553139E-01 0.160332763735E-01 0.164442885508E-01 0.168655309099E-01 - 0.172972477909E-01 0.177396889038E-01 0.181931094226E-01 0.186577700790E-01 - 0.191339372574E-01 0.196218830894E-01 0.201218855480E-01 0.206342285423E-01 - 0.211592020118E-01 0.216971020195E-01 0.222482308459E-01 0.228128970812E-01 - 0.233914157168E-01 0.239841082365E-01 0.245913027054E-01 0.252133338584E-01 - 0.258505431863E-01 0.265032790210E-01 0.271718966175E-01 0.278567582343E-01 - 0.285582332115E-01 0.292766980451E-01 0.300125364590E-01 0.307661394732E-01 - 0.315379054684E-01 0.323282402459E-01 0.331375570839E-01 0.339662767882E-01 - 0.348148277379E-01 0.356836459252E-01 0.365731749895E-01 0.374838662442E-01 - 0.384161786967E-01 0.393705790609E-01 0.403475417610E-01 0.413475489272E-01 - 0.423710903810E-01 0.434186636116E-01 0.444907737407E-01 0.455879334766E-01 - 0.467106630555E-01 0.478594901703E-01 0.490349498859E-01 0.502375845398E-01 - 0.514679436270E-01 0.527265836691E-01 0.540140680664E-01 0.553309669310E-01 - 0.566778569013E-01 0.580553209363E-01 0.594639480882E-01 0.609043332531E-01 - 0.623770768971E-01 0.638827847586E-01 0.654220675235E-01 0.669955404742E-01 - 0.686038231083E-01 0.702475387283E-01 0.719273139998E-01 0.736437784753E-01 - 0.753975640855E-01 0.771893045927E-01 0.790196350078E-01 0.808891909675E-01 - 0.827986080706E-01 0.847485211721E-01 0.867395636330E-01 0.887723665237E-01 - 0.908475577806E-01 0.929657613123E-01 0.951275960557E-01 0.973336749783E-01 - 0.995846040265E-01 0.101880981017 0.104223394471 0.106612422388 - 0.109048630958 0.111532573210 0.114064787601 0.116645796531 - 0.119276104797 0.121956197978 0.124686540746 0.127467575110 - 0.130299718591 0.133183362321 0.136118869067 0.139106571192 - 0.142146768535 0.145239726221 0.148385672402 0.151584795926 - 0.154837243936 0.158143119404 0.161502478600 0.164915328494 - 0.168381624109 0.171901265809 0.175474096544 0.179099899044 - 0.182778392977 0.186509232075 0.190292001230 0.194126213575 - 0.198011307559 0.201946644018 0.205931503264 0.209965082193 - 0.214046491433 0.218174752547 0.222348795293 0.226567454973 - 0.230829469882 0.235133478869 0.239478019048 0.243861523650 - 0.248282320071 0.252738628116 0.257228558471 0.261750111427 - 0.266301175884 0.270879528660 0.275482834128 0.280108644217 - 0.284754398804 0.289417426515 0.294094945981 0.298784067563 - 0.303481795582 0.308185031075 0.312890575109 0.317595132679 - 0.322295317203 0.326987655640 0.331668594263 0.336334505069 - 0.340981692875 0.345606403079 0.350204830101 0.354773126503 - 0.359307412770 0.363803787747 0.368258339702 0.372667158000 - 0.377026345326 0.381332030440 0.385580381389 0.389767619122 - 0.393890031426 0.397943987118 0.401925950365 0.405832495067 - 0.409660319161 0.413406258723 0.417067301751 0.420640601457 - 0.424123488937 0.427513485040 0.430808311270 0.434005899547 - 0.437104400641 0.440102191083 0.442997878383 0.445790304351 - 0.448478546334 0.451061916191 0.453539956840 0.455912436183 - 0.458179338301 0.460340851743 0.462397354842 0.464349397939 - 0.466197682492 0.467943037053 0.469586390145 0.471128740130 - 0.472571122219 0.473914572847 0.475160091703 0.476308601801 - 0.477360908088 0.478317655172 0.479179284885 0.479945994527 - 0.480617696764 0.481193982306 0.481674086615 0.482056862058 - 0.482340757021 0.482523803624 0.482603615727 0.482577398951 - 0.482441974360 0.482193817305 0.481829112616 0.481343826889 - 0.480733797882 0.479994840121 0.479122864492 0.478114007910 - 0.476964766961 0.475672126666 0.474233672054 0.472647665983 - 0.470913070885 0.469029486199 0.466996982391 0.464815870018 - 0.462486580310 0.460009732923 0.457386090912 0.454616575315 - 0.451702265742 0.448644400990 0.445444380086 0.442103762753 - 0.438624269637 0.435007782252 0.431256342637 0.427372152711 - 0.423357573327 0.419215123017 0.414947476426 0.410557462424 - 0.406048061901 0.401422405240 0.396683769456 0.391835575024 - 0.386881382364 0.381824888011 0.376669920458 0.371420435675 - 0.366080512308 0.360654346573 0.355146246827 0.349560627845 - 0.343902004805 0.338174986971 0.332384271116 0.326534634661 - 0.320630928574 0.314678070008 0.308681034723 0.302644849286 - 0.296574583069 0.290475340066 0.284352250545 0.278210462548 - 0.272055133266 0.265891420306 0.259724472862 0.253559422831 - 0.247401375887 0.241255402527 0.235126529124 0.229019729013 - 0.222939913627 0.216891923710 0.210880520641 0.204910377884 - 0.198986072594 0.193112077405 0.187292752436 0.181532337514 - 0.175834944675 0.170204550934 0.164644991380 0.159159952589 - 0.153752966405 0.148427404095 0.143186470903 0.138033201031 - 0.132970453049 0.128000905774 0.123127054607 0.118351208375 - 0.113675486655 0.109101817627 0.104631936429 0.100267384058 - 0.960095067872E-01 0.918594561291E-01 0.878181893307E-01 0.838864704037E-01 - 0.800648716863E-01 0.763537759297E-01 0.727533789016E-01 0.692636924953E-01 - 0.658845483324E-01 0.626156018442E-01 0.594563368135E-01 0.564060703579E-01 - 0.534639583344E-01 0.506290011397E-01 0.479000498833E-01 0.452758129051E-01 - 0.427548626097E-01 0.403356425871E-01 0.380164749900E-01 0.357955681333E-01 - 0.336710242851E-01 0.316408476135E-01 0.297029522571E-01 0.278551704814E-01 - 0.260952608902E-01 0.244209166542E-01 0.228297737247E-01 0.213194189972E-01 - 0.198873983928E-01 0.185312248251E-01 0.172483860213E-01 0.160363521683E-01 - 0.148925833548E-01 0.138145367839E-01 0.127996737309E-01 0.118454662228E-01 - 0.109494034201E-01 0.101089976804E-01 0.932179028917E-02 0.858535684220E-02 - 0.789731226802E-02 0.725531548143E-02 0.665707366032E-02 0.610034614137E-02 - 0.558294793195E-02 0.510275283811E-02 0.465769621076E-02 0.424577731408E-02 - 0.386506132236E-02 0.351368095349E-02 0.318983774884E-02 0.289180301130E-02 - 0.261791841440E-02 0.236659629707E-02 0.213631965971E-02 0.192564187822E-02 - 0.173318615362E-02 0.155764471558E-02 0.139777779863E-02 0.125241241034E-02 - 0.112044091082E-02 0.100081942313E-02 0.892566093909E-03 0.794759223473E-03 - 0.706535284101E-03 0.627086844948E-03 0.555660421225E-03 0.491554264729E-03 - 0.434116111959E-03 0.382740905219E-03 0.336868501164E-03 0.295981380310E-03 - 0.259602369956E-03 0.227292391987E-03 0.198648245921E-03 0.173300436534E-03 - 0.150911054305E-03 0.131171715925E-03 0.113801571046E-03 0.985453804982E-04 - 0.851716702189E-04 0.734709642647E-04 0.632540993902E-04 0.543506228959E-04 - 0.466072746907E-04 0.398865538313E-04 0.340653691752E-04 0.290337732188E-04 - 0.246937776901E-04 0.209582490236E-04 0.177498814647E-04 0.150002452239E-04 - 0.126489068360E-04 0.106426186600E-04 0.893457429107E-05 0.748372653583E-05 - 0.625416452187E-05 0.521454647655E-05 0.433758470421E-05 0.359957931914E-05 - 0.297999734644E-05 0.246109388135E-05 0.202757209710E-05 0.166627900678E-05 - 0.136593401420E-05 0.111688742925E-05 0.910906270504E-06 0.740984831728E-06 - 0.601177644702E-06 0.486452628062E-06 0.392562368130E-06 0.315931631453E-06 - 0.253559358779E-06 0.202933535288E-06 0.161957471164E-06 0.128886159355E-06 - 0.102271503009E-06 0.809153233791E-07 0.638291695628E-07 0.502000542962E-07 - 0.393613351753E-07 0.307680481744E-07 0.239760804451E-07 0.186246423254E-07 - 0.144215645970E-07 0.111310066537E-07 0.856321476742E-08 0.656601745819E-08 - 0.501778751204E-08 0.382163784784E-08 0.290065162999E-08 0.219397615104E-08 - 0.165363545597E-08 0.124193881255E-08 0.929381299077E-09 0.692949305273E-09 - 0.514757927259E-09 0.380959360274E-09 0.280871708568E-09 0.206286370945E-09 - 0.150919531555E-09 0.109979475361E-09 0.798266226255E-10 0.577074839373E-10 - 0.415473062892E-10 0.297891247706E-10 0.212693520263E-10 0.151220139117E-10 - 0.107053479198E-10 0.754578353343E-11 0.529537384138E-11 0.369959051151E-11 - 0.257306732482E-11 0.178141255024E-11 0.122763375141E-11 0.842051897239E-12 - 0.574842771122E-12 0.390547257372E-12 0.264050022826E-12 0.177648027364E-12 - 0.118923931884E-12 0.792110200848E-13 0.524906403802E-13 0.346043062619E-13 - 0.226935361331E-13 0.148036678549E-13 0.960511666662E-14 0.619830243759E-14 - 0.397786438230E-14 0.253865789838E-14 0.161103477773E-14 0.101653262509E-14 - 0.637708422569E-15 0.397718479274E-15 0.246575620457E-15 0.151954233360E-15 - 0.930745459294E-16 0.566593040938E-16 0.342767824929E-16 0.206055046035E-16 - 0.123079667364E-16 0.730422684711E-17 0.430637311294E-17 0.252210207982E-17 - 0.146720552623E-17 0.847734320011E-18 0.486442890565E-18 0.277184878979E-18 - 0.156831974430E-18 0.881025392887E-19 0.491350989475E-19 0.272022731167E-19 - 0.149481817820E-19 0.815268589145E-20 0.441266599679E-20 0.236999664238E-20 - 0.126298598209E-20 0.667745114160E-21 0.350220062953E-21 0.182198844212E-21 - 0.940113161740E-22 0.481060428385E-22 0.244094851360E-22 0.122803576047E-22 - 0.612505736587E-23 0.302836915091E-23 0.148408620975E-23 0.720796487407E-24 - 0.346912820571E-24 0.165436950269E-24 0.781625736359E-25 0.365820814677E-25 - 0.169585850273E-25 0.778592494285E-26 0.353978846950E-26 0.159344594512E-26 - 0.710127023381E-27 0.313269769929E-27 0.136782031518E-27 0.591032535548E-28 - 0.252701870367E-28 0.106896252387E-28 0.447316537465E-29 0.185142717470E-29 - 0.757839992335E-30 0.306737485647E-30 0.122747626663E-30 0.485572362462E-31 - 0.189856870950E-31 0.733611747191E-32 0.280097426144E-32 0.105654817400E-32 - 0.393677381002E-33 0.144875644166E-33 0.526484979459E-34 0.188904952138E-34 - 0.669110184763E-35 0.233925828564E-35 0.807073987669E-36 0.274745538710E-36 - 0.922691751851E-37 0.305644755066E-37 0.998472848868E-38 0.321616483282E-38 - 0.102128232957E-38 0.319654325693E-39 0.985969264196E-40 0.299649774875E-40 - 0.897121090900E-41 0.264540652596E-41 0.768165292472E-42 0.219610677678E-42 - 0.618021048583E-43 0.171166027298E-43 0.466453883997E-44 0.125051219512E-44 - 0.329735218728E-45 0.854968083364E-46 0.217946276313E-46 0.546098077905E-47 - 0.134468007021E-47 0.325310967627E-48 0.773059547242E-49 0.180411230173E-49 - 0.413381662674E-50 0.929769442524E-51 0.205226716905E-51 0.444451088876E-52 - 0.944150224497E-53 0.196688780105E-53 0.401728312796E-54 0.804250532496E-55 - 0.157778094020E-55 0.303240720362E-56 0.570823032720E-57 0.105214342172E-57 - 0.189842243025E-58 0.335226864593E-59 0.579155310744E-60 0.978683662235E-61 - 0.161718679843E-61 0.261232053326E-62 0.412399442134E-63 0.636077593677E-64 - 0.958246688009E-65 0.140953257072E-65 0.202436545755E-66 0.284273825438E-67 - 0.389458372654E-68 0.520387124545E-69 0.677948621583E-70 diff --git a/aiida_defects/formation_energy_siesta/pseudos/H.psf b/aiida_defects/formation_energy_siesta/pseudos/H.psf deleted file mode 100644 index 25a223e..0000000 --- a/aiida_defects/formation_energy_siesta/pseudos/H.psf +++ /dev/null @@ -1,1527 +0,0 @@ - H ca nrl nc - ATM3 19-FEB-98 Troullier-Martins - 1s 1.00 r= 1.25/2p 0.00 r= 1.25/3d 0.00 r= 1.25/4f 0.00 r= 1.25/ - 4 0 863 0.247875217667E-02 0.125000000000E-01 1.00000000000 - Radial grid follows - 0.311788641354E-04 0.627499101025E-04 0.947180709413E-04 0.127088341742E-03 - 0.159865780426E-03 0.193055508533E-03 0.226662712027E-03 0.260692642102E-03 - 0.295150616003E-03 0.330042017859E-03 0.365372299523E-03 0.401146981422E-03 - 0.437371653424E-03 0.474051975707E-03 0.511193679647E-03 0.548802568709E-03 - 0.586884519361E-03 0.625445481983E-03 0.664491481805E-03 0.704028619843E-03 - 0.744063073857E-03 0.784601099310E-03 0.825649030352E-03 0.867213280805E-03 - 0.909300345168E-03 0.951916799631E-03 0.995069303102E-03 0.103876459825E-02 - 0.108300951254E-02 0.112781095935E-02 0.117317593898E-02 0.121911153982E-02 - 0.126562493938E-02 0.131272340548E-02 0.136041429736E-02 0.140870506681E-02 - 0.145760325936E-02 0.150711651546E-02 0.155725257165E-02 0.160801926180E-02 - 0.165942451829E-02 0.171147637332E-02 0.176418296008E-02 0.181755251409E-02 - 0.187159337444E-02 0.192631398514E-02 0.198172289639E-02 0.203782876595E-02 - 0.209464036046E-02 0.215216655687E-02 0.221041634375E-02 0.226939882275E-02 - 0.232912321000E-02 0.238959883756E-02 0.245083515488E-02 0.251284173024E-02 - 0.257562825231E-02 0.263920453161E-02 0.270358050205E-02 0.276876622252E-02 - 0.283477187841E-02 0.290160778324E-02 0.296928438027E-02 0.303781224409E-02 - 0.310720208233E-02 0.317746473729E-02 0.324861118764E-02 0.332065255018E-02 - 0.339360008150E-02 0.346746517981E-02 0.354225938667E-02 0.361799438885E-02 - 0.369468202008E-02 0.377233426296E-02 0.385096325082E-02 0.393058126959E-02 - 0.401120075975E-02 0.409283431826E-02 0.417549470053E-02 0.425919482242E-02 - 0.434394776223E-02 0.442976676279E-02 0.451666523349E-02 0.460465675239E-02 - 0.469375506834E-02 0.478397410315E-02 0.487532795371E-02 0.496783089426E-02 - 0.506149737856E-02 0.515634204219E-02 0.525237970483E-02 0.534962537256E-02 - 0.544809424020E-02 0.554780169373E-02 0.564876331263E-02 0.575099487235E-02 - 0.585451234680E-02 0.595933191079E-02 0.606546994257E-02 0.617294302645E-02 - 0.628176795531E-02 0.639196173326E-02 0.650354157831E-02 0.661652492503E-02 - 0.673092942730E-02 0.684677296106E-02 0.696407362710E-02 0.708284975388E-02 - 0.720311990041E-02 0.732490285916E-02 0.744821765894E-02 0.757308356797E-02 - 0.769952009678E-02 0.782754700133E-02 0.795718428611E-02 0.808845220719E-02 - 0.822137127545E-02 0.835596225977E-02 0.849224619027E-02 0.863024436158E-02 - 0.876997833620E-02 0.891146994785E-02 0.905474130488E-02 0.919981479373E-02 - 0.934671308243E-02 0.949545912414E-02 0.964607616072E-02 0.979858772640E-02 - 0.995301765142E-02 0.101093900658E-01 0.102677294030E-01 0.104280604038E-01 - 0.105904081204E-01 0.107547979199E-01 0.109212554885E-01 0.110898068355E-01 - 0.112604782975E-01 0.114332965423E-01 0.116082885729E-01 0.117854817323E-01 - 0.119649037073E-01 0.121465825329E-01 0.123305465968E-01 0.125168246438E-01 - 0.127054457802E-01 0.128964394784E-01 0.130898355815E-01 0.132856643082E-01 - 0.134839562570E-01 0.136847424115E-01 0.138880541449E-01 0.140939232251E-01 - 0.143023818195E-01 0.145134625003E-01 0.147271982492E-01 0.149436224628E-01 - 0.151627689580E-01 0.153846719766E-01 0.156093661917E-01 0.158368867121E-01 - 0.160672690883E-01 0.163005493180E-01 0.165367638518E-01 0.167759495987E-01 - 0.170181439319E-01 0.172633846948E-01 0.175117102068E-01 0.177631592691E-01 - 0.180177711713E-01 0.182755856970E-01 0.185366431302E-01 0.188009842617E-01 - 0.190686503953E-01 0.193396833544E-01 0.196141254884E-01 0.198920196795E-01 - 0.201734093492E-01 0.204583384653E-01 0.207468515484E-01 0.210389936793E-01 - 0.213348105059E-01 0.216343482502E-01 0.219376537154E-01 0.222447742937E-01 - 0.225557579733E-01 0.228706533461E-01 0.231895096150E-01 0.235123766021E-01 - 0.238393047559E-01 0.241703451597E-01 0.245055495391E-01 0.248449702706E-01 - 0.251886603893E-01 0.255366735976E-01 0.258890642730E-01 0.262458874776E-01 - 0.266071989655E-01 0.269730551924E-01 0.273435133242E-01 0.277186312457E-01 - 0.280984675697E-01 0.284830816465E-01 0.288725335729E-01 0.292668842014E-01 - 0.296661951502E-01 0.300705288124E-01 0.304799483660E-01 0.308945177837E-01 - 0.313143018426E-01 0.317393661350E-01 0.321697770780E-01 0.326056019242E-01 - 0.330469087721E-01 0.334937665768E-01 0.339462451607E-01 0.344044152246E-01 - 0.348683483584E-01 0.353381170527E-01 0.358137947097E-01 0.362954556551E-01 - 0.367831751493E-01 0.372770293996E-01 0.377770955716E-01 0.382834518017E-01 - 0.387961772091E-01 0.393153519083E-01 0.398410570212E-01 0.403733746904E-01 - 0.409123880916E-01 0.414581814467E-01 0.420108400372E-01 0.425704502169E-01 - 0.431370994261E-01 0.437108762050E-01 0.442918702073E-01 0.448801722145E-01 - 0.454758741499E-01 0.460790690933E-01 0.466898512951E-01 0.473083161912E-01 - 0.479345604180E-01 0.485686818275E-01 0.492107795024E-01 0.498609537718E-01 - 0.505193062267E-01 0.511859397361E-01 0.518609584627E-01 0.525444678797E-01 - 0.532365747868E-01 0.539373873271E-01 0.546470150040E-01 0.553655686982E-01 - 0.560931606852E-01 0.568299046528E-01 0.575759157186E-01 0.583313104486E-01 - 0.590962068745E-01 0.598707245130E-01 0.606549843841E-01 0.614491090300E-01 - 0.622532225343E-01 0.630674505414E-01 0.638919202759E-01 0.647267605631E-01 - 0.655721018483E-01 0.664280762180E-01 0.672948174198E-01 0.681724608838E-01 - 0.690611437435E-01 0.699610048576E-01 0.708721848311E-01 0.717948260377E-01 - 0.727290726420E-01 0.736750706219E-01 0.746329677917E-01 0.756029138245E-01 - 0.765850602765E-01 0.775795606101E-01 0.785865702179E-01 0.796062464472E-01 - 0.806387486246E-01 0.816842380806E-01 0.827428781751E-01 0.838148343227E-01 - 0.849002740188E-01 0.859993668654E-01 0.871122845982E-01 0.882392011127E-01 - 0.893802924921E-01 0.905357370340E-01 0.917057152791E-01 0.928904100389E-01 - 0.940900064243E-01 0.953046918747E-01 0.965346561872E-01 0.977800915461E-01 - 0.990411925534E-01 0.100318156259 0.101611182190 0.102920472385 - 0.104246231424 0.105588666458 0.106947987247 0.108324406186 - 0.109718138344 0.111129401494 0.112558416150 0.114005405597 - 0.115470595931 0.116954216090 0.118456497894 0.119977676076 - 0.121517988325 0.123077675317 0.124656980755 0.126256151411 - 0.127875437158 0.129515091011 0.131175369171 0.132856531060 - 0.134558839362 0.136282560066 0.138027962508 0.139795319410 - 0.141584906925 0.143397004680 0.145231895818 0.147089867046 - 0.148971208675 0.150876214668 0.152805182687 0.154758414137 - 0.156736214214 0.158738891953 0.160766760277 0.162820136045 - 0.164899340100 0.167004697323 0.169136536679 0.171295191274 - 0.173480998400 0.175694299596 0.177935440694 0.180204771876 - 0.182502647731 0.184829427305 0.187185474164 0.189571156444 - 0.191986846913 0.194432923028 0.196909766992 0.199417765818 - 0.201957311386 0.204528800504 0.207132634974 0.209769221650 - 0.212438972503 0.215142304689 0.217879640607 0.220651407972 - 0.223458039878 0.226299974869 0.229177657000 0.232091535917 - 0.235042066919 0.238029711032 0.241054935081 0.244118211765 - 0.247220019726 0.250360843628 0.253541174231 0.256761508469 - 0.260022349525 0.263324206912 0.266667596553 0.270053040857 - 0.273481068809 0.276952216045 0.280467024937 0.284026044684 - 0.287629831387 0.291278948147 0.294973965145 0.298715459736 - 0.302504016534 0.306340227511 0.310224692082 0.314158017202 - 0.318140817462 0.322173715182 0.326257340510 0.330392331521 - 0.334579334317 0.338819003124 0.343112000400 0.347458996934 - 0.351860671954 0.356317713229 0.360830817182 0.365400688995 - 0.370028042718 0.374713601386 0.379458097127 0.384262271278 - 0.389126874500 0.394052666898 0.399040418138 0.404090907564 - 0.409204924327 0.414383267502 0.419626746215 0.424936179772 - 0.430312397781 0.435756240288 0.441268557904 0.446850211941 - 0.452502074542 0.458225028822 0.464019969006 0.469887800564 - 0.475829440357 0.481845816779 0.487937869899 0.494106551615 - 0.500352825794 0.506677668431 0.513082067794 0.519567024584 - 0.526133552089 0.532782676342 0.539515436283 0.546332883917 - 0.553236084487 0.560226116630 0.567304072554 0.574471058204 - 0.581728193435 0.589076612190 0.596517462674 0.604051907536 - 0.611681124047 0.619406304288 0.627228655335 0.635149399445 - 0.643169774251 0.651291032953 0.659514444514 0.667841293859 - 0.676272882075 0.684810526614 0.693455561502 0.702209337542 - 0.711073222530 0.720048601465 0.729136876770 0.738339468505 - 0.747657814594 0.757093371048 0.766647612192 0.776322030895 - 0.786118138804 0.796037466583 0.806081564145 0.816252000901 - 0.826550366004 0.836978268593 0.847537338049 0.858229224248 - 0.869055597820 0.880018150408 0.891118594932 0.902358665859 - 0.913740119474 0.925264734152 0.936934310637 0.948750672324 - 0.960715665544 0.972831159852 0.985099048317 0.997521247823 - 1.01009969936 1.02283636835 1.03573324491 1.04879234420 - 1.06201570674 1.07540539871 1.08896351227 1.10269216590 - 1.11659350474 1.13066970089 1.14492295380 1.15935549055 - 1.17396956627 1.18876746444 1.20375149724 1.21892400598 - 1.23428736139 1.24984396402 1.26559624461 1.28154666451 - 1.29769771599 1.31405192269 1.33061183999 1.34738005540 - 1.36435918900 1.38155189380 1.39896085622 1.41658879642 - 1.43443846881 1.45251266244 1.47081420144 1.48934594546 - 1.50811079013 1.52711166749 1.54635154646 1.56583343331 - 1.58556037214 1.60553544531 1.62576177397 1.64624251852 - 1.66698087913 1.68798009620 1.70924345091 1.73077426569 - 1.75257590478 1.77465177474 1.79700532495 1.81964004821 - 1.84255948125 1.86576720526 1.88926684650 1.91306207684 - 1.93715661433 1.96155422379 1.98625871741 2.01127395529 - 2.03660384614 2.06225234779 2.08822346788 2.11452126444 - 2.14114984656 2.16811337501 2.19541606289 2.22306217632 - 2.25105603504 2.27940201315 2.30810453978 2.33716809975 - 2.36659723430 2.39639654179 2.42657067843 2.45712435898 - 2.48806235752 2.51938950818 2.55111070589 2.58323090714 - 2.61575513079 2.64868845881 2.68203603710 2.71580307628 - 2.74999485254 2.78461670839 2.81967405358 2.85517236589 - 2.89111719200 2.92751414836 2.96436892207 3.00168727177 - 3.03947502852 3.07773809674 3.11648245511 3.15571415751 - 3.19543933398 3.23566419166 3.27639501576 3.31763817056 - 3.35940010038 3.40168733061 3.44450646872 3.48786420529 - 3.53176731504 3.57622265792 3.62123718019 3.66681791544 - 3.71297198576 3.75970660282 3.80702906900 3.85494677852 - 3.90346721863 3.95259797074 4.00234671164 4.05272121467 - 4.10372935094 4.15537909058 4.20767850397 4.26063576299 - 4.31425914233 4.36855702075 4.42353788241 4.47921031816 - 4.53558302695 4.59266481713 4.65046460784 4.70899143041 - 4.76825442979 4.82826286593 4.88902611528 4.95055367222 - 5.01285515055 5.07594028500 5.13981893277 5.20450107500 - 5.26999681843 5.33631639690 5.40347017296 5.47146863955 - 5.54032242155 5.61004227752 5.68063910131 5.75212392383 - 5.82450791472 5.89780238414 5.97201878449 6.04716871224 - 6.12326390971 6.20031626693 6.27833782349 6.35734077043 - 6.43733745210 6.51834036815 6.60036217546 6.68341569010 - 6.76751388935 6.85266991372 6.93889706902 7.02620882841 - 7.11461883454 7.20414090164 7.29478901773 7.38657734675 - 7.47952023083 7.57363219246 7.66892793684 7.76542235413 - 7.86313052177 7.96206770686 8.06224936854 8.16369116039 - 8.26640893291 8.37041873595 8.47573682126 8.58237964500 - 8.69036387033 8.79970637001 8.91042422902 9.02253474726 - 9.13605544221 9.25100405173 9.36739853676 9.48525708418 - 9.60459810963 9.72544026038 9.84780241827 9.97170370264 - 10.0971634733 10.2242013336 10.3528371335 10.4830909726 - 10.6149832032 10.7485344339 10.8837655323 11.0206976285 - 11.1593521184 11.2997506671 11.4419152122 11.5858679670 - 11.7316314247 11.8792283609 12.0286818381 12.1800152085 - 12.3332521185 12.4884165114 12.6455326322 12.8046250305 - 12.9657185648 13.1288384063 13.2940100429 13.4612592828 - 13.6306122593 13.8020954339 13.9757356013 14.1515598932 - 14.3295957824 14.5098710874 14.6924139766 14.8772529727 - 15.0644169571 15.2539351747 15.4458372379 15.6401531320 - 15.8369132191 16.0361482435 16.2378893359 16.4421680189 - 16.6490162114 16.8584662339 17.0705508133 17.2853030884 - 17.5027566145 17.7229453693 17.9459037576 18.1716666173 - 18.4002692241 18.6317472977 18.8661370071 19.1034749761 - 19.3437982892 19.5871444974 19.8335516242 20.0830581710 - 20.3357031239 20.5915259590 20.8505666493 21.1128656704 - 21.3784640069 21.6474031593 21.9197251498 22.1954725293 - 22.4746883838 22.7574163414 23.0437005789 23.3335858288 - 23.6271173862 23.9243411162 24.2253034604 24.5300514449 - 24.8386326872 25.1510954036 25.4674884172 25.7878611650 - 26.1122637059 26.4407467284 26.7733615587 27.1101601685 - 27.4511951833 27.7965198905 28.1461882478 28.5002548916 - 28.8587751455 29.2218050291 29.5894012664 29.9616212952 - 30.3385232756 30.7201660993 31.1066093988 31.4979135566 - 31.8941397147 32.2953497844 32.7016064555 33.1129732065 - 33.5295143142 33.9512948641 34.3783807601 34.8108387354 - 35.2487363624 35.6921420635 36.1411251217 36.5957556915 - 37.0561048099 37.5222444074 37.9942473193 38.4721872969 - 38.9561390193 39.4461781050 39.9423811236 40.4448256079 - 40.9535900657 41.4687539927 41.9903978841 42.5186032479 - 43.0534526173 43.5950295635 44.1434187092 44.6987057411 - 45.2609774241 45.8303216142 46.4068272725 46.9905844794 - 47.5816844480 48.1802195389 48.7862832745 49.3999703534 - 50.0213766654 50.6505993067 51.2877365944 51.9328880827 - 52.5861545776 53.2476381536 53.9174421686 54.5956712810 - 55.2824314654 55.9778300295 56.6819756307 57.3949782933 - 58.1169494253 58.8480018362 59.5882497544 60.3378088452 - 61.0967962287 61.8653304982 62.6435317388 63.4315215459 - 64.2294230447 65.0373609088 65.8554613802 66.6838522887 - 67.5226630722 68.3720247964 69.2320701759 70.1029335945 - 70.9847511265 71.8776605575 72.7818014065 73.6973149474 - 74.6243442310 75.5630341076 76.5135312492 77.4759841731 - 78.4505432644 79.4373608001 80.4365909723 81.4483899128 - 82.4729157172 83.5103284699 84.5607902685 85.6244652500 - 86.7015196157 87.7921216576 88.8964417844 90.0146525483 - 91.1469286722 92.2934470765 93.4543869069 94.6299295627 - 95.8202587249 97.0255603848 98.2460228731 99.4818368898 - 100.733195533 102.000294331 103.283331269 104.582506825 - 105.898023998 107.230088340 108.578907989 109.944693700 - 111.327658881 112.728019622 114.145994733 115.581805775 - 117.035677097 118.507835869 119.998512118 - Down Pseudopotential follows (l on next line) - 0 - -0.194762529562E-03 -0.391974870160E-03 -0.591667836617E-03 -0.793872631361E-03 - -0.998620849296E-03 -0.120594448274E-02 -0.141587592643E-02 -0.162844798257E-02 - -0.184369386597E-02 -0.206164720924E-02 -0.228234206800E-02 -0.250581292628E-02 - -0.273209470185E-02 -0.296122275167E-02 -0.319323287747E-02 -0.342816133128E-02 - -0.366604482114E-02 -0.390692051682E-02 -0.415082605562E-02 -0.439779954827E-02 - -0.464787958486E-02 -0.490110524088E-02 -0.515751608334E-02 -0.541715217695E-02 - -0.568005409035E-02 -0.594626290247E-02 -0.621582020897E-02 -0.648876812870E-02 - -0.676514931030E-02 -0.704500693888E-02 -0.732838474272E-02 -0.761532700016E-02 - -0.790587854648E-02 -0.820008478092E-02 -0.849799167377E-02 -0.879964577356E-02 - -0.910509421431E-02 -0.941438472292E-02 -0.972756562664E-02 -0.100446858606E-01 - -0.103657949753E-01 -0.106909431449E-01 -0.110201811742E-01 -0.113535605073E-01 - -0.116911332354E-01 -0.120329521049E-01 -0.123790705255E-01 -0.127295425790E-01 - -0.130844230272E-01 -0.134437673208E-01 -0.138076316081E-01 -0.141760727436E-01 - -0.145491482967E-01 -0.149269165614E-01 -0.153094365644E-01 -0.156967680753E-01 - -0.160889716154E-01 -0.164861084670E-01 -0.168882406836E-01 -0.172954310990E-01 - -0.177077433375E-01 -0.181252418235E-01 -0.185479917919E-01 -0.189760592981E-01 - -0.194095112284E-01 -0.198484153105E-01 -0.202928401237E-01 -0.207428551103E-01 - -0.211985305858E-01 -0.216599377502E-01 -0.221271486993E-01 -0.226002364354E-01 - -0.230792748793E-01 -0.235643388815E-01 -0.240555042341E-01 -0.245528476824E-01 - -0.250564469370E-01 -0.255663806862E-01 -0.260827286079E-01 -0.266055713821E-01 - -0.271349907039E-01 -0.276710692958E-01 -0.282138909209E-01 -0.287635403958E-01 - -0.293201036040E-01 -0.298836675093E-01 -0.304543201693E-01 -0.310321507493E-01 - -0.316172495360E-01 -0.322097079519E-01 -0.328096185693E-01 -0.334170751251E-01 - -0.340321725351E-01 -0.346550069089E-01 -0.352856755651E-01 -0.359242770464E-01 - -0.365709111350E-01 -0.372256788682E-01 -0.378886825541E-01 -0.385600257875E-01 - -0.392398134667E-01 -0.399281518089E-01 -0.406251483677E-01 -0.413309120494E-01 - -0.420455531300E-01 -0.427691832727E-01 -0.435019155454E-01 -0.442438644377E-01 - -0.449951458798E-01 -0.457558772597E-01 -0.465261774420E-01 -0.473061667866E-01 - -0.480959671669E-01 -0.488957019896E-01 -0.497054962133E-01 -0.505254763687E-01 - -0.513557705775E-01 -0.521965085735E-01 -0.530478217217E-01 -0.539098430398E-01 - -0.547827072184E-01 -0.556665506423E-01 -0.565615114116E-01 -0.574677293636E-01 - -0.583853460943E-01 -0.593145049806E-01 -0.602553512030E-01 -0.612080317677E-01 - -0.621726955301E-01 -0.631494932179E-01 -0.641385774545E-01 -0.651401027828E-01 - -0.661542256898E-01 -0.671811046303E-01 -0.682209000524E-01 -0.692737744221E-01 - -0.703398922486E-01 -0.714194201105E-01 -0.725125266812E-01 -0.736193827558E-01 - -0.747401612773E-01 -0.758750373639E-01 -0.770241883364E-01 -0.781877937454E-01 - -0.793660354000E-01 -0.805590973957E-01 -0.817671661434E-01 -0.829904303985E-01 - -0.842290812900E-01 -0.854833123510E-01 -0.867533195482E-01 -0.880393013131E-01 - -0.893414585725E-01 -0.906599947802E-01 -0.919951159485E-01 -0.933470306807E-01 - -0.947159502032E-01 -0.961020883988E-01 -0.975056618399E-01 -0.989268898224E-01 - -0.100365994400 -0.101823200419 -0.103298735551 -0.104792830335 - -0.106305718203 -0.107837635528 -0.109388821651 -0.110959518924 - -0.112549972747 -0.114160431605 -0.115791147105 -0.117442374021 - -0.119114370328 -0.120807397245 -0.122521719275 -0.124257604246 - -0.126015323354 -0.127795151202 -0.129597365848 -0.131422248843 - -0.133270085277 -0.135141163824 -0.137035776788 -0.138954220144 - -0.140896793589 -0.142863800586 -0.144855548410 -0.146872348199 - -0.148914515000 -0.150982367820 -0.153076229673 -0.155196427631 - -0.157343292876 -0.159517160749 -0.161718370805 -0.163947266863 - -0.166204197062 -0.168489513911 -0.170803574346 -0.173146739787 - -0.175519376190 -0.177921854106 -0.180354548738 -0.182817839999 - -0.185312112568 -0.187837755955 -0.190395164554 -0.192984737710 - -0.195606879776 -0.198262000178 -0.200950513476 -0.203672839428 - -0.206429403055 -0.209220634707 -0.212046970126 -0.214908850515 - -0.217806722603 -0.220741038718 -0.223712256850 -0.226720840723 - -0.229767259867 -0.232851989688 -0.235975511537 -0.239138312790 - -0.242340886912 -0.245583733541 -0.248867358556 -0.252192274155 - -0.255558998935 -0.258968057962 -0.262419982858 -0.265915311874 - -0.269454589971 -0.273038368901 -0.276667207291 -0.280341670720 - -0.284062331804 -0.287829770283 -0.291644573098 -0.295507334485 - -0.299418656053 -0.303379146874 -0.307389423570 -0.311450110401 - -0.315561839351 -0.319725250222 -0.323940990717 -0.328209716536 - -0.332532091465 -0.336908787466 -0.341340484768 -0.345827871964 - -0.350371646098 -0.354972512762 -0.359631186186 -0.364348389335 - -0.369124853999 -0.373961320892 -0.378858539738 -0.383817269375 - -0.388838277840 -0.393922342468 -0.399070249986 -0.404282796601 - -0.409560788098 -0.414905039931 -0.420316377315 -0.425795635314 - -0.431343658934 -0.436961303214 -0.442649433309 -0.448408924579 - -0.454240662674 -0.460145543617 -0.466124473889 -0.472178370500 - -0.478308161075 -0.484514783924 -0.490799188114 -0.497162333541 - -0.503605190988 -0.510128742196 -0.516733979917 -0.523421907964 - -0.530193541267 -0.537049905913 -0.543992039183 -0.551020989585 - -0.558137816883 -0.565343592111 -0.572639397588 -0.580026326919 - -0.587505484991 -0.595077987960 -0.602744963225 -0.610507549390 - -0.618366896224 -0.626324164598 -0.634380526413 -0.642537164515 - -0.650795272594 -0.659156055069 -0.667620726951 -0.676190513691 - -0.684866651009 -0.693650384702 -0.702542970427 -0.711545673465 - -0.720659768455 -0.729886539103 -0.739227277864 -0.748683285595 - -0.758255871165 -0.767946351046 -0.777756048857 -0.787686294872 - -0.797738425485 -0.807913782637 -0.818213713186 -0.828639568239 - -0.839192702424 -0.849874473107 -0.860686239555 -0.871629362029 - -0.882705200816 -0.893915115190 -0.905260462298 -0.916742595966 - -0.928362865421 -0.940122613932 -0.952023177348 -0.964065882543 - -0.976252045755 -0.988582970817 -1.00105994727 -1.01368424835 - -1.02645712885 -1.03937982286 -1.05245354131 -1.06567946944 - -1.07905876404 -1.09259255057 -1.10628192006 -1.12012792586 - -1.13413158017 -1.14829385038 -1.16261565520 -1.17709786051 - -1.19174127502 -1.20654664569 -1.22151465286 -1.23664590505 - -1.25194093363 -1.26740018699 -1.28302402455 -1.29881271035 - -1.31476640633 -1.33088516528 -1.34716892330 -1.36361749204 - -1.38023055036 -1.39700763571 -1.41394813495 -1.43105127484 - -1.44831611191 -1.46574152198 -1.48332618906 -1.50106859384 - -1.51896700151 -1.53701944917 -1.55522373251 -1.57357739208 - -1.59207769880 -1.61072163897 -1.62950589859 -1.64842684709 - -1.66748052042 -1.68666260343 -1.70596841165 -1.72539287244 - -1.74493050538 -1.76457540215 -1.78432120562 -1.80416108844 - -1.82408773091 -1.84409329832 -1.86416941769 -1.88430715400 - -1.90449698587 -1.92472878086 -1.94499177033 -1.96527452397 - -1.98556492413 -2.00585013987 -2.02611660103 -2.04634997233 - -2.06653512754 -2.08665612400 -2.10669617764 -2.12663763848 - -2.14646196701 -2.16614971161 -2.18568048708 -2.20503295477 - -2.22418480441 -2.24311273792 -2.26179245573 -2.28019864564 - -2.29830497488 -2.31608408563 -2.33350759440 -2.35054609586 - -2.36716917152 -2.38334540376 -2.39904239592 -2.41422679881 - -2.42886434452 -2.44291988792 -2.45635745680 -2.46914031110 - -2.48123101224 -2.49259150308 -2.50318319943 -2.51296709391 - -2.52190387294 -2.52995404775 -2.53707810010 -2.54323664379 - -2.54839060250 -2.55250140496 -2.55553119804 -2.55744307860 - -2.55820134465 -2.55777176648 -2.55612187808 -2.55322128934 - -2.54904201922 -2.54355884980 -2.53674970129 -2.52859602746 - -2.51908323087 -2.50820109716 -2.49594424696 -2.48231260388 - -2.46731187667 -2.45095405283 -2.43325790086 -2.41424947744 - -2.39396263533 -2.37243952709 -2.34973109881 -2.32589756734 - -2.30100887342 -2.27514510226 -2.24839686178 -2.22086560771 - -2.19266390333 -2.16391560019 -2.13475592487 -2.10533145483 - -2.07579996517 -2.04633012619 -2.01710102967 -1.98830152040 - -1.96012930749 -1.93278982840 -1.90649483737 -1.88146068872 - -1.85790628503 -1.83605066032 -1.81611016941 -1.79829525701 - -1.78280678442 -1.76983189745 -1.75953942893 -1.75207484099 - -1.74755473005 -1.74606093907 -1.74763435140 -1.75226847712 - -1.75990299000 -1.77041743150 -1.78362537071 -1.79926939758 - -1.81701743465 -1.83646098262 -1.85711607103 -1.87842787192 - -1.89978015569 -1.92051103067 -1.93993671843 -1.95738548285 - -1.97224426393 -1.98402107934 -1.99242686316 -1.99748113219 - -1.99967284813 -1.99999990846 -2.00000001587 -2.00000001441 - -2.00000001306 -2.00000001183 -2.00000001069 -2.00000000965 - -2.00000000870 -2.00000000783 -2.00000000704 -2.00000000632 - -2.00000000567 -2.00000000507 -2.00000000453 -2.00000000404 - -2.00000000360 -2.00000000320 -2.00000000284 -2.00000000252 - -2.00000000223 -2.00000000197 -2.00000000174 -2.00000000153 - -2.00000000134 -2.00000000118 -2.00000000103 -2.00000000090 - -2.00000000079 -2.00000000069 -2.00000000060 -2.00000000052 - -2.00000000045 -2.00000000039 -2.00000000034 -2.00000000029 - -2.00000000025 -2.00000000022 -2.00000000019 -2.00000000016 - -2.00000000014 -2.00000000012 -2.00000000010 -2.00000000009 - -2.00000000007 -2.00000000006 -2.00000000005 -2.00000000005 - -2.00000000004 -2.00000000003 -2.00000000003 -2.00000000002 - -2.00000000002 -2.00000000002 -2.00000000002 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 - Down Pseudopotential follows (l on next line) - 1 - -0.136130541247E-03 -0.273973393905E-03 -0.413550096195E-03 -0.554882457257E-03 - -0.697992560553E-03 -0.842902767322E-03 -0.989635720071E-03 -0.113821434612E-02 - -0.128866186116E-02 -0.144100177293E-02 -0.159525788484E-02 -0.175145429970E-02 - -0.190961542352E-02 -0.206976596928E-02 -0.223193096083E-02 -0.239613573675E-02 - -0.256240595437E-02 -0.273076759373E-02 -0.290124696167E-02 -0.307387069592E-02 - -0.324866576928E-02 -0.342565949381E-02 -0.360487952514E-02 -0.378635386672E-02 - -0.397011087429E-02 -0.415617926022E-02 -0.434458809806E-02 -0.453536682705E-02 - -0.472854525673E-02 -0.492415357160E-02 -0.512222233583E-02 -0.532278249803E-02 - -0.552586539612E-02 -0.573150276218E-02 -0.593972672744E-02 -0.615056982727E-02 - -0.636406500630E-02 -0.658024562356E-02 -0.679914545767E-02 -0.702079871212E-02 - -0.724524002065E-02 -0.747250445263E-02 -0.770262751853E-02 -0.793564517550E-02 - -0.817159383298E-02 -0.841051035836E-02 -0.865243208278E-02 -0.889739680695E-02 - -0.914544280703E-02 -0.939660884066E-02 -0.965093415295E-02 -0.990845848270E-02 - -0.101692220685E-01 -0.104332656552E-01 -0.107006304999E-01 -0.109713583790E-01 - -0.112454915941E-01 -0.115230729789E-01 -0.118041459061E-01 -0.120887542937E-01 - -0.123769426123E-01 -0.126687558918E-01 -0.129642397284E-01 -0.132634402921E-01 - -0.135664043333E-01 -0.138731791906E-01 -0.141838127982E-01 -0.144983536930E-01 - -0.148168510225E-01 -0.151393545523E-01 -0.154659146743E-01 -0.157965824137E-01 - -0.161314094381E-01 -0.164704480645E-01 -0.168137512682E-01 -0.171613726910E-01 - -0.175133666490E-01 -0.178697881418E-01 -0.182306928608E-01 -0.185961371978E-01 - -0.189661782539E-01 -0.193408738486E-01 -0.197202825284E-01 -0.201044635766E-01 - -0.204934770217E-01 -0.208873836477E-01 -0.212862450029E-01 -0.216901234098E-01 - -0.220990819748E-01 -0.225131845983E-01 -0.229324959841E-01 -0.233570816500E-01 - -0.237870079380E-01 -0.242223420245E-01 -0.246631519308E-01 -0.251095065338E-01 - -0.255614755768E-01 -0.260191296803E-01 -0.264825403532E-01 -0.269517800036E-01 - -0.274269219506E-01 -0.279080404354E-01 -0.283952106331E-01 -0.288885086641E-01 - -0.293880116067E-01 -0.298937975082E-01 -0.304059453981E-01 -0.309245352995E-01 - -0.314496482423E-01 -0.319813662754E-01 -0.325197724800E-01 -0.330649509819E-01 - -0.336169869655E-01 -0.341759666862E-01 -0.347419774846E-01 -0.353151077998E-01 - -0.358954471834E-01 -0.364830863130E-01 -0.370781170071E-01 -0.376806322391E-01 - -0.382907261514E-01 -0.389084940711E-01 -0.395340325237E-01 -0.401674392493E-01 - -0.408088132170E-01 -0.414582546408E-01 -0.421158649954E-01 -0.427817470314E-01 - -0.434560047922E-01 -0.441387436294E-01 -0.448300702201E-01 -0.455300925827E-01 - -0.462389200946E-01 -0.469566635088E-01 -0.476834349710E-01 -0.484193480379E-01 - -0.491645176940E-01 -0.499190603703E-01 -0.506830939621E-01 -0.514567378475E-01 - -0.522401129060E-01 -0.530333415376E-01 -0.538365476815E-01 -0.546498568360E-01 - -0.554733960775E-01 -0.563072940808E-01 -0.571516811391E-01 -0.580066891842E-01 - -0.588724518072E-01 -0.597491042793E-01 -0.606367835730E-01 -0.615356283836E-01 - -0.624457791506E-01 -0.633673780796E-01 -0.643005691648E-01 -0.652454982114E-01 - -0.662023128582E-01 -0.671711626006E-01 -0.681521988143E-01 -0.691455747785E-01 - -0.701514457002E-01 -0.711699687382E-01 -0.722013030276E-01 -0.732456097049E-01 - -0.743030519326E-01 -0.753737949255E-01 -0.764580059756E-01 -0.775558544788E-01 - -0.786675119613E-01 -0.797931521058E-01 -0.809329507793E-01 -0.820870860603E-01 - -0.832557382661E-01 -0.844390899817E-01 -0.856373260878E-01 -0.868506337897E-01 - -0.880792026466E-01 -0.893232246011E-01 -0.905828940088E-01 -0.918584076694E-01 - -0.931499648565E-01 -0.944577673492E-01 -0.957820194633E-01 -0.971229280832E-01 - -0.984807026942E-01 -0.998555554151E-01 -0.101247701031 -0.102657357027 - -0.104084743623 -0.105530083805 -0.106993603363 -0.108475530926 - -0.109976097993 -0.111495538978 -0.113034091235 -0.114591995105 - -0.116169493948 -0.117766834181 -0.119384265320 -0.121022040013 - -0.122680414083 -0.124359646570 -0.126059999764 -0.127781739253 - -0.129525133958 -0.131290456182 -0.133077981645 -0.134887989530 - -0.136720762526 -0.138576586873 -0.140455752403 -0.142358552587 - -0.144285284582 -0.146236249272 -0.148211751321 -0.150212099212 - -0.152237605304 -0.154288585871 -0.156365361155 -0.158468255419 - -0.160597596988 -0.162753718307 -0.164936955990 -0.167147650867 - -0.169386148044 -0.171652796951 -0.173947951396 -0.176271969619 - -0.178625214346 -0.181008052849 -0.183420856993 -0.185864003302 - -0.188337873009 -0.190842852117 -0.193379331458 -0.195947706749 - -0.198548378654 -0.201181752845 -0.203848240061 -0.206548256169 - -0.209282222228 -0.212050564552 -0.214853714772 -0.217692109900 - -0.220566192396 -0.223476410229 -0.226423216949 -0.229407071748 - -0.232428439529 -0.235487790977 -0.238585602620 -0.241722356908 - -0.244898542271 -0.248114653200 -0.251371190309 -0.254668660413 - -0.258007576595 -0.261388458279 -0.264811831304 -0.268278227998 - -0.271788187249 -0.275342254579 -0.278940982222 -0.282584929195 - -0.286274661374 -0.290010751570 -0.293793779606 -0.297624332390 - -0.301503003992 -0.305430395720 -0.309407116200 -0.313433781445 - -0.317511014937 -0.321639447701 -0.325819718382 -0.330052473318 - -0.334338366620 -0.338678060242 -0.343072224059 -0.347521535938 - -0.352026681815 -0.356588355764 -0.361207260069 -0.365884105297 - -0.370619610363 -0.375414502603 -0.380269517833 -0.385185400424 - -0.390162903355 -0.395202788280 -0.400305825584 -0.405472794442 - -0.410704482868 -0.416001687772 -0.421365215003 -0.426795879392 - -0.432294504799 -0.437861924142 -0.443498979436 -0.449206521813 - -0.454985411553 -0.460836518092 -0.466760720040 -0.472758905183 - -0.478831970478 -0.484980822051 -0.491206375171 -0.497509554231 - -0.503891292711 -0.510352533132 -0.516894227005 -0.523517334760 - -0.530222825677 -0.537011677785 -0.543884877768 -0.550843420841 - -0.557888310622 -0.565020558976 -0.572241185853 -0.579551219101 - -0.586951694262 -0.594443654341 -0.602028149565 -0.609706237103 - -0.617478980774 -0.625347450718 -0.633312723047 -0.641375879459 - -0.649538006823 -0.657800196730 -0.666163545004 -0.674629151185 - -0.683198117955 -0.691871550535 -0.700650556032 -0.709536242734 - -0.718529719356 -0.727632094237 -0.736844474470 -0.746167964978 - -0.755603667527 -0.765152679665 -0.774816093594 -0.784594994967 - -0.794490461602 -0.804503562116 -0.814635354466 -0.824886884397 - -0.835259183800 -0.845753268950 -0.856370138650 -0.867110772254 - -0.877976127565 -0.888967138614 -0.900084713300 -0.911329730890 - -0.922703039374 -0.934205452663 -0.945837747629 -0.957600660968 - -0.969494885896 -0.981521068645 -0.993679804780 -1.00597163530 - -1.01839704253 -1.03095644580 -1.04365019689 -1.05647857521 - -1.06944178278 -1.08253993888 -1.09577307453 -1.10914112656 - -1.12264393152 -1.13628121920 -1.15005260587 -1.16395758719 - -1.17799553081 -1.19216566863 -1.20646708864 -1.22089872654 - -1.23545935684 -1.25014758369 -1.26496183131 -1.27990033396 - -1.29496112564 -1.31014202931 -1.32544064568 -1.34085434172 - -1.35638023865 -1.37201519959 -1.38775581681 -1.40359839862 - -1.41953895579 -1.43557318777 -1.45169646838 -1.46790383135 - -1.48418995542 -1.50054914928 -1.51697533619 -1.53346203845 - -1.55000236173 -1.56658897928 -1.58321411610 -1.59986953318 - -1.61654651181 -1.63323583811 -1.64992778781 -1.66661211148 - -1.68327802026 -1.69991417217 -1.71650865927 -1.73304899575 - -1.74952210710 -1.76591432056 -1.78221135711 -1.79839832514 - -1.81445971605 -1.83037940206 -1.84614063652 -1.86172605688 - -1.87711769085 -1.89229696586 -1.90724472234 -1.92194123103 - -1.93636621491 -1.95049887596 -1.96431792731 -1.97780163116 - -1.99092784300 -2.00367406251 -2.01601749173 -2.02793510095 - -2.03940370278 -2.05040003501 -2.06090085266 -2.07088302977 - -2.08032367139 -2.08920023617 -2.09749067004 -2.10517355129 - -2.11222824732 -2.11863508341 -2.12437552349 -2.12943236308 - -2.13378993425 -2.13743432227 -2.14035359367 -2.14253803497 - -2.14398040128 -2.14467617353 -2.14462382298 -2.14382508123 - -2.14228521337 -2.14001329189 -2.13702246807 -2.13333023718 - -2.12895869340 -2.12393476939 -2.11829045502 -2.11206298885 - -2.10529501515 -2.09803469854 -2.09033578715 -2.08225761461 - -2.07386502991 -2.06522824351 -2.05642257719 -2.04752810398 - -2.03862916446 -2.02981374473 -2.02117270151 -2.01279881991 - -2.00478569029 -1.99722639192 -1.99021197376 -1.98382972566 - -1.97816123883 -1.97328026028 -1.96925035553 -1.96612240480 - -1.96393197306 -1.96269661302 -1.96241318385 -1.96305529778 - -1.96457104347 -1.96688117982 -1.96987804864 -1.97342552174 - -1.97736037848 -1.98149560791 -1.98562624689 -1.98953850677 - -1.99302311021 -1.99589396179 -1.99801351736 -1.99937570793 - -1.99991758633 -2.00000016366 -2.00000001471 -2.00000001335 - -2.00000001211 -2.00000001096 -2.00000000991 -2.00000000895 - -2.00000000807 -2.00000000726 -2.00000000653 -2.00000000586 - -2.00000000525 -2.00000000470 -2.00000000420 -2.00000000375 - -2.00000000334 -2.00000000297 -2.00000000263 -2.00000000234 - -2.00000000207 -2.00000000183 -2.00000000161 -2.00000000142 - -2.00000000125 -2.00000000109 -2.00000000096 -2.00000000084 - -2.00000000073 -2.00000000064 -2.00000000056 -2.00000000048 - -2.00000000042 -2.00000000036 -2.00000000031 -2.00000000027 - -2.00000000023 -2.00000000020 -2.00000000017 -2.00000000015 - -2.00000000013 -2.00000000011 -2.00000000009 -2.00000000008 - -2.00000000007 -2.00000000006 -2.00000000005 -2.00000000004 - -2.00000000004 -2.00000000003 -2.00000000003 -2.00000000002 - -2.00000000002 -2.00000000002 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 - Down Pseudopotential follows (l on next line) - 2 - -0.119484445649E-03 -0.240471820603E-03 -0.362981029380E-03 -0.487031214288E-03 - -0.612641758414E-03 -0.739832288657E-03 -0.868622678788E-03 -0.999033052560E-03 - -0.113108378685E-02 -0.126479551485E-02 -0.140018912928E-02 -0.153728578566E-02 - -0.167610690561E-02 -0.181667418020E-02 -0.195900957334E-02 -0.210313532521E-02 - -0.224907395576E-02 -0.239684826816E-02 -0.254648135245E-02 -0.269799658908E-02 - -0.285141765260E-02 -0.300676851535E-02 -0.316407345120E-02 -0.332335703935E-02 - -0.348464416816E-02 -0.364796003906E-02 -0.381333017046E-02 -0.398078040175E-02 - -0.415033689736E-02 -0.432202615081E-02 -0.449587498886E-02 -0.467191057572E-02 - -0.485016041728E-02 -0.503065236541E-02 -0.521341462232E-02 -0.539847574493E-02 - -0.558586464941E-02 -0.577561061559E-02 -0.596774329165E-02 -0.616229269866E-02 - -0.635928923531E-02 -0.655876368268E-02 -0.676074720899E-02 -0.696527137455E-02 - -0.717236813661E-02 -0.738206985440E-02 -0.759440929420E-02 -0.780941963441E-02 - -0.802713447077E-02 -0.824758782160E-02 -0.847081413312E-02 -0.869684828482E-02 - -0.892572559491E-02 -0.915748182587E-02 -0.939215318999E-02 -0.962977635507E-02 - -0.987038845011E-02 -0.101140270712E-01 -0.103607302871E-01 -0.106105366458E-01 - -0.108634851798E-01 -0.111196154128E-01 -0.113789673655E-01 -0.116415815620E-01 - -0.119074990363E-01 -0.121767613383E-01 -0.124494105407E-01 -0.127254892452E-01 - -0.130050405897E-01 -0.132881082545E-01 -0.135747364691E-01 -0.138649700198E-01 - -0.141588542559E-01 -0.144564350972E-01 -0.147577590412E-01 -0.150628731700E-01 - -0.153718251582E-01 -0.156846632800E-01 -0.160014364166E-01 -0.163221940643E-01 - -0.166469863418E-01 -0.169758639983E-01 -0.173088784214E-01 -0.176460816449E-01 - -0.179875263572E-01 -0.183332659094E-01 -0.186833543236E-01 -0.190378463016E-01 - -0.193967972330E-01 -0.197602632042E-01 -0.201283010073E-01 -0.205009681483E-01 - -0.208783228569E-01 -0.212604240950E-01 -0.216473315662E-01 -0.220391057252E-01 - -0.224358077868E-01 -0.228374997361E-01 -0.232442443376E-01 -0.236561051455E-01 - -0.240731465132E-01 -0.244954336036E-01 -0.249230323992E-01 -0.253560097126E-01 - -0.257944331965E-01 -0.262383713548E-01 -0.266878935528E-01 -0.271430700285E-01 - -0.276039719033E-01 -0.280706711931E-01 -0.285432408197E-01 -0.290217546219E-01 - -0.295062873676E-01 -0.299969147649E-01 -0.304937134741E-01 -0.309967611199E-01 - -0.315061363032E-01 -0.320219186137E-01 -0.325441886421E-01 -0.330730279926E-01 - -0.336085192961E-01 -0.341507462225E-01 -0.346997934944E-01 -0.352557468998E-01 - -0.358186933059E-01 -0.363887206722E-01 -0.369659180649E-01 -0.375503756702E-01 - -0.381421848086E-01 -0.387414379495E-01 -0.393482287250E-01 -0.399626519450E-01 - -0.405848036120E-01 -0.412147809358E-01 -0.418526823489E-01 -0.424986075219E-01 - -0.431526573789E-01 -0.438149341134E-01 -0.444855412044E-01 -0.451645834321E-01 - -0.458521668947E-01 -0.465483990248E-01 -0.472533886062E-01 -0.479672457910E-01 - -0.486900821165E-01 -0.494220105230E-01 -0.501631453711E-01 -0.509136024598E-01 - -0.516734990445E-01 -0.524429538552E-01 -0.532220871152E-01 -0.540110205600E-01 - -0.548098774559E-01 -0.556187826195E-01 -0.564378624371E-01 -0.572672448849E-01 - -0.581070595480E-01 -0.589574376416E-01 -0.598185120310E-01 -0.606904172524E-01 - -0.615732895340E-01 -0.624672668170E-01 -0.633724887777E-01 -0.642890968486E-01 - -0.652172342410E-01 -0.661570459671E-01 -0.671086788627E-01 -0.680722816102E-01 - -0.690480047616E-01 -0.700360007622E-01 -0.710364239741E-01 -0.720494307008E-01 - -0.730751792110E-01 -0.741138297636E-01 -0.751655446329E-01 -0.762304881333E-01 - -0.773088266455E-01 -0.784007286424E-01 -0.795063647149E-01 -0.806259075991E-01 - -0.817595322027E-01 -0.829074156327E-01 -0.840697372229E-01 -0.852466785616E-01 - -0.864384235202E-01 -0.876451582818E-01 -0.888670713701E-01 -0.901043536789E-01 - -0.913571985016E-01 -0.926258015616E-01 -0.939103610428E-01 -0.952110776201E-01 - -0.965281544910E-01 -0.978617974071E-01 -0.992122147061E-01 -0.100579617344 - -0.101964218929 -0.103366235753 -0.104785886827 -0.106223393913 - -0.107678981560 -0.109152877141 -0.110645310884 -0.112156515908 - -0.113686728265 -0.115236186970 -0.116805134040 -0.118393814536 - -0.120002476593 -0.121631371466 -0.123280753563 -0.124950880489 - -0.126642013083 -0.128354415460 -0.130088355052 -0.131844102646 - -0.133621932432 -0.135422122038 -0.137244952581 -0.139090708702 - -0.140959678617 -0.142852154157 -0.144768430815 -0.146708807790 - -0.148673588036 -0.150663078303 -0.152677589191 -0.154717435192 - -0.156782934743 -0.158874410270 -0.160992188240 -0.163136599211 - -0.165307977882 -0.167506663144 -0.169732998132 -0.171987330276 - -0.174270011355 -0.176581397552 -0.178921849503 -0.181291732356 - -0.183691415825 -0.186121274247 -0.188581686633 -0.191073036733 - -0.193595713087 -0.196150109087 -0.198736623031 -0.201355658191 - -0.204007622862 -0.206692930433 -0.209411999439 -0.212165253630 - -0.214953122028 -0.217776038993 -0.220634444285 -0.223528783130 - -0.226459506281 -0.229427070086 -0.232431936552 -0.235474573413 - -0.238555454195 -0.241675058284 -0.244833870992 -0.248032383630 - -0.251271093569 -0.254550504316 -0.257871125580 -0.261233473341 - -0.264638069924 -0.268085444066 -0.271576130987 -0.275110672463 - -0.278689616898 -0.282313519390 -0.285982941810 -0.289698452870 - -0.293460628193 -0.297270050389 -0.301127309124 -0.305033001194 - -0.308987730593 -0.312992108588 -0.317046753787 -0.321152292212 - -0.325309357368 -0.329518590312 -0.333780639723 -0.338096161968 - -0.342465821172 -0.346890289283 -0.351370246136 -0.355906379518 - -0.360499385230 -0.365149967147 -0.369858837278 -0.374626715825 - -0.379454331232 -0.384342420245 -0.389291727957 -0.394303007858 - -0.399377021878 -0.404514540430 -0.409716342444 -0.414983215407 - -0.420315955386 -0.425715367058 -0.431182263729 -0.436717467347 - -0.442321808516 -0.447996126498 -0.453741269207 -0.459558093205 - -0.465447463681 -0.471410254426 -0.477447347801 -0.483559634696 - -0.489748014473 -0.496013394905 -0.502356692105 -0.508778830435 - -0.515280742411 -0.521863368590 -0.528527657443 -0.535274565213 - -0.542105055756 -0.549020100366 -0.556020677581 -0.563107772966 - -0.570282378881 -0.577545494219 -0.584898124132 -0.592341279713 - -0.599875977674 -0.607503239975 -0.615224093436 -0.623039569313 - -0.630950702837 -0.638958532721 -0.647064100629 -0.655268450598 - -0.663572628430 -0.671977681023 -0.680484655667 -0.689094599283 - -0.697808557608 -0.706627574327 -0.715552690144 -0.724584941786 - -0.733725360943 -0.742974973143 -0.752334796541 -0.761805840640 - -0.771389104926 -0.781085577414 -0.790896233103 -0.800822032341 - -0.810863919077 -0.821022819017 -0.831299637665 -0.841695258242 - -0.852210539484 -0.862846313316 -0.873603382382 -0.884482517437 - -0.895484454587 -0.906609892376 -0.917859488710 -0.929233857606 - -0.940733565768 -0.952359128972 -0.964111008263 -0.975989605944 - -0.987995261361 -1.00012824646 -1.01238876113 -1.02477692831 - -1.03729278881 -1.04993629596 -1.06270730993 -1.07560559180 - -1.08863079736 -1.10178247062 -1.11506003702 -1.12846279632 - -1.14198991527 -1.15564041981 -1.16941318711 -1.18330693716 - -1.19732022411 -1.21145142723 -1.22569874156 -1.24006016818 - -1.25453350421 -1.26911633242 -1.28380601051 -1.29859966013 - -1.31349415547 -1.32848611167 -1.34357187284 -1.35874749986 - -1.37400875793 -1.38935110383 -1.40476967306 -1.42025926679 - -1.43581433862 -1.45142898139 -1.46709691381 -1.48281146722 - -1.49856557242 -1.51435174663 -1.53016208071 -1.54598822674 - -1.56182138598 -1.57765229742 -1.59347122692 -1.60926795726 - -1.62503177897 -1.64075148236 -1.65641535078 -1.67201115531 - -1.68752615108 -1.70294707548 -1.71826014841 -1.73345107488 - -1.74850505017 -1.76340676790 -1.77814043122 -1.79268976745 - -1.80703804660 -1.82116810389 -1.83506236690 -1.84870288752 - -1.86207137909 -1.87514925930 -1.88791769902 -1.90035767758 - -1.91245004495 -1.92417559110 -1.93551512300 -1.94644954962 - -1.95695997528 -1.96702780173 -1.97663483902 -1.98576342576 - -1.99439655853 -2.00251803085 -2.01011258144 -2.01716605191 - -2.02366555334 -2.02959964160 -2.03495850066 -2.03973413318 - -2.04392055727 -2.04751400830 -2.05051314393 -2.05291925071 - -2.05473644972 -2.05597189871 -2.05663598747 -2.05674252293 - -2.05630889960 -2.05535625082 -2.05390957528 -2.05199783293 - -2.04965400362 -2.04691510106 -2.04382213423 -2.04042000767 - -2.03675735125 -2.03288627011 -2.02886200443 -2.02474248914 - -2.02058780338 -2.01645950029 -2.01241980842 -2.00853069774 - -2.00485280558 -2.00144422086 -1.99835912979 -1.99564633185 - -1.99334764297 -1.99149621264 -1.99011479470 -1.98921402759 - -1.98879080005 -1.98882680336 -1.98928740206 -1.99012099306 - -1.99125906914 -1.99261725937 -1.99409768678 -1.99559306622 - -1.99699306407 -1.99819356069 -1.99917387050 -1.99973594752 - -1.99996465494 -2.00000014812 -2.00000001365 -2.00000001239 - -2.00000001123 -2.00000001017 -2.00000000920 -2.00000000830 - -2.00000000748 -2.00000000674 -2.00000000606 -2.00000000544 - -2.00000000487 -2.00000000436 -2.00000000390 -2.00000000348 - -2.00000000310 -2.00000000275 -2.00000000244 -2.00000000217 - -2.00000000192 -2.00000000169 -2.00000000149 -2.00000000132 - -2.00000000116 -2.00000000102 -2.00000000089 -2.00000000078 - -2.00000000068 -2.00000000059 -2.00000000052 -2.00000000045 - -2.00000000039 -2.00000000034 -2.00000000029 -2.00000000025 - -2.00000000022 -2.00000000019 -2.00000000016 -2.00000000014 - -2.00000000012 -2.00000000010 -2.00000000009 -2.00000000007 - -2.00000000006 -2.00000000005 -2.00000000005 -2.00000000004 - -2.00000000003 -2.00000000003 -2.00000000002 -2.00000000002 - -2.00000000002 -2.00000000002 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 - Down Pseudopotential follows (l on next line) - 3 - -0.111619570255E-03 -0.224643141861E-03 -0.339088374976E-03 -0.454973151894E-03 - -0.572315579843E-03 -0.691133993809E-03 -0.811446959404E-03 -0.933273275767E-03 - -0.105663197850E-02 -0.118154234264E-02 -0.130802388569E-02 -0.143609637062E-02 - -0.156577980902E-02 -0.169709446418E-02 -0.183006085426E-02 -0.196469975553E-02 - -0.210103220557E-02 -0.223907950660E-02 -0.237886322878E-02 -0.252040521357E-02 - -0.266372757718E-02 -0.280885271402E-02 -0.295580330017E-02 -0.310460229692E-02 - -0.325527295441E-02 -0.340783881522E-02 -0.356232371804E-02 -0.371875180145E-02 - -0.387714750761E-02 -0.403753558616E-02 -0.419994109803E-02 -0.436438941940E-02 - -0.453090624560E-02 -0.469951759521E-02 -0.487024981407E-02 -0.504312957938E-02 - -0.521818390394E-02 -0.539544014029E-02 -0.557492598506E-02 -0.575666948322E-02 - -0.594069903252E-02 -0.612704338791E-02 -0.631573166603E-02 -0.650679334976E-02 - -0.670025829281E-02 -0.689615672443E-02 -0.709451925408E-02 -0.729537687626E-02 - -0.749876097531E-02 -0.770470333035E-02 -0.791323612021E-02 -0.812439192851E-02 - -0.833820374869E-02 -0.855470498920E-02 -0.877392947871E-02 -0.899591147142E-02 - -0.922068565236E-02 -0.944828714288E-02 -0.967875150605E-02 -0.991211475231E-02 - -0.101484133450E-01 -0.103876842062E-01 -0.106299647223E-01 -0.108752927501E-01 - -0.111237066223E-01 -0.113752451541E-01 -0.116299476486E-01 -0.118878539036E-01 - -0.121490042172E-01 -0.124134393946E-01 -0.126812007541E-01 -0.129523301337E-01 - -0.132268698979E-01 -0.135048629439E-01 -0.137863527083E-01 -0.140713831744E-01 - -0.143599988785E-01 -0.146522449172E-01 -0.149481669543E-01 -0.152478112279E-01 - -0.155512245578E-01 -0.158584543526E-01 -0.161695486175E-01 -0.164845559611E-01 - -0.168035256038E-01 -0.171265073848E-01 -0.174535517704E-01 -0.177847098615E-01 - -0.181200334019E-01 -0.184595747863E-01 -0.188033870682E-01 -0.191515239686E-01 - -0.195040398841E-01 -0.198609898957E-01 -0.202224297770E-01 -0.205884160032E-01 - -0.209590057599E-01 -0.213342569519E-01 -0.217142282126E-01 -0.220989789124E-01 - -0.224885691690E-01 -0.228830598559E-01 -0.232825126124E-01 -0.236869898532E-01 - -0.240965547779E-01 -0.245112713811E-01 -0.249312044622E-01 -0.253564196360E-01 - -0.257869833422E-01 -0.262229628564E-01 -0.266644263003E-01 -0.271114426525E-01 - -0.275640817593E-01 -0.280224143453E-01 -0.284865120247E-01 -0.289564473127E-01 - -0.294322936364E-01 -0.299141253464E-01 -0.304020177286E-01 -0.308960470158E-01 - -0.313962903996E-01 -0.319028260427E-01 -0.324157330906E-01 -0.329350916844E-01 - -0.334609829734E-01 -0.339934891272E-01 -0.345326933492E-01 -0.350786798893E-01 - -0.356315340568E-01 -0.361913422343E-01 -0.367581918907E-01 -0.373321715951E-01 - -0.379133710307E-01 -0.385018810084E-01 -0.390977934815E-01 -0.397012015599E-01 - -0.403121995243E-01 -0.409308828416E-01 -0.415573481790E-01 -0.421916934198E-01 - -0.428340176783E-01 -0.434844213155E-01 -0.441430059545E-01 -0.448098744967E-01 - -0.454851311374E-01 -0.461688813828E-01 -0.468612320656E-01 -0.475622913626E-01 - -0.482721688109E-01 -0.489909753250E-01 -0.497188232148E-01 -0.504558262024E-01 - -0.512020994403E-01 -0.519577595292E-01 -0.527229245360E-01 -0.534977140129E-01 - -0.542822490153E-01 -0.550766521212E-01 -0.558810474501E-01 -0.566955606825E-01 - -0.575203190796E-01 -0.583554515028E-01 -0.592010884341E-01 -0.600573619966E-01 - -0.609244059749E-01 -0.618023558359E-01 -0.626913487502E-01 -0.635915236132E-01 - -0.645030210674E-01 -0.654259835234E-01 -0.663605551829E-01 -0.673068820609E-01 - -0.682651120086E-01 -0.692353947361E-01 -0.702178818365E-01 -0.712127268086E-01 - -0.722200850818E-01 -0.732401140395E-01 -0.742729730443E-01 -0.753188234625E-01 - -0.763778286893E-01 -0.774501541744E-01 -0.785359674477E-01 -0.796354381455E-01 - -0.807487380368E-01 -0.818760410502E-01 -0.830175233011E-01 -0.841733631190E-01 - -0.853437410751E-01 -0.865288400109E-01 -0.877288450664E-01 -0.889439437088E-01 - -0.901743257622E-01 -0.914201834365E-01 -0.926817113579E-01 -0.939591065989E-01 - -0.952525687090E-01 -0.965622997459E-01 -0.978885043067E-01 -0.992313895600E-01 - -0.100591165278 -0.101968043869 -0.103362240410 -0.104773972683 - -0.106203461203 -0.107650929259 -0.109116602943 -0.110600711189 - -0.112103485807 -0.113625161518 -0.115165975994 -0.116726169889 - -0.118305986882 -0.119905673712 -0.121525480217 -0.123165659371 - -0.124826467326 -0.126508163450 -0.128211010366 -0.129935273994 - -0.131681223595 -0.133449131805 -0.135239274685 -0.137051931759 - -0.138887386058 -0.140745924164 -0.142627836255 -0.144533416147 - -0.146462961342 -0.148416773073 -0.150395156347 -0.152398419999 - -0.154426876730 -0.156480843163 -0.158560639888 -0.160666591508 - -0.162799026694 -0.164958278234 -0.167144683079 -0.169358582400 - -0.171600321636 -0.173870250548 -0.176168723273 -0.178496098373 - -0.180852738895 -0.183239012423 -0.185655291130 -0.188101951841 - -0.190579376082 -0.193087950142 -0.195628065130 -0.198200117030 - -0.200804506763 -0.203441640245 -0.206111928447 -0.208815787455 - -0.211553638534 -0.214325908183 -0.217133028204 -0.219975435763 - -0.222853573449 -0.225767889343 -0.228718837079 -0.231706875911 - -0.234732470777 -0.237796092365 -0.240898217178 -0.244039327604 - -0.247219911978 -0.250440464655 -0.253701486075 -0.257003482830 - -0.260346967736 -0.263732459898 -0.267160484785 -0.270631574291 - -0.274146266813 -0.277705107316 -0.281308647404 -0.284957445390 - -0.288652066366 -0.292393082274 -0.296181071975 -0.300016621320 - -0.303900323215 -0.307832777700 -0.311814592006 -0.315846380634 - -0.319928765417 -0.324062375588 -0.328247847851 -0.332485826441 - -0.336776963195 -0.341121917609 -0.345521356908 -0.349975956103 - -0.354486398054 -0.359053373524 -0.363677581240 -0.368359727948 - -0.373100528462 -0.377900705715 -0.382760990810 -0.387682123063 - -0.392664850043 -0.397709927613 -0.402818119964 -0.407990199646 - -0.413226947598 -0.418529153164 -0.423897614118 -0.429333136672 - -0.434836535483 -0.440408633656 -0.446050262737 -0.451762262700 - -0.457545481928 -0.463400777185 -0.469329013576 -0.475331064508 - -0.481407811628 -0.487560144759 -0.493788961826 -0.500095168761 - -0.506479679407 -0.512943415398 -0.519487306033 -0.526112288128 - -0.532819305855 -0.539609310564 -0.546483260585 -0.553442121007 - -0.560486863446 -0.567618465780 -0.574837911863 -0.582146191219 - -0.589544298704 -0.597033234141 -0.604614001925 -0.612287610596 - -0.620055072378 -0.627917402684 -0.635875619579 -0.643930743208 - -0.652083795177 -0.660335797890 -0.668687773840 -0.677140744851 - -0.685695731260 -0.694353751050 -0.703115818921 -0.711982945298 - -0.720956135272 -0.730036387475 -0.739224692876 -0.748522033506 - -0.757929381094 -0.767447695623 -0.777077923794 -0.786820997395 - -0.796677831567 -0.806649322968 -0.816736347829 -0.826939759888 - -0.837260388205 -0.847699034856 -0.858256472481 -0.868933441701 - -0.879730648391 -0.890648760790 -0.901688406460 -0.912850169074 - -0.924134585033 -0.935542139897 -0.947073264630 -0.958728331649 - -0.970507650666 -0.982411464322 -0.994439943592 -1.00659318297 - -1.01887119543 -1.03127390710 -1.04380115174 -1.05645266491 - -1.06922807792 -1.08212691146 -1.09514856898 -1.10829232979 - -1.12155734179 -1.13494261405 -1.14844700891 -1.16206923394 - -1.17580783344 -1.18966117976 -1.20362746421 -1.21770468773 - -1.23189065119 -1.24618294546 -1.26057894107 -1.27507577774 - -1.28967035347 -1.30435931350 -1.31913903893 -1.33400563518 - -1.34895492019 -1.36398241252 -1.37908331925 -1.39425252381 - -1.40948457374 -1.42477366846 -1.44011364706 -1.45549797622 - -1.47091973832 -1.48637161976 -1.50184589969 -1.51733443911 - -1.53282867058 -1.54831958851 -1.56379774030 -1.57925321836 - -1.59467565322 -1.61005420784 -1.62537757337 -1.64063396644 - -1.65581112829 -1.67089632588 -1.68587635530 -1.70073754755 - -1.71546577717 -1.73004647386 -1.74446463738 -1.75870485610 - -1.77275132946 -1.78658789470 -1.80019805816 -1.81356503154 - -1.82667177347 -1.83950103669 -1.85203542125 -1.86425743410 - -1.87614955535 -1.88769431155 -1.89887435629 -1.90967255846 - -1.92007209834 -1.93005657161 -1.93961010171 -1.94871746025 - -1.95736419569 -1.96553677004 -1.97322270331 -1.98041072541 - -1.98709093479 -1.99325496322 -1.99889614556 -2.00400969353 - -2.00859287178 -2.01264517460 -2.01616850114 -2.01916732657 - -2.02164886640 -2.02362323052 -2.02510356316 -2.02610616461 - -2.02665058962 -2.02675971746 -2.02645978733 -2.02578039308 - -2.02475442998 -2.02341798628 -2.02181017171 -2.01997287488 - -2.01795044134 -2.01578926438 -2.01353728081 -2.01124336503 - -2.00895661586 -2.00672553267 -2.00459707998 -2.00261564368 - -2.00082188694 -1.99925152038 -1.99793400978 -1.99689125513 - -1.99613628865 -1.99567205615 -1.99549036741 -1.99557112714 - -1.99588199005 -1.99637862261 -1.99700580137 -1.99769963559 - -1.99839127112 -1.99908294242 -1.99957256569 -1.99986106869 - -1.99998115880 -2.00000013158 -2.00000001268 -2.00000001151 - -2.00000001043 -2.00000000944 -2.00000000854 -2.00000000771 - -2.00000000695 -2.00000000626 -2.00000000562 -2.00000000505 - -2.00000000452 -2.00000000405 -2.00000000362 -2.00000000323 - -2.00000000287 -2.00000000256 -2.00000000227 -2.00000000201 - -2.00000000178 -2.00000000157 -2.00000000139 -2.00000000122 - -2.00000000107 -2.00000000094 -2.00000000083 -2.00000000072 - -2.00000000063 -2.00000000055 -2.00000000048 -2.00000000042 - -2.00000000036 -2.00000000031 -2.00000000027 -2.00000000023 - -2.00000000020 -2.00000000017 -2.00000000015 -2.00000000013 - -2.00000000011 -2.00000000009 -2.00000000008 -2.00000000007 - -2.00000000006 -2.00000000005 -2.00000000004 -2.00000000004 - -2.00000000003 -2.00000000003 -2.00000000002 -2.00000000002 - -2.00000000002 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000001 -2.00000000001 -2.00000000001 -2.00000000001 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 -2.00000000000 - -2.00000000000 -2.00000000000 -2.00000000000 - Core charge follows - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 - Valence charge follows - 0.192859942394E-08 0.781173797153E-08 0.177986530177E-07 0.320429777590E-07 - 0.507028602581E-07 0.739410855989E-07 0.101925201233E-06 0.134827645597E-06 - 0.172825880089E-06 0.216102524489E-06 0.264845495903E-06 0.319248151340E-06 - 0.379509433995E-06 0.445834023349E-06 0.518432489170E-06 0.597521449530E-06 - 0.683323732926E-06 0.776068544625E-06 0.875991637323E-06 0.983335486252E-06 - 0.109834946882E-05 0.122129004895E-05 0.135242096614E-05 0.149201342952E-05 - 0.164034631684E-05 0.179770637873E-05 0.196438844814E-05 0.214069565534E-05 - 0.232693964833E-05 0.252344081913E-05 0.273052853577E-05 0.294854138044E-05 - 0.317782739366E-05 0.341874432486E-05 0.367165988941E-05 0.393695203229E-05 - 0.421500919859E-05 0.450623061099E-05 0.481102655440E-05 0.512981866796E-05 - 0.546304024460E-05 0.581113653829E-05 0.617456507923E-05 0.655379599720E-05 - 0.694931235324E-05 0.736161047981E-05 0.779120032985E-05 0.823860583470E-05 - 0.870436527134E-05 0.918903163903E-05 0.969317304571E-05 0.102173731042E-04 - 0.107622313389E-04 0.113283636025E-04 0.119164025038E-04 0.125269978465E-04 - 0.131608170789E-04 0.138185457558E-04 0.145008880115E-04 0.152085670456E-04 - 0.159423256210E-04 0.167029265745E-04 0.174911533412E-04 0.183078104914E-04 - 0.191537242818E-04 0.200297432214E-04 0.209367386506E-04 0.218756053360E-04 - 0.228472620808E-04 0.238526523500E-04 0.248927449119E-04 0.259685344964E-04 - 0.270810424697E-04 0.282313175266E-04 0.294204364004E-04 0.306495045908E-04 - 0.319196571109E-04 0.332320592526E-04 0.345879073726E-04 0.359884296973E-04 - 0.374348871494E-04 0.389285741946E-04 0.404708197112E-04 0.420629878802E-04 - 0.437064791003E-04 0.454027309241E-04 0.471532190199E-04 0.489594581571E-04 - 0.508230032169E-04 0.527454502295E-04 0.547284374366E-04 0.567736463820E-04 - 0.588828030295E-04 0.610576789096E-04 0.633000922950E-04 0.656119094069E-04 - 0.679950456508E-04 0.704514668852E-04 0.729831907215E-04 0.755922878576E-04 - 0.782808834452E-04 0.810511584922E-04 0.839053513006E-04 0.868457589407E-04 - 0.898747387635E-04 0.929947099510E-04 0.962081551062E-04 0.995176218837E-04 - 0.102925724661E-03 0.106435146253E-03 0.110048639670E-03 0.113769029920E-03 - 0.117599215858E-03 0.121542172080E-03 0.125600950866E-03 0.129778684174E-03 - 0.134078585684E-03 0.138503952889E-03 0.143058169249E-03 0.147744706389E-03 - 0.152567126361E-03 0.157529083955E-03 0.162634329080E-03 0.167886709193E-03 - 0.173290171799E-03 0.178848767007E-03 0.184566650159E-03 0.190448084516E-03 - 0.196497444018E-03 0.202719216115E-03 0.209118004664E-03 0.215698532905E-03 - 0.222465646505E-03 0.229424316690E-03 0.236579643443E-03 0.243936858795E-03 - 0.251501330188E-03 0.259278563931E-03 0.267274208741E-03 0.275494059370E-03 - 0.283944060329E-03 0.292630309701E-03 0.301559063051E-03 0.310736737439E-03 - 0.320169915525E-03 0.329865349787E-03 0.339829966840E-03 0.350070871863E-03 - 0.360595353140E-03 0.371410886710E-03 0.382525141143E-03 0.393945982428E-03 - 0.405681478984E-03 0.417739906801E-03 0.430129754706E-03 0.442859729763E-03 - 0.455938762811E-03 0.469376014131E-03 0.483180879266E-03 0.497362994979E-03 - 0.511932245367E-03 0.526898768117E-03 0.542272960931E-03 0.558065488100E-03 - 0.574287287251E-03 0.590949576256E-03 0.608063860316E-03 0.625641939220E-03 - 0.643695914788E-03 0.662238198493E-03 0.681281519280E-03 0.700838931572E-03 - 0.720923823479E-03 0.741549925213E-03 0.762731317701E-03 0.784482441427E-03 - 0.806818105478E-03 0.829753496827E-03 0.853304189830E-03 0.877486155974E-03 - 0.902315773857E-03 0.927809839409E-03 0.953985576380E-03 0.980860647067E-03 - 0.100845316333E-02 0.103678169783E-02 0.106586529564E-02 0.109572348599E-02 - 0.112637629448E-02 0.115784425542E-02 0.119014842461E-02 0.122331039231E-02 - 0.125735229666E-02 0.129229683731E-02 0.132816728945E-02 0.136498751814E-02 - 0.140278199300E-02 0.144157580333E-02 0.148139467342E-02 0.152226497845E-02 - 0.156421376059E-02 0.160726874560E-02 0.165145835976E-02 0.169681174729E-02 - 0.174335878809E-02 0.179113011598E-02 0.184015713733E-02 0.189047205019E-02 - 0.194210786380E-02 0.199509841864E-02 0.204947840692E-02 0.210528339354E-02 - 0.216254983758E-02 0.222131511428E-02 0.228161753756E-02 0.234349638304E-02 - 0.240699191160E-02 0.247214539354E-02 0.253899913323E-02 0.260759649444E-02 - 0.267798192613E-02 0.275020098894E-02 0.282430038225E-02 0.290032797190E-02 - 0.297833281848E-02 0.305836520633E-02 0.314047667322E-02 0.322472004063E-02 - 0.331114944479E-02 0.339982036837E-02 0.349078967297E-02 0.358411563224E-02 - 0.367985796581E-02 0.377807787397E-02 0.387883807308E-02 0.398220283185E-02 - 0.408823800836E-02 0.419701108788E-02 0.430859122158E-02 0.442304926605E-02 - 0.454045782367E-02 0.466089128390E-02 0.478442586537E-02 0.491113965898E-02 - 0.504111267185E-02 0.517442687219E-02 0.531116623519E-02 0.545141678977E-02 - 0.559526666639E-02 0.574280614579E-02 0.589412770880E-02 0.604932608704E-02 - 0.620849831479E-02 0.637174378184E-02 0.653916428732E-02 0.671086409477E-02 - 0.688694998808E-02 0.706753132870E-02 0.725272011384E-02 0.744263103581E-02 - 0.763738154248E-02 0.783709189888E-02 0.804188524993E-02 0.825188768428E-02 - 0.846722829937E-02 0.868803926757E-02 0.891445590354E-02 0.914661673273E-02 - 0.938466356104E-02 0.962874154565E-02 0.987899926705E-02 0.101355888021E-01 - 0.103986657987E-01 0.106683895506E-01 0.109449230749E-01 0.112284331891E-01 - 0.115190905903E-01 0.118170699354E-01 0.121225499218E-01 0.124357133700E-01 - 0.127567473067E-01 0.130858430491E-01 0.134231962901E-01 0.137690071850E-01 - 0.141234804382E-01 0.144868253917E-01 0.148592561143E-01 0.152409914910E-01 - 0.156322553139E-01 0.160332763735E-01 0.164442885508E-01 0.168655309099E-01 - 0.172972477909E-01 0.177396889038E-01 0.181931094226E-01 0.186577700790E-01 - 0.191339372574E-01 0.196218830894E-01 0.201218855480E-01 0.206342285423E-01 - 0.211592020118E-01 0.216971020195E-01 0.222482308459E-01 0.228128970812E-01 - 0.233914157168E-01 0.239841082365E-01 0.245913027054E-01 0.252133338584E-01 - 0.258505431863E-01 0.265032790210E-01 0.271718966175E-01 0.278567582343E-01 - 0.285582332115E-01 0.292766980451E-01 0.300125364590E-01 0.307661394732E-01 - 0.315379054684E-01 0.323282402459E-01 0.331375570839E-01 0.339662767882E-01 - 0.348148277379E-01 0.356836459252E-01 0.365731749895E-01 0.374838662442E-01 - 0.384161786967E-01 0.393705790609E-01 0.403475417610E-01 0.413475489272E-01 - 0.423710903810E-01 0.434186636116E-01 0.444907737407E-01 0.455879334766E-01 - 0.467106630555E-01 0.478594901703E-01 0.490349498859E-01 0.502375845398E-01 - 0.514679436270E-01 0.527265836691E-01 0.540140680664E-01 0.553309669310E-01 - 0.566778569013E-01 0.580553209363E-01 0.594639480882E-01 0.609043332531E-01 - 0.623770768971E-01 0.638827847586E-01 0.654220675235E-01 0.669955404742E-01 - 0.686038231083E-01 0.702475387283E-01 0.719273139998E-01 0.736437784753E-01 - 0.753975640855E-01 0.771893045927E-01 0.790196350078E-01 0.808891909675E-01 - 0.827986080706E-01 0.847485211721E-01 0.867395636330E-01 0.887723665237E-01 - 0.908475577806E-01 0.929657613123E-01 0.951275960557E-01 0.973336749783E-01 - 0.995846040265E-01 0.101880981017 0.104223394471 0.106612422388 - 0.109048630958 0.111532573210 0.114064787601 0.116645796531 - 0.119276104797 0.121956197978 0.124686540746 0.127467575110 - 0.130299718591 0.133183362321 0.136118869067 0.139106571192 - 0.142146768535 0.145239726221 0.148385672402 0.151584795926 - 0.154837243936 0.158143119404 0.161502478600 0.164915328494 - 0.168381624109 0.171901265809 0.175474096544 0.179099899044 - 0.182778392977 0.186509232075 0.190292001230 0.194126213575 - 0.198011307559 0.201946644018 0.205931503264 0.209965082193 - 0.214046491433 0.218174752547 0.222348795293 0.226567454973 - 0.230829469882 0.235133478869 0.239478019048 0.243861523650 - 0.248282320071 0.252738628116 0.257228558471 0.261750111427 - 0.266301175884 0.270879528660 0.275482834128 0.280108644217 - 0.284754398804 0.289417426515 0.294094945981 0.298784067563 - 0.303481795582 0.308185031075 0.312890575109 0.317595132679 - 0.322295317203 0.326987655640 0.331668594263 0.336334505069 - 0.340981692875 0.345606403079 0.350204830101 0.354773126503 - 0.359307412770 0.363803787747 0.368258339702 0.372667158000 - 0.377026345326 0.381332030440 0.385580381389 0.389767619122 - 0.393890031426 0.397943987118 0.401925950365 0.405832495067 - 0.409660319161 0.413406258723 0.417067301751 0.420640601457 - 0.424123488937 0.427513485040 0.430808311270 0.434005899547 - 0.437104400641 0.440102191083 0.442997878383 0.445790304351 - 0.448478546334 0.451061916191 0.453539956840 0.455912436183 - 0.458179338301 0.460340851743 0.462397354842 0.464349397939 - 0.466197682492 0.467943037053 0.469586390145 0.471128740130 - 0.472571122219 0.473914572847 0.475160091703 0.476308601801 - 0.477360908088 0.478317655172 0.479179284885 0.479945994527 - 0.480617696764 0.481193982306 0.481674086615 0.482056862058 - 0.482340757021 0.482523803624 0.482603615727 0.482577398951 - 0.482441974360 0.482193817305 0.481829112616 0.481343826889 - 0.480733797882 0.479994840121 0.479122864492 0.478114007910 - 0.476964766961 0.475672126666 0.474233672054 0.472647665983 - 0.470913070885 0.469029486199 0.466996982391 0.464815870018 - 0.462486580310 0.460009732923 0.457386090912 0.454616575315 - 0.451702265742 0.448644400990 0.445444380086 0.442103762753 - 0.438624269637 0.435007782252 0.431256342637 0.427372152711 - 0.423357573327 0.419215123017 0.414947476426 0.410557462424 - 0.406048061901 0.401422405240 0.396683769456 0.391835575024 - 0.386881382364 0.381824888011 0.376669920458 0.371420435675 - 0.366080512308 0.360654346573 0.355146246827 0.349560627845 - 0.343902004805 0.338174986971 0.332384271116 0.326534634661 - 0.320630928574 0.314678070008 0.308681034723 0.302644849286 - 0.296574583069 0.290475340066 0.284352250545 0.278210462548 - 0.272055133266 0.265891420306 0.259724472862 0.253559422831 - 0.247401375887 0.241255402527 0.235126529124 0.229019729013 - 0.222939913627 0.216891923710 0.210880520641 0.204910377884 - 0.198986072594 0.193112077405 0.187292752436 0.181532337514 - 0.175834944675 0.170204550934 0.164644991380 0.159159952589 - 0.153752966405 0.148427404095 0.143186470903 0.138033201031 - 0.132970453049 0.128000905774 0.123127054607 0.118351208375 - 0.113675486655 0.109101817627 0.104631936429 0.100267384058 - 0.960095067872E-01 0.918594561291E-01 0.878181893307E-01 0.838864704037E-01 - 0.800648716863E-01 0.763537759297E-01 0.727533789016E-01 0.692636924953E-01 - 0.658845483324E-01 0.626156018442E-01 0.594563368135E-01 0.564060703579E-01 - 0.534639583344E-01 0.506290011397E-01 0.479000498833E-01 0.452758129051E-01 - 0.427548626097E-01 0.403356425871E-01 0.380164749900E-01 0.357955681333E-01 - 0.336710242851E-01 0.316408476135E-01 0.297029522571E-01 0.278551704814E-01 - 0.260952608902E-01 0.244209166542E-01 0.228297737247E-01 0.213194189972E-01 - 0.198873983928E-01 0.185312248251E-01 0.172483860213E-01 0.160363521683E-01 - 0.148925833548E-01 0.138145367839E-01 0.127996737309E-01 0.118454662228E-01 - 0.109494034201E-01 0.101089976804E-01 0.932179028917E-02 0.858535684220E-02 - 0.789731226802E-02 0.725531548143E-02 0.665707366032E-02 0.610034614137E-02 - 0.558294793195E-02 0.510275283811E-02 0.465769621076E-02 0.424577731408E-02 - 0.386506132236E-02 0.351368095349E-02 0.318983774884E-02 0.289180301130E-02 - 0.261791841440E-02 0.236659629707E-02 0.213631965971E-02 0.192564187822E-02 - 0.173318615362E-02 0.155764471558E-02 0.139777779863E-02 0.125241241034E-02 - 0.112044091082E-02 0.100081942313E-02 0.892566093909E-03 0.794759223473E-03 - 0.706535284101E-03 0.627086844948E-03 0.555660421225E-03 0.491554264729E-03 - 0.434116111959E-03 0.382740905219E-03 0.336868501164E-03 0.295981380310E-03 - 0.259602369956E-03 0.227292391987E-03 0.198648245921E-03 0.173300436534E-03 - 0.150911054305E-03 0.131171715925E-03 0.113801571046E-03 0.985453804982E-04 - 0.851716702189E-04 0.734709642647E-04 0.632540993902E-04 0.543506228959E-04 - 0.466072746907E-04 0.398865538313E-04 0.340653691752E-04 0.290337732188E-04 - 0.246937776901E-04 0.209582490236E-04 0.177498814647E-04 0.150002452239E-04 - 0.126489068360E-04 0.106426186600E-04 0.893457429107E-05 0.748372653583E-05 - 0.625416452187E-05 0.521454647655E-05 0.433758470421E-05 0.359957931914E-05 - 0.297999734644E-05 0.246109388135E-05 0.202757209710E-05 0.166627900678E-05 - 0.136593401420E-05 0.111688742925E-05 0.910906270504E-06 0.740984831728E-06 - 0.601177644702E-06 0.486452628062E-06 0.392562368130E-06 0.315931631453E-06 - 0.253559358779E-06 0.202933535288E-06 0.161957471164E-06 0.128886159355E-06 - 0.102271503009E-06 0.809153233791E-07 0.638291695628E-07 0.502000542962E-07 - 0.393613351753E-07 0.307680481744E-07 0.239760804451E-07 0.186246423254E-07 - 0.144215645970E-07 0.111310066537E-07 0.856321476742E-08 0.656601745819E-08 - 0.501778751204E-08 0.382163784784E-08 0.290065162999E-08 0.219397615104E-08 - 0.165363545597E-08 0.124193881255E-08 0.929381299077E-09 0.692949305273E-09 - 0.514757927259E-09 0.380959360274E-09 0.280871708568E-09 0.206286370945E-09 - 0.150919531555E-09 0.109979475361E-09 0.798266226255E-10 0.577074839373E-10 - 0.415473062892E-10 0.297891247706E-10 0.212693520263E-10 0.151220139117E-10 - 0.107053479198E-10 0.754578353343E-11 0.529537384138E-11 0.369959051151E-11 - 0.257306732482E-11 0.178141255024E-11 0.122763375141E-11 0.842051897239E-12 - 0.574842771122E-12 0.390547257372E-12 0.264050022826E-12 0.177648027364E-12 - 0.118923931884E-12 0.792110200848E-13 0.524906403802E-13 0.346043062619E-13 - 0.226935361331E-13 0.148036678549E-13 0.960511666662E-14 0.619830243759E-14 - 0.397786438230E-14 0.253865789838E-14 0.161103477773E-14 0.101653262509E-14 - 0.637708422569E-15 0.397718479274E-15 0.246575620457E-15 0.151954233360E-15 - 0.930745459294E-16 0.566593040938E-16 0.342767824929E-16 0.206055046035E-16 - 0.123079667364E-16 0.730422684711E-17 0.430637311294E-17 0.252210207982E-17 - 0.146720552623E-17 0.847734320011E-18 0.486442890565E-18 0.277184878979E-18 - 0.156831974430E-18 0.881025392887E-19 0.491350989475E-19 0.272022731167E-19 - 0.149481817820E-19 0.815268589145E-20 0.441266599679E-20 0.236999664238E-20 - 0.126298598209E-20 0.667745114160E-21 0.350220062953E-21 0.182198844212E-21 - 0.940113161740E-22 0.481060428385E-22 0.244094851360E-22 0.122803576047E-22 - 0.612505736587E-23 0.302836915091E-23 0.148408620975E-23 0.720796487407E-24 - 0.346912820571E-24 0.165436950269E-24 0.781625736359E-25 0.365820814677E-25 - 0.169585850273E-25 0.778592494285E-26 0.353978846950E-26 0.159344594512E-26 - 0.710127023381E-27 0.313269769929E-27 0.136782031518E-27 0.591032535548E-28 - 0.252701870367E-28 0.106896252387E-28 0.447316537465E-29 0.185142717470E-29 - 0.757839992335E-30 0.306737485647E-30 0.122747626663E-30 0.485572362462E-31 - 0.189856870950E-31 0.733611747191E-32 0.280097426144E-32 0.105654817400E-32 - 0.393677381002E-33 0.144875644166E-33 0.526484979459E-34 0.188904952138E-34 - 0.669110184763E-35 0.233925828564E-35 0.807073987669E-36 0.274745538710E-36 - 0.922691751851E-37 0.305644755066E-37 0.998472848868E-38 0.321616483282E-38 - 0.102128232957E-38 0.319654325693E-39 0.985969264196E-40 0.299649774875E-40 - 0.897121090900E-41 0.264540652596E-41 0.768165292472E-42 0.219610677678E-42 - 0.618021048583E-43 0.171166027298E-43 0.466453883997E-44 0.125051219512E-44 - 0.329735218728E-45 0.854968083364E-46 0.217946276313E-46 0.546098077905E-47 - 0.134468007021E-47 0.325310967627E-48 0.773059547242E-49 0.180411230173E-49 - 0.413381662674E-50 0.929769442524E-51 0.205226716905E-51 0.444451088876E-52 - 0.944150224497E-53 0.196688780105E-53 0.401728312796E-54 0.804250532496E-55 - 0.157778094020E-55 0.303240720362E-56 0.570823032720E-57 0.105214342172E-57 - 0.189842243025E-58 0.335226864593E-59 0.579155310744E-60 0.978683662235E-61 - 0.161718679843E-61 0.261232053326E-62 0.412399442134E-63 0.636077593677E-64 - 0.958246688009E-65 0.140953257072E-65 0.202436545755E-66 0.284273825438E-67 - 0.389458372654E-68 0.520387124545E-69 0.677948621583E-70 diff --git a/aiida_defects/formation_energy_siesta/pseudos/O.psf b/aiida_defects/formation_energy_siesta/pseudos/O.psf deleted file mode 100644 index 4185405..0000000 --- a/aiida_defects/formation_energy_siesta/pseudos/O.psf +++ /dev/null @@ -1,1821 +0,0 @@ - O ca nrl nc - ATM3 19-FEB-98 Troullier-Martins - 2s 2.00 r= 1.14/2p 4.00 r= 1.14/3d 0.00 r= 1.14/4f 0.00 r= 1.14/ - 4 0 1029 0.309844022083E-03 0.125000000000E-01 6.00000000000 - Radial grid follows - 0.389735801693E-05 0.784373876281E-05 0.118397588677E-04 0.158860427178E-04 - 0.199832225532E-04 0.241319385666E-04 0.283328390034E-04 0.325865802628E-04 - 0.368938270004E-04 0.412552522324E-04 0.456715374403E-04 0.501433726777E-04 - 0.546714566780E-04 0.592564969634E-04 0.638992099558E-04 0.686003210887E-04 - 0.733605649201E-04 0.781806852479E-04 0.830614352256E-04 0.880035774804E-04 - 0.930078842321E-04 0.980751374137E-04 0.103206128794E-03 0.108401660101E-03 - 0.113662543146E-03 0.118989599954E-03 0.124383662888E-03 0.129845574781E-03 - 0.135376189068E-03 0.140976369919E-03 0.146646992373E-03 0.152388942477E-03 - 0.158203117422E-03 0.164090425685E-03 0.170051787170E-03 0.176088133351E-03 - 0.182200407420E-03 0.188389564433E-03 0.194656571457E-03 0.201002407725E-03 - 0.207428064787E-03 0.213934546665E-03 0.220522870010E-03 0.227194064261E-03 - 0.233949171805E-03 0.240789248143E-03 0.247715362049E-03 0.254728595743E-03 - 0.261830045058E-03 0.269020819608E-03 0.276302042968E-03 0.283674852843E-03 - 0.291140401250E-03 0.298699854695E-03 0.306354394360E-03 0.314105216280E-03 - 0.321953531539E-03 0.329900566451E-03 0.337947562756E-03 0.346095777814E-03 - 0.354346484801E-03 0.362700972906E-03 0.371160547534E-03 0.379726530512E-03 - 0.388400260291E-03 0.397183092161E-03 0.406076398455E-03 0.415081568772E-03 - 0.424200010187E-03 0.433433147476E-03 0.442782423334E-03 0.452249298606E-03 - 0.461835252510E-03 0.471541782870E-03 0.481370406352E-03 0.491322658699E-03 - 0.501400094969E-03 0.511604289783E-03 0.521936837567E-03 0.532399352802E-03 - 0.542993470279E-03 0.553720845349E-03 0.564583154186E-03 0.575582094048E-03 - 0.586719383543E-03 0.597996762894E-03 0.609415994214E-03 0.620978861782E-03 - 0.632687172320E-03 0.644542755274E-03 0.656547463104E-03 0.668703171570E-03 - 0.681011780026E-03 0.693475211716E-03 0.706095414078E-03 0.718874359044E-03 - 0.731814043350E-03 0.744916488848E-03 0.758183742822E-03 0.771617878307E-03 - 0.785220994414E-03 0.798995216658E-03 0.812942697289E-03 0.827065615629E-03 - 0.841366178413E-03 0.855846620133E-03 0.870509203387E-03 0.885356219235E-03 - 0.900389987551E-03 0.915612857394E-03 0.931027207368E-03 0.946635445996E-03 - 0.962440012097E-03 0.978443375167E-03 0.994648035764E-03 0.101105652590E-02 - 0.102767140943E-02 0.104449528247E-02 0.106153077378E-02 0.107878054520E-02 - 0.109624729202E-02 0.111393374348E-02 0.113184266311E-02 0.114997684922E-02 - 0.116833913530E-02 0.118693239052E-02 0.120575952009E-02 0.122482346580E-02 - 0.124412720643E-02 0.126367375822E-02 0.128346617537E-02 0.130350755048E-02 - 0.132380101505E-02 0.134434973998E-02 0.136515693606E-02 0.138622585444E-02 - 0.140755978719E-02 0.142916206778E-02 0.145103607161E-02 0.147318521654E-02 - 0.149561296342E-02 0.151832281662E-02 0.154131832460E-02 0.156460308048E-02 - 0.158818072252E-02 0.161205493479E-02 0.163622944769E-02 0.166070803852E-02 - 0.168549453213E-02 0.171059280144E-02 0.173600676811E-02 0.176174040314E-02 - 0.178779772744E-02 0.181418281254E-02 0.184089978115E-02 0.186795280785E-02 - 0.189534611974E-02 0.192308399708E-02 0.195117077396E-02 0.197961083901E-02 - 0.200840863603E-02 0.203756866475E-02 0.206709548148E-02 0.209699369984E-02 - 0.212726799149E-02 0.215792308685E-02 0.218896377585E-02 0.222039490864E-02 - 0.225222139642E-02 0.228444821213E-02 0.231708039128E-02 0.235012303271E-02 - 0.238358129941E-02 0.241746041930E-02 0.245176568605E-02 0.248650245994E-02 - 0.252167616865E-02 0.255729230816E-02 0.259335644355E-02 0.262987420992E-02 - 0.266685131324E-02 0.270429353127E-02 0.274220671442E-02 0.278059678671E-02 - 0.281946974666E-02 0.285883166826E-02 0.289868870188E-02 0.293904707526E-02 - 0.297991309449E-02 0.302129314496E-02 0.306319369239E-02 0.310562128383E-02 - 0.314858254867E-02 0.319208419969E-02 0.323613303413E-02 0.328073593470E-02 - 0.332589987069E-02 0.337163189906E-02 0.341793916553E-02 0.346482890571E-02 - 0.351230844621E-02 0.356038520581E-02 0.360906669661E-02 0.365836052518E-02 - 0.370827439378E-02 0.375881610155E-02 0.380999354576E-02 0.386181472296E-02 - 0.391428773033E-02 0.396742076687E-02 0.402122213475E-02 0.407570024052E-02 - 0.413086359651E-02 0.418672082210E-02 0.424328064509E-02 0.430055190307E-02 - 0.435854354480E-02 0.441726463158E-02 0.447672433871E-02 0.453693195688E-02 - 0.459789689366E-02 0.465962867494E-02 0.472213694645E-02 0.478543147521E-02 - 0.484952215114E-02 0.491441898853E-02 0.498013212765E-02 0.504667183630E-02 - 0.511404851145E-02 0.518227268084E-02 0.525135500465E-02 0.532130627711E-02 - 0.539213742827E-02 0.546385952563E-02 0.553648377591E-02 0.561002152681E-02 - 0.568448426874E-02 0.575988363667E-02 0.583623141189E-02 0.591353952390E-02 - 0.599182005225E-02 0.607108522844E-02 0.615134743780E-02 0.623261922147E-02 - 0.631491327834E-02 0.639824246701E-02 0.648261980784E-02 0.656805848497E-02 - 0.665457184835E-02 0.674217341589E-02 0.683087687550E-02 0.692069608727E-02 - 0.701164508565E-02 0.710373808160E-02 0.719698946483E-02 0.729141380607E-02 - 0.738702585931E-02 0.748384056413E-02 0.758187304802E-02 0.768113862876E-02 - 0.778165281679E-02 0.788343131767E-02 0.798649003449E-02 0.809084507039E-02 - 0.819651273104E-02 0.830350952725E-02 0.841185217747E-02 0.852155761047E-02 - 0.863264296794E-02 0.874512560720E-02 0.885902310388E-02 0.897435325471E-02 - 0.909113408025E-02 0.920938382774E-02 0.932912097396E-02 0.945036422806E-02 - 0.957313253456E-02 0.969744507626E-02 0.982332127723E-02 0.995078080590E-02 - 0.100798435781E-01 0.102105297601E-01 0.103428597719E-01 0.104768542903E-01 - 0.106125342523E-01 0.107499208582E-01 0.108890355748E-01 0.110299001391E-01 - 0.111725365615E-01 0.113169671292E-01 0.114632144099E-01 0.116113012549E-01 - 0.117612508030E-01 0.119130864843E-01 0.120668320234E-01 0.122225114433E-01 - 0.123801490692E-01 0.125397695323E-01 0.127013977737E-01 0.128650590481E-01 - 0.130307789280E-01 0.131985833073E-01 0.133684984058E-01 0.135405507732E-01 - 0.137147672930E-01 0.138911751868E-01 0.140698020187E-01 0.142506756996E-01 - 0.144338244913E-01 0.146192770113E-01 0.148070622367E-01 0.149972095095E-01 - 0.151897485406E-01 0.153847094146E-01 0.155821225944E-01 0.157820189264E-01 - 0.159844296447E-01 0.161893863764E-01 0.163969211464E-01 0.166070663825E-01 - 0.168198549202E-01 0.170353200083E-01 0.172534953135E-01 0.174744149262E-01 - 0.176981133656E-01 0.179246255849E-01 0.181539869773E-01 0.183862333807E-01 - 0.186214010844E-01 0.188595268335E-01 0.191006478359E-01 0.193448017671E-01 - 0.195920267767E-01 0.198423614941E-01 0.200958450347E-01 0.203525170056E-01 - 0.206124175125E-01 0.208755871654E-01 0.211420670849E-01 0.214118989092E-01 - 0.216851248001E-01 0.219617874495E-01 0.222419300867E-01 0.225255964845E-01 - 0.228128309663E-01 0.231036784132E-01 0.233981842705E-01 0.236963945555E-01 - 0.239983558641E-01 0.243041153784E-01 0.246137208740E-01 0.249272207272E-01 - 0.252446639232E-01 0.255661000631E-01 0.258915793718E-01 0.262211527063E-01 - 0.265548715629E-01 0.268927880861E-01 0.272349550758E-01 0.275814259965E-01 - 0.279322549848E-01 0.282874968586E-01 0.286472071250E-01 0.290114419896E-01 - 0.293802583648E-01 0.297537138790E-01 0.301318668852E-01 0.305147764706E-01 - 0.309025024657E-01 0.312951054535E-01 0.316926467789E-01 0.320951885587E-01 - 0.325027936906E-01 0.329155258640E-01 0.333334495691E-01 0.337566301072E-01 - 0.341851336012E-01 0.346190270056E-01 0.350583781172E-01 0.355032555854E-01 - 0.359537289234E-01 0.364098685184E-01 0.368717456431E-01 0.373394324669E-01 - 0.378130020668E-01 0.382925284389E-01 0.387780865103E-01 0.392697521503E-01 - 0.397676021828E-01 0.402717143977E-01 0.407821675637E-01 0.412990414402E-01 - 0.418224167896E-01 0.423523753905E-01 0.428890000500E-01 0.434323746168E-01 - 0.439825839942E-01 0.445397141537E-01 0.451038521478E-01 0.456750861243E-01 - 0.462535053398E-01 0.468392001733E-01 0.474322621409E-01 0.480327839097E-01 - 0.486408593125E-01 0.492565833623E-01 0.498800522672E-01 0.505113634455E-01 - 0.511506155409E-01 0.517979084377E-01 0.524533432769E-01 0.531170224715E-01 - 0.537890497227E-01 0.544695300360E-01 0.551585697381E-01 0.558562764926E-01 - 0.565627593177E-01 0.572781286028E-01 0.580024961258E-01 0.587359750705E-01 - 0.594786800447E-01 0.602307270973E-01 0.609922337374E-01 0.617633189518E-01 - 0.625441032243E-01 0.633347085539E-01 0.641352584743E-01 0.649458780730E-01 - 0.657666940112E-01 0.665978345428E-01 0.674394295353E-01 0.682916104897E-01 - 0.691545105609E-01 0.700282645788E-01 0.709130090693E-01 0.718088822755E-01 - 0.727160241794E-01 0.736345765238E-01 0.745646828343E-01 0.755064884420E-01 - 0.764601405059E-01 0.774257880360E-01 0.784035819169E-01 0.793936749306E-01 - 0.803962217814E-01 0.814113791191E-01 0.824393055643E-01 0.834801617324E-01 - 0.845341102593E-01 0.856013158268E-01 0.866819451877E-01 0.877761671928E-01 - 0.888841528162E-01 0.900060751832E-01 0.911421095962E-01 0.922924335631E-01 - 0.934572268243E-01 0.946366713810E-01 0.958309515240E-01 0.970402538618E-01 - 0.982647673506E-01 0.995046833228E-01 0.100760195518 0.102031500113 - 0.103318795750 0.104622283574 0.105942167256 0.107278653031 - 0.108631949728 0.110002268801 0.111389824366 0.112794833232 - 0.114217514934 0.115658091769 0.117116788830 0.118593834041 - 0.120089458193 0.121603894981 0.123137381040 0.124690155978 - 0.126262462420 0.127854546043 0.129466655613 0.131099043025 - 0.132751963343 0.134425674838 0.136120439033 0.137836520737 - 0.139574188092 0.141333712611 0.143115369224 0.144919436319 - 0.146746195784 0.148595933054 0.150468937156 0.152365500748 - 0.154285920174 0.156230495502 0.158199530577 0.160193333064 - 0.162212214499 0.164256490336 0.166326479998 0.168422506925 - 0.170544898625 0.172693986726 0.174870107027 0.177073599552 - 0.179304808601 0.181564082805 0.183851775180 0.186168243183 - 0.188513848766 0.190888958436 0.193293943307 0.195729179164 - 0.198195046517 0.200691930664 0.203220221746 0.205780314815 - 0.208372609891 0.210997512025 0.213655431364 0.216346783211 - 0.219071988098 0.221831471842 0.224625665619 0.227455006027 - 0.230319935156 0.233220900657 0.236158355812 0.239132759605 - 0.242144576791 0.245194277974 0.248282339676 0.251409244412 - 0.254575480767 0.257781543474 0.261027933484 0.264315158055 - 0.267643730820 0.271014171876 0.274427007862 0.277882772039 - 0.281382004380 0.284925251644 0.288513067473 0.292146012469 - 0.295824654287 0.299549567724 0.303321334803 0.307140544873 - 0.311007794690 0.314923688523 0.318888838236 0.322903863392 - 0.326969391348 0.331086057351 0.335254504637 0.339475384535 - 0.343749356567 0.348077088549 0.352459256697 0.356896545736 - 0.361389648999 0.365939268545 0.370546115259 0.375210908971 - 0.379934378565 0.384717262093 0.389560306889 0.394464269689 - 0.399429916748 0.404458023958 0.409549376970 0.414704771320 - 0.419925012548 0.425210916327 0.430563308590 0.435983025661 - 0.441470914379 0.447027832241 0.452654647524 0.458352239430 - 0.464121498221 0.469963325353 0.475878633625 0.481868347315 - 0.487933402329 0.494074746343 0.500293338955 0.506590151834 - 0.512966168867 0.519422386322 0.525959812996 0.532579470374 - 0.539282392792 0.546069627594 0.552942235301 0.559901289770 - 0.566947878369 0.574083102141 0.581308075980 0.588623928802 - 0.596031803724 0.603532858242 0.611128264410 0.618819209027 - 0.626606893818 0.634492535625 0.642477366596 0.650562634375 - 0.658749602304 0.667039549612 0.675433771621 0.683933579944 - 0.692540302694 0.701255284690 0.710079887664 0.719015490479 - 0.728063489341 0.737225298018 0.746502348061 0.755896089030 - 0.765407988713 0.775039533366 0.784792227937 0.794667596303 - 0.804667181512 0.814792546019 0.825045271933 0.835426961263 - 0.845939236169 0.856583739215 0.867362133628 0.878276103552 - 0.889327354317 0.900517612705 0.911848627216 0.923322168344 - 0.934940028853 0.946704024058 0.958615992105 0.970677794266 - 0.982891315221 0.995258463357 1.00778117107 1.02046139505 - 1.03330111661 1.04630234199 1.05946710266 1.07279745563 - 1.08629548379 1.09996329625 1.11380302863 1.12781684341 - 1.14200693028 1.15637550647 1.17092481710 1.18565713552 - 1.20057476370 1.21568003255 1.23097530228 1.24646296283 - 1.26214543416 1.27802516670 1.29410464169 1.31038637157 - 1.32687290040 1.34356680424 1.36047069153 1.37758720356 - 1.39491901480 1.41246883339 1.43023940152 1.44823349588 - 1.46645392809 1.48490354512 1.50358522976 1.52250190107 - 1.54165651481 1.56105206393 1.58069157903 1.60057812881 - 1.62071482060 1.64110480079 1.66175125536 1.68265741035 - 1.70382653241 1.72526192924 1.74696695017 1.76894498665 - 1.79119947280 1.81373388593 1.83655174708 1.85965662159 - 1.88305211964 1.90674189684 1.93072965474 1.95501914150 - 1.97961415239 2.00451853043 2.02973616699 2.05527100237 - 2.08112702643 2.10730827924 2.13381885167 2.16066288605 - 2.18784457681 2.21536817116 2.24323796970 2.27145832716 - 2.30003365301 2.32896841222 2.35826712589 2.38793437201 - 2.41797478615 2.44839306218 2.47919395302 2.51038227138 - 2.54196289048 2.57394074488 2.60632083116 2.63910820880 - 2.67230800087 2.70592539492 2.73996564373 2.77443406616 - 2.80933604797 2.84467704267 2.88046257236 2.91669822860 - 2.95338967328 2.99054263952 3.02816293255 3.06625643062 - 3.10482908590 3.14388692546 3.18343605215 3.22348264563 - 3.26403296324 3.30509334105 3.34667019483 3.38877002106 - 3.43139939791 3.47456498631 3.51827353097 3.56253186145 - 3.60734689319 3.65272562863 3.69867515830 3.74520266190 - 3.79231540945 3.84002076242 3.88832617485 3.93723919457 - 3.98676746434 4.03691872305 4.08770080694 4.13912165081 - 4.19118928928 4.24391185801 4.29729759502 4.35135484193 - 4.40609204530 4.46151775793 4.51764064021 4.57446946144 - 4.63201310124 4.69028055093 4.74928091491 4.80902341211 - 4.86951737741 4.93077226313 4.99279764046 5.05560320099 - 5.11919875822 5.18359424908 5.24879973551 5.31482540599 - 5.38168157716 5.44937869544 5.51792733865 5.58733821764 - 5.65762217801 5.72879020177 5.80085340907 5.87382305993 - 5.94771055600 6.02252744237 6.09828540931 6.17499629417 - 6.25267208318 6.33132491333 6.41096707430 6.49161101033 - 6.57326932220 6.65595476919 6.73968027107 6.82445891012 - 6.91030393317 6.99722875368 7.08524695384 7.17437228666 - 7.26461867816 7.35600022952 7.44853121930 7.54222610565 - 7.63709952858 7.73316631227 7.83044146735 7.92894019324 - 8.02867788059 8.12967011361 8.23193267253 8.33548153609 - 8.44033288402 8.54650309955 8.65400877199 8.76286669931 - 8.87309389081 8.98470756969 9.09772517582 9.21216436843 - 9.32804302888 9.44537926344 9.56419140615 9.68449802164 - 9.80631790805 9.92967010001 10.0545738715 10.1810487391 - 10.3091144647 10.4387910587 10.5700987836 10.7030581563 - 10.8376899520 10.9740152072 11.1120552230 11.2518315685 - 11.3933660840 11.5366808846 11.6817983634 11.8287411953 - 11.9775323406 12.1281950481 12.2807528591 12.4352296112 - 12.5916494416 12.7500367913 12.9104164086 13.0728133531 - 13.2372529997 13.4037610425 13.5723634986 13.7430867125 - 13.9159573601 14.0910024527 14.2682493416 14.4477257219 - 14.6294596371 14.8134794836 14.9998140148 15.1884923458 - 15.3795439581 15.5729987039 15.7688868108 15.9672388867 - 16.1680859247 16.3714593073 16.5773908122 16.7859126166 - 16.9970573024 17.2108578613 17.4273477003 17.6465606462 - 17.8685309515 18.0932932995 18.3208828098 18.5513350438 - 18.7846860100 19.0209721701 19.2602304441 19.5024982168 - 19.7478133429 19.9962141534 20.2477394615 20.5024285685 - 20.7603212700 21.0214578625 21.2858791489 21.5536264456 - 21.8247415887 22.0992669405 22.3772453962 22.6587203904 - 22.9437359041 23.2323364717 23.5245671876 23.8204737133 - 24.1201022849 24.4234997200 24.7307134251 25.0417914028 - 25.3567822598 25.6757352141 25.9987001026 26.3257273893 - 26.6568681729 26.9921741948 27.3316978472 27.6754921815 - 28.0236109161 28.3761084454 28.7330398477 29.0944608944 - 29.4604280583 29.8309985223 30.2062301890 30.5861816890 - 30.9709123906 31.3604824086 31.7549526142 32.1543846442 - 32.5588409106 32.9683846106 33.3830797362 33.8029910842 - 34.2281842669 34.6587257214 35.0946827207 35.5361233840 - 35.9831166873 36.4357324741 36.8940414668 37.3581152769 - 37.8280264169 38.3038483114 38.7856553086 39.2735226917 - 39.7675266911 40.2677444958 40.7742542659 41.2871351447 - 41.8064672707 42.3323317907 42.8648108721 43.4039877158 - 43.9499465693 44.5027727398 45.0625526075 45.6293736391 - 46.2033244017 46.7844945760 47.3729749712 47.9688575386 - 48.5722353860 49.1832027924 49.8018552227 50.4282893426 - 51.0626030337 51.7048954089 52.3552668275 53.0138189116 - 53.6806545611 54.3558779705 55.0395946449 55.7319114163 - 56.4329364607 57.1427793146 57.8615508925 58.5893635038 - 59.3263308708 60.0725681461 60.8281919308 61.5933202926 - 62.3680727845 63.1525704631 63.9469359077 64.7512932395 - 65.5657681411 66.3904878757 67.2255813076 68.0711789217 - 68.9274128445 69.7944168641 70.6723264518 71.5612787827 - 72.4614127574 73.3728690237 74.2957899985 75.2303198900 - 76.1766047205 77.1347923488 78.1050324938 79.0874767575 - 80.0822786487 81.0895936073 82.1095790283 83.1423942865 - 84.1882007614 85.2471618623 86.3194430541 87.4052118830 - 88.5046380024 89.6178932000 90.7451514241 91.8865888112 - 93.0423837132 94.2127167253 95.3977707145 96.5977308479 - 97.8127846216 99.0431218904 100.288934897 101.550418302 - 102.827769215 104.121187224 105.430874429 106.757035472 - 108.099877566 109.459610535 110.836446839 112.230601612 - 113.642292693 115.071740662 116.519168873 117.984803490 - 119.468873521 - Down Pseudopotential follows (l on next line) - 0 - -0.477757180914E-04 -0.961523807311E-04 -0.145137546864E-03 -0.194738870515E-03 - -0.244964101984E-03 -0.295821089056E-03 -0.347317778231E-03 -0.399462215960E-03 - -0.452262549909E-03 -0.505727030225E-03 -0.559864010830E-03 -0.614681950726E-03 - -0.670189415314E-03 -0.726395077733E-03 -0.783307720218E-03 -0.840936235469E-03 - -0.899289628041E-03 -0.958377015754E-03 -0.101820763111E-02 -0.107879082275E-02 - -0.114013605690E-02 -0.120225291885E-02 -0.126515111446E-02 -0.132884047168E-02 - -0.139333094208E-02 -0.145863260239E-02 -0.152475565611E-02 -0.159171043506E-02 - -0.165950740103E-02 -0.172815714740E-02 -0.179767040080E-02 -0.186805802278E-02 - -0.193933101151E-02 -0.201150050348E-02 -0.208457777530E-02 -0.215857424539E-02 - -0.223350147579E-02 -0.230937117398E-02 -0.238619519472E-02 -0.246398554185E-02 - -0.254275437021E-02 -0.262251398753E-02 -0.270327685634E-02 -0.278505559595E-02 - -0.286786298438E-02 -0.295171196036E-02 -0.303661562541E-02 -0.312258724580E-02 - -0.320964025469E-02 -0.329778825420E-02 -0.338704501754E-02 -0.347742449116E-02 - -0.356894079694E-02 -0.366160823437E-02 -0.375544128281E-02 -0.385045460376E-02 - -0.394666304312E-02 -0.404408163351E-02 -0.414272559666E-02 -0.424261034574E-02 - -0.434375148780E-02 -0.444616482620E-02 -0.454986636306E-02 -0.465487230179E-02 - -0.476119904960E-02 -0.486886322009E-02 -0.497788163580E-02 -0.508827133089E-02 - -0.520004955374E-02 -0.531323376973E-02 -0.542784166387E-02 -0.554389114366E-02 - -0.566140034180E-02 -0.578038761909E-02 -0.590087156725E-02 -0.602287101187E-02 - -0.614640501530E-02 -0.627149287968E-02 -0.639815414991E-02 -0.652640861674E-02 - -0.665627631983E-02 -0.678777755092E-02 -0.692093285695E-02 -0.705576304331E-02 - -0.719228917707E-02 -0.733053259028E-02 -0.747051488331E-02 -0.761225792819E-02 - -0.775578387208E-02 -0.790111514068E-02 -0.804827444176E-02 -0.819728476870E-02 - -0.834816940409E-02 -0.850095192334E-02 -0.865565619841E-02 -0.881230640149E-02 - -0.897092700881E-02 -0.913154280445E-02 -0.929417888420E-02 -0.945886065950E-02 - -0.962561386141E-02 -0.979446454460E-02 -0.996543909147E-02 -0.101385642162E-01 - -0.103138669690E-01 -0.104913747403E-01 -0.106711152651E-01 -0.108531166269E-01 - -0.110374072629E-01 -0.112240159677E-01 -0.114129718979E-01 -0.116043045771E-01 - -0.117980439001E-01 -0.119942201377E-01 -0.121928639414E-01 -0.123940063481E-01 - -0.125976787853E-01 -0.128039130756E-01 -0.130127414418E-01 -0.132241965120E-01 - -0.134383113247E-01 -0.136551193339E-01 -0.138746544143E-01 -0.140969508666E-01 - -0.143220434230E-01 -0.145499672525E-01 -0.147807579662E-01 -0.150144516233E-01 - -0.152510847365E-01 -0.154906942774E-01 -0.157333176828E-01 -0.159789928605E-01 - -0.162277581946E-01 -0.164796525521E-01 -0.167347152890E-01 -0.169929862560E-01 - -0.172545058050E-01 -0.175193147955E-01 -0.177874546005E-01 -0.180589671137E-01 - -0.183338947554E-01 -0.186122804794E-01 -0.188941677797E-01 -0.191796006973E-01 - -0.194686238268E-01 -0.197612823239E-01 -0.200576219120E-01 -0.203576888894E-01 - -0.206615301366E-01 -0.209691931238E-01 -0.212807259180E-01 -0.215961771905E-01 - -0.219155962250E-01 -0.222390329244E-01 -0.225665378196E-01 -0.228981620765E-01 - -0.232339575046E-01 -0.235739765648E-01 -0.239182723777E-01 -0.242668987315E-01 - -0.246199100913E-01 -0.249773616064E-01 -0.253393091200E-01 -0.257058091772E-01 - -0.260769190340E-01 -0.264526966665E-01 -0.268332007795E-01 -0.272184908161E-01 - -0.276086269666E-01 -0.280036701781E-01 -0.284036821638E-01 -0.288087254131E-01 - -0.292188632006E-01 -0.296341595967E-01 -0.300546794772E-01 -0.304804885333E-01 - -0.309116532823E-01 -0.313482410775E-01 -0.317903201190E-01 -0.322379594641E-01 - -0.326912290382E-01 -0.331501996459E-01 -0.336149429815E-01 -0.340855316408E-01 - -0.345620391319E-01 -0.350445398868E-01 -0.355331092733E-01 -0.360278236063E-01 - -0.365287601600E-01 -0.370359971796E-01 -0.375496138939E-01 -0.380696905275E-01 - -0.385963083130E-01 -0.391295495040E-01 -0.396694973879E-01 -0.402162362986E-01 - -0.407698516298E-01 -0.413304298483E-01 -0.418980585076E-01 -0.424728262609E-01 - -0.430548228759E-01 -0.436441392479E-01 -0.442408674142E-01 -0.448451005687E-01 - -0.454569330760E-01 -0.460764604864E-01 -0.467037795504E-01 -0.473389882341E-01 - -0.479821857342E-01 -0.486334724935E-01 -0.492929502165E-01 -0.499607218853E-01 - -0.506368917754E-01 -0.513215654719E-01 -0.520148498862E-01 -0.527168532725E-01 - -0.534276852441E-01 -0.541474567913E-01 -0.548762802979E-01 -0.556142695589E-01 - -0.563615397983E-01 -0.571182076867E-01 -0.578843913598E-01 -0.586602104360E-01 - -0.594457860359E-01 -0.602412408003E-01 -0.610466989095E-01 -0.618622861028E-01 - -0.626881296972E-01 -0.635243586083E-01 -0.643711033691E-01 -0.652284961509E-01 - -0.660966707836E-01 -0.669757627764E-01 -0.678659093386E-01 -0.687672494012E-01 - -0.696799236380E-01 -0.706040744876E-01 -0.715398461752E-01 -0.724873847353E-01 - -0.734468380336E-01 -0.744183557904E-01 -0.754020896036E-01 -0.763981929719E-01 - -0.774068213185E-01 -0.784281320154E-01 -0.794622844073E-01 -0.805094398362E-01 - -0.815697616667E-01 -0.826434153104E-01 -0.837305682520E-01 -0.848313900749E-01 - -0.859460524872E-01 -0.870747293480E-01 -0.882175966946E-01 -0.893748327690E-01 - -0.905466180456E-01 -0.917331352588E-01 -0.929345694312E-01 -0.941511079016E-01 - -0.953829403542E-01 -0.966302588473E-01 -0.978932578429E-01 -0.991721342366E-01 - -0.100467087387 -0.101778319148 -0.103106033897 -0.104450438568 - -0.105811742683 -0.107190158384 -0.108585900463 -0.109999186400 - -0.111430236391 -0.112879273384 -0.114346523111 -0.115832214125 - -0.117336577833 -0.118859848532 -0.120402263444 -0.121964062750 - -0.123545489632 -0.125146790303 -0.126768214048 -0.128410013262 - -0.130072443488 -0.131755763452 -0.133460235107 -0.135186123670 - -0.136933697659 -0.138703228941 -0.140494992765 -0.142309267808 - -0.144146336215 -0.146006483640 -0.147889999292 -0.149797175975 - -0.151728310136 -0.153683701901 -0.155663655130 -0.157668477453 - -0.159698480324 -0.161753979058 -0.163835292887 -0.165942744999 - -0.168076662593 -0.170237376920 -0.172425223340 -0.174640541362 - -0.176883674703 -0.179154971330 -0.181454783519 -0.183783467899 - -0.186141385510 -0.188528901851 -0.190946386937 -0.193394215349 - -0.195872766291 -0.198382423645 -0.200923576022 -0.203496616825 - -0.206101944300 -0.208739961595 -0.211411076816 -0.214115703091 - -0.216854258620 -0.219627166742 -0.222434855991 -0.225277760159 - -0.228156318355 -0.231070975068 -0.234022180229 -0.237010389275 - -0.240036063213 -0.243099668679 -0.246201678012 -0.249342569312 - -0.252522826507 -0.255742939424 -0.259003403852 -0.262304721611 - -0.265647400620 -0.269031954968 -0.272458904982 -0.275928777297 - -0.279442104929 -0.282999427344 -0.286601290530 -0.290248247072 - -0.293940856226 -0.297679683987 -0.301465303170 -0.305298293482 - -0.309179241599 -0.313108741239 -0.317087393243 -0.321115805652 - -0.325194593781 -0.329324380301 -0.333505795319 -0.337739476455 - -0.342026068922 -0.346366225609 -0.350760607164 -0.355209882071 - -0.359714726734 -0.364275825563 -0.368893871056 -0.373569563880 - -0.378303612960 -0.383096735562 -0.387949657380 -0.392863112617 - -0.397837844081 -0.402874603262 -0.407974150428 -0.413137254707 - -0.418364694179 -0.423657255964 -0.429015736311 -0.434440940689 - -0.439933683876 -0.445494790053 -0.451125092889 -0.456825435641 - -0.462596671241 -0.468439662387 -0.474355281642 -0.480344411524 - -0.486407944598 -0.492546783576 -0.498761841405 -0.505054041370 - -0.511424317183 -0.517873613083 -0.524402883932 -0.531013095311 - -0.537705223619 -0.544480256173 -0.551339191303 -0.558283038452 - -0.565312818279 -0.572429562757 -0.579634315275 -0.586928130738 - -0.594312075674 -0.601787228332 -0.609354678788 -0.617015529052 - -0.624770893173 -0.632621897342 -0.640569680005 -0.648615391969 - -0.656760196513 -0.665005269499 -0.673351799486 -0.681800987842 - -0.690354048860 -0.699012209880 -0.707776711400 -0.716648807206 - -0.725629764490 -0.734720863976 -0.743923400052 -0.753238680895 - -0.762668028610 -0.772212779363 -0.781874283523 -0.791653905805 - -0.801553025418 -0.811573036215 -0.821715346849 -0.831981380934 - -0.842372577213 -0.852890389725 -0.863536287982 -0.874311757157 - -0.885218298268 -0.896257428378 -0.907430680798 -0.918739605302 - -0.930185768344 -0.941770753294 -0.953496160675 -0.965363608415 - -0.977374732111 -0.989531185302 -1.00183463976 -1.01428678578 - -1.02688933251 -1.03964400828 -1.05255256095 -1.06561675825 - -1.07883838822 -1.09221925956 -1.10576120208 -1.11946606714 - -1.13333572813 -1.14737208098 -1.16157704463 -1.17595256166 - -1.19050059880 -1.20522314759 -1.22012222501 -1.23519987418 - -1.25045816507 -1.26589919524 -1.28152509071 -1.29733800675 - -1.31334012880 -1.32953367343 -1.34592088931 -1.36250405832 - -1.37928549664 -1.39626755591 -1.41345262453 -1.43084312895 - -1.44844153506 -1.46625034968 -1.48427212211 -1.50250944579 - -1.52096496001 -1.53964135176 -1.55854135769 -1.57766776612 - -1.59702341923 -1.61661121535 -1.63643411135 -1.65649512521 - -1.67679733869 -1.69734390020 -1.71813802777 -1.73918301224 - -1.76048222056 -1.78203909938 -1.80385717869 -1.82594007583 - -1.84829149955 -1.87091525442 -1.89381524543 -1.91699548281 - -1.94046008719 -1.96421329496 -1.98825946397 -2.01260307950 - -2.03724876058 -2.06220126659 -2.08746550432 -2.11304653525 - -2.13894958335 -2.16518004320 -2.19174348854 -2.21864568133 - -2.24589258118 -2.27349035528 -2.30144538892 -2.32976429640 - -2.35845393260 -2.38752140503 -2.41697408655 -2.44681962865 - -2.47706597536 -2.50772137791 -2.53879440994 -2.57029398354 - -2.60222936597 -2.63461019713 -2.66744650782 -2.70074873880 - -2.73452776072 -2.76879489477 -2.80356193437 -2.83884116755 - -2.87464540037 -2.91098798121 -2.94788282590 -2.98534444390 - -3.02338796530 -3.06202916880 -3.10128451062 -3.14117115424 - -3.18170700113 -3.22291072225 -3.26480179043 -3.30740051348 - -3.35072806809 -3.39480653433 -3.43965893074 -3.48530924992 - -3.53178249445 -3.57910471313 -3.62730303719 -3.67640571652 - -3.72644215559 -3.77744294883 -3.82943991536 -3.88246613255 - -3.93655596833 -3.99174511172 -4.04807060131 -4.10557085114 - -4.16428567352 -4.22425629831 -4.28552538796 -4.34813704769 - -4.41213683009 -4.47757173337 -4.54449019223 -4.61294206065 - -4.68297858528 -4.75465236854 -4.82801732004 -4.90312859508 - -4.98004251873 -5.05881649405 -5.13950889274 -5.22217892643 - -5.30688649680 -5.39369202248 -5.48265624070 -5.57383998134 - -5.66730391115 -5.76310824569 -5.86131242639 -5.96197476025 - -6.06515201932 -6.17089899740 -6.27926802116 -6.39030841295 - -6.50406590253 -6.62058198533 -6.73989322455 -6.86203049509 - -6.98701816709 -7.11487322769 -7.24560433970 -7.37921083664 - -7.51568165404 -7.65499419812 -7.79711315340 -7.94198923219 - -8.08955787024 -8.23973787416 -8.39243002780 -8.54751566713 - -8.70485523471 -8.86428682761 -9.02562475529 -9.18865812644 - -9.35314948743 -9.51883353807 -9.68541595405 -9.85257234936 - -10.0199474159 -10.1871542814 -10.3537741320 -10.5193561475 - -10.6834178055 -10.8454456089 -11.0048963010 -11.1611986293 - -11.3137557261 -11.4619481716 -11.6051378080 -11.7426723696 - -11.8738909916 -11.9981306552 -12.1147336171 -12.2230558628 - -12.3224766073 -12.4124088496 -12.4923109642 -12.5616992881 - -12.6201616241 -12.6673715480 -12.7031033570 -12.7272474441 - -12.7398258192 -12.7410074226 -12.7311227892 -12.7106775188 - -12.6803638820 -12.6410697488 -12.5938838468 -12.5400961475 - -12.4811919163 -12.4188376534 -12.3548567654 -12.2911923440 - -12.2298538615 -12.1728439116 -12.1220603046 -12.0791678588 - -12.0454330966 -12.0215137394 -12.0071934010 -12.0010501896 - -12.0000428749 -12.0000340386 -12.0000269757 -12.0000213201 - -12.0000168039 -12.0000132077 -12.0000103523 -12.0000080915 - -12.0000063067 -12.0000049017 -12.0000037991 -12.0000029363 - -12.0000022632 -12.0000017396 -12.0000013335 -12.0000010196 - -12.0000007776 -12.0000005916 -12.0000004491 -12.0000003402 - -12.0000002572 -12.0000001942 -12.0000001464 -12.0000001103 - -12.0000000831 -12.0000000626 -12.0000000472 -12.0000000357 - -12.0000000270 -12.0000000205 -12.0000000157 -12.0000000120 - -12.0000000093 -12.0000000073 -12.0000000057 -12.0000000045 - -12.0000000036 -12.0000000029 -12.0000000024 -12.0000000019 - -12.0000000016 -12.0000000013 -12.0000000011 -12.0000000009 - -12.0000000008 -12.0000000007 -12.0000000006 -12.0000000005 - -12.0000000004 -12.0000000003 -12.0000000003 -12.0000000003 - -12.0000000002 -12.0000000002 -12.0000000002 -12.0000000001 - -12.0000000001 -12.0000000001 -12.0000000001 -12.0000000001 - -12.0000000001 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 - Down Pseudopotential follows (l on next line) - 1 - -0.144057762305E-03 -0.289927548186E-03 -0.437632150086E-03 -0.587194647143E-03 - -0.738638408794E-03 -0.891987098425E-03 -0.104726467707E-02 -0.120449540716E-02 - -0.136370385631E-02 -0.152491490114E-02 -0.168815373121E-02 -0.185344585289E-02 - -0.202081709340E-02 -0.219029360484E-02 -0.236190186822E-02 -0.253566869767E-02 - -0.271162124461E-02 -0.288978700195E-02 -0.307019380844E-02 -0.325286985299E-02 - -0.343784367907E-02 -0.362514418922E-02 -0.381480064947E-02 -0.400684269403E-02 - -0.420130032982E-02 -0.439820394122E-02 -0.459758429479E-02 -0.479947254408E-02 - -0.500390023450E-02 -0.521089930828E-02 -0.542050210939E-02 -0.563274138867E-02 - -0.584765030889E-02 -0.606526244997E-02 -0.628561181420E-02 -0.650873283158E-02 - -0.673466036516E-02 -0.696342971654E-02 -0.719507663133E-02 -0.742963730479E-02 - -0.766714838743E-02 -0.790764699079E-02 -0.815117069318E-02 -0.839775754563E-02 - -0.864744607776E-02 -0.890027530382E-02 -0.915628472883E-02 -0.941551435470E-02 - -0.967800468649E-02 -0.994379673877E-02 -0.102129320420E-01 -0.104854526490E-01 - -0.107614011415E-01 -0.110408206371E-01 -0.113237547954E-01 -0.116102478253E-01 - -0.119003444919E-01 -0.121940901231E-01 -0.124915306173E-01 -0.127927124500E-01 - -0.130976826813E-01 -0.134064889632E-01 -0.137191795472E-01 -0.140358032917E-01 - -0.143564096696E-01 -0.146810487761E-01 -0.150097713366E-01 -0.153426287143E-01 - -0.156796729188E-01 -0.160209566137E-01 -0.163665331249E-01 -0.167164564494E-01 - -0.170707812630E-01 -0.174295629296E-01 -0.177928575091E-01 -0.181607217668E-01 - -0.185332131820E-01 -0.189103899568E-01 -0.192923110257E-01 -0.196790360641E-01 - -0.200706254984E-01 -0.204671405148E-01 -0.208686430692E-01 -0.212751958968E-01 - -0.216868625218E-01 -0.221037072677E-01 -0.225257952667E-01 -0.229531924705E-01 - -0.233859656603E-01 -0.238241824574E-01 -0.242679113333E-01 -0.247172216211E-01 - -0.251721835258E-01 -0.256328681356E-01 -0.260993474328E-01 -0.265716943049E-01 - -0.270499825566E-01 -0.275342869206E-01 -0.280246830696E-01 -0.285212476283E-01 - -0.290240581852E-01 -0.295331933045E-01 -0.300487325387E-01 -0.305707564411E-01 - -0.310993465779E-01 -0.316345855414E-01 -0.321765569628E-01 -0.327253455251E-01 - -0.332810369766E-01 -0.338437181440E-01 -0.344134769461E-01 -0.349904024077E-01 - -0.355745846732E-01 -0.361661150208E-01 -0.367650858771E-01 -0.373715908309E-01 - -0.379857246484E-01 -0.386075832874E-01 -0.392372639131E-01 -0.398748649126E-01 - -0.405204859105E-01 -0.411742277845E-01 -0.418361926812E-01 -0.425064840318E-01 - -0.431852065686E-01 -0.438724663411E-01 -0.445683707329E-01 -0.452730284778E-01 - -0.459865496778E-01 -0.467090458192E-01 -0.474406297909E-01 -0.481814159015E-01 - -0.489315198974E-01 -0.496910589809E-01 -0.504601518283E-01 -0.512389186086E-01 - -0.520274810022E-01 -0.528259622202E-01 -0.536344870230E-01 -0.544531817405E-01 - -0.552821742913E-01 -0.561215942031E-01 -0.569715726324E-01 -0.578322423858E-01 - -0.587037379398E-01 -0.595861954624E-01 -0.604797528345E-01 -0.613845496709E-01 - -0.623007273423E-01 -0.632284289977E-01 -0.641677995863E-01 -0.651189858807E-01 - -0.660821364990E-01 -0.670574019289E-01 -0.680449345505E-01 -0.690448886607E-01 - -0.700574204967E-01 -0.710826882609E-01 -0.721208521453E-01 -0.731720743566E-01 - -0.742365191416E-01 -0.753143528129E-01 -0.764057437747E-01 -0.775108625490E-01 - -0.786298818027E-01 -0.797629763741E-01 -0.809103233004E-01 -0.820721018454E-01 - -0.832484935273E-01 -0.844396821472E-01 -0.856458538177E-01 -0.868671969922E-01 - -0.881039024939E-01 -0.893561635461E-01 -0.906241758018E-01 -0.919081373750E-01 - -0.932082488707E-01 -0.945247134170E-01 -0.958577366965E-01 -0.972075269785E-01 - -0.985742951512E-01 -0.999582547551E-01 -0.101359622016 -0.102778615879 - -0.104215458043 -0.105670372993 -0.107143588040 -0.108635333350 - -0.110145841987 -0.111675349943 -0.113224096179 -0.114792322661 - -0.116380274396 -0.117988199473 -0.119616349103 -0.121264977652 - -0.122934342686 -0.124624705011 -0.126336328711 -0.128069481190 - -0.129824433217 -0.131601458963 -0.133400836047 -0.135222845580 - -0.137067772206 -0.138935904149 -0.140827533257 -0.142742955046 - -0.144682468749 -0.146646377361 -0.148634987686 -0.150648610385 - -0.152687560026 -0.154752155132 -0.156842718229 -0.158959575898 - -0.161103058827 -0.163273501860 -0.165471244053 -0.167696628720 - -0.169950003494 -0.172231720379 -0.174542135800 -0.176881610667 - -0.179250510422 -0.181649205106 -0.184078069407 -0.186537482726 - -0.189027829229 -0.191549497914 -0.194102882667 -0.196688382326 - -0.199306400740 -0.201957346834 -0.204641634674 -0.207359683528 - -0.210111917933 -0.212898767764 -0.215720668295 -0.218578060271 - -0.221471389977 -0.224401109305 -0.227367675823 -0.230371552853 - -0.233413209535 -0.236493120905 -0.239611767968 -0.242769637772 - -0.245967223483 -0.249205024464 -0.252483546351 -0.255803301132 - -0.259164807227 -0.262568589568 -0.266015179680 -0.269505115765 - -0.273038942786 -0.276617212548 -0.280240483790 -0.283909322264 - -0.287624300830 -0.291385999540 -0.295195005733 -0.299051914118 - -0.302957326876 -0.306911853746 -0.310916112125 -0.314970727157 - -0.319076331838 -0.323233567107 -0.327443081952 -0.331705533504 - -0.336021587143 -0.340391916600 -0.344817204061 -0.349298140273 - -0.353835424650 -0.358429765384 -0.363081879550 -0.367792493221 - -0.372562341579 -0.377392169028 -0.382282729308 -0.387234785616 - -0.392249110718 -0.397326487073 -0.402467706949 -0.407673572553 - -0.412944896145 -0.418282500170 -0.423687217385 -0.429159890982 - -0.434701374723 -0.440312533070 -0.445994241316 -0.451747385724 - -0.457572863658 -0.463471583726 -0.469444465917 -0.475492441741 - -0.481616454377 -0.487817458811 -0.494096421990 -0.500454322962 - -0.506892153036 -0.513410915923 -0.520011627899 -0.526695317954 - -0.533463027954 -0.540315812799 -0.547254740580 -0.554280892749 - -0.561395364280 -0.568599263837 -0.575893713942 -0.583279851148 - -0.590758826209 -0.598331804260 -0.605999964988 -0.613764502817 - -0.621626627085 -0.629587562230 -0.637648547976 -0.645810839517 - -0.654075707713 -0.662444439277 -0.670918336971 -0.679498719804 - -0.688186923231 -0.696984299352 -0.705892217118 -0.714912062534 - -0.724045238872 -0.733293166878 -0.742657284985 -0.752139049531 - -0.761739934975 -0.771461434118 -0.781305058327 -0.791272337758 - -0.801364821586 -0.811584078235 -0.821931695612 -0.832409281339 - -0.843018462997 -0.853760888362 -0.864638225651 -0.875652163768 - -0.886804412553 -0.898096703031 -0.909530787672 -0.921108440641 - -0.932831458065 -0.944701658289 -0.956720882147 -0.968890993224 - -0.981213878135 -0.993691446792 -1.00632563268 -1.01911839315 - -1.03207170968 -1.04518758818 -1.05846805925 -1.07191517853 - -1.08553102693 -1.09931771096 -1.11327736301 -1.12741214169 - -1.14172423210 -1.15621584615 -1.17088922287 -1.18574662872 - -1.20079035794 -1.21602273280 -1.23144610402 -1.24706285100 - -1.26287538221 -1.27888613550 -1.29509757845 -1.31151220869 - -1.32813255423 -1.34496117386 -1.36200065742 -1.37925362620 - -1.39672273329 -1.41441066390 -1.43232013577 -1.45045389946 - -1.46881473878 -1.48740547112 -1.50622894783 -1.52528805458 - -1.54458571173 -1.56412487472 -1.58390853444 -1.60393971760 - -1.62422148713 -1.64475694254 -1.66554922033 -1.68660149436 - -1.70791697623 -1.72949891571 -1.75135060109 -1.77347535958 - -1.79587655774 -1.81855760181 -1.84152193819 -1.86477305376 - -1.88831447631 -1.91214977495 -1.93628256049 -1.96071648584 - -1.98545524640 -2.01050258050 -2.03586226972 -2.06153813934 - -2.08753405874 -2.11385394175 -2.14050174705 -2.16748147859 - -2.19479718592 -2.22245296463 -2.25045295667 -2.27880135074 - -2.30750238268 -2.33656033579 -2.36597954123 -2.39576437832 - -2.42591927492 -2.45644870772 -2.48735720262 -2.51864933499 - -2.55032973000 -2.58240306290 -2.61487405931 -2.64774749548 - -2.68102819852 -2.71472104667 -2.74883096948 -2.78336294804 - -2.81832201513 -2.85371325541 -2.88954180550 -2.92581285414 - -2.96253164225 -2.99970346298 -3.03733366173 -3.07542763615 - -3.11399083607 -3.15302876345 -3.19254697222 -3.23255106812 - -3.27304670848 -3.31403960199 -3.35553550832 -3.39754023778 - -3.44005965088 -3.48309965783 -3.52666621797 -3.57076533909 - -3.61540307676 -3.66058553350 -3.70631885788 -3.75260924351 - -3.79946292799 -3.84688619168 -3.89488535639 -3.94346678394 - -3.99263687461 -4.04240206540 -4.09276882820 -4.14374366781 - -4.19533311968 -4.24754374767 -4.30038214140 -4.35385491363 - -4.40796869719 -4.46273014192 -4.51814591120 -4.57422267829 - -4.63096712243 -4.68838592464 -4.74648576317 -4.80527330870 - -4.86475521920 -4.92493813438 -4.98582866983 -5.04743341070 - -5.10975890503 -5.17281165657 -5.23659811717 -5.30112467867 - -5.36639766423 -5.43242331920 -5.49920780128 -5.56675717016 - -5.63507737651 -5.70417425023 -5.77405348800 -5.84472064015 - -5.91618109660 -5.98844007210 -6.06150259047 -6.13537346802 - -6.21005729593 -6.28555842162 -6.36188092908 -6.43902861809 - -6.51700498220 -6.59581318555 -6.67545603837 -6.75593597117 - -6.83725500747 -6.91941473516 -7.00241627619 -7.08626025485 - -7.17094676424 -7.25647533108 -7.34284487876 -7.43005368846 - -7.51809935842 -7.60697876116 -7.69668799867 -7.78722235547 - -7.87857624943 -7.97074318043 -8.06371567656 -8.15748523808 - -8.25204227881 -8.34737606515 -8.44347465243 -8.54032481882 - -8.63791199645 -8.73622020005 -8.83523195280 -8.93492820957 - -9.03528827743 -9.13628973352 -9.23790834033 -9.34011795829 - -9.44289045592 -9.54619561747 -9.65000104829 -9.75427207792 - -9.85897166113 -9.96406027716 -10.0694958272 -10.1752335305 - -10.2812258196 -10.3874222341 -10.4937693150 -10.6002104983 - -10.7066860093 -10.8131327583 -10.9194842371 -11.0256704187 - -11.1316176596 -11.2372486054 -11.3424821021 -11.4472331123 - -11.5514126382 -11.6549276522 -11.7576810370 -11.8595715357 - -11.9604937132 -12.0603379319 -12.1589903407 -12.2563328820 - -12.3522433160 -12.4465952660 -12.5392582853 -12.6300979490 - -12.7189759721 -12.8057503571 -12.8902755716 -12.9724027616 - -13.0519799990 -13.1288525695 -13.2028633014 -13.2738529381 - -13.3416605577 -13.4061240418 -13.4670805962 -13.5243673245 - -13.5778218602 -13.6272830552 -13.6725917301 -13.7135914857 - -13.7501295783 -13.7820578588 -13.8092337767 -13.8315214493 - -13.8487927938 -13.8609287241 -13.8678204074 -13.8693705799 - -13.8654949174 -13.8561234564 -13.8412020603 -13.8206939244 - -13.7945811122 -13.7628661128 -13.7255734118 -13.6827510618 - -13.6344722405 -13.5808367829 -13.5219726699 -13.4580374572 - -13.3892196252 -13.3157398283 -13.2378520221 -13.1558444434 - -13.0700404164 -12.9807989581 -12.8885151516 -12.7936202538 - -12.6965815048 -12.5979015988 -12.4981177774 -12.3978005006 - -12.2975516496 -12.1980022086 -12.0998093716 -12.0036530147 - -11.9102314696 -11.8202565302 -11.7344476190 -11.6535250379 - -11.5782022255 -11.5091769409 -11.4471213003 -11.3926705974 - -11.3464108537 -11.3088650658 -11.2804781507 -11.2616006359 - -11.2524712079 -11.2531983166 -11.2637411520 -11.2838904519 - -11.3132497905 -11.3512182260 -11.3969754736 -11.4494711156 - -11.5074197752 -11.5693046734 -11.6333925701 -11.6977637624 - -11.7603616049 -11.8190669232 -11.8718037527 -11.9166840656 - -11.9522005986 -11.9774786127 -11.9925994747 -11.9990783357 - -12.0000399633 -12.0000317352 -12.0000251502 -12.0000198773 - -12.0000156668 -12.0000123140 -12.0000096517 -12.0000075439 - -12.0000058799 -12.0000045700 -12.0000035420 -12.0000027376 - -12.0000021100 -12.0000016218 -12.0000012433 -12.0000009506 - -12.0000007250 -12.0000005516 -12.0000004187 -12.0000003172 - -12.0000002398 -12.0000001810 -12.0000001365 -12.0000001029 - -12.0000000775 -12.0000000584 -12.0000000440 -12.0000000333 - -12.0000000252 -12.0000000192 -12.0000000146 -12.0000000112 - -12.0000000087 -12.0000000068 -12.0000000053 -12.0000000042 - -12.0000000034 -12.0000000027 -12.0000000022 -12.0000000018 - -12.0000000015 -12.0000000012 -12.0000000010 -12.0000000009 - -12.0000000007 -12.0000000006 -12.0000000005 -12.0000000004 - -12.0000000004 -12.0000000003 -12.0000000003 -12.0000000002 - -12.0000000002 -12.0000000002 -12.0000000001 -12.0000000001 - -12.0000000001 -12.0000000001 -12.0000000001 -12.0000000001 - -12.0000000001 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 - Down Pseudopotential follows (l on next line) - 2 - -0.109804095643E-03 -0.220989356775E-03 -0.333573156314E-03 -0.447573085698E-03 - -0.563006957642E-03 -0.679892808913E-03 -0.798248903156E-03 -0.918093733740E-03 - -0.103944602665E-02 -0.116232474343E-02 -0.128674908410E-02 -0.141273849022E-02 - -0.154031264787E-02 -0.166949149075E-02 -0.180029520332E-02 -0.193274422390E-02 - -0.206685924789E-02 -0.220266123104E-02 -0.234017139266E-02 -0.247941121896E-02 - -0.262040246644E-02 -0.276316716524E-02 -0.290772762261E-02 -0.305410642639E-02 - -0.320232644855E-02 -0.335241084873E-02 -0.350438307790E-02 -0.365826688199E-02 - -0.381408630564E-02 -0.397186569591E-02 -0.413162970611E-02 -0.429340329966E-02 - -0.445721175397E-02 -0.462308066440E-02 -0.479103594827E-02 -0.496110384888E-02 - -0.513331093964E-02 -0.530768412821E-02 -0.548425066069E-02 -0.566303812592E-02 - -0.584407445973E-02 -0.602738794937E-02 -0.621300723787E-02 -0.640096132856E-02 - -0.659127958957E-02 -0.678399175844E-02 -0.697912794677E-02 -0.717671864489E-02 - -0.737679472668E-02 -0.757938745433E-02 -0.778452848327E-02 -0.799224986712E-02 - -0.820258406265E-02 -0.841556393491E-02 -0.863122276231E-02 -0.884959424188E-02 - -0.907071249447E-02 -0.929461207012E-02 -0.952132795348E-02 -0.975089556922E-02 - -0.998335078759E-02 -0.102187299300E-01 -0.104570697749E-01 -0.106984075630E-01 - -0.109427810038E-01 -0.111902282809E-01 -0.114407880582E-01 -0.116944994861E-01 - -0.119514022072E-01 -0.122115363630E-01 -0.124749425995E-01 -0.127416620745E-01 - -0.130117364630E-01 -0.132852079646E-01 -0.135621193093E-01 -0.138425137650E-01 - -0.141264351434E-01 -0.144139278076E-01 -0.147050366785E-01 -0.149998072423E-01 - -0.152982855569E-01 -0.156005182599E-01 -0.159065525755E-01 -0.162164363216E-01 - -0.165302179178E-01 -0.168479463927E-01 -0.171696713916E-01 -0.174954431841E-01 - -0.178253126724E-01 -0.181593313986E-01 -0.184975515533E-01 -0.188400259836E-01 - -0.191868082012E-01 -0.195379523908E-01 -0.198935134190E-01 -0.202535468421E-01 - -0.206181089154E-01 -0.209872566018E-01 -0.213610475806E-01 -0.217395402566E-01 - -0.221227937692E-01 -0.225108680018E-01 -0.229038235909E-01 -0.233017219356E-01 - -0.237046252075E-01 -0.241125963599E-01 -0.245256991383E-01 -0.249439980896E-01 - -0.253675585727E-01 -0.257964467688E-01 -0.262307296913E-01 -0.266704751964E-01 - -0.271157519939E-01 -0.275666296580E-01 -0.280231786378E-01 -0.284854702683E-01 - -0.289535767822E-01 -0.294275713204E-01 -0.299075279438E-01 -0.303935216449E-01 - -0.308856283593E-01 -0.313839249778E-01 -0.318884893584E-01 -0.323994003382E-01 - -0.329167377459E-01 -0.334405824143E-01 -0.339710161929E-01 -0.345081219607E-01 - -0.350519836391E-01 -0.356026862048E-01 -0.361603157036E-01 -0.367249592635E-01 - -0.372967051082E-01 -0.378756425710E-01 -0.384618621090E-01 -0.390554553169E-01 - -0.396565149414E-01 -0.402651348956E-01 -0.408814102740E-01 -0.415054373670E-01 - -0.421373136761E-01 -0.427771379290E-01 -0.434250100952E-01 -0.440810314015E-01 - -0.447453043479E-01 -0.454179327235E-01 -0.460990216228E-01 -0.467886774619E-01 - -0.474870079955E-01 -0.481941223334E-01 -0.489101309577E-01 -0.496351457400E-01 - -0.503692799590E-01 -0.511126483178E-01 -0.518653669624E-01 -0.526275534992E-01 - -0.533993270140E-01 -0.541808080901E-01 -0.549721188273E-01 -0.557733828612E-01 - -0.565847253820E-01 -0.574062731545E-01 -0.582381545377E-01 -0.590804995049E-01 - -0.599334396639E-01 -0.607971082775E-01 -0.616716402848E-01 -0.625571723216E-01 - -0.634538427419E-01 -0.643617916399E-01 -0.652811608715E-01 -0.662120940765E-01 - -0.671547367011E-01 -0.681092360205E-01 -0.690757411621E-01 -0.700544031284E-01 - -0.710453748210E-01 -0.720488110643E-01 -0.730648686295E-01 -0.740937062593E-01 - -0.751354846925E-01 -0.761903666894E-01 -0.772585170567E-01 -0.783401026736E-01 - -0.794352925178E-01 -0.805442576918E-01 -0.816671714496E-01 -0.828042092237E-01 - -0.839555486525E-01 -0.851213696082E-01 -0.863018542247E-01 -0.874971869257E-01 - -0.887075544543E-01 -0.899331459012E-01 -0.911741527349E-01 -0.924307688313E-01 - -0.937031905037E-01 -0.949916165339E-01 -0.962962482029E-01 -0.976172893225E-01 - -0.989549462668E-01 -0.100309428004 -0.101680946132 -0.103069714905 - -0.104475951274 -0.105899874915 -0.107341708269 -0.108801676571 - -0.110280007888 -0.111776933153 -0.113292686205 -0.114827503819 - -0.116381625750 -0.117955294763 -0.119548756678 -0.121162260404 - -0.122796057976 -0.124450404602 -0.126125558693 -0.127821781911 - -0.129539339205 -0.131278498856 -0.133039532516 -0.134822715249 - -0.136628325580 -0.138456645532 -0.140307960671 -0.142182560154 - -0.144080736772 -0.146002786993 -0.147949011012 -0.149919712797 - -0.151915200134 -0.153935784676 -0.155981781994 -0.158053511622 - -0.160151297110 -0.162275466071 -0.164426350237 -0.166604285504 - -0.168809611991 -0.171042674088 -0.173303820512 -0.175593404357 - -0.177911783158 -0.180259318936 -0.182636378261 -0.185043332306 - -0.187480556907 -0.189948432619 -0.192447344776 -0.194977683551 - -0.197539844016 -0.200134226205 -0.202761235173 -0.205421281061 - -0.208114779161 -0.210842149977 -0.213603819291 -0.216400218232 - -0.219231783339 -0.222098956630 -0.225002185672 -0.227941923649 - -0.230918629432 -0.233932767648 -0.236984808757 -0.240075229121 - -0.243204511079 -0.246373143020 -0.249581619461 -0.252830441121 - -0.256120115000 -0.259451154458 -0.262824079292 -0.266239415817 - -0.269697696949 -0.273199462284 -0.276745258184 -0.280335637861 - -0.283971161460 -0.287652396149 -0.291379916203 -0.295154303093 - -0.298976145578 -0.302846039792 -0.306764589338 -0.310732405382 - -0.314750106742 -0.318818319990 -0.322937679540 -0.327108827755 - -0.331332415036 -0.335609099929 -0.339939549220 -0.344324438045 - -0.348764449983 -0.353260277171 -0.357812620402 -0.362422189237 - -0.367089702110 -0.371815886441 -0.376601478744 -0.381447224742 - -0.386353879479 -0.391322207434 -0.396352982641 -0.401446988804 - -0.406605019415 -0.411827877879 -0.417116377631 -0.422471342264 - -0.427893605649 -0.433384012066 -0.438943416328 -0.444572683915 - -0.450272691099 -0.456044325079 -0.461888484119 -0.467806077674 - -0.473798026536 -0.479865262970 -0.486008730849 -0.492229385805 - -0.498528195363 -0.504906139093 -0.511364208754 -0.517903408441 - -0.524524754738 -0.531229276868 -0.538018016846 -0.544892029635 - -0.551852383303 -0.558900159183 -0.566036452028 -0.573262370182 - -0.580579035736 -0.587987584697 -0.595489167157 -0.603084947460 - -0.610776104377 -0.618563831272 -0.626449336286 -0.634433842509 - -0.642518588158 -0.650704826762 -0.658993827340 -0.667386874589 - -0.675885269070 -0.684490327395 -0.693203382420 -0.702025783436 - -0.710958896364 -0.720004103952 -0.729162805971 -0.738436419422 - -0.747826378730 -0.757334135956 -0.766961161000 -0.776708941812 - -0.786578984600 -0.796572814046 -0.806691973521 -0.816938025300 - -0.827312550781 -0.837817150711 -0.848453445403 -0.859223074969 - -0.870127699541 -0.881168999504 -0.892348675728 -0.903668449802 - -0.915130064271 -0.926735282871 -0.938485890774 -0.950383694829 - -0.962430523803 -0.974628228635 -0.986978682680 -0.999483781959 - -1.01214544542 -1.02496561517 -1.03794625679 -1.05108935950 - -1.06439693652 -1.07787102526 -1.09151368764 -1.10532701030 - -1.11931310493 -1.13347410848 -1.14781218351 -1.16232951838 - -1.17702832759 -1.19191085202 -1.20697935927 -1.22223614384 - -1.23768352753 -1.25332385965 -1.26915951732 -1.28519290579 - -1.30142645871 -1.31786263841 -1.33450393623 -1.35135287277 - -1.36841199823 -1.38568389271 -1.40317116644 -1.42087646019 - -1.43880244547 -1.45695182491 -1.47532733253 -1.49393173404 - -1.51276782715 -1.53183844190 -1.55114644096 -1.57069471989 - -1.59048620753 -1.61052386625 -1.63081069227 -1.65134971599 - -1.67214400228 -1.69319665080 -1.71451079629 -1.73608960890 - -1.75793629450 -1.78005409494 -1.80244628842 -1.82511618975 - -1.84806715067 -1.87130256014 -1.89482584463 -1.91864046846 - -1.94274993402 -1.96715778212 -1.99186759226 -2.01688298287 - -2.04220761167 -2.06784517585 -2.09379941243 -2.12007409843 - -2.14667305119 -2.17360012861 -2.20085922935 -2.22845429314 - -2.25638930090 -2.28466827507 -2.31329527971 -2.34227442079 - -2.37160984629 -2.40130574642 -2.43136635376 -2.46179594340 - -2.49259883306 -2.52377938321 -2.55534199715 -2.58729112108 - -2.61963124415 -2.65236689847 -2.68550265914 -2.71904314420 - -2.75299301456 -2.78735697396 -2.82213976880 -2.85734618803 - -2.89298106294 -2.92904926690 -2.96555571517 -3.00250536447 - -3.03990321272 -3.07775429852 -3.11606370076 -3.15483653804 - -3.19407796806 -3.23379318700 -3.27398742874 -3.31466596405 - -3.35583409973 -3.39749717757 -3.43966057331 -3.48232969545 - -3.52550998398 -3.56920690898 -3.61342596909 -3.65817268990 - -3.70345262216 -3.74927133985 -3.79563443816 -3.84254753119 - -3.89001624962 -3.93804623807 -3.98664315236 -4.03581265653 - -4.08556041962 -4.13589211228 -4.18681340308 -4.23832995460 - -4.29044741923 -4.34317143470 -4.39650761926 -4.45046156664 - -4.50503884053 -4.56024496884 -4.61608543746 -4.67256568374 - -4.72969108945 -4.78746697334 -4.84589858326 -4.90499108771 - -4.96474956694 -5.02517900350 -5.08628427217 -5.14807012935 - -5.21054120174 -5.27370197446 -5.33755677836 -5.40210977666 - -5.46736495086 -5.53332608573 -5.59999675362 -5.66738029770 - -5.73547981449 -5.80429813525 -5.87383780649 -5.94410106937 - -6.01508983805 -6.08680567690 -6.15924977650 -6.23242292850 - -6.30632549913 -6.38095740141 -6.45631806608 -6.53240641103 - -6.60922080929 -6.68675905563 -6.76501833146 -6.84399516829 - -6.92368540949 -7.00408417041 -7.08518579683 -7.16698382163 - -7.24947091977 -7.33263886141 -7.41647846331 -7.50097953837 - -7.58613084335 -7.67192002477 -7.75833356304 -7.84535671471 - -7.93297345307 -8.02116640689 -8.10991679762 -8.19920437491 - -8.28900735061 -8.37930233140 -8.47006425006 -8.56126629564 - -8.65287984261 -8.74487437920 -8.83721743514 -8.92987450911 - -9.02280899605 -9.11598211476 -9.20935283604 -9.30287781185 - -9.39651130580 -9.49020512555 -9.58390855756 -9.67756830477 - -9.77112842783 -9.86453029058 -9.95771251047 -10.0506109147 - -10.1431585028 -10.2352854172 -10.3269189214 -10.4179833889 - -10.5084003014 -10.5980882595 -10.6869630071 -10.7749374688 - -10.8619218045 -10.9478234800 -11.0325473578 -11.1159958070 - -11.1980688362 -11.2786642496 -11.3576778290 -11.4350035431 - -11.5105337857 -11.5841596453 -11.6557712072 -11.7252578904 - -11.7925088213 -11.8574132449 -11.9198609770 -11.9797428963 - -12.0369514810 -12.0913813883 -12.1429300796 -12.1914984913 - -12.2369917520 -12.2793199463 -12.3183989246 -12.3541511575 - -12.3865066351 -12.4154038073 -12.4407905632 -12.4626252459 - -12.4808776976 -12.4955303306 -12.5065792153 -12.5140351787 - -12.5179249029 -12.5182920123 -12.5151981361 -12.5087239313 - -12.4989700471 -12.4860580136 -12.4701310283 -12.4513546176 - -12.4299171435 -12.4060301229 -12.3799283242 -12.3518696020 - -12.3221344258 -12.2910250566 -12.2588643205 -12.2259939243 - -12.1927722581 -12.1595716242 -12.1267748344 -12.0947711156 - -12.0639512706 -12.0347020430 -12.0073996514 -11.9824024693 - -11.9600428522 -11.9406181470 -11.9243809566 -11.9115287931 - -11.9021933215 -11.8964294896 -11.8942049538 -11.8953903548 - -11.8997511767 -11.9069421387 -11.9165053353 -11.9278736670 - -11.9403814869 -11.9532848616 -11.9657944055 -11.9771243203 - -11.9865620795 -11.9935641627 -11.9978844060 -11.9997603153 - -12.0000392409 -12.0000317352 -12.0000251502 -12.0000198773 - -12.0000156668 -12.0000123140 -12.0000096517 -12.0000075439 - -12.0000058799 -12.0000045700 -12.0000035420 -12.0000027376 - -12.0000021100 -12.0000016218 -12.0000012433 -12.0000009506 - -12.0000007250 -12.0000005516 -12.0000004187 -12.0000003172 - -12.0000002398 -12.0000001810 -12.0000001365 -12.0000001029 - -12.0000000775 -12.0000000584 -12.0000000440 -12.0000000333 - -12.0000000252 -12.0000000192 -12.0000000146 -12.0000000112 - -12.0000000087 -12.0000000068 -12.0000000053 -12.0000000042 - -12.0000000034 -12.0000000027 -12.0000000022 -12.0000000018 - -12.0000000015 -12.0000000012 -12.0000000010 -12.0000000009 - -12.0000000007 -12.0000000006 -12.0000000005 -12.0000000004 - -12.0000000004 -12.0000000003 -12.0000000003 -12.0000000002 - -12.0000000002 -12.0000000002 -12.0000000001 -12.0000000001 - -12.0000000001 -12.0000000001 -12.0000000001 -12.0000000001 - -12.0000000001 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 - Down Pseudopotential follows (l on next line) - 3 - -0.997906871301E-04 -0.200836586576E-03 -0.303153486958E-03 -0.406757375493E-03 - -0.511664440491E-03 -0.617891073886E-03 -0.725453873796E-03 -0.834369647118E-03 - -0.944655412153E-03 -0.105632840126E-02 -0.116940606357E-02 -0.128390606768E-02 - -0.139984630443E-02 -0.151724488971E-02 -0.163612016727E-02 -0.175649071160E-02 - -0.187837533082E-02 -0.200179306964E-02 -0.212676321231E-02 -0.225330528564E-02 - -0.238143906208E-02 -0.251118456277E-02 -0.264256206067E-02 -0.277559208377E-02 - -0.291029541825E-02 -0.304669311176E-02 -0.318480647667E-02 -0.332465709346E-02 - -0.346626681404E-02 -0.360965776517E-02 -0.375485235196E-02 -0.390187326130E-02 - -0.405074346548E-02 -0.420148622574E-02 -0.435412509587E-02 -0.450868392599E-02 - -0.466518686616E-02 -0.482365837024E-02 -0.498412319967E-02 -0.514660642735E-02 - -0.531113344156E-02 -0.547772994992E-02 -0.564642198339E-02 -0.581723590040E-02 - -0.599019839088E-02 -0.616533648052E-02 -0.634267753490E-02 -0.652224926384E-02 - -0.670407972572E-02 -0.688819733182E-02 -0.707463085079E-02 -0.726340941316E-02 - -0.745456251584E-02 -0.764812002681E-02 -0.784411218969E-02 -0.804256962855E-02 - -0.824352335264E-02 -0.844700476125E-02 -0.865304564863E-02 -0.886167820896E-02 - -0.907293504134E-02 -0.928684915493E-02 -0.950345397408E-02 -0.972278334357E-02 - -0.994487153387E-02 -0.101697532465E-01 -0.103974636196E-01 -0.106280382331E-01 - -0.108615131145E-01 -0.110979247446E-01 -0.113373100629E-01 -0.115797064736E-01 - -0.118251518514E-01 -0.120736845474E-01 -0.123253433950E-01 -0.125801677163E-01 - -0.128381973276E-01 -0.130994725463E-01 -0.133640341969E-01 -0.136319236174E-01 - -0.139031826656E-01 -0.141778537261E-01 -0.144559797162E-01 -0.147376040933E-01 - -0.150227708615E-01 -0.153115245782E-01 -0.156039103612E-01 -0.158999738960E-01 - -0.161997614426E-01 -0.165033198430E-01 -0.168106965281E-01 -0.171219395256E-01 - -0.174370974674E-01 -0.177562195969E-01 -0.180793557770E-01 -0.184065564976E-01 - -0.187378728838E-01 -0.190733567039E-01 -0.194130603770E-01 -0.197570369819E-01 - -0.201053402646E-01 -0.204580246476E-01 -0.208151452375E-01 -0.211767578343E-01 - -0.215429189396E-01 -0.219136857661E-01 -0.222891162455E-01 -0.226692690388E-01 - -0.230542035443E-01 -0.234439799078E-01 -0.238386590313E-01 -0.242383025830E-01 - -0.246429730067E-01 -0.250527335316E-01 -0.254676481822E-01 -0.258877817883E-01 - -0.263131999950E-01 -0.267439692732E-01 -0.271801569298E-01 -0.276218311182E-01 - -0.280690608491E-01 -0.285219160013E-01 -0.289804673321E-01 -0.294447864892E-01 - -0.299149460213E-01 -0.303910193895E-01 -0.308730809789E-01 -0.313612061102E-01 - -0.318554710515E-01 -0.323559530300E-01 -0.328627302445E-01 -0.333758818769E-01 - -0.338954881055E-01 -0.344216301166E-01 -0.349543901178E-01 -0.354938513507E-01 - -0.360400981038E-01 -0.365932157256E-01 -0.371532906381E-01 -0.377204103505E-01 - -0.382946634721E-01 -0.388761397271E-01 -0.394649299680E-01 -0.400611261898E-01 - -0.406648215449E-01 -0.412761103568E-01 -0.418950881356E-01 -0.425218515926E-01 - -0.431564986552E-01 -0.437991284828E-01 -0.444498414814E-01 -0.451087393203E-01 - -0.457759249469E-01 -0.464515026039E-01 -0.471355778444E-01 -0.478282575496E-01 - -0.485296499444E-01 -0.492398646149E-01 -0.499590125257E-01 -0.506872060364E-01 - -0.514245589200E-01 -0.521711863803E-01 -0.529272050698E-01 -0.536927331080E-01 - -0.544678901000E-01 -0.552527971549E-01 -0.560475769050E-01 -0.568523535246E-01 - -0.576672527497E-01 -0.584924018975E-01 -0.593279298863E-01 -0.601739672555E-01 - -0.610306461860E-01 -0.618981005213E-01 -0.627764657876E-01 -0.636658792155E-01 - -0.645664797614E-01 -0.654784081288E-01 -0.664018067907E-01 -0.673368200118E-01 - -0.682835938705E-01 -0.692422762824E-01 -0.702130170229E-01 -0.711959677509E-01 - -0.721912820319E-01 -0.731991153629E-01 -0.742196251956E-01 -0.752529709619E-01 - -0.762993140981E-01 -0.773588180704E-01 -0.784316484004E-01 -0.795179726908E-01 - -0.806179606518E-01 -0.817317841271E-01 -0.828596171213E-01 -0.840016358264E-01 - -0.851580186499E-01 -0.863289462422E-01 -0.875146015250E-01 -0.887151697197E-01 - -0.899308383763E-01 -0.911617974026E-01 -0.924082390941E-01 -0.936703581636E-01 - -0.949483517716E-01 -0.962424195575E-01 -0.975527636701E-01 -0.988795887994E-01 - -0.100223102209 -0.101583513767 -0.102961035980 -0.104355884026 - -0.105768275787 -0.107198431886 -0.108646575716 -0.110112933480 - -0.111597734224 -0.113101209871 -0.114623595260 -0.116165128183 - -0.117726049418 -0.119306602771 -0.120907035111 -0.122527596409 - -0.124168539779 -0.125830121514 -0.127512601129 -0.129216241399 - -0.130941308402 -0.132688071557 -0.134456803671 -0.136247780978 - -0.138061283181 -0.139897593500 -0.141756998709 -0.143639789190 - -0.145546258969 -0.147476705767 -0.149431431045 -0.151410740051 - -0.153414941866 -0.155444349455 -0.157499279713 -0.159580053514 - -0.161686995764 -0.163820435447 -0.165980705682 -0.168168143767 - -0.170383091238 -0.172625893919 -0.174896901976 -0.177196469972 - -0.179524956921 -0.181882726345 -0.184270146327 -0.186687589573 - -0.189135433467 -0.191614060129 -0.194123856476 -0.196665214280 - -0.199238530231 -0.201844205994 -0.204482648277 -0.207154268891 - -0.209859484812 -0.212598718249 -0.215372396706 -0.218180953052 - -0.221024825582 -0.223904458092 -0.226820299941 -0.229772806125 - -0.232762437344 -0.235789660076 -0.238854946647 -0.241958775302 - -0.245101630285 -0.248284001906 -0.251506386623 -0.254769287113 - -0.258073212355 -0.261418677703 -0.264806204967 -0.268236322497 - -0.271709565259 -0.275226474918 -0.278787599924 -0.282393495596 - -0.286044724202 -0.289741855052 -0.293485464582 -0.297276136442 - -0.301114461585 -0.305001038360 -0.308936472602 -0.312921377724 - -0.316956374811 -0.321042092715 -0.325179168153 -0.329368245801 - -0.333609978394 -0.337905026823 -0.342254060242 -0.346657756163 - -0.351116800560 -0.355631887978 -0.360203721633 -0.364833013523 - -0.369520484532 -0.374266864543 -0.379072892546 -0.383939316749 - -0.388866894696 -0.393856393376 -0.398908589341 -0.404024268822 - -0.409204227852 -0.414449272378 -0.419760218389 -0.425137892035 - -0.430583129753 -0.436096778392 -0.441679695336 -0.447332748639 - -0.453056817151 -0.458852790648 -0.464721569968 -0.470664067143 - -0.476681205534 -0.482773919971 -0.488943156890 -0.495189874473 - -0.501515042791 -0.507919643947 -0.514404672219 -0.520971134211 - -0.527620048996 -0.534352448272 -0.541169376507 -0.548071891097 - -0.555061062516 -0.562137974479 -0.569303724093 -0.576559422023 - -0.583906192649 -0.591345174231 -0.598877519074 -0.606504393693 - -0.614226978985 -0.622046470395 -0.629964078090 -0.637981027134 - -0.646098557659 -0.654317925048 -0.662640400107 -0.671067269254 - -0.679599834694 -0.688239414608 -0.696987343339 -0.705844971578 - -0.714813666553 -0.723894812227 -0.733089809483 -0.742400076326 - -0.751827048077 -0.761372177573 -0.771036935370 -0.780822809941 - -0.790731307885 -0.800763954133 -0.810922292153 -0.821207884168 - -0.831622311357 -0.842167174081 -0.852844092089 -0.863654704742 - -0.874600671232 -0.885683670798 -0.896905402959 -0.908267587729 - -0.919771965852 -0.931420299027 -0.943214370138 -0.955155983489 - -0.967246965040 -0.979489162635 -0.991884446251 -1.00443470823 - -1.01714186352 -1.03000784992 -1.04303462834 -1.05622418302 - -1.06957852178 -1.08309967631 -1.09678970238 -1.11065068011 - -1.12468471420 -1.13889393425 -1.15328049494 -1.16784657634 - -1.18259438416 -1.19752615000 -1.21264413164 -1.22795061327 - -1.24344790579 -1.25913834705 -1.27502430215 -1.29110816368 - -1.30739235202 -1.32387931558 -1.34057153110 -1.35747150393 - -1.37458176828 -1.39190488750 -1.40944345440 -1.42720009146 - -1.44517745118 -1.46337821630 -1.48180510011 -1.50046084675 - -1.51934823144 -1.53847006080 -1.55782917312 -1.57742843865 - -1.59727075987 -1.61735907177 -1.63769634214 -1.65828557186 - -1.67912979516 -1.70023207989 -1.72159552785 -1.74322327499 - -1.76511849177 -1.78728438338 -1.80972419000 -1.83244118714 - -1.85543868582 -1.87872003292 -1.90228861138 -1.92614784049 - -1.95030117614 -1.97475211108 -1.99950417515 -2.02456093554 - -2.04992599703 -2.07560300222 -2.10159563175 -2.12790760454 - -2.15454267797 -2.18150464814 -2.20879735001 -2.23642465763 - -2.26439048431 -2.29269878277 -2.32135354534 -2.35035880406 - -2.37971863082 -2.40943713752 -2.43951847613 -2.46996683877 - -2.50078645782 -2.53198160594 -2.56355659609 -2.59551578157 - -2.62786355598 -2.66060435316 -2.69374264717 -2.72728295212 - -2.76122982212 -2.79558785104 -2.83036167235 -2.86555595889 - -2.90117542255 -2.93722481395 -2.97370892212 -3.01063257399 - -3.04800063399 -3.08581800346 -3.12408962009 -3.16282045723 - -3.20201552315 -3.24167986027 -3.28181854421 -3.32243668289 - -3.36353941539 -3.40513191084 -3.44721936711 -3.48980700949 - -3.53290008915 -3.57650388155 -3.62062368467 -3.66526481715 - -3.71043261624 -3.75613243560 -3.80236964295 -3.84914961753 - -3.89647774735 -3.94435942630 -3.99280005099 -4.04180501738 - -4.09137971720 -4.14152953408 -4.19225983943 -4.24357598809 - -4.29548331356 -4.34798712303 -4.40109269207 -4.45480525888 - -4.50913001827 -4.56407211520 -4.61963663792 -4.67582861069 - -4.73265298602 -4.79011463645 -4.84821834583 -4.90696880004 - -4.96637057719 -5.02642813721 -5.08714581082 -5.14852778791 - -5.21057810514 -5.27330063297 -5.33669906179 -5.40077688743 - -5.46553739575 -5.53098364640 -5.59711845576 -5.66394437890 - -5.73146369054 -5.79967836512 -5.86859005573 -5.93820007202 - -6.00850935693 -6.07951846228 -6.15122752318 -6.22363623119 - -6.29674380608 -6.37054896645 -6.44504989879 -6.52024422528 - -6.59612897003 -6.67270052392 -6.74995460787 -6.82788623457 - -6.90648966866 -6.98575838531 -7.06568502712 -7.14626135948 - -7.22747822419 -7.30932549152 -7.39179201053 -7.47486555787 - -7.55853278489 -7.64277916315 -7.72758892851 -7.81294502360 - -7.89882903899 -7.98522115295 -8.07210007002 -8.15944295846 - -8.24722538678 -8.33542125933 -8.42400275143 -8.51294024394 - -8.60220225776 -8.69175538836 -8.78156424067 -8.87159136479 - -8.96179719269 -9.05213997649 -9.14257572863 -9.23305816455 - -9.32353864831 -9.41396614187 -9.50428715852 -9.59444572132 - -9.68438332722 -9.77403891767 -9.86334885664 -9.95224691703 - -10.0406642764 -10.1285295230 -10.2157686739 -10.3023052051 - -10.3880600963 -10.4729518913 -10.5568967746 -10.6398086669 - -10.7215993400 -10.8021785539 -10.8814542165 -10.9593325680 - -11.0357183925 -11.1105152572 -11.1836257819 -11.2549519404 - -11.3243953954 -11.3918578677 -11.4572415433 -11.5204495174 - -11.5813862785 -11.6399582325 -11.6960742686 -11.7496463664 - -11.8005902456 -11.8488260572 -11.8942791164 -11.9368806746 - -11.9765687303 -12.0132888747 -12.0469951691 -12.0776510501 - -12.1052302561 -12.1297177684 -12.1511107589 -12.1694195354 - -12.1846684703 -12.1968969033 -12.2061599984 -12.2125295414 - -12.2160946542 -12.2169624071 -12.2152582995 -12.2111265852 - -12.2047304067 -12.1962517088 -12.1858908917 -12.1738661644 - -12.1604125580 -12.1457805534 -12.1302342794 -12.1140492357 - -12.0975094973 -12.0809043600 -12.0645243920 -12.0486568663 - -12.0335805605 -12.0195599304 -12.0068386875 -11.9956328433 - -11.9861233263 -11.9784483328 -11.9726956408 -11.9688952048 - -11.9670124588 -11.9669428853 -11.9685085801 -11.9714577369 - -11.9754682273 -11.9801567454 -11.9850953470 -11.9898376444 - -11.9939574386 -11.9971031932 -11.9991345136 -11.9999230921 - -12.0000373010 -12.0000296134 -12.0000234687 -12.0000185484 - -12.0000146193 -12.0000114907 -12.0000090064 -12.0000070395 - -12.0000054868 -12.0000042645 -12.0000033052 -12.0000025546 - -12.0000019689 -12.0000015134 -12.0000011601 -12.0000008870 - -12.0000006765 -12.0000005147 -12.0000003907 -12.0000002960 - -12.0000002238 -12.0000001689 -12.0000001274 -12.0000000960 - -12.0000000723 -12.0000000545 -12.0000000411 -12.0000000310 - -12.0000000235 -12.0000000179 -12.0000000137 -12.0000000105 - -12.0000000081 -12.0000000063 -12.0000000050 -12.0000000039 - -12.0000000031 -12.0000000025 -12.0000000021 -12.0000000017 - -12.0000000014 -12.0000000012 -12.0000000010 -12.0000000008 - -12.0000000007 -12.0000000006 -12.0000000005 -12.0000000004 - -12.0000000004 -12.0000000003 -12.0000000003 -12.0000000002 - -12.0000000002 -12.0000000002 -12.0000000001 -12.0000000001 - -12.0000000001 -12.0000000001 -12.0000000001 -12.0000000001 - -12.0000000001 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 -12.0000000000 -12.0000000000 -12.0000000000 - -12.0000000000 - Core charge follows - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 0.00000000000 0.00000000000 0.00000000000 - 0.00000000000 - Valence charge follows - 0.492067138083E-10 0.199310418009E-09 0.454118792434E-09 0.817551676193E-09 - 0.129364410540E-08 0.188654943031E-08 0.260054251385E-08 0.344002301379E-08 - 0.440951875045E-08 0.551368916247E-08 0.675732885253E-08 0.814537122571E-08 - 0.968289222256E-08 0.113751141495E-07 0.132274096089E-07 0.152453055317E-07 - 0.174344873149E-07 0.198008030662E-07 0.223502679600E-07 0.250890687061E-07 - 0.280235681343E-07 0.311603098984E-07 0.345060233031E-07 0.380676282544E-07 - 0.418522403407E-07 0.458671760441E-07 0.501199580876E-07 0.546183209208E-07 - 0.593702163479E-07 0.643838193018E-07 0.696675337669E-07 0.752299988566E-07 - 0.810800950472E-07 0.872269505734E-07 0.936799479897E-07 0.100448730901E-06 - 0.107543210869E-06 0.114973574491E-06 0.122750290675E-06 0.130884118085E-06 - 0.139386112795E-06 0.148267636130E-06 0.157540362713E-06 0.167216288724E-06 - 0.177307740364E-06 0.187827382542E-06 0.198788227788E-06 0.210203645393E-06 - 0.222087370783E-06 0.234453515142E-06 0.247316575271E-06 0.260691443715E-06 - 0.274593419142E-06 0.289038216989E-06 0.304041980389E-06 0.319621291371E-06 - 0.335793182355E-06 0.352575147941E-06 0.369985156997E-06 0.388041665068E-06 - 0.406763627091E-06 0.426170510450E-06 0.446282308355E-06 0.467119553576E-06 - 0.488703332524E-06 0.511055299691E-06 0.534197692468E-06 0.558153346340E-06 - 0.582945710472E-06 0.608598863694E-06 0.635137530898E-06 0.662587099859E-06 - 0.690973638478E-06 0.720323912479E-06 0.750665403555E-06 0.782026327979E-06 - 0.814435655691E-06 0.847923129883E-06 0.882519287074E-06 0.918255477711E-06 - 0.955163887291E-06 0.993277558026E-06 0.103263041107E-05 0.107325726930E-05 - 0.111519388071E-05 0.115847694236E-05 0.120314412497E-05 0.124923409818E-05 - 0.129678655633E-05 0.134584224508E-05 0.139644298856E-05 0.144863171727E-05 - 0.150245249674E-05 0.155795055682E-05 0.161517232186E-05 0.167416544149E-05 - 0.173497882236E-05 0.179766266058E-05 0.186226847501E-05 0.192884914143E-05 - 0.199745892760E-05 0.206815352911E-05 0.214099010632E-05 0.221602732205E-05 - 0.229332538042E-05 0.237294606653E-05 0.245495278726E-05 0.253941061305E-05 - 0.262638632079E-05 0.271594843779E-05 0.280816728683E-05 0.290311503248E-05 - 0.300086572846E-05 0.310149536631E-05 0.320508192528E-05 0.331170542345E-05 - 0.342144797026E-05 0.353439382025E-05 0.365062942827E-05 0.377024350609E-05 - 0.389332708039E-05 0.401997355235E-05 0.415027875860E-05 0.428434103391E-05 - 0.442226127534E-05 0.456414300807E-05 0.471009245297E-05 0.486021859581E-05 - 0.501463325830E-05 0.517345117089E-05 0.533679004749E-05 0.550477066206E-05 - 0.567751692718E-05 0.585515597457E-05 0.603781823776E-05 0.622563753681E-05 - 0.641875116518E-05 0.661729997888E-05 0.682142848784E-05 0.703128494965E-05 - 0.724702146568E-05 0.746879407965E-05 0.769676287874E-05 0.793109209725E-05 - 0.817195022295E-05 0.841951010611E-05 0.867394907134E-05 0.893544903226E-05 - 0.920419660915E-05 0.948038324954E-05 0.976420535195E-05 0.100558643928E-04 - 0.103555670563E-04 0.106635253682E-04 0.109799568324E-04 0.113050845716E-04 - 0.116391374708E-04 0.119823503252E-04 0.123349639915E-04 0.126972255432E-04 - 0.130693884300E-04 0.134517126406E-04 0.138444648708E-04 0.142479186948E-04 - 0.146623547415E-04 0.150880608754E-04 0.155253323816E-04 0.159744721557E-04 - 0.164357908993E-04 0.169096073193E-04 0.173962483330E-04 0.178960492786E-04 - 0.184093541309E-04 0.189365157218E-04 0.194778959680E-04 0.200338661031E-04 - 0.206048069163E-04 0.211911089971E-04 0.217931729865E-04 0.224114098343E-04 - 0.230462410629E-04 0.236980990384E-04 0.243674272484E-04 0.250546805865E-04 - 0.257603256450E-04 0.264848410142E-04 0.272287175897E-04 0.279924588884E-04 - 0.287765813709E-04 0.295816147739E-04 0.304081024504E-04 0.312566017181E-04 - 0.321276842180E-04 0.330219362812E-04 0.339399593058E-04 0.348823701426E-04 - 0.358498014923E-04 0.368429023109E-04 0.378623382275E-04 0.389087919715E-04 - 0.399829638115E-04 0.410855720054E-04 0.422173532617E-04 0.433790632134E-04 - 0.445714769038E-04 0.457953892845E-04 0.470516157271E-04 0.483409925473E-04 - 0.496643775429E-04 0.510226505460E-04 0.524167139892E-04 0.538474934862E-04 - 0.553159384280E-04 0.568230225944E-04 0.583697447810E-04 0.599571294430E-04 - 0.615862273553E-04 0.632581162902E-04 0.649739017122E-04 0.667347174912E-04 - 0.685417266343E-04 0.703961220364E-04 0.722991272508E-04 0.742519972794E-04 - 0.762560193837E-04 0.783125139174E-04 0.804228351799E-04 0.825883722933E-04 - 0.848105501008E-04 0.870908300904E-04 0.894307113414E-04 0.918317314961E-04 - 0.942954677579E-04 0.968235379142E-04 0.994176013871E-04 0.102079360312E-03 - 0.104810560643E-03 0.107612993290E-03 0.110488495283E-03 0.113438950971E-03 - 0.116466293248E-03 0.119572504813E-03 0.122759619466E-03 0.126029723436E-03 - 0.129384956744E-03 0.132827514603E-03 0.136359648857E-03 0.139983669452E-03 - 0.143701945954E-03 0.147516909107E-03 0.151431052423E-03 0.155446933826E-03 - 0.159567177336E-03 0.163794474794E-03 0.168131587640E-03 0.172581348737E-03 - 0.177146664240E-03 0.181830515518E-03 0.186635961131E-03 0.191566138860E-03 - 0.196624267781E-03 0.201813650414E-03 0.207137674916E-03 0.212599817338E-03 - 0.218203643944E-03 0.223952813593E-03 0.229851080191E-03 0.235902295196E-03 - 0.242110410211E-03 0.248479479633E-03 0.255013663380E-03 0.261717229699E-03 - 0.268594558041E-03 0.275650142024E-03 0.282888592474E-03 0.290314640554E-03 - 0.297933140975E-03 0.305749075304E-03 0.313767555357E-03 0.321993826691E-03 - 0.330433272196E-03 0.339091415783E-03 0.347973926182E-03 0.357086620841E-03 - 0.366435469944E-03 0.376026600532E-03 0.385866300755E-03 0.395961024231E-03 - 0.406317394545E-03 0.416942209860E-03 0.427842447679E-03 0.439025269729E-03 - 0.450498026997E-03 0.462268264905E-03 0.474343728639E-03 0.486732368634E-03 - 0.499442346218E-03 0.512482039422E-03 0.525860048960E-03 0.539585204385E-03 - 0.553666570433E-03 0.568113453547E-03 0.582935408602E-03 0.598142245822E-03 - 0.613744037919E-03 0.629751127431E-03 0.646174134289E-03 0.663023963614E-03 - 0.680311813747E-03 0.698049184526E-03 0.716247885813E-03 0.734920046285E-03 - 0.754078122494E-03 0.773734908208E-03 0.793903544042E-03 0.814597527383E-03 - 0.835830722629E-03 0.857617371751E-03 0.879972105181E-03 0.902909953045E-03 - 0.926446356756E-03 0.950597180967E-03 0.975378725913E-03 0.100080774014E-02 - 0.102690143366E-02 0.105367749151E-02 0.108115408773E-02 0.110934989988E-02 - 0.113828412393E-02 0.116797648970E-02 0.119844727677E-02 0.122971733095E-02 - 0.126180808129E-02 0.129474155762E-02 0.132854040870E-02 0.136322792101E-02 - 0.139882803814E-02 0.143536538078E-02 0.147286526753E-02 0.151135373629E-02 - 0.155085756642E-02 0.159140430172E-02 0.163302227408E-02 0.167574062809E-02 - 0.171958934640E-02 0.176459927601E-02 0.181080215550E-02 0.185823064315E-02 - 0.190691834614E-02 0.195689985074E-02 0.200821075356E-02 0.206088769395E-02 - 0.211496838758E-02 0.217049166118E-02 0.222749748857E-02 0.228602702799E-02 - 0.234612266084E-02 0.240782803174E-02 0.247118809016E-02 0.253624913355E-02 - 0.260305885208E-02 0.267166637502E-02 0.274212231887E-02 0.281447883733E-02 - 0.288878967312E-02 0.296511021172E-02 0.304349753723E-02 0.312401049032E-02 - 0.320670972840E-02 0.329165778805E-02 0.337891914998E-02 0.346856030636E-02 - 0.356064983085E-02 0.365525845133E-02 0.375245912547E-02 0.385232711927E-02 - 0.395494008868E-02 0.406037816446E-02 0.416872404034E-02 0.428006306480E-02 - 0.439448333638E-02 0.451207580285E-02 0.463293436441E-02 0.475715598095E-02 - 0.488484078369E-02 0.501609219132E-02 0.515101703085E-02 0.528972566340E-02 - 0.543233211511E-02 0.557895421334E-02 0.572971372860E-02 0.588473652216E-02 - 0.604415269985E-02 0.620809677216E-02 0.637670782102E-02 0.655012967344E-02 - 0.672851108243E-02 0.691200591544E-02 0.710077335066E-02 0.729497808160E-02 - 0.749479053015E-02 0.770038706870E-02 0.791195025155E-02 0.812966905610E-02 - 0.835373913423E-02 0.858436307433E-02 0.882175067440E-02 0.906611922679E-02 - 0.931769381501E-02 0.957670762319E-02 0.984340225871E-02 0.101180280886E-01 - 0.104008445903E-01 0.106921207175E-01 0.109921352814E-01 0.113011773486E-01 - 0.116195466556E-01 0.119475540419E-01 0.122855219006E-01 0.126337846489E-01 - 0.129926892193E-01 0.133625955705E-01 0.137438772220E-01 0.141369218101E-01 - 0.145421316685E-01 0.149599244340E-01 0.153907336779E-01 0.158350095643E-01 - 0.162932195372E-01 0.167658490362E-01 0.172534022441E-01 0.177564028652E-01 - 0.182753949375E-01 0.188109436796E-01 0.193636363739E-01 0.199340832866E-01 - 0.205229186279E-01 0.211308015522E-01 0.217584172011E-01 0.224064777903E-01 - 0.230757237425E-01 0.237669248682E-01 0.244808815957E-01 0.252184262532E-01 - 0.259804244041E-01 0.267677762382E-01 0.275814180207E-01 0.284223236008E-01 - 0.292915059839E-01 0.301900189664E-01 0.311189588398E-01 0.320794661626E-01 - 0.330727276048E-01 0.340999778676E-01 0.351625016793E-01 0.362616358722E-01 - 0.373987715415E-01 0.385753562902E-01 0.397928965620E-01 0.410529600660E-01 - 0.423571782954E-01 0.437072491434E-01 0.451049396194E-01 0.465520886685E-01 - 0.480506100979E-01 0.496024956112E-01 0.512098179574E-01 0.528747341930E-01 - 0.545994890649E-01 0.563864185130E-01 0.582379532984E-01 0.601566227584E-01 - 0.621450586919E-01 0.642059993774E-01 0.663422937265E-01 0.685569055749E-01 - 0.708529181140E-01 0.732335384636E-01 0.757021023898E-01 0.782620791668E-01 - 0.809170765870E-01 0.836708461174E-01 0.865272882051E-01 0.894904577308E-01 - 0.925645696109E-01 0.957540045462E-01 0.990633149169E-01 0.102497230822 - 0.106060666260 0.109758725445 0.113596709263 0.117580121849 - 0.121714677291 0.126006306451 0.130461163890 0.135085634890 - 0.139886342569 0.144870155065 0.150044192782 0.155415835687 - 0.160992730627 0.166782798660 0.172794242379 0.179035553190 - 0.185515518542 0.192243229057 0.199228085549 0.206479805888 - 0.214008431673 0.221824334681 0.229938223042 0.238361147097 - 0.247104504893 0.256180047256 0.265599882383 0.275376479910 - 0.285522674357 0.296051667916 0.306977032482 0.318312710863 - 0.330073017079 0.342272635658 0.354926619848 0.368050388635 - 0.381659722469 0.395770757591 0.410399978842 0.425564210848 - 0.441280607445 0.457566639229 0.474440079091 0.491918985611 - 0.510021684163 0.528766745600 0.548172962370 0.568259321916 - 0.589044977219 0.610549214330 0.632791416759 0.655791026560 - 0.679567501983 0.704140271557 0.729528684466 0.755751957110 - 0.782829115719 0.810778934941 0.839619872303 0.869369998471 - 0.900046923277 0.931667717455 0.964248830099 0.997806001852 - 1.03235417388 1.06790739272 1.10447871109 1.14208008487 - 1.18072226639 1.22041469435 1.26116538063 1.30298079424 - 1.34586574303 1.38982325343 1.43485444883 1.48095842711 - 1.52813213812 1.57637026161 1.62566508655 1.67600639262 - 1.72738133475 1.77977433171 1.83316695973 1.88753785230 - 1.94286260710 1.99911370140 2.05626041706 2.11426877616 - 2.17310148880 2.23271791391 2.29307403456 2.35412244869 - 2.41581237648 2.47808968531 2.54089693326 2.60417343186 - 2.66785532896 2.73187571190 2.79616473160 2.86064974751 - 2.92525549331 2.98990426307 3.05451611718 3.11900910724 - 3.18329951858 3.24730212917 3.31093048295 3.37409717567 - 3.43671415091 3.49869300374 3.55994528916 3.62038283249 - 3.67991803844 3.73846419577 3.79593577419 3.85224871027 - 3.90732067927 3.96107134979 4.01342261853 4.06429882274 - 4.11362692821 4.16133669127 4.20736079363 4.25163494961 - 4.29409798580 4.33469189396 4.37336185843 4.41005626012 - 4.44472665979 4.47732776356 4.50781737440 4.53615633346 - 4.56230845529 4.58624046122 4.60792191475 4.62732516275 - 4.64442528556 4.65920005848 4.67162992619 4.68169799093 - 4.68939001375 4.69469442739 4.69760235820 4.69810765343 - 4.69620690965 4.69189949733 4.68518757689 4.67607610157 - 4.66457280356 4.65068816116 4.63443534695 4.61583015916 - 4.59489094172 4.57163850139 4.54609603353 4.51828907108 - 4.48824547317 4.45599547098 4.42157178748 4.38500984471 - 4.34634806684 4.30562827773 4.26289617956 4.21820188173 - 4.17160042837 4.12315224651 4.07292340562 4.02098553498 - 3.96741520785 3.91229270410 3.85570039022 3.79772183704 - 3.73844220461 3.67794751735 3.61632467743 3.55366118319 - 3.49004493484 3.42556402346 3.36030652592 3.29436030323 - 3.22781280335 3.16075086907 3.09326055139 3.02542692910 - 2.95733393492 2.88906418864 2.82069883781 2.75231740615 - 2.68399765019 2.61581542427 2.54784455424 2.48015672003 - 2.41282134725 2.34590550793 2.27947383050 2.21358841904 - 2.14830878184 2.08369176910 2.01979151997 1.95665941851 - 1.89434405873 1.83289121832 1.77234384105 1.71274202751 - 1.65412303402 1.59652127942 1.53996835945 1.48449306846 - 1.43012142805 1.37687672242 1.32477954001 1.27384782105 - 1.22409691075 1.17553961764 1.12818627686 1.08204481776 - 1.03712083564 0.993417667225 0.950936469352 0.909676300637 - 0.869634205674 0.830805301416 0.793182865369 0.756758425238 - 0.721521849691 0.687461439890 0.654564021475 0.622815036670 - 0.592198636236 0.562697770947 0.534294282351 0.506968992525 - 0.480701792602 0.455471729826 0.431257092922 0.408035495597 - 0.385783957966 0.364478985760 0.344096647145 0.324612647041 - 0.306002398794 0.288241093127 0.271303764262 0.255165353147 - 0.239800767736 0.225184940264 0.211292881502 0.198099731964 - 0.185580810065 0.173711657235 0.162468080012 0.151826189135 - 0.141762435681 0.132253644289 0.123277043532 0.114810293494 - 0.106831510624 0.993192899499E-01 0.922527247176E-01 0.856114235606E-01 - 0.793755252759E-01 0.735257113068E-01 0.680432160256E-01 0.629098349172E-01 - 0.581079307604E-01 0.536204379104E-01 0.494308647818E-01 0.455232946350E-01 - 0.418823847648E-01 0.384933641941E-01 0.353420299687E-01 0.324147421527E-01 - 0.296984176190E-01 0.271805227286E-01 0.248490649910E-01 0.226925837928E-01 - 0.207001402830E-01 0.188613064967E-01 0.171661537993E-01 0.156052407289E-01 - 0.141696003109E-01 0.128507269183E-01 0.116405627456E-01 0.105314839628E-01 - 0.951628661145E-02 0.858817230414E-02 0.774073378304E-02 0.696794039176E-02 - 0.626412351155E-02 0.562396200967E-02 0.504246774497E-02 0.451497117308E-02 - 0.403710709027E-02 0.360480055288E-02 0.321425300589E-02 0.286192865197E-02 - 0.254454108916E-02 0.225904024338E-02 0.200259961863E-02 0.177260388584E-02 - 0.156663682850E-02 0.138246966090E-02 0.121804973242E-02 0.107148962905E-02 - 0.941056680999E-03 0.825162883251E-03 0.722355233771E-03 0.631306492009E-03 - 0.550806358615E-03 0.479753075379E-03 0.417145442735E-03 0.362075250607E-03 - 0.313720116855E-03 0.271336726278E-03 0.234254461811E-03 0.201869418488E-03 - 0.173638789701E-03 0.149075614399E-03 0.127743873121E-03 0.109253920075E-03 - 0.932582379717E-04 0.794475018827E-04 0.675469380753E-04 0.573129635841E-04 - 0.485300921564E-04 0.410080921990E-04 0.345793824258E-04 0.290966510552E-04 - 0.244306846351E-04 0.204683928657E-04 0.171110161383E-04 0.142725029168E-04 - 0.118780445310E-04 0.986275543852E-05 0.817048752447E-05 0.675276754701E-05 - 0.556784739077E-05 0.457985735540E-05 0.375805327709E-05 0.307614885108E-05 - 0.251172508931E-05 0.204570940360E-05 0.166191734962E-05 0.134665059473E-05 - 0.108834518340E-05 0.877264662498E-06 0.705233096067E-06 0.565403441574E-06 - 0.452057178061E-06 0.360431469062E-06 0.286570510258E-06 0.227198053263E-06 - 0.179608413059E-06 0.141573558050E-06 0.111264149079E-06 0.871826381400E-07 - 0.681067597077E-07 0.530419490085E-07 0.411814030886E-07 0.318726636740E-07 - 0.245897466955E-07 0.189099733068E-07 0.144947725022E-07 0.110738272879E-07 - 0.843202596278E-08 0.639875858379E-08 0.483916721040E-08 0.364701806971E-08 - 0.273891533023E-08 0.204962060172E-08 0.152828042193E-08 0.113539660121E-08 - 0.840402060306E-09 0.619728337900E-09 0.455270821748E-09 0.333174470034E-09 - 0.242876783297E-09 0.176356454175E-09 0.127545807959E-09 0.918731534478E-10 - 0.659077533626E-10 0.470855238045E-10 0.334979781014E-10 0.237305092574E-10 - 0.167389992590E-10 0.117560732930E-10 0.822018397683E-11 0.572220007784E-11 - 0.396535681355E-11 0.273535948917E-11 0.187816745983E-11 0.128356100872E-11 - 0.873042207831E-12 0.590968561572E-12 0.398086537087E-12 0.266838079980E-12 - 0.177970581346E-12 0.118100374875E-12 0.779702958636E-13 0.512098838857E-13 - 0.334577400567E-13 0.217434652220E-13 0.140546823862E-13 0.903532640701E-14 - 0.577653260680E-14 0.367249190037E-14 0.232163520229E-14 0.145926956738E-14 - 0.911914218636E-15 0.566522907139E-15 0.349859521425E-15 0.214758300607E-15 - 0.131024693049E-15 0.794455821451E-16 0.478702634244E-16 0.286620320988E-16 - 0.170513367862E-16 0.100782457013E-16 0.591767113103E-17 0.345159598746E-17 - 0.199965810434E-17 0.115059149725E-17 0.657474155631E-18 0.373070016172E-18 - 0.210192726827E-18 0.117576834047E-18 0.652924778228E-19 0.359916639436E-19 - 0.196923551975E-19 0.106932426660E-19 0.576229862932E-20 0.308116323951E-20 - 0.163464617449E-20 0.860359369591E-21 0.449199768652E-21 0.232626150035E-21 - 0.119479182375E-21 0.608548798448E-22 0.307342220241E-22 0.153895634017E-22 - 0.763942482449E-23 0.375904692604E-23 0.183328249803E-23 0.886067537413E-24 - 0.424366078290E-24 0.201372837587E-24 0.946666200135E-25 0.440836277434E-25 - 0.203324788198E-25 0.928716786551E-26 0.420051926337E-26 0.188102888672E-26 - 0.833884973106E-27 0.365914599940E-27 0.158913299884E-27 0.682953245443E-28 - 0.290411964045E-28 0.122172284825E-28 0.508401321599E-29 0.209245826429E-29 - 0.851653071919E-30 0.342738794473E-30 0.136362993829E-30 0.536290125591E-31 - 0.208453688437E-31 0.800684778133E-32 0.303871971308E-32 0.113928098483E-32 - 0.421905710048E-33 0.154303817980E-33 0.557244976820E-34 0.198680164185E-34 - 0.699248382637E-35 0.242887913960E-35 0.832541269225E-36 0.281551670887E-36 - 0.939266932370E-37 0.309046419097E-37 0.100273547372E-37 0.320774827979E-38 - 0.101155080901E-38 0.314390876899E-39 0.962869150208E-40 0.290535357024E-40 - 0.863541762028E-41 0.252776994572E-41 0.728580853639E-42 0.206737407810E-42 - 0.577398300452E-43 0.158693809563E-43 0.429125521306E-44 0.114145628155E-44 - 0.298603144914E-45 0.768065153929E-46 0.194212694338E-46 0.482657587449E-47 - 0.117865732555E-47 0.282765622000E-48 0.666283105990E-49 0.154164876475E-49 - 0.350192293450E-50 0.780766289609E-51 0.170815157143E-51 0.366622337929E-52 - 0.771780157692E-53 0.159310415172E-53 0.322376223484E-54 0.639353712209E-55 - 0.124242014288E-55 0.236501169680E-56 0.440882316895E-57 0.804678407904E-58 - 0.143752904980E-58 0.251297681757E-59 0.429753553997E-60 0.718769753007E-61 - 0.117537976705E-61 0.187872019796E-62 0.293438733657E-63 0.447732651291E-64 - 0.667174161330E-65 0.970622839045E-66 0.137823387979E-66 0.190952492052E-67 - 0.258062668805E-68 0.340085800650E-69 0.436897851065E-70 0.546968808210E-71 - 0.667111386677E-72 0.792405437701E-73 0.916366802295E-74 0.103138442652E-74 - 0.112943105187E-75 0.120292104147E-76 0.124570818703E-77 0.125376680381E-78 - 0.122655219192E-79 0.116821097577E-80 0.108021194521E-81 0.969365470990E-83 - 0.843904678479E-84 diff --git a/aiida_defects/formation_energy_siesta/utils.py b/aiida_defects/formation_energy_siesta/utils.py deleted file mode 100644 index fd980ee..0000000 --- a/aiida_defects/formation_energy_siesta/utils.py +++ /dev/null @@ -1,132 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## -from __future__ import absolute_import - -from aiida.engine import calcfunction - - -#def run_pw_calculation(pw_inputs, structure, charge): -# """ -# Run a QuantumESPRESSO PW.x calculation by invoking the appropriate workchain. -# The user is not restricted in how they set up the PW calculation. -# This function simply acts as a wrapper to run a user-configured generic pw.x builder object -# -# Parameters -# ---------- -# pw_builder : AiiDA ProcessBuilder -# An AiiDA ProcessBuilder object for the desired QuantumEspresso workchain -# structure: AiiDA StructureData -# The required structure -# charge: AiiDA Float -# The required total system charge. Adding an electron is negative by convention - -# Returns -# ------- -# future -# A future representing the submitted calculation -# """ -# from aiida.engine import submit -# from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain -# from aiida_quantumespresso.workflows.pw.relax import PwRelaxWorkChain -# -# # Add the appropriate system charge and structure -# pw_inputs['structure'] = structure -# -# pw_inputs['parameters']['SYSTEM']['tot_charge'] = charge -# -# future = submit(PwBaseWorkChain, **pw_inputs) -# -# return future - - -#def run_siesta_calculation(pw_inputs, structure, charge): -# """ -# -# """ -# -# from aiida.engine import submit -# from aiida_siesta.workflows.base import SiestaBaseWorkChain -# from aiida_quantumespresso.workflows.pw.relax import PwRelaxWorkChain - -@calcfunction -def get_raw_formation_energy(defect_energy, host_energy, chemical_potential, - charge, fermi_energy, valence_band_maximum): - """ - Compute the formation energy without correction - """ - e_f_uncorrected = defect_energy - host_energy - chemical_potential + ( - charge * (valence_band_maximum + fermi_energy)) - return e_f_uncorrected - - -@calcfunction -def get_corrected_formation_energy(e_f_uncorrected, correction): - """ - Compute the formation energy with correction - """ - e_f_corrected = e_f_uncorrected + correction - return e_f_corrected - - -@calcfunction -def get_corrected_aligned_formation_energy(e_f_corrected, alignment): - """ - Compute the formation energy with correction and aligned - """ - e_f_corrected_aligned = e_f_corrected + alignment - return e_f_corrected_aligned - - -# def run_pw_calculation(pw_inputs, charge, run_type, additional_inputs=None): -# """ -# Run a QuantumESPRESSO PW.x calculation by invoking the PW workchain - -# Parameters -# ---------- -# pw_inputs : AiiDA Dict -# A : AiiDA Float -# The required total system charge. Adding an electron is negative by convention -# run_type: AiiDA String -# The desired type of calculation. Allowed values: 'scf', 'relax', 'vc-relax' - -# Returns -# ------- -# pw_object? -# A future representing the submitted calculation -# """ - -# required_keys = [ -# 'code', 'pseudos', 'parameters', 'settings', 'metadata', -# 'structure' -# ] - -# # Validate builder dictionary -# for key in required_keys: -# if key not in pw_inputs: -# raise KeyError( -# "Required key, '{}' not found in input dictionary".format(key)) - -# # Validate 'run_type' -# if run_type not in ['scf', 'relax', 'vc-relax']: -# raise ValueError("Run type, '{}', not recognised".format(run_type)) - -# builder['parameters']['SYSTEM']['tot_charge'] = charge - -# if run_type == 'relax' or run_type == 'vc-relax': -# pw_inputs['relaxation_scheme'] = run_type -# running = submit(PwRelaxWorkChain, **inputs) -# self.report( -# 'Launching PwRelaxWorkChain for structure, {}, with charge {} (PK={})' -# .format(pw_inputs.structure, charge, running.pid)) -# return running -# else: -# future = submit(PwBaseWorkChain, **inputs) -# self.report( -# 'Launching PwBaseWorkChain for structure, {}, with charge {} (PK={})' -# .format(pw_inputs.structure, charge, future.pid))s -# return future From c92969202ea22857618fb6f9172262f3b7a6b40a Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Thu, 24 Sep 2020 14:30:37 +0200 Subject: [PATCH 17/60] correct the funtion to compute electron and hole concentration and modify the chemical potential workchain so that it works also with binary compounds --- .../chemical_potential/chemical_potential.py | 42 ++++++------- .../formation_energy/fermi_level/utils.py | 62 +++++++++++++++---- 2 files changed, 68 insertions(+), 36 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index 34ea76f..b340878 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -23,18 +23,10 @@ class ChemicalPotentialWorkchain(WorkChain): of that compound. Here we implement method similar to Buckeridge et al., (https://doi.org/10.1016/j.cpc.2013.08.026), """ - ref_energy = {'Li':-195.51408, 'Na': -1294.781, 'K': -1515.34028, 'Rb': -665.48096, 'Cs': -855.71637, - 'Be':-382.31135, 'Mg':-445.18254, 'Ca': -1018.30809, 'Sr': -953.20309, 'Ba': -5846.81333, - 'Zn':-6275.54609, 'Cd': -1654.6221, 'Hg': -4220.15135, - 'Sc': -1248.9897, 'Y': -1260.65816, 'La': -6144.92827, - 'Ti': -1621.05852, 'Zr':-1348.75011, 'Hf': -1534.22174, 'Ce': -6467.05434, - 'V': -1972.58745, 'Ta':-1928.66788, 'Nb': -4490.36915, 'Mo':-1865.95416, 'W': -2163.94756, - 'B':-86.50025, 'Al': -524.03435, 'Ga': -3741.75933, 'In': -1964.75235, - 'C':-246.491433, 'Si':-154.27445, 'Ge': -2900.6119, 'Sn':-2162.23795, 'Pb': -11693.19885, - 'N': -274.00734, 'P':-191.03878, 'As': -247.16661, 'Sb': -2511.63434, 'Bi': -2516.86824, - 'O':-557.49850, 'S':-326.67885, 'Se': -589.11981, 'Te': -359.67088, - 'F': -657.89303, 'Cl':-451.66500, 'Br': -551.1849, 'I': -5073.88094 - } +# ref_energy = {'Li':-195.51408, 'P':-191.03878, 'O':-557.49850, 'S':-326.67885, 'Cl':-451.66500, 'B':-86.50025, 'Zn':-6275.54609, +# 'Mg':-445.18254, 'Ta':-1928.66788, 'Zr':-1348.75011, 'Sn':-2162.23795, 'Mo':-1865.95416, 'Ta':-1928.66325, 'Be':-382.31135, +# 'C':-246.491433, 'Si':-154.27445, 'Na': -1294.781, 'K': -1515.34028, 'Rb': -665.48096, 'Cs': -855.71637, 'Ca': -1018.30809, +# 'Sr': -953.20309, 'Ba': -5846.81333} @classmethod def define(cls, spec): super(ChemicalPotentialWorkchain, cls).define(spec) @@ -42,7 +34,7 @@ def define(cls, spec): spec.input("compound", valid_type=Str) spec.input("dependent_element", valid_type=Str) spec.input("defect_specie", valid_type=Str) - #spec.input("ref_energy", valid_type=Float) + spec.input("ref_energy", valid_type=Dict, help="The reference chemical potential of elements in the structure") spec.input("tolerance", valid_type=Float) spec.outline( @@ -152,20 +144,16 @@ def solve_matrix_of_constraint(self): check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= self.inputs.tolerance.value bool_mask = [not(False in x) for x in check_constraint] corners_of_stability_region = intersecting_points[bool_mask] - #corners_of_stability_region = remove_duplicate(corners_of_stability_region) + corners_of_stability_region = remove_duplicate(corners_of_stability_region) if corners_of_stability_region.size == 0: self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(self.inputs.compound.value)) return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED - ### compute the corresponding chemical potential of the dependent element - with_dependent = (self.ctx.first_eqn[-1]-np.sum(corners_of_stability_region*self.ctx.first_eqn[:-2], axis=1))/self.ctx.first_eqn[-2] - corners_of_stability_region = np.hstack((corners_of_stability_region, np.reshape(with_dependent,(len(with_dependent),1)))) - #print(corners_of_stability_region) - stability_data = ArrayData() stability_data.set_array('stability_corners', corners_of_stability_region) self.ctx.stability_corners = stability_data + self.report('The stability corner is : {}'.format(corners_of_stability_region)) #self.out("stability_corners", self.ctx.stability_corners) def get_centroid(self): @@ -177,14 +165,19 @@ def get_centroid(self): stability_corners = self.ctx.stability_corners.get_array('stability_corners') M = self.ctx.matrix_eqns.get_array('set_of_constraints') - grid = get_grid(stability_corners[:,:-1], M) - ctr_stability = get_centroid(grid) #without the dependent element - #ctr_stability = np.mean(stability_corners[:,:-1], axis=0) #without the dependent element - + N_specie = M.shape[1] + if N_specie == 2: + ctr_stability = np.mean(stability_corners, axis=0) #without the dependent element + else: + #grid = get_grid(stability_corners[:,:-1], M) + grid = get_grid(stability_corners, M) + ctr_stability = get_centroid(grid) #without the dependent element + ### Add the corresponding chemical potential of the dependent element with_dependent = (self.ctx.first_eqn[-1]-np.sum(ctr_stability*self.ctx.first_eqn[:-2]))/self.ctx.first_eqn[-2] centroid_of_stability = np.append(ctr_stability, with_dependent) self.report('center of stability is {}'.format(centroid_of_stability)) + ctrd = ArrayData() ctrd.set_array('data', centroid_of_stability) self.ctx.centroid = ctrd @@ -193,7 +186,8 @@ def get_centroid(self): def chemical_potential(self): index = self.ctx.column_order[self.inputs.defect_specie.value] #chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), self.inputs.ref_energy) - chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), Float(self.ref_energy[self.inputs.defect_specie.value])) + chem_ref = self.inputs.ref_energy.get_dict() + chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), Float(chem_ref[self.inputs.defect_specie.value])) self.ctx.chemical_potential = chemical_potential self.out('chemical_potential', chemical_potential) self.report('The chemical potential of {} is {}'.format(self.inputs.defect_specie.value, chemical_potential.value)) diff --git a/aiida_defects/formation_energy/fermi_level/utils.py b/aiida_defects/formation_energy/fermi_level/utils.py index a7c3283..3830bf9 100644 --- a/aiida_defects/formation_energy/fermi_level/utils.py +++ b/aiida_defects/formation_energy/fermi_level/utils.py @@ -66,29 +66,67 @@ def defect_formation_energy(E_Fermi): def electron_concentration(E_Fermi): ''' - compute the concentration of electrons + Compute electron concentration ''' - - E_Fermi = _get_first_element(E_Fermi) upper_dos = dos_y[dos_x>=band_gap] E_upper = dos_x[dos_x>=band_gap] - # plt.plot(E_upper, upper_dos) + + ndim = E_Fermi.ndim + E_Fermi = np.expand_dims(E_Fermi, axis=ndim) # To broadcast with E_upper mask_n = ((E_upper-E_Fermi)/(k_B*temperature) < 700.0) # To avoid overflow in the exp - temp_n = upper_dos[mask_n]/(np.exp((E_upper[mask_n]-E_Fermi)/(k_B*temperature))+1.0) - return input_chem_shape*convert*np.sum(temp_n)*dE/unitcell.volume + for i in range(ndim): + upper_dos = np.repeat(np.expand_dims(upper_dos, axis=0), E_Fermi.shape[ndim-i-1], axis=0) + upper_dos[~mask_n] = 0 + temp = E_upper-E_Fermi + temp[~mask_n] = 0 + temp_n = upper_dos/(np.exp(temp/(k_B*temperature))+1.0) + + return convert*np.sum(temp_n, axis=ndim)*dE/unitcell.volume def hole_concentration(E_Fermi): ''' - compute the concentration of holes + Compute hole concentration ''' - - E_Fermi = _get_first_element(E_Fermi) lower_dos = dos_y[dos_x<=0.0] E_lower = dos_x[dos_x<=0.0] - # plt.plot(E_lower, lower_dos) + + ndim = E_Fermi.ndim + E_Fermi = np.expand_dims(E_Fermi, axis=ndim) # To broadcast with E_lower mask_p = ((E_Fermi-E_lower)/(k_B*temperature) < 700.0) # To avoid overflow in the exp - temp_p = lower_dos[mask_p]/(np.exp((E_Fermi-E_lower[mask_p])/(k_B*temperature))+1.0) - return input_chem_shape*convert*np.sum(temp_p)*dE/unitcell.volume + for i in range(ndim): + lower_dos = np.repeat(np.expand_dims(lower_dos, axis=0), E_Fermi.shape[ndim-i-1], axis=0) + lower_dos[~mask_p] = 0 + temp = E_Fermi-E_lower + temp[~mask_p] = 0 + temp_p = lower_dos/(np.exp(temp/(k_B*temperature))+1.0) + + return convert*np.sum(temp_p, axis=ndim)*dE/unitcell.volume + +# def electron_concentration(E_Fermi): +# ''' +# compute the concentration of electrons +# ''' +# +# E_Fermi = _get_first_element(E_Fermi) +# upper_dos = dos_y[dos_x>=band_gap] +# E_upper = dos_x[dos_x>=band_gap] +# # plt.plot(E_upper, upper_dos) +# mask_n = ((E_upper-E_Fermi)/(k_B*temperature) < 700.0) # To avoid overflow in the exp +# temp_n = upper_dos[mask_n]/(np.exp((E_upper[mask_n]-E_Fermi)/(k_B*temperature))+1.0) +# return input_chem_shape*convert*np.sum(temp_n)*dE/unitcell.volume + +# def hole_concentration(E_Fermi): +# ''' +# compute the concentration of holes +# ''' +# +# E_Fermi = _get_first_element(E_Fermi) +# lower_dos = dos_y[dos_x<=0.0] +# E_lower = dos_x[dos_x<=0.0] +# # plt.plot(E_lower, lower_dos) +# mask_p = ((E_Fermi-E_lower)/(k_B*temperature) < 700.0) # To avoid overflow in the exp +# temp_p = lower_dos[mask_p]/(np.exp((E_Fermi-E_lower[mask_p])/(k_B*temperature))+1.0) +# return input_chem_shape*convert*np.sum(temp_p)*dE/unitcell.volume def c_defect(N_site, Ef): ''' From 31f8fe2b07849e290287857a5a4dcbc3790a5d96 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Mon, 5 Oct 2020 20:48:55 +0100 Subject: [PATCH 18/60] Convert testing environment to pytest Replace old tests with tests of workchains. Until the enhanced workflow testing tools become available, these tests serve to check if the workflows can be created without error. Adds new tests for: "FormationEnergyWorkchainQE", "GaussianCounterchargeWorkchain", "ModelPotentialWorkchain", and a placeholder for "FormationEnergyWorkchainSiesta". Also adds new placeholder workchain for the Siesta specific implementation of the formation energy workchain, FormationEnergyWorkchainSiesta. --- .../gaussian_countercharge.py | 15 +- .../model_potential/model_potential.py | 2 +- .../formation_energy/formation_energy_base.py | 7 +- .../formation_energy/formation_energy_qe.py | 8 +- .../formation_energy_siesta.py | 64 +++ aiida_defects/tests/__init__.py | 185 --------- setup.json | 14 +- {aiida_defects/tests => tests}/README.rst | 0 tests/__init__.py | 7 + tests/conftest.py | 385 ++++++++++++++++++ tests/fixtures/pseudos/Si.upf | 91 +++++ .../old_test_poisson_solver.py | 0 .../komsa_pasquarello/old_test_utils.py | 0 tests/pytest.ini | 6 + .../tests => tests}/test_data/halite_bulk.cif | 0 .../test_data/halite_bulk_sub_k.cif | 0 .../test_data/halite_bulk_v_cl.cif | 0 .../test_data/halite_bulk_v_cl_sub_k.cif | 0 .../test_data/halite_unitcell.cif | 0 .../tests => tests}/test_data/lton.cif | 0 .../tests => tests}/test_data/lton_bulk.cif | 0 .../tools/old_test_defects.py | 0 .../model_potential/test_model_potential.py | 68 ++++ .../test_gaussian_countercharge.py | 70 ++++ .../test_formation_energy_qe.py | 101 +++++ .../test_formation_energy_siesta.py | 73 ++++ 26 files changed, 885 insertions(+), 211 deletions(-) create mode 100644 aiida_defects/formation_energy/formation_energy_siesta.py delete mode 100644 aiida_defects/tests/__init__.py rename {aiida_defects/tests => tests}/README.rst (100%) create mode 100644 tests/__init__.py create mode 100644 tests/conftest.py create mode 100644 tests/fixtures/pseudos/Si.upf rename aiida_defects/tests/formation_energy/corrections/komsa_pasquarello/test_poisson_solver.py => tests/formation_energy/corrections/komsa_pasquarello/old_test_poisson_solver.py (100%) rename aiida_defects/tests/formation_energy/corrections/komsa_pasquarello/test_utils.py => tests/formation_energy/corrections/komsa_pasquarello/old_test_utils.py (100%) create mode 100644 tests/pytest.ini rename {aiida_defects/tests => tests}/test_data/halite_bulk.cif (100%) rename {aiida_defects/tests => tests}/test_data/halite_bulk_sub_k.cif (100%) rename {aiida_defects/tests => tests}/test_data/halite_bulk_v_cl.cif (100%) rename {aiida_defects/tests => tests}/test_data/halite_bulk_v_cl_sub_k.cif (100%) rename {aiida_defects/tests => tests}/test_data/halite_unitcell.cif (100%) rename {aiida_defects/tests => tests}/test_data/lton.cif (100%) rename {aiida_defects/tests => tests}/test_data/lton_bulk.cif (100%) rename aiida_defects/tests/tools/test_defects.py => tests/tools/old_test_defects.py (100%) create mode 100644 tests/workflows/formation_energy/corrections/gaussian_countercharge/model_potential/test_model_potential.py create mode 100644 tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py create mode 100644 tests/workflows/formation_energy/test_formation_energy_qe.py create mode 100644 tests/workflows/formation_energy/test_formation_energy_siesta.py diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 8a22828..55d260c 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -43,11 +43,11 @@ def define(cls, spec): help="Dielectric constant for the host material.") spec.input("model_iterations_required", valid_type=orm.Int, - default=orm.Int(3), + default=lambda: orm.Int(3), help="The number of model charge systems to compute. More may improve convergence.") spec.input("cutoff", valid_type=orm.Float, - default=orm.Float(40.), + default=lambda: orm.Float(40.), help="Plane wave cutoff for electrostatic model.") spec.input("v_host", valid_type=orm.ArrayData, @@ -67,11 +67,11 @@ def define(cls, spec): spec.input("charge_fit_tolerance", valid_type=orm.Float, help="Permissable error for any fitted charge model parameter.", - default=orm.Float(1.0e-3)) + default=lambda: orm.Float(1.0e-3)) spec.input("strict_fit", valid_type=orm.Bool, help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", - default=orm.Bool(True)) + default=lambda: orm.Bool(True)) spec.outline( cls.setup, @@ -159,7 +159,7 @@ def setup(self): def fit_charge_model(self): - """ + """ Fit an anisotropic gaussian to the charge state electron density """ @@ -167,16 +167,15 @@ def fit_charge_model(self): self.inputs.rho_host, self.inputs.rho_defect_q, self.inputs.host_structure) - + self.ctx.fitted_params = orm.List(list=fit['fit']) self.ctx.peak_charge = orm.Float(fit['peak_charge']) - for parameter in fit['error']: if parameter > self.inputs.charge_fit_tolerance: self.logger.warning("Charge fitting parameter worse than allowed tolerance") if self.inputs.strict_fit: - return self.exit_codes.ERROR_BAD_CHARGE_FIT + return self.exit_codes.ERROR_BAD_CHARGE_FIT def should_run_model(self): diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index 94b3c23..8d9d64a 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -42,7 +42,7 @@ def define(cls, spec): help="Defect site position in crystal coordinates") spec.input('cutoff', valid_type=orm.Float, - default=orm.Float(40.), + default=lambda: orm.Float(40.), help="Energy cutoff for grids in Rydberg") spec.input('epsilon', valid_type=orm.Float, diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index bdbf7be..0401226 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -55,7 +55,7 @@ def define(cls, spec): valid_type=orm.Float, help="Defect charge state") spec.input( - "defect_specie", + "defect_species", valid_type=orm.Str) spec.input( "defect_site", @@ -75,15 +75,12 @@ def define(cls, spec): spec.input("add_or_remove", valid_type=orm.Str, help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") - # Chemical potential + # Chemical potential # TODO: Doc all of this spec.input('formation_energy_dict', valid_type=orm.Dict) spec.input('compound', valid_type=orm.Str) spec.input('dependent_element', valid_type=orm.Str) spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) - - spec.input("run_dfpt", valid_type=orm.Bool) - # Methodology spec.input( "correction_scheme", diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index d806ca1..26e5fc8 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -41,12 +41,12 @@ def define(cls, spec): help="Inputs for postprocessing calculations") # What calculations to run - spec.input('run_pw_host', valid_type=orm.Bool, required=True) + spec.input('run_pw_host', valid_type=orm.Bool, required=True) # TODO: Check why these are here - for restarts? spec.input('run_pw_defect_q0', valid_type=orm.Bool, required=True) spec.input('run_pw_defect_q', valid_type=orm.Bool, required=True) spec.input('run_dfpt', valid_type=orm.Bool, required=True) - spec.input('host_node', valid_type=orm.Int, required=False) + spec.input('host_node', valid_type=orm.Int, required=False) # TODO: Need to look at this if this is intended for passing parent calcs spec.input('defect_q0_node', valid_type=orm.Int, required=False) spec.input('defect_q_node', valid_type=orm.Int, required=False) spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) @@ -60,8 +60,6 @@ def define(cls, spec): help="Parameters for the PWSCF calcuations. Some will be set automatically") spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, help="Scheduler options for the PW.x calculations") - spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, - help="Settings for the PW.x calculations") spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, help="The pseudopotential family for use with the code, if required") @@ -74,7 +72,7 @@ def define(cls, spec): help="The k-point grid to use for the calculations") spec.input("qe.dft.unitcell.parameters", valid_type=orm.Dict, - help="Parameters for the PWSCF calcuations. Some will be set automatically") + help="Parameters for the PWSCF calculations. Some will be set automatically") spec.input("qe.dft.unitcell.scheduler_options", valid_type=orm.Dict, help="Scheduler options for the PW.x calculations") diff --git a/aiida_defects/formation_energy/formation_energy_siesta.py b/aiida_defects/formation_energy/formation_energy_siesta.py new file mode 100644 index 0000000..5ff8934 --- /dev/null +++ b/aiida_defects/formation_energy/formation_energy_siesta.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +import numpy as np + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit +from aiida.plugins import WorkflowFactory +from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain + +from aiida_defects.formation_energy.formation_energy_base import FormationEnergyWorkchainBase +from aiida_defects.formation_energy.utils import run_pw_calculation +from .utils import get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy + + +class FormationEnergyWorkchainSiesta(FormationEnergyWorkchainBase): + """ + Compute the formation energy for a given defect using Siesta + """ + @classmethod + def define(cls, spec): + super(FormationEnergyWorkchainSiesta, cls).define(spec) + + # Namespace to make it clear which code is being used. + spec.input_namespace('siesta.dft.supercell', + help="Inputs for DFT calculations on supercells") + + # DFT inputs (Siesta) + # spec.input("siesta.dft.supercell.code", + # valid_type=orm.Code, + # help="The Siesta code to use for the supercell calculations") + # spec.input("siesta.dft.supercell.parameters", + # valid_type=orm.Dict, + # help="Parameters for the supercell calculations. Some will be set automatically") + # spec.input("siesta.dft.supercell.scheduler_options", + # valid_type=orm.Dict, + # help="Scheduler options for the Siesta calculation") + + spec.outline( + cls.setup, + if_(cls.correction_required)( + if_(cls.is_gaussian_scheme)( + cls.placeholder, + cls.run_gaussian_correction_workchain), + if_(cls.is_point_scheme)( + cls.raise_not_implemented + #cls.prepare_point_correction_workchain, + #cls.run_point_correction_workchain), + ), + cls.check_correction_workchain), + cls.compute_formation_energy + ) + + def placeholder(self): + """ + Placeholder method + """ + pass \ No newline at end of file diff --git a/aiida_defects/tests/__init__.py b/aiida_defects/tests/__init__.py deleted file mode 100644 index 3303208..0000000 --- a/aiida_defects/tests/__init__.py +++ /dev/null @@ -1,185 +0,0 @@ -""" tests for the plugin - -Use the aiida.utils.fixtures.PluginTestCase class for convenient -testing that does not pollute your profiles/databases. -""" - -# Helper functions for tests -from __future__ import absolute_import -from __future__ import print_function -import os -import tempfile -import aiida_diff.utils as utils - -TEST_DIR = os.path.dirname(os.path.realpath(__file__)) -TEST_COMPUTER = 'localhost-test' - -executables = { - 'diff': 'diff', -} - - -def get_path_to_executable(executable): - """ Get path to local executable. - - :param executable: Name of executable in the $PATH variable - :type executable: str - - :return: path to executable - :rtype: str - """ - # pylint issue https://github.com/ConradJohnston/aiida-defectsQA/pylint/issues/73 - import distutils.spawn # pylint: disable=no-name-in-module,import-error - path = distutils.spawn.find_executable(executable) - if path is None: - raise ValueError("{} executable not found in PATH.".format(executable)) - - return path - - -def get_computer(name=TEST_COMPUTER, workdir=None): - """Get AiiDA computer. - - Loads computer 'name' from the database, if exists. - Sets up local computer 'name', if it isn't found in the DB. - - :param name: Name of computer to load or set up. - :param workdir: path to work directory - Used only when creating a new computer. - - :return: The computer node - :rtype: :py:class:`aiida.orm.Computer` - """ - from aiida.orm import Computer - from aiida.common.exceptions import NotExistent - - if utils.AIIDA_VERSION < utils.StrictVersion('1.0a0'): - try: - computer = Computer.get(name) - except NotExistent: - # pylint: disable=abstract-class-instantiated,no-value-for-parameter, unexpected-keyword-arg - if workdir is None: - workdir = tempfile.mkdtemp() - - computer = Computer( - name=name, - description='localhost computer set up by aiida_diff tests', - hostname=name, - workdir=workdir, - transport_type='local', - scheduler_type='direct', - enabled_state=True) - #TODO: simpify once API improvements are in place - else: - from aiida.orm.backend import construct_backend - backend = construct_backend() - - try: - computer = backend.computers.get(name=name) - except NotExistent: - if workdir is None: - workdir = tempfile.mkdtemp() - - computer = backend.computers.create( - name=name, - description='localhost computer set up by aiida_diff tests', - hostname=name, - workdir=workdir, - transport_type='local', - scheduler_type='direct', - enabled_state=True) - - computer.store() - - # TODO configure computer for user, see - # aiida_core.aiida.cmdline.commands.computer.Computer.computer_configure - - return computer - - -def get_code(entry_point, computer=None): - """Get local code. - - Sets up code for given entry point on given computer. - - :param entry_point: Entry point of calculation plugin - :param computer_name: Name of (local) computer - - :return: The code node - :rtype: :py:class:`aiida.orm.Code` - """ - from aiida.orm import Code - from aiida.common.exceptions import NotExistent - - try: - executable = executables[entry_point] - except KeyError: - raise KeyError( - "Entry point {} not recognized. Allowed values: {}".format( - entry_point, list(executables.keys()))) - - if computer is None: - computer = get_computer() - - try: - code = Code.get_from_string('{}@{}'.format(executable, - computer.get_name())) - except NotExistent: - path = get_path_to_executable(executable) - code = Code( - input_plugin_name=entry_point, - remote_computer_exec=[computer, path], - ) - code.label = executable - code.store() - - return code - - -def test_calculation_execution(calc, - allowed_returncodes=(0, ), - check_paths=None): - """ test that a calculation executes successfully - - :param calc: the calculation - :param allowed_returncodes: raise RunTimeError if return code is not in allowed_returncodes - :param check_paths: raise OSError if these relative paths are not in the folder after execution - :return: - """ - # pylint: disable=too-many-locals - from aiida.common.folders import SandboxFolder - import stat - import subprocess - - # output input files and scripts to temporary folder - with SandboxFolder() as folder: - - subfolder, script_filename = calc.submit_test(folder=folder) - print("inputs created at {}".format(subfolder.abspath)) - - script_path = os.path.join(subfolder.abspath, script_filename) - scheduler_stderr = calc._SCHED_ERROR_FILE # pylint: disable=protected-access - - # we first need to make sure the script is executable - st = os.stat(script_path) - os.chmod(script_path, st.st_mode | stat.S_IEXEC) - # now call script, NB: bash -l -c is required to access global variable loaded in .bash_profile - returncode = subprocess.call(["bash", "-l", "-c", script_path], - cwd=subfolder.abspath) - - if returncode not in allowed_returncodes: - - err_msg = "process failed (and couldn't find stderr file: {})".format( - scheduler_stderr) - stderr_path = os.path.join(subfolder.abspath, scheduler_stderr) - if os.path.exists(stderr_path): - with open(stderr_path) as f: - err_msg = "Process failed with stderr:\n{}".format( - f.read()) - raise RuntimeError(err_msg) - - if check_paths is not None: - for outpath in check_paths: - subfolder.get_abs_path(outpath, check_existence=True) - - print("calculation completed execution") diff --git a/setup.json b/setup.json index 34ceaba..5b4e556 100644 --- a/setup.json +++ b/setup.json @@ -1,7 +1,7 @@ { "name": "aiida-defects", - "version": "0.6.0", - "author": "Conrad Johnston, Chiara Ricca", + "version": "0.9.0", + "author": "Conrad Johnston, Sokseiha Muy, Chiara Ricca", "author_email": "conrad.s.johnston@googlemail.com", "url": "https://github.com/ConradJohnston/aiida-defects/", "license": "MIT License", @@ -16,6 +16,7 @@ "entry_points": { "aiida.workflows": [ "defects.formation_energy.qe = aiida_defects.formation_energy.formation_energy_qe:FormationEnergyWorkchainQE", + "defects.formation_energy.siesta = aiida_defects.formation_energy.formation_energy_siesta:FormationEnergyWorkchainSiesta", "defects.formation_energy.corrections.gaussian_countercharge = aiida_defects.formation_energy.corrections.gaussian_countercharge.gaussian_countercharge:GaussianCounterChargeWorkchain", "defects.formation_energy.corrections.gaussian_countercharge.model_potential = aiida_defects.formation_energy.corrections.gaussian_countercharge.model_potential.model_potential:ModelPotentialWorkchain", "defects.formation_energy.corrections.point_countercharge = aiida_defects.formation_energy.corrections.point_countercharge.point_countercharge:PointCounterChargeWorkchain", @@ -27,22 +28,21 @@ "reentry_register": true, "install_requires": [ "aiida-core >= 1.0.0b1,<2.0.0", - "aiida-quantumespresso>3.0.0a1", + "aiida-quantumespresso>='3.1.0'", "pymatgen", "six" ], "extras_require": { "dev_precommit": [ "pre-commit", - "pylint==1.9.4; python_version<'3.0'", "pylint==2.2.2; python_version>='3.0'", "prospector==1.1.5", "pep8-naming==0.4.1", "modernize==0.7" - ], + ], "docs": [ - "Sphinx", - "docutils", + "Sphinx", + "docutils", "sphinx_rtd_theme" ], "testing": [ diff --git a/aiida_defects/tests/README.rst b/tests/README.rst similarity index 100% rename from aiida_defects/tests/README.rst rename to tests/README.rst diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..0ede96f --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py new file mode 100644 index 0000000..bd7915b --- /dev/null +++ b/tests/conftest.py @@ -0,0 +1,385 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +# pylint: disable=redefined-outer-name,too-many-statements +"""Initialise a text database and profile for pytest.""" +import collections +import io +import os +import shutil + +import pytest + +pytest_plugins = ['aiida.manage.tests.pytest_fixtures'] # pylint: disable=invalid-name + + +@pytest.fixture(scope='session') +def filepath_tests(): + """Return the absolute filepath of the `tests` folder. + + .. warning:: if this file moves with respect to the `tests` folder, the implementation should change. + + :return: absolute filepath of `tests` folder which is the basepath for all test resources. + """ + return os.path.dirname(os.path.abspath(__file__)) + + +@pytest.fixture +def filepath_fixtures(filepath_tests): + """Return the absolute filepath to the directory containing the file `fixtures`.""" + return os.path.join(filepath_tests, 'fixtures') + + +@pytest.fixture(scope='function') +def fixture_sandbox(): + """Return a `SandboxFolder`.""" + from aiida.common.folders import SandboxFolder + with SandboxFolder() as folder: + yield folder + + + +@pytest.fixture +def generate_calc_job(): + """Fixture to construct a new `CalcJob` instance and call `prepare_for_submission` for testing `CalcJob` classes. + + The fixture will return the `CalcInfo` returned by `prepare_for_submission` and the temporary folder that was passed + to it, into which the raw input files will have been written. + """ + + def _generate_calc_job(folder, entry_point_name, inputs=None): + """Fixture to generate a mock `CalcInfo` for testing calculation jobs.""" + from aiida.engine.utils import instantiate_process + from aiida.manage.manager import get_manager + from aiida.plugins import CalculationFactory + + manager = get_manager() + runner = manager.get_runner() + + process_class = CalculationFactory(entry_point_name) + process = instantiate_process(runner, process_class, **inputs) + + calc_info = process.prepare_for_submission(folder) + + return calc_info + + return _generate_calc_job + + +@pytest.fixture +def generate_calc_job_node(fixture_localhost): + """Fixture to generate a mock `CalcJobNode` for testing parsers.""" + + def flatten_inputs(inputs, prefix=''): + """Flatten inputs recursively like :meth:`aiida.engine.processes.process::Process._flatten_inputs`.""" + flat_inputs = [] + for key, value in inputs.items(): + if isinstance(value, collections.Mapping): + flat_inputs.extend(flatten_inputs(value, prefix=prefix + key + '__')) + else: + flat_inputs.append((prefix + key, value)) + return flat_inputs + + def _generate_calc_job_node( + entry_point_name='base', computer=None, test_name=None, inputs=None, attributes=None, retrieve_temporary=None + ): + """Fixture to generate a mock `CalcJobNode` for testing parsers. + + :param entry_point_name: entry point name of the calculation class + :param computer: a `Computer` instance + :param test_name: relative path of directory with test output files in the `fixtures/{entry_point_name}` folder. + :param inputs: any optional nodes to add as input links to the corrent CalcJobNode + :param attributes: any optional attributes to set on the node + :param retrieve_temporary: optional tuple of an absolute filepath of a temporary directory and a list of + filenames that should be written to this directory, which will serve as the `retrieved_temporary_folder`. + For now this only works with top-level files and does not support files nested in directories. + :return: `CalcJobNode` instance with an attached `FolderData` as the `retrieved` node. + """ + from aiida import orm + from aiida.common import LinkType + from aiida.plugins.entry_point import format_entry_point_string + + if computer is None: + computer = fixture_localhost + + filepath_folder = None + + if test_name is not None: + basepath = os.path.dirname(os.path.abspath(__file__)) + filename = os.path.join(entry_point_name[len('quantumespresso.'):], test_name) + filepath_folder = os.path.join(basepath, 'parsers', 'fixtures', filename) + filepath_input = os.path.join(filepath_folder, 'aiida.in') + + entry_point = format_entry_point_string('aiida.calculations', entry_point_name) + + node = orm.CalcJobNode(computer=computer, process_type=entry_point) + node.set_attribute('input_filename', 'aiida.in') + node.set_attribute('output_filename', 'aiida.out') + node.set_attribute('error_filename', 'aiida.err') + node.set_option('resources', {'num_machines': 1, 'num_mpiprocs_per_machine': 1}) + node.set_option('max_wallclock_seconds', 1800) + + if attributes: + node.set_attribute_many(attributes) + + if filepath_folder: + from qe_tools.utils.exceptions import ParsingError + from aiida_quantumespresso.tools.pwinputparser import PwInputFile + try: + parsed_input = PwInputFile(filepath_input) + except ParsingError: + pass + else: + inputs['structure'] = parsed_input.get_structuredata() + inputs['parameters'] = orm.Dict(dict=parsed_input.namelists) + + if inputs: + metadata = inputs.pop('metadata', {}) + options = metadata.get('options', {}) + + for name, option in options.items(): + node.set_option(name, option) + + for link_label, input_node in flatten_inputs(inputs): + input_node.store() + node.add_incoming(input_node, link_type=LinkType.INPUT_CALC, link_label=link_label) + + node.store() + + if retrieve_temporary: + dirpath, filenames = retrieve_temporary + for filename in filenames: + shutil.copy(os.path.join(filepath_folder, filename), os.path.join(dirpath, filename)) + + if filepath_folder: + retrieved = orm.FolderData() + retrieved.put_object_from_tree(filepath_folder) + + # Remove files that are supposed to be only present in the retrieved temporary folder + if retrieve_temporary: + for filename in filenames: + retrieved.delete_object(filename) + + retrieved.add_incoming(node, link_type=LinkType.CREATE, link_label='retrieved') + retrieved.store() + + remote_folder = orm.RemoteData(computer=computer, remote_path='/tmp') + remote_folder.add_incoming(node, link_type=LinkType.CREATE, link_label='remote_folder') + remote_folder.store() + + return node + + return _generate_calc_job_node + + +# @pytest.fixture(scope='session') +# def generate_upf_data(filepath_tests): +# """Return a `UpfData` instance for the given element a file for which should exist in `tests/fixtures/pseudos`.""" + +# def _generate_upf_data(element): +# """Return `UpfData` node.""" +# from aiida.orm import UpfData + +# filepath = os.path.join(filepath_tests, 'fixtures', 'pseudos', '{}.upf'.format(element)) + +# with io.open(filepath, 'r') as handle: +# upf = UpfData(file=handle.name) + +# return upf + +# return _generate_upf_data + + +# @pytest.fixture +# def generate_structure(): +# """Return a `StructureData` representing bulk silicon.""" + +# def _generate_structure(): +# """Return a `StructureData` representing bulk silicon.""" +# from aiida.orm import StructureData + +# param = 5.43 +# cell = [[param / 2., param / 2., 0], [param / 2., 0, param / 2.], [0, param / 2., param / 2.]] +# structure = StructureData(cell=cell) +# structure.append_atom(position=(0., 0., 0.), symbols='Si', name='Si') +# structure.append_atom(position=(param / 4., param / 4., param / 4.), symbols='Si', name='Si') + +# return structure + +# return _generate_structure + + +# @pytest.fixture +# def generate_kpoints_mesh(): +# """Return a `KpointsData` node.""" + +# def _generate_kpoints_mesh(npoints): +# """Return a `KpointsData` with a mesh of npoints in each direction.""" +# from aiida.orm import KpointsData + +# kpoints = KpointsData() +# kpoints.set_kpoints_mesh([npoints] * 3) + +# return kpoints + +# return _generate_kpoints_mesh + + +@pytest.fixture(scope='session') +def generate_parser(): + """Fixture to load a parser class for testing parsers.""" + + def _generate_parser(entry_point_name): + """Fixture to load a parser class for testing parsers. + + :param entry_point_name: entry point name of the parser class + :return: the `Parser` sub class + """ + from aiida.plugins import ParserFactory + return ParserFactory(entry_point_name) + + return _generate_parser + + +@pytest.fixture +def generate_remote_data(): + """Return a `RemoteData` node.""" + + def _generate_remote_data(computer, remote_path, entry_point_name=None): + """Return a `KpointsData` with a mesh of npoints in each direction.""" + from aiida.common.links import LinkType + from aiida.orm import CalcJobNode, RemoteData + from aiida.plugins.entry_point import format_entry_point_string + + entry_point = format_entry_point_string('aiida.calculations', entry_point_name) + + remote = RemoteData(remote_path=remote_path) + remote.computer = computer + + if entry_point_name is not None: + creator = CalcJobNode(computer=computer, process_type=entry_point) + creator.set_option('resources', {'num_machines': 1, 'num_mpiprocs_per_machine': 1}) + remote.add_incoming(creator, link_type=LinkType.CREATE, link_label='remote_folder') + creator.store() + + return remote + + return _generate_remote_data + + +@pytest.fixture +def generate_workchain(): + """Generate an instance of a `WorkChain`.""" + + def _generate_workchain(entry_point, inputs): + """Generate an instance of a `WorkChain` with the given entry point and inputs. + + :param entry_point: entry point name of the work chain subclass. + :param inputs: inputs to be passed to process construction. + :return: a `WorkChain` instance. + """ + from aiida.engine.utils import instantiate_process + from aiida.manage.manager import get_manager + from aiida.plugins import WorkflowFactory + + process_class = WorkflowFactory(entry_point) + runner = get_manager().get_runner() + process = instantiate_process(runner, process_class, **inputs) + + return process + + return _generate_workchain + + + + +# New +@pytest.fixture +def generate_array_data(): + """Return an `ArrayData` node.""" + + def _generate_array_data(size): + """Return a `ArrayData` with an identity matrix of dimension `size`.""" + from aiida.orm import ArrayData + from numpy import ones + + array = ArrayData() + array.set_array('test', ones(size)) + + return array + + return _generate_array_data + +## Methods below not new but retained from above + +@pytest.fixture +def generate_structure(): + """Return a `StructureData` representing bulk silicon.""" + + def _generate_structure(): + """Return a `StructureData` representing bulk silicon.""" + from aiida.orm import StructureData + + param = 5.43 + cell = [[param / 2., param / 2., 0], [param / 2., 0, param / 2.], [0, param / 2., param / 2.]] + structure = StructureData(cell=cell) + structure.append_atom(position=(0., 0., 0.), symbols='Si', name='Si') + structure.append_atom(position=(param / 4., param / 4., param / 4.), symbols='Si', name='Si') + + return structure + + return _generate_structure + +@pytest.fixture +def generate_kpoints_mesh(): + """Return a `KpointsData` node.""" + + def _generate_kpoints_mesh(npoints): + """Return a `KpointsData` with a mesh of npoints in each direction.""" + from aiida.orm import KpointsData + + kpoints = KpointsData() + kpoints.set_kpoints_mesh([npoints] * 3) + + return kpoints + + return _generate_kpoints_mesh + +@pytest.fixture(scope='session') +def generate_upf_data(filepath_tests): + """Return a `UpfData` instance for the given element a file for which should exist in `tests/fixtures/pseudos`.""" + + def _generate_upf_data(element): + """Return `UpfData` node.""" + from aiida.orm import UpfData + + filepath = os.path.join(filepath_tests, 'fixtures', 'pseudos', '{}.upf'.format(element)) + + with io.open(filepath, 'r') as handle: + upf = UpfData(file=handle.name) + + return upf + + return _generate_upf_data + + +@pytest.fixture +def fixture_localhost(aiida_localhost): + """Return a localhost `Computer`.""" + localhost = aiida_localhost + localhost.set_default_mpiprocs_per_machine(1) + return localhost + +@pytest.fixture +def fixture_code(fixture_localhost): + """Return a `Code` instance configured to run calculations of given entry point on localhost `Computer`.""" + + def _fixture_code(entry_point_name): + from aiida.orm import Code + return Code(input_plugin_name=entry_point_name, remote_computer_exec=[fixture_localhost, '/bin/true']) + + return _fixture_code \ No newline at end of file diff --git a/tests/fixtures/pseudos/Si.upf b/tests/fixtures/pseudos/Si.upf new file mode 100644 index 0000000..bff3273 --- /dev/null +++ b/tests/fixtures/pseudos/Si.upf @@ -0,0 +1,91 @@ + + + WARNING: this is a modified dummy pseudo for unit testing purposes only + Author: ADC + Generation date: 10Oct2014 + Pseudopotential type: USPP + Element: Si + Functional: PBE + + Suggested minimum cutoff for wavefunctions: 44. Ry + Suggested minimum cutoff for charge density: 175. Ry + The Pseudo was generated with a Scalar-Relativistic Calculation + Local Potential by smoothing AE potential with Bessel fncs, cutoff radius: 1.9000 + + Valence configuration: + nl pn l occ Rcut Rcut US E pseu + 3S 1 0 2.00 1.600 1.800 -0.794728 + 3P 2 1 2.00 1.600 1.800 -0.299965 + Generation configuration: + 3S 1 0 2.00 1.600 1.800 -0.794724 + 3S 1 0 0.00 1.600 1.800 6.000000 + 3P 2 1 2.00 1.600 1.800 -0.299964 + 3P 2 1 0.00 1.600 1.800 6.000000 + 3D 3 2 0.00 1.600 1.800 0.100000 + 3D 3 2 0.00 1.600 1.800 0.300000 + + Pseudization used: troullier-martins + + &input + title='Si', + zed=14., + rel=1, + config='[Ne] 3s2 3p2 3d-1', + iswitch=3, + dft='PBE' + / + &inputp + lpaw=.false., + pseudotype=3, + file_pseudopw='Si.pbe-n-rrkjus_psl.1.0.0.UPF', + author='ADC', + lloc=-1, + rcloc=1.9, + which_augfun='PSQ', + rmatch_augfun_nc=.true., + nlcc=.true., + new_core_ps=.true., + rcore=1.3, + tm=.true. + / +6 +3S 1 0 2.00 0.00 1.60 1.80 0.0 +3S 1 0 0.00 6.00 1.60 1.80 0.0 +3P 2 1 2.00 0.00 1.60 1.80 0.0 +3P 2 1 0.00 6.00 1.60 1.80 0.0 +3D 3 2 0.00 0.10 1.60 1.80 0.0 +3D 3 2 0.00 0.30 1.60 1.80 0.0 + + + + + + + + \ No newline at end of file diff --git a/aiida_defects/tests/formation_energy/corrections/komsa_pasquarello/test_poisson_solver.py b/tests/formation_energy/corrections/komsa_pasquarello/old_test_poisson_solver.py similarity index 100% rename from aiida_defects/tests/formation_energy/corrections/komsa_pasquarello/test_poisson_solver.py rename to tests/formation_energy/corrections/komsa_pasquarello/old_test_poisson_solver.py diff --git a/aiida_defects/tests/formation_energy/corrections/komsa_pasquarello/test_utils.py b/tests/formation_energy/corrections/komsa_pasquarello/old_test_utils.py similarity index 100% rename from aiida_defects/tests/formation_energy/corrections/komsa_pasquarello/test_utils.py rename to tests/formation_energy/corrections/komsa_pasquarello/old_test_utils.py diff --git a/tests/pytest.ini b/tests/pytest.ini new file mode 100644 index 0000000..dfc0b4e --- /dev/null +++ b/tests/pytest.ini @@ -0,0 +1,6 @@ +[pytest] +filterwarnings = + ignore::DeprecationWarning:frozendict: + ignore::DeprecationWarning:pkg_resources: + ignore::DeprecationWarning:reentry: + ignore::DeprecationWarning:sqlalchemy_utils: \ No newline at end of file diff --git a/aiida_defects/tests/test_data/halite_bulk.cif b/tests/test_data/halite_bulk.cif similarity index 100% rename from aiida_defects/tests/test_data/halite_bulk.cif rename to tests/test_data/halite_bulk.cif diff --git a/aiida_defects/tests/test_data/halite_bulk_sub_k.cif b/tests/test_data/halite_bulk_sub_k.cif similarity index 100% rename from aiida_defects/tests/test_data/halite_bulk_sub_k.cif rename to tests/test_data/halite_bulk_sub_k.cif diff --git a/aiida_defects/tests/test_data/halite_bulk_v_cl.cif b/tests/test_data/halite_bulk_v_cl.cif similarity index 100% rename from aiida_defects/tests/test_data/halite_bulk_v_cl.cif rename to tests/test_data/halite_bulk_v_cl.cif diff --git a/aiida_defects/tests/test_data/halite_bulk_v_cl_sub_k.cif b/tests/test_data/halite_bulk_v_cl_sub_k.cif similarity index 100% rename from aiida_defects/tests/test_data/halite_bulk_v_cl_sub_k.cif rename to tests/test_data/halite_bulk_v_cl_sub_k.cif diff --git a/aiida_defects/tests/test_data/halite_unitcell.cif b/tests/test_data/halite_unitcell.cif similarity index 100% rename from aiida_defects/tests/test_data/halite_unitcell.cif rename to tests/test_data/halite_unitcell.cif diff --git a/aiida_defects/tests/test_data/lton.cif b/tests/test_data/lton.cif similarity index 100% rename from aiida_defects/tests/test_data/lton.cif rename to tests/test_data/lton.cif diff --git a/aiida_defects/tests/test_data/lton_bulk.cif b/tests/test_data/lton_bulk.cif similarity index 100% rename from aiida_defects/tests/test_data/lton_bulk.cif rename to tests/test_data/lton_bulk.cif diff --git a/aiida_defects/tests/tools/test_defects.py b/tests/tools/old_test_defects.py similarity index 100% rename from aiida_defects/tests/tools/test_defects.py rename to tests/tools/old_test_defects.py diff --git a/tests/workflows/formation_energy/corrections/gaussian_countercharge/model_potential/test_model_potential.py b/tests/workflows/formation_energy/corrections/gaussian_countercharge/model_potential/test_model_potential.py new file mode 100644 index 0000000..1eab708 --- /dev/null +++ b/tests/workflows/formation_energy/corrections/gaussian_countercharge/model_potential/test_model_potential.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +"""Tests for the `ModelPotentialWorkchain` class.""" +import pytest +from aiida.common import AttributeDict +from aiida.orm import Float, List, Dict, Int, StructureData +from aiida_defects.formation_energy.corrections.gaussian_countercharge.model_potential.model_potential import ModelPotentialWorkchain + +@pytest.fixture +def generate_inputs_model_potential(generate_structure): + """Generate default inputs for `ModelPotentialWorkchain`""" + + def _generate_inputs_model_potential(): + """Generate default inputs for `ModelPotentialWorkchain`""" + + inputs = { + 'peak_charge': Float(1.0), + 'defect_charge': Float(1.0), + 'scale_factor': Int(2), + 'host_structure': generate_structure(), + 'defect_site': List(list=[0.5,0.5,0.5]), + 'epsilon': Float(1.0), + 'gaussian_params': List(list=[1.,1.,1.,1.,1.,1.,1.,1.,1.]) + } + + return inputs + + return _generate_inputs_model_potential + + + +@pytest.fixture +def generate_workchain_model_potential(generate_workchain, generate_inputs_model_potential): + """Generate an instance of a `ModelPotentialWorkchain`.""" + + def _generate_workchain_model_potential(exit_code=None): + entry_point = 'defects.formation_energy.corrections.gaussian_countercharge.model_potential' + inputs = generate_inputs_model_potential() + process = generate_workchain(entry_point, inputs) + + if exit_code is not None: + node.set_process_state(ProcessState.FINISHED) + node.set_exit_status(exit_code.status) + + return process + + return _generate_workchain_model_potential + +def test_get_model_structure(aiida_profile, generate_workchain_model_potential): + """ + Test `ModelPotentialWorkchain.get_model_structure`. + This checks that we can create the workchain successfully, and that model structure + is created correctly. + """ + from numpy import ndarray + + process = generate_workchain_model_potential() + process.get_model_structure() + + assert isinstance(process.ctx.model_structure, StructureData) + assert isinstance(process.ctx.real_cell, ndarray) + assert isinstance(process.ctx.reciprocal_cell, ndarray) + assert isinstance(process.ctx.limits, List) \ No newline at end of file diff --git a/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py b/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py new file mode 100644 index 0000000..2c5b4a6 --- /dev/null +++ b/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +"""Tests for the `GaussianCounterChargeWorkchain` class.""" +import pytest +from aiida.common import AttributeDict +from aiida.orm import Float, List, Dict, Int +from aiida_defects.formation_energy.corrections.gaussian_countercharge.gaussian_countercharge import GaussianCounterChargeWorkchain + +@pytest.fixture +def generate_inputs_gaussian_countercharge(generate_structure, generate_array_data): + """Generate default inputs for `GaussianCounterChargeWorkchain`""" + + def _generate_inputs_gaussian_countercharge(): + """Generate default inputs for `GaussianCounterChargeWorkchain`""" + + mock_array = generate_array_data(3) + + inputs = { + 'host_structure' : generate_structure(), + 'defect_charge' : Float(-2.), + 'defect_site' : List(list=[0.5,0.5,0.5]), + 'epsilon' : Float(11.68), + 'v_host' : mock_array, + 'v_defect_q0' : mock_array, + 'v_defect_q' : mock_array, + 'rho_host' : mock_array, + 'rho_defect_q' : mock_array, + } + + return inputs + + return _generate_inputs_gaussian_countercharge + + + +@pytest.fixture +def generate_workchain_gaussian_countercharge(generate_workchain, generate_inputs_gaussian_countercharge): + """Generate an instance of a `GaussianCounterChargeWorkchain`.""" + + def _generate_workchain_gaussian_countercharge(exit_code=None): + entry_point = 'defects.formation_energy.corrections.gaussian_countercharge' + inputs = generate_inputs_gaussian_countercharge() + process = generate_workchain(entry_point, inputs) + + if exit_code is not None: + node.set_process_state(ProcessState.FINISHED) + node.set_exit_status(exit_code.status) + + return process + + return _generate_workchain_gaussian_countercharge + +def test_setup(aiida_profile, generate_workchain_gaussian_countercharge): + """ + Test `GaussianCounterChargeWorkchain.setup`. + This checks that we can create the workchain successfully, and that it is initialised in to the correct state. + """ + process = generate_workchain_gaussian_countercharge() + process.setup() + + # assert process.ctx.restart_calc is None + assert process.ctx.model_iteration.value == 0 + assert process.ctx.model_energies == {} + assert process.ctx.model_structures == {} + assert process.ctx.model_correction_energies == {} \ No newline at end of file diff --git a/tests/workflows/formation_energy/test_formation_energy_qe.py b/tests/workflows/formation_energy/test_formation_energy_qe.py new file mode 100644 index 0000000..1ed195b --- /dev/null +++ b/tests/workflows/formation_energy/test_formation_energy_qe.py @@ -0,0 +1,101 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +"""Tests for the `FormationEnergyWorkchainQE` class.""" +import pytest +from aiida.common import AttributeDict +from aiida.orm import Float, List, Dict, Int, Str, Bool +from aiida_defects.formation_energy.formation_energy_qe import FormationEnergyWorkchainQE + +@pytest.fixture +def generate_inputs_formation_energy_qe(fixture_code, generate_structure, generate_kpoints_mesh, generate_array_data, generate_upf_data): + """Generate default inputs for `FormationEnergyWorkchainQE`""" + + def _generate_inputs_formation_energy_qe(): + """Generate default inputs for `FormationEnergyWorkchainQE`""" + + mock_array = generate_array_data(3) + mock_structure = generate_structure() + mock_parameters = Dict(dict={}) + mock_kpoints = generate_kpoints_mesh(2) + mock_pseudos = {'Si': generate_upf_data('Si')} + + inputs = { + "host_structure": mock_structure, + "defect_structure": mock_structure, + "host_unitcell": mock_structure, + 'defect_charge': Float(1.0), + 'defect_species': Str('Si'), + 'defect_site': List(list=[0.5,0.5,0.5]), + "fermi_level": Float(1.0), + "add_or_remove": Str('remove'), + "formation_energy_dict": Dict(dict={}), + "compound": Str("SiO2"), + "dependent_element": Str("O"), + "correction_scheme": Str('gaussian'), + "run_dfpt": Bool(True), + 'run_pw_host': Bool(True), + 'run_pw_defect_q0': Bool(True), + 'run_pw_defect_q': Bool(True), + "qe": { + "dft": { + "supercell": { + "code": fixture_code('quantumespresso.pw'), + "kpoints": mock_kpoints, + "parameters": mock_parameters, + "scheduler_options": mock_parameters, + "pseudopotentials": mock_pseudos, + }, + "unitcell": { + "code": fixture_code('quantumespresso.pw'), + "kpoints": mock_kpoints, + "parameters": mock_parameters, + "scheduler_options": mock_parameters, + "pseudopotentials": mock_pseudos, + }, + }, + "pp":{ + "code": fixture_code('quantumespresso.pp'), + "scheduler_options": mock_parameters, + }, + "dfpt":{ + "code": fixture_code('quantumespresso.ph'), + "scheduler_options": mock_parameters, + } + } + } + + return inputs + + return _generate_inputs_formation_energy_qe + + + +@pytest.fixture +def generate_workchain_formation_energy_qe(generate_workchain, generate_inputs_formation_energy_qe): + """Generate an instance of a `FormationEnergyWorkchainQE` workchain.""" + + def _generate_workchain_formation_energy_qe(exit_code=None): + entry_point = 'defects.formation_energy.qe' + inputs = generate_inputs_formation_energy_qe() + process = generate_workchain(entry_point, inputs) + + if exit_code is not None: + node.set_process_state(ProcessState.FINISHED) + node.set_exit_status(exit_code.status) + + return process + + return _generate_workchain_formation_energy_qe + +def test_setup(aiida_profile, generate_workchain_formation_energy_qe): + """ + Test `FormationEnergyWorkchainQE.setup`. + This checks that we can create the workchain successfully, and that it is initialised into the correct state. + """ + process = generate_workchain_formation_energy_qe() + process.setup() diff --git a/tests/workflows/formation_energy/test_formation_energy_siesta.py b/tests/workflows/formation_energy/test_formation_energy_siesta.py new file mode 100644 index 0000000..cc2762e --- /dev/null +++ b/tests/workflows/formation_energy/test_formation_energy_siesta.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +"""Tests for the `FormationEnergyWorkchainSiesta` class.""" +import pytest +from aiida.common import AttributeDict +from aiida.orm import Float, List, Dict, Int, Str +from aiida_defects.formation_energy.formation_energy_siesta import FormationEnergyWorkchainSiesta + +@pytest.fixture +def generate_inputs_formation_energy_siesta(fixture_code, generate_structure, generate_kpoints_mesh, generate_array_data, generate_upf_data): + """Generate default inputs for `FormationEnergyWorkchainSiesta`""" + + def _generate_inputs_formation_energy_siesta(): + """Generate default inputs for `FormationEnergyWorkchainSiesta`""" + + mock_structure = generate_structure() + + inputs = { + "host_structure": mock_structure, + "defect_structure": mock_structure, + "host_unitcell": mock_structure, + 'defect_charge': Float(1.0), + 'defect_site': List(list=[0.5,0.5,0.5]), + "fermi_level": Float(1.0), + "add_or_remove": Str('remove'), + "formation_energy_dict": Dict(dict={}), + "compound": Str("SiO2"), + "dependent_element": Str("O"), + "correction_scheme": Str('gaussian'), + "run_dfpt": Bool(True), + 'run_pw_host': Bool(True), + 'run_pw_defect_q0': Bool(True), + 'run_pw_defect_q': Bool(True), + "siesta": { + } + } + + return inputs + + return _generate_inputs_formation_energy_siesta + + + +@pytest.fixture +def generate_workchain_formation_energy_siesta(generate_workchain, generate_inputs_formation_energy_siesta): + """Generate an instance of a `FormationEnergyWorkchainSiesta` workchain.""" + + def _generate_workchain_formation_energy_siesta(exit_code=None): + entry_point = 'defects.formation_energy.siesta' + inputs = generate_inputs_formation_energy_siesta() + process = generate_workchain(entry_point, inputs) + + if exit_code is not None: + node.set_process_state(ProcessState.FINISHED) + node.set_exit_status(exit_code.status) + + return process + + return _generate_workchain_formation_energy_siesta + +@pytest.mark.skip(reason="Siesta version of workchain not implemented") +def test_setup(aiida_profile, generate_workchain_formation_energy_siesta): + """ + Test `FormationEnergyWorkchainSiesta.setup`. + This checks that we can create the workchain successfully, and that it is initialised into the correct state. + """ + process = generate_workchain_formation_energy_siesta() + process.setup() \ No newline at end of file From 13fbcadd2958178597cc0f67d5776ec6cd74947d Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 6 Oct 2020 11:04:11 +0200 Subject: [PATCH 19/60] cleaning up the code, adding more comments and modify the output so that chemical potentials of all elements of the centroid of stability region are stored. --- .../chemical_potential/chemical_potential.py | 83 ++++++++++--------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index b340878..c9e9ae0 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -23,17 +23,14 @@ class ChemicalPotentialWorkchain(WorkChain): of that compound. Here we implement method similar to Buckeridge et al., (https://doi.org/10.1016/j.cpc.2013.08.026), """ -# ref_energy = {'Li':-195.51408, 'P':-191.03878, 'O':-557.49850, 'S':-326.67885, 'Cl':-451.66500, 'B':-86.50025, 'Zn':-6275.54609, -# 'Mg':-445.18254, 'Ta':-1928.66788, 'Zr':-1348.75011, 'Sn':-2162.23795, 'Mo':-1865.95416, 'Ta':-1928.66325, 'Be':-382.31135, -# 'C':-246.491433, 'Si':-154.27445, 'Na': -1294.781, 'K': -1515.34028, 'Rb': -665.48096, 'Cs': -855.71637, 'Ca': -1018.30809, -# 'Sr': -953.20309, 'Ba': -5846.81333} + @classmethod def define(cls, spec): super(ChemicalPotentialWorkchain, cls).define(spec) spec.input("formation_energy_dict", valid_type=Dict) spec.input("compound", valid_type=Str) spec.input("dependent_element", valid_type=Str) - spec.input("defect_specie", valid_type=Str) + #spec.input("defect_specie", valid_type=Str) spec.input("ref_energy", valid_type=Dict, help="The reference chemical potential of elements in the structure") spec.input("tolerance", valid_type=Float) @@ -43,9 +40,9 @@ def define(cls, spec): cls.get_centroid, cls.chemical_potential, ) - #spec.output(stability_corners', valid_type=ArrayData) + spec.output('stability_corners', valid_type=ArrayData) spec.output('matrix_of_constraints', valid_type=ArrayData) - spec.output('chemical_potential', valid_type=Float) + spec.output('chemical_potential', valid_type=Dict) spec.exit_code(601, "ERROR_CHEMICAL_POTENTIAL_FAILED", message="The stability region can't be determined. The compound is probably unstable" @@ -112,20 +109,25 @@ def set_matrix_of_constraint(self): eqns[1:,:][mask] = eqns_0 #print(eqns) - # Store the matrix of constraint (before removing the depedent-element row) in the database - temp_data = ArrayData() - temp_data.set_array('data', eqns) - set_of_constraints = return_matrix_of_constraint(temp_data) - #self.ctx.constraints = set_of_constraints - self.out('matrix_of_constraints', set_of_constraints) + # Store the matrix of constraint (before removing the depedent-element column) in the database + constraints_with_dependent_element = ArrayData() + constraints_with_dependent_element.set_array('data', eqns) - matrix = np.delete(eqns, N_species-1, axis=1) - matrix_data = ArrayData() - matrix_data.set_array('set_of_constraints', matrix) + #set_of_constraints = return_matrix_of_constraint(temp_data) + #self.ctx.constraints = set_of_constraints + #self.out('matrix_of_constraints', set_of_constraints) + #matrix = np.delete(eqns, N_species-1, axis=1) + #matrix_data = ArrayData() + #matrix_data.set_array('set_of_constraints', matrix) + + # Removing column corresponding to the dependent element from the set of equations correponding to the constraints + # that delineate the stability region + matrix_data = remove_column_of_dependent_element(constraints_with_dependent_element, Float(N_species)) self.ctx.matrix_eqns = matrix_data + self.out('matrix_of_constraints', matrix_data) def solve_matrix_of_constraint(self): - matrix_eqns = self.ctx.matrix_eqns.get_array('set_of_constraints') + matrix_eqns = self.ctx.matrix_eqns.get_array('data') N_species = matrix_eqns.shape[1] ### Look at all combination of lines and find their intersections @@ -138,7 +140,8 @@ def solve_matrix_of_constraint(self): except np.linalg.LinAlgError: ### Singular matrix: lines are parallels therefore don't have any intersection pass - + + ### Determine the points that form the 'corners' of stability region. These are intersecting point that verify all the constraints. intersecting_points = np.array(intersecting_points) get_constraint = np.dot(intersecting_points, matrix_eqns[:,:-1].T) check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= self.inputs.tolerance.value @@ -151,43 +154,49 @@ def solve_matrix_of_constraint(self): return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED stability_data = ArrayData() - stability_data.set_array('stability_corners', corners_of_stability_region) - self.ctx.stability_corners = stability_data - self.report('The stability corner is : {}'.format(corners_of_stability_region)) - #self.out("stability_corners", self.ctx.stability_corners) + stability_data.set_array('data', corners_of_stability_region) + ordered_stability_corners = Order_point_clockwise(stability_data) + self.ctx.stability_corners = ordered_stability_corners + #self.report('The stability corner is : {}'.format(ordered_stability_corners.get_array('data'))) + self.out("stability_corners", ordered_stability_corners) def get_centroid(self): - - ### Use to determine centroid (as oppose to center). Applicable only in 2D chemical potential map (ternary systems) - #stability_corners = Order_point_clockwise(self.ctx.stability_corners.get_array('stability_corners')) - #P = Polygon(stability_corners) - #centroid_of_stability = np.array([P.centroid.x, P.centroid.y]) - - stability_corners = self.ctx.stability_corners.get_array('stability_corners') - M = self.ctx.matrix_eqns.get_array('set_of_constraints') + ''' + Use to determine centroid (as oppose to center). The center is defined as the average coordinates of the corners + while a centroid is the average cooridinates of every point inside the polygone or polyhedron. + For binary compounds, the stability region is a one-dimensional segment. The centroid coincides with the center. + For ternary and quarternary compounds, the centroid is returned. + For quinternary compound and hight, the center is returned. + ''' + stability_corners = self.ctx.stability_corners.get_array('data') + M = self.ctx.matrix_eqns.get_array('data') N_specie = M.shape[1] if N_specie == 2: ctr_stability = np.mean(stability_corners, axis=0) #without the dependent element else: - #grid = get_grid(stability_corners[:,:-1], M) grid = get_grid(stability_corners, M) ctr_stability = get_centroid(grid) #without the dependent element ### Add the corresponding chemical potential of the dependent element with_dependent = (self.ctx.first_eqn[-1]-np.sum(ctr_stability*self.ctx.first_eqn[:-2]))/self.ctx.first_eqn[-2] centroid_of_stability = np.append(ctr_stability, with_dependent) - self.report('center of stability is {}'.format(centroid_of_stability)) + self.report('Centroid of the stability region is {}'.format(centroid_of_stability)) ctrd = ArrayData() ctrd.set_array('data', centroid_of_stability) self.ctx.centroid = ctrd - #self.out("centroid", self.ctx.centroid) def chemical_potential(self): - index = self.ctx.column_order[self.inputs.defect_specie.value] - #chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), self.inputs.ref_energy) + #index = self.ctx.column_order[self.inputs.defect_specie.value] + #chem_ref = self.inputs.ref_energy.get_dict() + #chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), Float(chem_ref[self.inputs.defect_specie.value])) + #self.ctx.chemical_potential = chemical_potential + #self.out('chemical_potential', chemical_potential) + #self.report('The chemical potential of {} is {}'.format(self.inputs.defect_specie.value, chemical_potential.value)) + chem_ref = self.inputs.ref_energy.get_dict() - chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), Float(chem_ref[self.inputs.defect_specie.value])) + chemical_potential = get_chemical_potential(self.ctx.centroid, self.inputs.ref_energy, self.ctx.column_order) self.ctx.chemical_potential = chemical_potential self.out('chemical_potential', chemical_potential) - self.report('The chemical potential of {} is {}'.format(self.inputs.defect_specie.value, chemical_potential.value)) + self.report('The chemical potential is {}'.format(str(chemical_potential.get_dict()))) + From d0893f63929782bbd755752771f77d3f83a20703 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Tue, 3 Nov 2020 15:01:42 +0000 Subject: [PATCH 20/60] Remove redundant 'dead' code Removed broken legacy variable assignment --- aiida_defects/formation_energy/formation_energy_qe.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 26e5fc8..bd0f3f1 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -138,7 +138,6 @@ def prep_dft_calcs_gaussian_correction(self): pw_inputs.pseudos = self.inputs.qe.dft.supercell.pseudopotentials pw_inputs.kpoints = self.inputs.qe.dft.supercell.kpoints pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() - pw_inputs.settings = self.inputs.qe.dft.supercell.settings parameters = self.inputs.qe.dft.supercell.parameters.get_dict() From f1c2e3b285897adbd7530d6ed54874af2d8013ae Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 15 Dec 2020 14:34:09 +0100 Subject: [PATCH 21/60] Add a warning in case the materials is not stable before shifting its formation to the convex hull. --- .../chemical_potential/chemical_potential.py | 84 ++++--- .../chemical_potential/utils.py | 212 +++++++++++++++--- 2 files changed, 242 insertions(+), 54 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index c9e9ae0..ab0823f 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -27,14 +27,21 @@ class ChemicalPotentialWorkchain(WorkChain): @classmethod def define(cls, spec): super(ChemicalPotentialWorkchain, cls).define(spec) - spec.input("formation_energy_dict", valid_type=Dict) - spec.input("compound", valid_type=Str) - spec.input("dependent_element", valid_type=Str) - #spec.input("defect_specie", valid_type=Str) - spec.input("ref_energy", valid_type=Dict, help="The reference chemical potential of elements in the structure") - spec.input("tolerance", valid_type=Float) + spec.input("formation_energy_dict", valid_type=Dict, + help="The formation energies of all compounds in the phase diagram to which belong the material of interest") + spec.input("compound", valid_type=Str, + help="The name of the material of interest") + spec.input("dependent_element", valid_type=Str, + help="In a N-element phase diagram, the chemical potential of depedent_element is fixed by that of the other N-1 elements") + spec.input("dopant_elements", valid_type=List, required=False, default=lambda: List(list=[]), + help="The aliovalent dopants that might be introduce into the prestine material. Several dopants might be present in co-doping scenario.") + spec.input("ref_energy", valid_type=Dict, + help="The reference chemical potential of elements in the structure") + spec.input("tolerance", valid_type=Float, default=lambda: Float(1E-4), + help="Use to determine if a point in the chemical potential space is a corner of the stability region or not") spec.outline( + cls.setup, cls.set_matrix_of_constraint, cls.solve_matrix_of_constraint, cls.get_centroid, @@ -47,20 +54,50 @@ def define(cls, spec): spec.exit_code(601, "ERROR_CHEMICAL_POTENTIAL_FAILED", message="The stability region can't be determined. The compound is probably unstable" ) + spec.exit_code(602, "ERROR_INVALID_DEPENDENT_ELEMENT", + message="In the case of aliovalent substitution, the dopant element has to be different from dependent element." + ) + + def setup(self): + if self.inputs.dependent_element.value in self.inputs.dopant_elements.get_list(): + self.report('In the case of aliovalent substitution, the dopant element has to be different from dependent element. Please choose a different dependent element.') + return self.exit_codes.ERROR_INVALID_DEPENDENT_ELEMENT + + composition = Composition(self.inputs.compound.value) + element_list = [atom for atom in composition] + + if self.inputs.dopant_elements.get_list(): # check if the list empty + element_list += [Element(atom) for atom in self.inputs.dopant_elements.get_list()] # List concatenation + N_species = len(composition) + len(self.inputs.dopant_elements.get_list()) + else: + N_species = len(composition) + + self.ctx.element_list = element_list + self.ctx.N_species = N_species + formation_energy_dict = self.inputs.formation_energy_dict.get_dict() + + # check if the compound is stable or not. If not shift its energy down to put it on the convex hull and issue a warning. + E_hull = get_e_above_hull(self.inputs.compound.value, element_list, formation_energy_dict) + if E_hull > 0: + self.report('WARNING! The compound {} is predicted to be unstable. For the purpose of determining the stability region, we shift its formation energy down so that it is on the convex hull. Use with care!'.format(self.inputs.compound.value)) + formation_energy_dict[self.inputs.compound.value] -= composition.num_atoms*(E_hull+0.005) # the factor 0.005 is added for numerical reason + + self.ctx.formation_energy_dict = Dict(dict=formation_energy_dict) def set_matrix_of_constraint(self): compound_of_interest = Composition(self.inputs.compound.value) - N_species = len(compound_of_interest) - N_competing_phases = len(self.inputs.formation_energy_dict.get_dict()) - 1 + N_competing_phases = len(self.ctx.formation_energy_dict.get_dict()) - 1 + N_species = self.ctx.N_species column_order = {} # To track which element corresponds to each column, the dependent element is always the last column i = 0 - for ele in compound_of_interest: + for ele in self.ctx.element_list: if ele.symbol != self.inputs.dependent_element.value: column_order[ele.symbol] = i i += 1 - column_order[self.inputs.dependent_element.value] = N_species - 1 + column_order[self.inputs.dependent_element.value] = self.ctx.N_species - 1 self.ctx.column_order = Dict(dict=column_order) + #self.report('Column order: {}'.format(column_order)) ############################################################################## # Construct matrix containing all linear equations. The last column is the rhs @@ -71,19 +108,19 @@ def set_matrix_of_constraint(self): eqns = np.zeros(N_species+1) for ele in compound_of_interest: eqns[column_order[ele.symbol]] = -1.0*compound_of_interest[ele] - eqns[N_species] = -1.0*self.inputs.formation_energy_dict.get_dict()[self.inputs.compound.value] + eqns[N_species] = -1.0*self.ctx.formation_energy_dict.get_dict()[self.inputs.compound.value] self.ctx.first_eqn = eqns - #print(eqns) + #self.report('The first equation is :{}'.format(eqns)) # Now loop through all the competing phases - for key in self.inputs.formation_energy_dict.keys(): + for key in self.ctx.formation_energy_dict.keys(): # if key != compound: if not same_composition(key, self.inputs.compound.value): tmp = np.zeros(N_species+1) temp_composition = Composition(key) for ele in temp_composition: tmp[column_order[ele.symbol]] = temp_composition[ele] - tmp[N_species] = self.inputs.formation_energy_dict.get_dict()[key] + tmp[N_species] = self.ctx.formation_energy_dict.get_dict()[key] eqns = np.vstack((eqns, tmp)) #print(eqns) @@ -96,7 +133,7 @@ def set_matrix_of_constraint(self): eqns = np.vstack((eqns, tmp)) tmp = np.zeros(N_species+1) tmp[column_order[ele.symbol]] = -1.0 - tmp[N_species] = -1.*self.inputs.formation_energy_dict.get_dict()[self.inputs.compound.value]/compound_of_interest[ele] + tmp[N_species] = -1.*self.ctx.formation_energy_dict.get_dict()[self.inputs.compound.value]/compound_of_interest[ele] eqns = np.vstack((eqns, tmp)) #print(eqns) @@ -122,16 +159,16 @@ def set_matrix_of_constraint(self): # Removing column corresponding to the dependent element from the set of equations correponding to the constraints # that delineate the stability region - matrix_data = remove_column_of_dependent_element(constraints_with_dependent_element, Float(N_species)) + matrix_data = remove_column_of_dependent_element(constraints_with_dependent_element, Int(N_species)) self.ctx.matrix_eqns = matrix_data self.out('matrix_of_constraints', matrix_data) def solve_matrix_of_constraint(self): matrix_eqns = self.ctx.matrix_eqns.get_array('data') - N_species = matrix_eqns.shape[1] + #N_species = matrix_eqns.shape[1] ### Look at all combination of lines and find their intersections - comb = combinations(np.arange(np.shape(matrix_eqns)[0]), N_species-1) + comb = combinations(np.arange(np.shape(matrix_eqns)[0]), self.ctx.N_species-1) intersecting_points = [] for item in list(comb): try: @@ -170,8 +207,8 @@ def get_centroid(self): ''' stability_corners = self.ctx.stability_corners.get_array('data') M = self.ctx.matrix_eqns.get_array('data') - N_specie = M.shape[1] - if N_specie == 2: + #N_specie = M.shape[1] + if self.ctx.N_species == 2: ctr_stability = np.mean(stability_corners, axis=0) #without the dependent element else: grid = get_grid(stability_corners, M) @@ -187,13 +224,6 @@ def get_centroid(self): self.ctx.centroid = ctrd def chemical_potential(self): - #index = self.ctx.column_order[self.inputs.defect_specie.value] - #chem_ref = self.inputs.ref_energy.get_dict() - #chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), Float(chem_ref[self.inputs.defect_specie.value])) - #self.ctx.chemical_potential = chemical_potential - #self.out('chemical_potential', chemical_potential) - #self.report('The chemical potential of {} is {}'.format(self.inputs.defect_specie.value, chemical_potential.value)) - chem_ref = self.inputs.ref_energy.get_dict() chemical_potential = get_chemical_potential(self.ctx.centroid, self.inputs.ref_energy, self.ctx.column_order) self.ctx.chemical_potential = chemical_potential diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py index 12d01cc..b6ef9db 100644 --- a/aiida_defects/formation_energy/chemical_potential/utils.py +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -10,10 +10,162 @@ from aiida.engine import calcfunction import numpy as np from pymatgen.core.composition import Composition -from aiida.orm import ArrayData, Float +from aiida.orm import ArrayData, Float, Dict from pymatgen import Element -from shapely.geometry import Polygon from itertools import combinations +from pymatgen.analysis.phase_diagram import * +from pymatgen.entries.computed_entries import ComputedEntry + +@calcfunction +def get_matrix_of_constraints(N_species, compound, dependent_element, column_order, formation_energy_dict): + N_species = N_species.value + compound = compound.value + dependent_element = dependent_element.value + column_order = column_order.get_dict() + formation_energy_dict = formation_energy_dict.get_dict() + + compound_of_interest = Composition(compound) + + # Construct the 1st equation corresponding to the compound of interest + eqns = np.zeros(N_species+1) + for ele in compound_of_interest: + eqns[column_order[ele.symbol]] = -1.0*compound_of_interest[ele] + eqns[N_species] = -1.0*formation_energy_dict[compound] + #self.ctx.first_eqn = eqns + + # Now loop through all the competing phases + for key in formation_energy_dict: + # if key != compound: + if not same_composition(key, compound): + tmp = np.zeros(N_species+1) + temp_composition = Composition(key) + for ele in temp_composition: + tmp[column_order[ele.symbol]] = temp_composition[ele] + tmp[N_species] = formation_energy_dict[key] + eqns = np.vstack((eqns, tmp)) + #print(eqns) + + # Add constraints corresponding to the stability with respect to decomposition into + # elements and combine it with the constraint on the stability of compound of interest + for ele in compound_of_interest: + if ele.symbol != dependent_element: + tmp = np.zeros(N_species+1) + tmp[column_order[ele.symbol]] = 1.0 + eqns = np.vstack((eqns, tmp)) + tmp = np.zeros(N_species+1) + tmp[column_order[ele.symbol]] = -1.0 + tmp[N_species] = -1.*formation_energy_dict[compound]/compound_of_interest[ele] + eqns = np.vstack((eqns, tmp)) + #print(eqns) + + # Eliminate the dependent element (variable) from the equations + mask = eqns[1:, N_species-1] != 0.0 + eqns_0 = eqns[1:,:][mask] + common_factor = compound_of_interest[dependent_element]/eqns_0[:, N_species-1] + eqns_0 = eqns_0*np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting + eqns_0 = (eqns_0+eqns[0,:])/np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting + eqns[1:,:][mask] = eqns_0 + #print(eqns) + + # Store the matrix of constraint (before removing the depedent-element column) + # constraints_with_dependent_element = ArrayData() + # constraints_with_dependent_element.set_array('data', eqns) + + # Removing column corresponding to the dependent element from the set of equations correponding to the constraints + # that delineate the stability region + matrix = np.delete(eqns, N_species-1, axis=1) + matrix_data = ArrayData() + matrix_data.set_array('data', matrix) + return matrix_data + +@calcfunction +def get_stability_corners(matrix_eqns, N_species, compound, tolerance): + matrix_eqns = matrix_eqns.get_array('data') + N_species = N_species.value + tolerance = tolerance.value + compound = compound.value + + ### Look at all combination of lines and find their intersections + comb = combinations(np.arange(np.shape(matrix_eqns)[0]), N_species-1) + intersecting_points = [] + for item in list(comb): + try: + point = np.linalg.solve(matrix_eqns[item,:-1], matrix_eqns[item,-1]) + intersecting_points.append(point) + except np.linalg.LinAlgError: + ### Singular matrix: lines are parallels therefore don't have any intersection + pass + + ### Determine the points that form the 'corners' of stability region. These are intersecting point that verify all the constraints. + intersecting_points = np.array(intersecting_points) + get_constraint = np.dot(intersecting_points, matrix_eqns[:,:-1].T) + check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= tolerance + bool_mask = [not(False in x) for x in check_constraint] + corners_of_stability_region = intersecting_points[bool_mask] + corners_of_stability_region = remove_duplicate(corners_of_stability_region) + + if corners_of_stability_region.size == 0: + self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(compound)) + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED + + ordered_stability_corner = ArrayData() + ordered_stability_corner.set_array('data', Order_point_clockwise(corners_of_stability_region)) + #ordered_stability_corners = Order_point_clockwise(stability_data) + #self.ctx.stability_corners = ordered_stability_corners + + #self.report('The stability corner is : {}'.format(ordered_stability_corners.get_array('data'))) + return ordered_stability_corner + +@calcfunction +def get_center_of_stability(compound, dependent_element, stability_corners, N_species, matrix_eqns): + ''' + Use to determine centroid (as oppose to center). The center is defined as the average coordinates of the corners + while a centroid is the average cooridinates of every point inside the polygone or polyhedron. + For binary compounds, the stability region is a one-dimensional segment. The centroid coincides with the center. + For ternary and quarternary compounds, the centroid is returned. + For quinternary compound and hight, the center is returned. + ''' + compound = compound.value + dependent_element = dependent_element.value + N_species = N_species.value + stability_corners = stability_corners.get_array('data') + matrix_eqns = matrix_eqns.get_array('data') + + if N_species == 2: + ctr_stability = np.mean(stability_corners, axis=0) #without the dependent element + else: + grid = get_grid(stability_corners, matrix_eqns) + ctr_stability = get_centroid(grid) #without the dependent element + + ### Add the corresponding chemical potential of the dependent element + composition = Composition(compound) + first_eqn = matrix_eqns[0] + with_dependent = -1.0*(first_eqn[-1]-np.sum(ctr_stability*first_eqn[:-1]))/composition[dependent_element] + centroid_of_stability = np.append(ctr_stability, with_dependent) +# self.report('Centroid of the stability region is {}'.format(centroid_of_stability)) + + ctrd = ArrayData() + ctrd.set_array('data', centroid_of_stability) + return ctrd + + +def get_e_above_hull(compound, element_list, formation_energy_dict): + composition = Composition(compound) + mp_entries = [] + + idx = 0 + for i, (material, Ef) in enumerate(formation_energy_dict.items()): + if material == compound: + idx = i + mp_entries.append(ComputedEntry(Composition(material), Ef)) + for ref in element_list: + mp_entries.append(ComputedEntry(Composition(ref.symbol), 0.0)) + #mp_entries.append(ComputedEntry(composition, E_formation)) + + pd = PhaseDiagram(mp_entries) + ehull = pd.get_e_above_hull(mp_entries[idx]) + + return ehull def same_composition(compound_1, compound_2): composition_1 = Composition(compound_1) @@ -42,17 +194,7 @@ def remove_duplicate(array): non_duplicate_array.append(point) return np.array(non_duplicate_array) -def Order_point_clockwise(points): - center = np.mean(points, axis=0) - # compute angle - t = np.arctan2(points[:,0]-center[0], points[:,1]-center[1]) - sort_t = np.sort(t) - t = list(t) - u = [t.index(element) for element in sort_t] - ordered_points = points[u] - return ordered_points - -def get_grid(stability_corners, matrix_eqns, N_point=100, tolerance=1E-4): +def get_grid(stability_corners, matrix_eqns, N_point=50, tolerance=1E-4): xmin = np.amin(stability_corners[:,0]) xmax = np.amax(stability_corners[:,0]) ymin = np.amin(stability_corners[:,1]) @@ -85,21 +227,37 @@ def get_grid(stability_corners, matrix_eqns, N_point=100, tolerance=1E-4): def get_centroid(stability_region): return np.mean(stability_region, axis=0) -def PolygoneArea(stability_corners): - # stability corners must be ordered clockwise or anticlockwise - x = stability_corners[:,0] - y = stability_corners[:,1] - return 0.5*np.abs(np.dot(x,np.roll(y,1))-np.dot(y,np.roll(x,1))) +@calcfunction +def Order_point_clockwise(points): + points = points.get_array('data') + if len(points[0]) == 1: + points_order = points + else: + center = np.mean(points, axis=0) + # compute angle + t = np.arctan2(points[:,0]-center[0], points[:,1]-center[1]) + sort_t = np.sort(t) + t = list(t) + u = [t.index(element) for element in sort_t] + points_order = points[u] + ordered_points = ArrayData() + ordered_points.set_array('data', points_order) + return ordered_points + #return points_order @calcfunction -def return_matrix_of_constraint(matrix_data): - matrix = matrix_data.get_array('data') - x = matrix + np.zeros_like(matrix) - mat = ArrayData() - mat.set_array('data', x) - #matrix_data.set_array('data', eqn) - return mat +def remove_column_of_dependent_element(set_of_constraints, N_species): + matrix = np.delete(set_of_constraints.get_array('data'), N_species.value-1, axis=1) + matrix_data = ArrayData() + matrix_data.set_array('data', matrix) + return matrix_data @calcfunction -def get_chemical_potential(ref_energy, chem_pot): - return Float(ref_energy.value + chem_pot.value) +def get_chemical_potential(centroid, ref_energy, column_order): + centroid = centroid.get_array('data') + ref_energy = ref_energy.get_dict() + column_order = column_order.get_dict() + chem_pot = {} + for element in column_order.keys(): + chem_pot[element] = ref_energy[element]+centroid[column_order[element]] + return Dict(dict=chem_pot) From 7a3d962aa9967383d03c220d6ff11ecab8864bc1 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 15 Dec 2020 14:37:10 +0100 Subject: [PATCH 22/60] Reorganizing the workchain so that all the calculations are done by the calcfunctions in utils.py --- .../chemical_potential/chemical_potential.py | 178 +++++------------- 1 file changed, 44 insertions(+), 134 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index ab0823f..2a28908 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -42,10 +42,9 @@ def define(cls, spec): spec.outline( cls.setup, - cls.set_matrix_of_constraint, - cls.solve_matrix_of_constraint, - cls.get_centroid, - cls.chemical_potential, + cls.generate_matrix_of_constraints, + cls.solve_matrix_of_constraints, + cls.get_chemical_potential, ) spec.output('stability_corners', valid_type=ArrayData) spec.output('matrix_of_constraints', valid_type=ArrayData) @@ -73,7 +72,7 @@ def setup(self): N_species = len(composition) self.ctx.element_list = element_list - self.ctx.N_species = N_species + self.ctx.N_species = Int(N_species) formation_energy_dict = self.inputs.formation_energy_dict.get_dict() # check if the compound is stable or not. If not shift its energy down to put it on the convex hull and issue a warning. @@ -84,10 +83,10 @@ def setup(self): self.ctx.formation_energy_dict = Dict(dict=formation_energy_dict) - def set_matrix_of_constraint(self): - compound_of_interest = Composition(self.inputs.compound.value) - N_competing_phases = len(self.ctx.formation_energy_dict.get_dict()) - 1 - N_species = self.ctx.N_species + def generate_matrix_of_constraints(self): + #compound_of_interest = Composition(self.inputs.compound.value) + #N_competing_phases = len(self.ctx.formation_energy_dict.get_dict()) - 1 + #N_species = self.ctx.N_species column_order = {} # To track which element corresponds to each column, the dependent element is always the last column i = 0 @@ -95,7 +94,7 @@ def set_matrix_of_constraint(self): if ele.symbol != self.inputs.dependent_element.value: column_order[ele.symbol] = i i += 1 - column_order[self.inputs.dependent_element.value] = self.ctx.N_species - 1 + column_order[self.inputs.dependent_element.value] = self.ctx.N_species.value - 1 self.ctx.column_order = Dict(dict=column_order) #self.report('Column order: {}'.format(column_order)) @@ -103,130 +102,41 @@ def set_matrix_of_constraint(self): # Construct matrix containing all linear equations. The last column is the rhs # of the system of equations ############################################################################## - - # Construct the 1st equation corresponding to the compound of interest - eqns = np.zeros(N_species+1) - for ele in compound_of_interest: - eqns[column_order[ele.symbol]] = -1.0*compound_of_interest[ele] - eqns[N_species] = -1.0*self.ctx.formation_energy_dict.get_dict()[self.inputs.compound.value] - self.ctx.first_eqn = eqns - #self.report('The first equation is :{}'.format(eqns)) - - # Now loop through all the competing phases - for key in self.ctx.formation_energy_dict.keys(): - # if key != compound: - if not same_composition(key, self.inputs.compound.value): - tmp = np.zeros(N_species+1) - temp_composition = Composition(key) - for ele in temp_composition: - tmp[column_order[ele.symbol]] = temp_composition[ele] - tmp[N_species] = self.ctx.formation_energy_dict.get_dict()[key] - eqns = np.vstack((eqns, tmp)) - #print(eqns) - - # Add constraints corresponding to the stability with respect to decomposition into - # elements and combine it with the constraint on the stability of compound of interest - for ele in compound_of_interest: - if ele.symbol != self.inputs.dependent_element.value: - tmp = np.zeros(N_species+1) - tmp[column_order[ele.symbol]] = 1.0 - eqns = np.vstack((eqns, tmp)) - tmp = np.zeros(N_species+1) - tmp[column_order[ele.symbol]] = -1.0 - tmp[N_species] = -1.*self.ctx.formation_energy_dict.get_dict()[self.inputs.compound.value]/compound_of_interest[ele] - eqns = np.vstack((eqns, tmp)) - #print(eqns) - - # Eliminate the dependent element (variable) from the equations - mask = eqns[1:, N_species-1] != 0.0 - eqns_0 = eqns[1:,:][mask] - common_factor = compound_of_interest[self.inputs.dependent_element.value]/eqns_0[:, N_species-1] - eqns_0 = eqns_0*np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting - eqns_0 = (eqns_0+eqns[0,:])/np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting - eqns[1:,:][mask] = eqns_0 - #print(eqns) - - # Store the matrix of constraint (before removing the depedent-element column) in the database - constraints_with_dependent_element = ArrayData() - constraints_with_dependent_element.set_array('data', eqns) - - #set_of_constraints = return_matrix_of_constraint(temp_data) - #self.ctx.constraints = set_of_constraints - #self.out('matrix_of_constraints', set_of_constraints) - #matrix = np.delete(eqns, N_species-1, axis=1) - #matrix_data = ArrayData() - #matrix_data.set_array('set_of_constraints', matrix) - - # Removing column corresponding to the dependent element from the set of equations correponding to the constraints - # that delineate the stability region - matrix_data = remove_column_of_dependent_element(constraints_with_dependent_element, Int(N_species)) - self.ctx.matrix_eqns = matrix_data - self.out('matrix_of_constraints', matrix_data) - - def solve_matrix_of_constraint(self): - matrix_eqns = self.ctx.matrix_eqns.get_array('data') - #N_species = matrix_eqns.shape[1] - - ### Look at all combination of lines and find their intersections - comb = combinations(np.arange(np.shape(matrix_eqns)[0]), self.ctx.N_species-1) - intersecting_points = [] - for item in list(comb): - try: - point = np.linalg.solve(matrix_eqns[item,:-1], matrix_eqns[item,-1]) - intersecting_points.append(point) - except np.linalg.LinAlgError: - ### Singular matrix: lines are parallels therefore don't have any intersection - pass - - ### Determine the points that form the 'corners' of stability region. These are intersecting point that verify all the constraints. - intersecting_points = np.array(intersecting_points) - get_constraint = np.dot(intersecting_points, matrix_eqns[:,:-1].T) - check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= self.inputs.tolerance.value - bool_mask = [not(False in x) for x in check_constraint] - corners_of_stability_region = intersecting_points[bool_mask] - corners_of_stability_region = remove_duplicate(corners_of_stability_region) - if corners_of_stability_region.size == 0: - self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(self.inputs.compound.value)) - return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED - - stability_data = ArrayData() - stability_data.set_array('data', corners_of_stability_region) - ordered_stability_corners = Order_point_clockwise(stability_data) - self.ctx.stability_corners = ordered_stability_corners + self.ctx.matrix_eqns = get_matrix_of_constraints( + self.ctx.N_species, + self.inputs.compound, + self.inputs.dependent_element, + self.ctx.column_order, + self.ctx.formation_energy_dict + ) + self.out('matrix_of_constraints', self.ctx.matrix_eqns) + + def solve_matrix_of_constraints(self): + self.ctx.stability_corners = get_stability_corners( + self.ctx.matrix_eqns, + self.ctx.N_species, + self.inputs.compound, + self.inputs.tolerance + ) #self.report('The stability corner is : {}'.format(ordered_stability_corners.get_array('data'))) - self.out("stability_corners", ordered_stability_corners) - - def get_centroid(self): - ''' - Use to determine centroid (as oppose to center). The center is defined as the average coordinates of the corners - while a centroid is the average cooridinates of every point inside the polygone or polyhedron. - For binary compounds, the stability region is a one-dimensional segment. The centroid coincides with the center. - For ternary and quarternary compounds, the centroid is returned. - For quinternary compound and hight, the center is returned. - ''' - stability_corners = self.ctx.stability_corners.get_array('data') - M = self.ctx.matrix_eqns.get_array('data') - #N_specie = M.shape[1] - if self.ctx.N_species == 2: - ctr_stability = np.mean(stability_corners, axis=0) #without the dependent element - else: - grid = get_grid(stability_corners, M) - ctr_stability = get_centroid(grid) #without the dependent element - - ### Add the corresponding chemical potential of the dependent element - with_dependent = (self.ctx.first_eqn[-1]-np.sum(ctr_stability*self.ctx.first_eqn[:-2]))/self.ctx.first_eqn[-2] - centroid_of_stability = np.append(ctr_stability, with_dependent) - self.report('Centroid of the stability region is {}'.format(centroid_of_stability)) - - ctrd = ArrayData() - ctrd.set_array('data', centroid_of_stability) - self.ctx.centroid = ctrd - - def chemical_potential(self): - chem_ref = self.inputs.ref_energy.get_dict() - chemical_potential = get_chemical_potential(self.ctx.centroid, self.inputs.ref_energy, self.ctx.column_order) - self.ctx.chemical_potential = chemical_potential - self.out('chemical_potential', chemical_potential) - self.report('The chemical potential is {}'.format(str(chemical_potential.get_dict()))) + self.out("stability_corners", self.ctx.stability_corners) + + def get_chemical_potential(self): + centroid = get_center_of_stability( + self.inputs.compound, + self.inputs.dependent_element, + self.ctx.stability_corners, + self.ctx.N_species, + self.ctx.matrix_eqns + ) + self.report('Centroid of the stability region is {}'.format(centroid.get_array('data'))) + + self.ctx.chemical_potential = get_chemical_potential( + centroid, + self.inputs.ref_energy, + self.ctx.column_order + ) + self.out('chemical_potential', self.ctx.chemical_potential) + self.report('The chemical potential is {}'.format(self.ctx.chemical_potential.get_dict())) From f881d1c04611dacb0eb5b6b7d1954de535d93c99 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 15 Dec 2020 14:42:29 +0100 Subject: [PATCH 23/60] Adding exit code for potential failure in the scipy non-linear solver. --- .../formation_energy/fermi_level/Test.py | 106 ------------------ .../fermi_level/fermi_level.py | 41 ++++--- .../formation_energy/fermi_level/utils.py | 15 +-- 3 files changed, 35 insertions(+), 127 deletions(-) delete mode 100644 aiida_defects/formation_energy/fermi_level/Test.py diff --git a/aiida_defects/formation_energy/fermi_level/Test.py b/aiida_defects/formation_energy/fermi_level/Test.py deleted file mode 100644 index 91469ac..0000000 --- a/aiida_defects/formation_energy/fermi_level/Test.py +++ /dev/null @@ -1,106 +0,0 @@ -import json -import numpy as np -import re -from pymatgen.core.structure import Structure -from pymatgen.core.composition import Composition -from aiida.engine import submit -from aiida.orm import StructureData -from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData, XyData, StructureData -from aiida_defects.formation_energy.utils import get_vbm -from aiida_defects.formation_energy.fermi_level.fermi_level import FermiLevelWorkchain -from aiida_defects.formation_energy.fermi_level.utils import compute_net_charge - -with open('/home/sokseiham/Documents/Defect_calculations/Li7PS6/defect_dict.json') as f: - defect_dict = json.load(f) - dos = np.array(defect_dict['DOS']) - host_structure = Structure.from_dict(defect_dict['unitcell']) - defect_data = defect_dict['defect_data'] - band_gap = defect_dict['band_gap'] - Ef = defect_dict['Ef'] - -# While save in json, floats in the dict key were converted into strings. We need to convert those keys back to float. -for key in defect_data: - key_list = list(defect_data[key]['charge'].keys()) - for chg in key_list: - defect_data[key]['charge'][float(chg)] = defect_data[key]['charge'].pop(chg) - -# site = {'S_1': 1, 'S_2': 2, 'S_3': 1, 'S_oct': 1, 'S_tet': 1, 'Li_1': 2, 'Li_2': 1, 'Li_3': 2, 'Li_4': 2} -# for key in defect_data: -# # print(defect_data[key]['N_site']) -# for defect in site.keys(): -# if defect in key: -# defect_data[key]['N_site'] = site[defect] -# break - -temp = {} -aliovalent = 'Br' -for defect in defect_data: - split = re.split('_|-', defect) - if '-' in defect: - # if split[0] == aliovalent: - # temp[defect] = defect_data[defect] - pass - else: - # if split[0] == 'V': - temp[defect] = defect_data[defect] -defect_data = temp -#print(defect_data) - -compound = 'Li7PS6' -dependent_element = 'P' -temperature = 300.0 -# dopant = None - -dos_node = load_node(48514) -unitcell_node = load_node(48495) -vbm = get_vbm(unitcell_node) -Dos = dos_node.outputs.output_dos -dos_x = Dos.get_x()[1] - vbm -dos_y = Dos.get_y()[1][1] -#chem_potentials = {'Li': -1.923-195.514, 'P':-191.038, 'S':-0.835-326.678} -chem_potentials = {'Li': -1.923-195.514+np.array([-1.5,0,1.5]), 'P':-191.038*np.ones(3), 'S':-0.835-326.678*np.ones(3)} -#chem_potentials = {'Li': -1.923-195.514*np.ones((3,3)), 'P':-191.038*np.ones((3,3)), 'S':-0.835-326.678*np.ones((3,3))} -input_chem_shape = np.ones_like(chem_potentials['Li']) - -#f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, host_structure, dos_x, dos_y, band_gap, dopant=None) -#print(f(0.2*input_chem_shape)) - -inputs = { - "defect_data": Dict(dict=defect_data), - "chem_potentials": Dict(dict=chem_potentials), - "temperature": Float(temperature), - "valence_band_maximum": Float(vbm), - "number_of_electrons": Float(unitcell_node.res.number_of_electrons), - "unitcell": StructureData(pymatgen=host_structure), - "DOS": Dos, - "band_gap": Float(band_gap), - #"dopant": Dict(dict={'X_1':{'c': 1E18, 'q':-1}}) - } -#print(inputs["defect_data"].get_dict()) -#defect_data = inputs["defect_data"].get_dict() -#E_Fermi = 0.0 -#E_defect_formation = {} -#for defect in defect_data.keys(): -# temp = defect_data[defect] -# Ef = {} -# for chg in temp['charge'].keys(): -# E_formation = temp['charge'][chg]['E']-temp['E_host']+chg*(E_Fermi+temp['vbm'])+temp['charge'][chg]['E_corr'] -# for spc in temp['species'].keys(): -# E_formation -= temp['species'][spc]*chem_potentials[spc] -# Ef[chg] = E_formation -# E_defect_formation[defect] = Ef -#print(E_defect_formation) - -#defect_data = inputs["defect_data"].get_dict() -#chem_potentials = inputs["chem_potentials"].get_dict() -#temperature = inputs["temperature"].value -#unitcell = inputs["unitcell"].get_pymatgen_structure() -#dos_x = dos_x.get_array('data') -#dos_y = dos_y.get_array('data') -#band_gap = inputs["band_gap"].value - -f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, host_structure, band_gap, dos_x, dos_y, dopant=None) -print(f(0.2*input_chem_shape)) - -#workchain_future = submit(FermiLevelWorkchain, **inputs) -#print('Submitted workchain with PK=' + str(workchain_future.pk)) diff --git a/aiida_defects/formation_energy/fermi_level/fermi_level.py b/aiida_defects/formation_energy/fermi_level/fermi_level.py index 3494b35..2c26ea5 100644 --- a/aiida_defects/formation_energy/fermi_level/fermi_level.py +++ b/aiida_defects/formation_energy/fermi_level/fermi_level.py @@ -11,6 +11,7 @@ from aiida.engine import WorkChain, calcfunction, ToContext, while_ import sys import numpy as np +from scipy.optimize.nonlin import NoConvergence from pymatgen.core.composition import Composition from .utils import * @@ -33,6 +34,8 @@ def define(cls, spec): spec.input("band_gap", valid_type=Float) spec.input("dopant", valid_type=Dict, default=lambda: Dict(dict=None), help="aliovalent dopants specified by its charge and concentration. Used to compute the change in the defect concentrations with frozen defect approach") + spec.input("tolerance_factor", valid_type=Float, default=lambda: Float(1e-10), + help="tolerance factor use in the non-linear solver to solve for the self-consistent fermi level") spec.outline( cls.setup, @@ -43,6 +46,9 @@ def define(cls, spec): spec.exit_code(701, "ERROR_FERMI_LEVEL_FAILED", message="The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input" ) + spec.exit_code(702, "ERROR_NON_LINEAR_SOLVER_FAILED", + message="The non-linear solver used to solve for the self-consistent Fermi level failed. The tolerance factor might be too small" + ) def setup(self): """ @@ -68,9 +74,10 @@ def setup(self): mask = (dos_x <= 0.05) N_electron = np.trapz(dos_y[mask], dos_x[mask]) - if np.absolute(N_electron-self.inputs.number_of_electrons.value) > 1e-3: + if np.absolute(N_electron-self.inputs.number_of_electrons.value) > 5e-3: + self.report('The number of electrons obtained from the integration of DOS is: {}'.format(N_electron)) self.report('The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input') - return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED + return self.exit_codes.ERROR_FERMI_LEVEL_FAILED #is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(unitcell_node.outputs.output_band) #if not is_insulator: @@ -78,15 +85,21 @@ def setup(self): #self.report('The compound is metallic!') def compute_sc_fermi_level(self): - E_Fermi = solve_for_sc_fermi(self.inputs.defect_data, - self.inputs.chem_potentials, - self.ctx.input_chem_shape, - self.inputs.temperature, - self.inputs.unitcell, - self.inputs.band_gap, - self.ctx.dos_x, - self.ctx.dos_y, - self.inputs.dopant) - self.ctx.sc_fermi_level = E_Fermi - self.out('fermi_level', E_Fermi) - self.report('The self-consistent Fermi level is: {} eV'.format(E_Fermi.get_array('data'))) + try: + E_Fermi = solve_for_sc_fermi(self.inputs.defect_data, + self.inputs.chem_potentials, + self.ctx.input_chem_shape, + self.inputs.temperature, + self.inputs.unitcell, + self.inputs.band_gap, + self.ctx.dos_x, + self.ctx.dos_y, + self.inputs.dopant, + self.inputs.tolerance_factor) + + self.ctx.sc_fermi_level = E_Fermi + self.out('fermi_level', E_Fermi) + self.report('The self-consistent Fermi level is: {} eV'.format(E_Fermi.get_array('data'))) + except NoConvergence: + self.report("The non-linear solver used to solve for the self-consistent Fermi level failed. The tolerance factor might be too small") + return self.exit_codes.ERROR_NON_LINEAR_SOLVER_FAILED diff --git a/aiida_defects/formation_energy/fermi_level/utils.py b/aiida_defects/formation_energy/fermi_level/utils.py index 3830bf9..f5043d3 100644 --- a/aiida_defects/formation_energy/fermi_level/utils.py +++ b/aiida_defects/formation_energy/fermi_level/utils.py @@ -13,6 +13,7 @@ from aiida.orm import ArrayData, Float from pymatgen import Element from scipy.optimize import broyden1 +from scipy.optimize.nonlin import NoConvergence def _get_first_element(x): ''' @@ -40,7 +41,7 @@ def compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperatu value at a time but it is much slower than vectorization using numpy dopant : aliovalent dopants specified by its charge and concentration with the format {'X_1': {'c':, 'q':}, 'X_2': {'c':, 'q':}, ...}. Used to compute the change in the defect concentrations with 'frozen defect' approach - uniticell : is the structure used to compute the Dos not the host supercell used to compute the formation energy + uniticell : is the structure used to compute the Dos, NOT the host supercell used to compute the formation energy ''' dE = dos_x[1] - dos_x[0] @@ -56,12 +57,13 @@ def defect_formation_energy(E_Fermi): for defect in defect_data.keys(): temp = defect_data[defect] Ef = {} - for chg in temp['charge'].keys(): - E_formation = temp['charge'][chg]['E']-temp['E_host']+float(chg)*(E_Fermi+temp['vbm'])+temp['charge'][chg]['E_corr'] + for chg in temp['charges'].keys(): + E_formation = temp['charges'][chg]['E']-temp['E_host']+float(chg)*(E_Fermi+temp['vbm'])+temp['charges'][chg]['E_corr'] for spc in temp['species'].keys(): E_formation -= temp['species'][spc]*input_chem_shape*chem_potentials[spc] Ef[chg] = E_formation E_defect_formation[defect] = Ef + print(E_defect_formation) return E_defect_formation def electron_concentration(E_Fermi): @@ -132,7 +134,6 @@ def c_defect(N_site, Ef): ''' compute the concentration of defects having formation energy Ef and can exist in N_sites in the unitcell ''' - return convert*N_site*np.exp(-1.0*Ef/(k_B*temperature))/unitcell.volume def Net_charge(E_Fermi): @@ -148,7 +149,6 @@ def Net_charge(E_Fermi): positive_charge = 0.0 negative_charge = 0.0 for key in E_defect_formation.keys(): - # print(key) for chg in E_defect_formation[key]: # print(chg) if float(chg) > 0: @@ -166,7 +166,7 @@ def Net_charge(E_Fermi): return Net_charge @calcfunction -def solve_for_sc_fermi(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant): +def solve_for_sc_fermi(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant, f_tol): ''' solve the non-linear equation with E_fermi as variable to obtain the self-consistent Fermi level. The non-linear solver broyden1 in scipy is used. @@ -180,9 +180,10 @@ def solve_for_sc_fermi(defect_data, chem_potentials, input_chem_shape, temperatu dos_x = dos_x.get_array('data') dos_y = dos_y.get_array('data') band_gap = band_gap.value + tolerance = f_tol.value net_charge = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant) - sc_fermi = broyden1(net_charge, input_chem_shape*band_gap/2, f_tol=1e-12) + sc_fermi = broyden1(net_charge, input_chem_shape*band_gap/2, f_tol=tolerance) v_data = ArrayData() v_data.set_array('data', sc_fermi) return v_data From da0935df2c803fdb383c255918657bfa758b363c Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 15 Dec 2020 17:47:42 +0100 Subject: [PATCH 24/60] Adding options to restart from pp calculations of electrostatic potential and charge density. Removing the chemical_potential workchain, the chemical potential has to be provided directly by users. --- .../formation_energy/formation_energy_base.py | 38 ++- .../formation_energy/formation_energy_qe.py | 296 ++++++++++++------ 2 files changed, 222 insertions(+), 112 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index f29a7b3..4619323 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -54,9 +54,9 @@ def define(cls, spec): "defect_charge", valid_type=orm.Float, help="Defect charge state") - spec.input( - "defect_specie", - valid_type=orm.Str) +# spec.input( +# "defect_specie", +# valid_type=orm.Str) spec.input( "defect_site", valid_type=orm.List, @@ -67,20 +67,20 @@ def define(cls, spec): valid_type=orm.Float, default=lambda: orm.Float(0.0), help="Fermi level position with respect to the valence band maximum") - # spec.input( - # "chemical_potential", - # valid_type=orm.Float, - # help="The chemical potential of the given defect type. The convention is that removing an atom is positive", - # ) - spec.input("add_or_remove", valid_type=orm.Str, + spec.input( + "chemical_potential", + valid_type=orm.Dict, + help="The chemical potential of the given defect type. The convention is that removing an atom is positive") + spec.input("chempot_sign", valid_type=orm.Dict, help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") # Chemical potential - spec.input('formation_energy_dict', valid_type=orm.Dict) - spec.input('compound', valid_type=orm.Str) - spec.input('dependent_element', valid_type=orm.Str) - spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) - + #spec.input('formation_energy_dict', valid_type=orm.Dict) + #spec.input('compound', valid_type=orm.Str) + #spec.input('dependent_element', valid_type=orm.Str) + #spec.input("ref_energy", valid_type=Dict, help="The reference chemical potential of elements in the structure") + #spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) + spec.input('sigma', valid_type=orm.Float) spec.input("run_dfpt", valid_type=orm.Bool) @@ -90,6 +90,8 @@ def define(cls, spec): valid_type=orm.Str, help="The correction scheme to apply", ) + spec.input("cutoff", valid_type=orm.Float) + # Outputs spec.output( @@ -198,6 +200,8 @@ def run_gaussian_correction_workchain(self): "defect_site": self.inputs.defect_site, "host_structure": self.inputs.host_structure, "epsilon": self.ctx.epsilon, + "sigma" : self.inputs.sigma, + "cutoff" : self.inputs.cutoff, } workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) @@ -285,7 +289,7 @@ def check_chemical_potential_workchain(self): #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION else: self.ctx.chemical_potential = chem_potential_wc.outputs.chemical_potential - + def compute_formation_energy(self): """ Compute the formation energy @@ -294,8 +298,8 @@ def compute_formation_energy(self): self.ctx.e_f_uncorrected = get_raw_formation_energy( self.ctx.defect_energy, self.ctx.host_energy, - self.inputs.add_or_remove, - self.ctx.chemical_potential, + self.inputs.chempot_sign, + self.inputs.chemical_potential, self.inputs.defect_charge, self.inputs.fermi_level, self.ctx.host_vbm diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 8263bcc..541ca30 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -11,14 +11,16 @@ from aiida import orm from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit -from aiida.plugins import WorkflowFactory +from aiida.plugins import CalculationFactory, WorkflowFactory from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain # from aiida_quantumespresso.calculations.pp import PpCalculation +from aiida.orm.nodes.data.upf import get_pseudos_from_structure from aiida_defects.formation_energy.formation_energy_base import FormationEnergyWorkchainBase from aiida_defects.formation_energy.utils import run_pw_calculation from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy +PpCalculation = CalculationFactory('quantumespresso.pp') class FormationEnergyWorkchainQE(FormationEnergyWorkchainBase): """ @@ -40,48 +42,68 @@ def define(cls, spec): spec.input_namespace('qe.pp', help="Inputs for postprocessing calculations") + # What calculations to run spec.input('run_pw_host', valid_type=orm.Bool, required=True) spec.input('run_pw_defect_q0', valid_type=orm.Bool, required=True) spec.input('run_pw_defect_q', valid_type=orm.Bool, required=True) + spec.input('run_v_host', valid_type=orm.Bool, required=True) + spec.input('run_v_defect_q0', valid_type=orm.Bool, required=True) + spec.input('run_v_defect_q', valid_type=orm.Bool, required=True) + spec.input('run_rho_host', valid_type=orm.Bool, required=True) + spec.input('run_rho_defect_q0', valid_type=orm.Bool, required=True) + spec.input('run_rho_defect_q', valid_type=orm.Bool, required=True) spec.input('run_dfpt', valid_type=orm.Bool, required=True) spec.input('host_node', valid_type=orm.Int, required=False) spec.input('defect_q0_node', valid_type=orm.Int, required=False) spec.input('defect_q_node', valid_type=orm.Int, required=False) + spec.input('v_host_node', valid_type=orm.Int, required=False) + spec.input('v_defect_q0_node', valid_type=orm.Int, required=False) + spec.input('v_defect_q_node', valid_type=orm.Int, required=False) + spec.input('rho_host_node', valid_type=orm.Int, required=False) + spec.input('rho_defect_q0_node', valid_type=orm.Int, required=False) + spec.input('rho_defect_q_node', valid_type=orm.Int, required=False) spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) # DFT inputs (PW.x) spec.input("qe.dft.supercell.code", valid_type=orm.Code, help="The pw.x code to use for the calculations") - spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") +# spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, +# help="The k-point grid to use for the calculations") spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, help="Parameters for the PWSCF calcuations. Some will be set automatically") spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, help="Scheduler options for the PW.x calculations") spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, help="Settings for the PW.x calculations") - spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, - help="The pseudopotential family for use with the code, if required") + #spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, + # help="The pseudopotential family for use with the code, if required") + spec.input("qe.dft.supercell.pseudopotential_family", valid_type=orm.Str, + help="The pseudopotential family for use with the code") # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant spec.input("qe.dft.unitcell.code", valid_type=orm.Code, help="The pw.x code to use for the calculations") - spec.input("qe.dft.unitcell.kpoints", - valid_type=orm.KpointsData, - help="The k-point grid to use for the calculations") +# spec.input("qe.dft.unitcell.kpoints", +# valid_type=orm.KpointsData, +# help="The k-point grid to use for the calculations") spec.input("qe.dft.unitcell.parameters", valid_type=orm.Dict, help="Parameters for the PWSCF calcuations. Some will be set automatically") spec.input("qe.dft.unitcell.scheduler_options", valid_type=orm.Dict, help="Scheduler options for the PW.x calculations") - spec.input_namespace("qe.dft.unitcell.pseudopotentials", - valid_type=orm.UpfData, - dynamic=True, - help="The pseudopotential family for use with the code, if required") +# spec.input_namespace("qe.dft.unitcell.pseudopotentials", +# valid_type=orm.UpfData, +# dynamic=True, +# help="The pseudopotential family for use with the code, if required") + spec.input("qe.dft.unitcell.pseudopotential_family", valid_type=orm.Str, + help="The pseudopotential family for use with the code") + + spec.input('k_points_distance', valid_type=orm.Float, required=False, default=lambda: orm.Float(0.2), + help='distance (in 1/Angstrom) between adjacent kpoints') # Postprocessing inputs (PP.x) spec.input("qe.pp.code", @@ -123,8 +145,8 @@ def define(cls, spec): #cls.run_point_correction_workchain), ), cls.check_correction_workchain), - cls.run_chemical_potential_workchain, - cls.check_chemical_potential_workchain, +# cls.run_chemical_potential_workchain, +# cls.check_chemical_potential_workchain, cls.compute_formation_energy ) @@ -136,13 +158,27 @@ def prep_dft_calcs_gaussian_correction(self): """ self.report("Setting up the Gaussian Countercharge correction workchain") - - pw_inputs = self.inputs.qe.dft.supercell.code.get_builder() - pw_inputs.pseudos = self.inputs.qe.dft.supercell.pseudopotentials - pw_inputs.kpoints = self.inputs.qe.dft.supercell.kpoints - pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() - pw_inputs.settings = self.inputs.qe.dft.supercell.settings - + + kpoints = orm.KpointsData() + kpoints.set_cell_from_structure(self.inputs.host_structure) + kpoints.set_kpoints_mesh_from_density(self.inputs.k_points_distance.value) + + inputs = { + 'pw':{ + 'code' : self.inputs.qe.dft.supercell.code, + #'pseudos': get_pseudos_from_structure(self.inputs.unitcell, self.inputs.qe.dft.unitcell.pseudopotential_family.value), + 'metadata' : self.inputs.qe.dft.supercell.scheduler_options.get_dict(), + 'settings' : self.inputs.qe.dft.supercell.settings, + }, + 'kpoints': kpoints, + } + +# pw_inputs = self.inputs.qe.dft.supercell.code.get_builder() +# pw_inputs.pseudos = self.inputs.qe.dft.supercell.pseudopotentials +# pw_inputs.kpoints = self.inputs.qe.dft.supercell.kpoints +# pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() +# pw_inputs.settings = self.inputs.qe.dft.supercell.settings + parameters = self.inputs.qe.dft.supercell.parameters.get_dict() # We set 'tot_charge' later so throw an error if the user tries to set it to avoid @@ -153,11 +189,13 @@ def prep_dft_calcs_gaussian_correction(self): # Host structure if self.inputs.run_pw_host: - pw_inputs.structure = self.inputs.host_structure + pseudos = get_pseudos_from_structure(self.inputs.host_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) parameters['SYSTEM']['tot_charge'] = orm.Float(0.) - pw_inputs.parameters = orm.Dict(dict=parameters) + inputs['pw']['parameters'] = orm.Dict(dict=parameters) + inputs['pw']['structure'] = self.inputs.host_structure + inputs['pw']['pseudos'] = pseudos - future = self.submit(pw_inputs) + future = self.submit(PwBaseWorkChain, **inputs) self.report( 'Launching PWSCF for host structure (PK={}) with charge {} (PK={})' .format(self.inputs.host_structure.pk, "0.0", future.pk)) @@ -165,11 +203,15 @@ def prep_dft_calcs_gaussian_correction(self): # Defect structure; neutral charge state if self.inputs.run_pw_defect_q0: - pw_inputs.structure = self.inputs.defect_structure + pseudos = get_pseudos_from_structure(self.inputs.defect_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) parameters['SYSTEM']['tot_charge'] = orm.Float(0.) - pw_inputs.parameters = orm.Dict(dict=parameters) + parameters['SYSTEM']['nspin'] = 2 + parameters['SYSTEM']['tot_magnetization'] = 0.0 + inputs['pw']['parameters'] = orm.Dict(dict=parameters) + inputs['pw']['structure'] = self.inputs.defect_structure + inputs['pw']['pseudos'] = pseudos - future = self.submit(pw_inputs) + future = self.submit(PwBaseWorkChain, **inputs) self.report( 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' .format(self.inputs.defect_structure.pk, "0.0", future.pk)) @@ -177,11 +219,15 @@ def prep_dft_calcs_gaussian_correction(self): # Defect structure; target charge state if self.inputs.run_pw_defect_q: - pw_inputs.structure = self.inputs.defect_structure - parameters['SYSTEM']['tot_charge'] = self.inputs.defect_charge - pw_inputs.parameters = orm.Dict(dict=parameters) - - future = self.submit(pw_inputs) + pseudos = get_pseudos_from_structure(self.inputs.defect_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) + parameters['SYSTEM']['tot_charge'] = self.inputs.defect_charge.value + parameters['SYSTEM']['nspin'] = 2 + parameters['SYSTEM']['tot_magnetization'] = 0.0 + inputs['pw']['parameters'] = orm.Dict(dict=parameters) + inputs['pw']['structure'] = self.inputs.defect_structure + inputs['pw']['pseudos'] = pseudos + + future = self.submit(PwBaseWorkChain, **inputs) self.report( 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) @@ -202,6 +248,9 @@ def check_dft_calcs_gaussian_correction(self): #self.ctx.host_vbm = orm.Float(host_calc.outputs.output_band.get_array('bands')[0][-1]) # valence band maximum self.ctx.host_vbm = orm.Float(get_vbm(host_calc)) self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(host_calc.outputs.output_band) + if not is_insulator: + self.report('WARNING! The ground state of the host structure is metallic!') else: self.report( 'PWSCF for the host structure has failed with status {}'.format(host_calc.exit_status)) @@ -215,7 +264,10 @@ def check_dft_calcs_gaussian_correction(self): #self.ctx.host_vbm = orm.Float(HostNode.outputs.output_band.get_array('bands')[0][-1]) # eV self.ctx.host_vbm = orm.Float(get_vbm(HostNode)) self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) - + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(HostNode.outputs.output_band) + if not is_insulator: + self.report('WARNING! The ground state of the host structure is metallic!') + # Defect (q=0) if self.inputs.run_pw_defect_q0: defect_q0_calc = self.ctx['calc_defect_q0'] @@ -224,10 +276,16 @@ def check_dft_calcs_gaussian_correction(self): return self.exit_codes.ERROR_DFT_CALCULATION_FAILED else: self.report('The energy of neutral defect structure is: {} eV'.format(defect_q0_calc.outputs.output_parameters.get_dict()['energy'])) + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(defect_q0_calc.outputs.output_band) + if not is_insulator: + self.report('WARNING! The ground state of neutral defect structure is metallic!') else: Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) self.report('Extracting PWSCF for defect structure with charge {} from node PK={}'.format("0.0", self.inputs.defect_q0_node.value)) self.report('The energy of neutral defect structure is: {} eV'.format(Defect_q0Node.outputs.output_parameters.get_dict()['energy'])) + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(Defect_q0Node.outputs.output_band) + if not is_insulator: + self.report('WARNING! The ground state of neutral defect structure is metallic!') # Defect (q=q) if self.inputs.run_pw_defect_q: @@ -236,6 +294,9 @@ def check_dft_calcs_gaussian_correction(self): self.ctx.defect_energy = orm.Float(defect_q_calc.outputs.output_parameters.get_dict()['energy']) # eV self.report('The energy of defect structure with charge {} is: {} eV'. format(self.inputs.defect_charge.value, defect_q_calc.outputs.output_parameters.get_dict()['energy'])) + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(defect_q_calc.outputs.output_band) + if not is_insulator: + self.report('WARNING! The ground state of charged defect structure is metallic!') else: self.report( 'PWSCF for the defect structure (with charge {}) has failed with status {}' @@ -248,54 +309,81 @@ def check_dft_calcs_gaussian_correction(self): self.ctx.defect_energy = orm.Float(Defect_qNode.outputs.output_parameters.get_dict()['energy']) # eV self.report('The energy of defect structure with charge {} is: {} eV'. format(self.inputs.defect_charge.value, Defect_qNode.outputs.output_parameters.get_dict()['energy'])) + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(Defect_qNode.outputs.output_band) + if not is_insulator: + self.report('WARNING! The ground state of charged defect structure is metallic!') def get_dft_potentials_gaussian_correction(self): """ Obtain the electrostatic potentials from the PWSCF calculations. """ + # User inputs - pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs = PpCalculation.get_builder() + pp_inputs.code = self.inputs.qe.pp.code pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() # Fixed settings - pp_inputs.plot_number = orm.Int(11) # Elctrostatic potential - pp_inputs.plot_dimension = orm.Int(3) # 3D + #pp_inputs.plot_number = orm.Int(0) # Charge density + #pp_inputs.plot_dimension = orm.Int(3) # 3D + + parameters = orm.Dict(dict={ + 'INPUTPP': { + "plot_num" : 11, + }, + 'PLOT': { + "iflag" : 3 + } + }) + pp_inputs.parameters = parameters # Host - if self.inputs.run_pw_host: - pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder +# if self.inputs.run_pw_host: +# pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder +# else: +# HostNode = orm.load_node(int(self.inputs.host_node)) +# pp_inputs.parent_folder = HostNode.outputs.remote_folder + if self.inputs.run_v_host: + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + temp_node = orm.load_node(self.inputs.host_node.value) + pp_inputs.parent_folder = temp_node.outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for host structure (PK={}) with charge {} (PK={})'. + format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_v_host': future}) else: - HostNode = orm.load_node(int(self.inputs.host_node)) - pp_inputs.parent_folder = HostNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Launching PP.x for host structure (PK={}) with charge {} (PK={})'. - format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_host': future}) + self.ctx['calc_v_host'] = orm.load_node(self.inputs.v_host_node.value) # Defect (q=0) - if self.inputs.run_pw_defect_q0: - pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + if self.inputs.run_v_defect_q0: + if self.inputs.run_pw_defect_q0: + pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + else: + temp_node = orm.load_node(self.inputs.defect_q0_node.value) + pp_inputs.parent_folder = temp_node.outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_v_defect_q0': future}) else: - Defect_q0Node = orm.load_node(int(self.inputs.defect_q0_node)) - pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder + self.ctx['calc_v_defect_q0'] = orm.load_node(self.inputs.v_defect_q0_node.value) - future = self.submit(pp_inputs) - self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'pp_defect_q0': future}) # Defect (q=q) - if self.inputs.run_pw_defect_q: - pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + if self.inputs.run_v_defect_q: + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + temp_node = orm.load_node(self.inputs.defect_q_node.value) + pp_inputs.parent_folder = temp_node.outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'calc_v_defect_q': future}) else: - Defect_qNode = orm.load_node(int(self.inputs.defect_q_node)) - pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Launching PP.x for defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'pp_defect_q': future}) + self.ctx['calc_v_defect_q'] = orm.load_node(self.inputs.v_defect_q_node.value) def check_dft_potentials_gaussian_correction(self): """ @@ -304,7 +392,7 @@ def check_dft_potentials_gaussian_correction(self): """ # Host - host_pp = self.ctx['pp_host'] + host_pp = self.ctx['calc_v_host'] if host_pp.is_finished_ok: data_array = host_pp.outputs.output_data.get_array('data') v_data = orm.ArrayData() @@ -316,7 +404,7 @@ def check_dft_potentials_gaussian_correction(self): return self.exit_codes.ERROR_PP_CALCULATION_FAILED # Defect (q=0) - defect_q0_pp = self.ctx['pp_defect_q0'] + defect_q0_pp = self.ctx['calc_v_defect_q0'] if defect_q0_pp.is_finished_ok: data_array = defect_q0_pp.outputs.output_data.get_array('data') v_data = orm.ArrayData() @@ -329,7 +417,7 @@ def check_dft_potentials_gaussian_correction(self): return self.exit_codes.ERROR_PP_CALCULATION_FAILED # Defect (q=q) - defect_q_pp = self.ctx['pp_defect_q'] + defect_q_pp = self.ctx['calc_v_defect_q'] if defect_q_pp.is_finished_ok: data_array = defect_q_pp.outputs.output_data.get_array('data') v_data = orm.ArrayData() @@ -381,50 +469,68 @@ def get_charge_density(self): """ Obtain the electrostatic potentials from the PWSCF calculations. """ + # User inputs - pp_inputs = self.inputs.qe.pp.code.get_builder() + pp_inputs = PpCalculation.get_builder() + pp_inputs.code = self.inputs.qe.pp.code pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() # Fixed settings - pp_inputs.plot_number = orm.Int(0) # Electron Density - pp_inputs.plot_dimension = orm.Int(3) # 3D + #pp_inputs.plot_number = orm.Int(0) # Charge density + #pp_inputs.plot_dimension = orm.Int(3) # 3D + + parameters = orm.Dict(dict={ + 'INPUTPP': { + "plot_num" : 0, + }, + 'PLOT': { + "iflag" : 3 + } + }) + pp_inputs.parameters = parameters # Host - if self.inputs.run_pw_host: - pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + if self.inputs.run_rho_host: + if self.inputs.run_pw_host: + pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + else: + temp_node = orm.load_node(self.inputs.host_node.value) + pp_inputs.parent_folder = temp_node.outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for charge density of host structure (PK={}) with charge {} (PK={})' + .format(self.inputs.host_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_rho_host': future}) else: - HostNode = orm.load_node(self.inputs.host_node.value) - pp_inputs.parent_folder = HostNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Extracting charge density of host structure (PK={}) with charge {} (PK={})' - .format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'calc_rho_host': future}) + self.ctx['calc_rho_host'] = orm.load_node(self.inputs.rho_host_node.value) # Defect (q=0) - if self.inputs.run_pw_defect_q0: - pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + if self.inputs.run_rho_defect_q0: + if self.inputs.run_pw_defect_q0: + pp_inputs.parent_folder = self.ctx['calc_defect_q0'].outputs.remote_folder + else: + temp_node = orm.load_node(self.inputs.defect_q0_node.value) + pp_inputs.parent_folder = temp_node.outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for charge density of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, "0.0", future.pk)) + self.to_context(**{'calc_rho_defect_q0': future}) else: - Defect_q0Node = orm.load_node(self.inputs.defect_q0_node.value) - pp_inputs.parent_folder = Defect_q0Node.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, "0.0", future.pk)) - self.to_context(**{'calc_rho_defect_q0': future}) + self.ctx['calc_rho_defect_q0'] = orm.load_node(self.inputs.rho_defect_q0_node.value) # Defect (q=q) - if self.inputs.run_pw_defect_q: - pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + if self.inputs.run_rho_defect_q: + if self.inputs.run_pw_defect_q: + pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder + else: + temp_node = orm.load_node(self.inputs.defect_q_node.value) + pp_inputs.parent_folder = temp_node.outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for charge density of defect structure (PK={}) with charge {} (PK={})' + .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) + self.to_context(**{'calc_rho_defect_q': future}) else: - Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) - pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder + self.ctx['calc_rho_defect_q'] = orm.load_node(self.inputs.rho_defect_q_node.value) - future = self.submit(pp_inputs) - self.report('Extracting charge density of defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'calc_rho_defect_q': future}) - def check_charge_density_calculations(self): """ Check if the required calculations for the Gaussian Countercharge correction workchain From a7689d6d93ff768c8362bfc09bc75473941d2c55 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 15 Dec 2020 17:51:18 +0100 Subject: [PATCH 25/60] Adding defect_chemistry workchains to compute a series of defect formations energies in one run with chemical potential and fermi level determined consistently. Possibility to restart the calculations from previous failed or successful calculations. --- .../formation_energy/defect_chemistry_base.py | 397 +++++++++ .../formation_energy/defect_chemistry_qe.py | 763 ++++++++++++++++++ 2 files changed, 1160 insertions(+) create mode 100644 aiida_defects/formation_energy/defect_chemistry_base.py create mode 100644 aiida_defects/formation_energy/defect_chemistry_qe.py diff --git a/aiida_defects/formation_energy/defect_chemistry_base.py b/aiida_defects/formation_energy/defect_chemistry_base.py new file mode 100644 index 0000000..d80e9ea --- /dev/null +++ b/aiida_defects/formation_energy/defect_chemistry_base.py @@ -0,0 +1,397 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit +import numpy as np +from .chemical_potential.chemical_potential import ChemicalPotentialWorkchain + +# from .utils import ( +# get_raw_formation_energy, +# get_corrected_formation_energy, +# get_corrected_aligned_formation_energy, +# ) +from .utils import * + +class DefectChemistryWorkchainBase(WorkChain): + """ + The base class to determine the defect chemistry of a given material, containing the + generic, code-agnostic methods, error codes, etc. Defect chemistry refer to the concentration or defect formation + energy of all possible defects (vacancies, interstitials, substitutions,...) which can exist in the material at + thermodynamics equilibrium. + + Any computational code can be used to calculate the required energies and relative permittivity. + However, different codes must be setup in specific ways, and so separate classes are used to implement these + possibilities. This is an abstract class and should not be used directly, but rather the + concrete code-specific classes should be used instead. + """ + + @classmethod + def define(cls, spec): + super(DefectChemistryWorkchainBase, cls).define(spec) + + spec.input('restart_wc', valid_type=orm.Bool, required=False, default=lambda: orm.Bool(False), + help="whether to restart the workchain from previous run or to start from scratch") + spec.input('restart_node', valid_type=orm.Int, required=False, + help="if restart from previous run, provide the node corresponding to that run") + spec.input("unitcell", valid_type=orm.StructureData, + help="Pristine structure to use in the calculation of permittivity and DOS", required=False) + spec.input("host_structure", valid_type=orm.StructureData, + help="Pristine supercell without defect") + spec.input('defect_info', valid_type=orm.Dict, + help="Dictionary containing the information about defects included in the calculations of defect chemistry") + + # Chemical potential workchain + spec.expose_inputs(ChemicalPotentialWorkchain) + + # Fermi level workchain + spec.input("temperature", valid_type=orm.Float, + help="temperature at which the defect chemistry is determined. Enter in the calculaion of electron, hole and defect concentrations") + spec.input("dopant", valid_type=orm.Float, required=False, + help="Charge and concentration of aliovalent dopants added to the system. Used in the 'frozen' defect approach") + + # Correction workchain + spec.input("correction_scheme", valid_type=orm.Str, + help="The correction scheme to apply") + spec.input("epsilon", valid_type=orm.Float, required=False, + help="Dielectric constant of the host") + + # Outputs +# spec.output( +# "density_of_states", valid_type=orm.XyData, required=True) + spec.output( + "defect_formation_energy", valid_type=orm.Dict, required=True) + spec.output( + "chemical_potential", valid_type=orm.Dict, required=True) + spec.output( + "fermi_level", valid_type=orm.Dict, required=True) + spec.output( + "defect_data", valid_type=orm.Dict, required=True) + spec.output( + "total_correction", valid_type=orm.Dict, required=True) + spec.output( + "electrostatic_correction", valid_type=orm.Dict, required=True) + spec.output( + "potential_alignment", valid_type=orm.Dict, required=True) + + # Error codes + spec.exit_code(201, "ERROR_INVALID_CORRECTION", + message="The requested correction scheme is not recognised") + spec.exit_code(202, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly") + spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", + message="The correction scheme sub-workchain failed") + spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", + message="DFT calculation failed") + spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", + message="A post-processing calculation failed") + spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", + message="DFPT calculation failed") + spec.exit_code(305, "ERROR_DOS_CALCULATION_FAILED", + message="DOS calculation failed") + spec.exit_code(306, "ERROR_DOS_INTEGRATION_FAILED", + message="The number of electrons obtained from the integration of the DOS is different from the expected number of electrons") + spec.exit_code(401, "ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED", + message="The chemical potential calculation failed") + spec.exit_code(402, "ERROR_FERMI_LEVEL_WORKCHAIN_FAILED", + message="The self-consistent fermi level calculation failed") + spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly") + spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", + message="The requested method is not yet implemented") + + def setup(self): + """ + Setup the workchain + """ + + self.ctx.inputs_chempots = self.exposed_inputs(ChemicalPotentialWorkchain) + + # Check if correction scheme is valid: + correction_schemes_available = ["gaussian", "point"] + if self.inputs.correction_scheme is not None: + if self.inputs.correction_scheme not in correction_schemes_available: + return self.exit_codes.ERROR_INVALID_CORRECTION + + self.ctx.all_dopants = self.inputs.formation_energy_dict.get_dict() + self.ctx.chempot_dopants = self.ctx.all_dopants + self.ctx.sc_fermi_dopants = list(self.inputs.formation_energy_dict.get_dict().keys()) + self.ctx.pw_host_dopants = list(self.inputs.formation_energy_dict.get_dict().keys()) + self.ctx.chemical_potential = {} + self.ctx.fermi_level = {} + + self.ctx['output_unitcell'] = {} + #self.ctx['calc_dos'] = {} + self.ctx.dos = {} + + self.ctx.all_defects = self.inputs.defect_info.get_dict() + + self.ctx.pw_defects = self.inputs.defect_info.get_dict() + self.ctx.phi_defects = self.inputs.defect_info.get_dict() + self.ctx.rho_defects = self.inputs.defect_info.get_dict() + self.ctx.gc_correction_defects = self.inputs.defect_info.get_dict() + + self.ctx.total_correction = {} + self.ctx.electrostatic_correction = {} + self.ctx.potential_alignment = {} + + # defect_data contains all the information requires to compute defect formation energy such as E_corr, E_host, vbm,... + self.ctx.defect_data = {} + for defect, properties in self.ctx.all_defects.items(): + self.ctx.total_correction[defect] = {} + self.ctx.electrostatic_correction[defect] = {} + self.ctx.potential_alignment[defect] = {} + self.ctx.defect_data[defect] = {'N_site': properties['N_site'], 'species': properties['species'], 'charges': {}} + # Add neutral defect to the calculation even if the user doesn't specify it because it is needed to generate the charge model + if 0.0 not in properties['charges']: + self.ctx.all_defects[defect]['charges'].append(0.0) + self.ctx.pw_defects[defect]['charges'].append(0.0) + self.ctx.phi_defects[defect]['charges'].append(0.0) + self.ctx.rho_defects[defect]['charges'].append(0.0) + for chg in self.ctx.all_defects[defect]['charges']: + self.ctx.defect_data[defect]['charges'][str(chg)] = {} + #self.report('The defect data are: {}'.format(self.ctx.defect_data)) + + + def if_restart_wc(self): + return self.inputs.restart_wc.value + + def if_rerun_calc_unitcell(self): + if not self.ctx['output_unitcell']: + return True +# elif self.ctx['calc_unitcell'].is_finished_ok: +# is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(self.ctx['calc_unitcell'].outputs.output_band) +# self.ctx.vbm = get_vbm(self.ctx['calc_unitcell']) +# self.ctx.number_of_electrons = self.ctx['calc_unitcell'].outputs.output_parameters.get_dict()['number_of_electrons'] +# self.ctx.band_gap = band_gap +# return False + else: + self.ctx.number_of_electrons = self.ctx.output_unitcell['number_of_electrons'] + self.ctx.vbm = self.ctx.output_unitcell['vbm'] + self.ctx.band_gap = self.ctx.output_unitcell['band_gap'] + return False + + def if_rerun_calc_dos(self): +# if not self.ctx['calc_dos']: +# #self.report('start from scratch') +# return True +# elif self.ctx['calc_dos'].is_finished_ok: +# self.ctx.dos = self.ctx['calc_dos'].outputs.output_dos +# #self.report('finished ok') +# return False +# else: +# #self.report('not finished correctly') +# return True + if not self.ctx.dos: + #self.report('start from scratch') + return True + else: + #sefl.out('density_of_states', store_dos(self.ctx.dos)) + return False + + def if_run_dfpt(self): + return self.inputs.epsilon == 0.0 + + def run_chemical_potential_workchain(self): + from .chemical_potential.chemical_potential import ( + ChemicalPotentialWorkchain, ) + + self.report('Computing the chemical potentials...') +# inputs = { +# #"formation_energy_dict": self.inputs.formation_energy_dict, +# "compound": self.inputs.compound, +# "dependent_element": self.inputs.dependent_element, +# "ref_energy": self.inputs.ref_energy, +# "tolerance": self.inputs.tolerance, +# } + inputs = { + "compound": self.ctx.inputs_chempots.compound, + "dependent_element": self.ctx.inputs_chempots.dependent_element, + "ref_energy": self.ctx.inputs_chempots.ref_energy, + "tolerance": self.ctx.inputs_chempots.tolerance, + } + + for key, ef_dict in self.ctx.chempot_dopants.items(): + inputs['formation_energy_dict'] = orm.Dict(dict=ef_dict) + if key != 'intrinsic': + inputs['dopant_elements'] = orm.List(list=[key]) + + workchain_future = self.submit(ChemicalPotentialWorkchain, **inputs) + workchain_future.label = key + label = "chem_potential_wc_{}".format(key) + self.to_context(**{label: workchain_future}) + # Re-initialize dopant_elements to [] + inputs['dopant_elements'] = orm.List(list=[]) + + def check_chemical_potential_workchain(self): + """ + Check if the chemical potential workchain have finished correctly. + If yes, assign the output to context + """ + + for key, ef_dict in self.ctx.all_dopants.items(): + chem_potential_wc = self.ctx["chem_potential_wc_{}".format(key)] + if not chem_potential_wc.is_finished_ok: + self.report( + "Chemical potential workchain failed with status {}".format( + chem_potential_wc.exit_status + ) + ) + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED + #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION + else: + self.ctx.chemical_potential[key] = chem_potential_wc.outputs.chemical_potential.get_dict() + #self.ctx.stability_corners = chem_potential_wc.outputs.stability_corners + #self.ctx.matrix_of_constraints = chem_potential_wc.outputs.matrix_of_constraints + self.report('Chemical potentials: {}'.format(self.ctx.chemical_potential)) + self.out('chemical_potential', store_dict(orm.Dict(dict=self.ctx.chemical_potential))) + + def run_gaussian_correction_workchain(self): + """ + Run the workchain for the Gaussian Countercharge correction + """ + from .corrections.gaussian_countercharge.gaussian_countercharge import ( + GaussianCounterChargeWorkchain, + ) + + self.report("Computing correction via the Gaussian Countercharge scheme") + + inputs = { + "v_host": self.ctx.phi_host, + #"rho_host": self.ctx.rho_host, + "host_structure": self.inputs.host_structure, + "epsilon": self.ctx.epsilon, + } + + #defect_info = self.ctx.all_defects + for defect, properties in self.ctx.gc_correction_defects.items(): + inputs['defect_site'] = orm.List(list=properties['defect_position']) + inputs["v_defect_q0"] = self.ctx['phi_defect_{}[{}]'.format(defect, 0.0)] + for chg in properties['charges']: + if chg != 0.0: + inputs["defect_charge"] = orm.Float(chg) + inputs["v_defect_q"] = self.ctx['phi_defect_{}[{}]'.format(defect, chg)] + #inputs["rho_defect_q"] = self.ctx['rho_defect_{}[{}]'.format(defect, chg)] + workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) + label = "correction_wc_{}[{}]".format(defect, chg) + workchain_future.label = label + self.to_context(**{label: workchain_future}) + + def check_correction_workchain(self): + """ + Check if the potential alignment workchains have finished correctly. + If yes, assign the outputs to the context + """ + + for defect, properties in self.ctx.all_defects.items(): + for chg in properties['charges']: + if chg != 0.0: + correction_wc = self.ctx["correction_wc_{}[{}]".format(defect, chg)] + if not correction_wc.is_finished_ok: + self.report("Correction workchain failed with status {}" + .format(correction_wc.exit_status) + ) + return self.exit_codes.ERROR_CORRECTION_WORKCHAIN_FAILED + else: + self.ctx.defect_data[defect]['charges'][str(chg)]['E_corr'] = correction_wc.outputs.total_correction.value + self.ctx.total_correction[defect][str(chg)] = correction_wc.outputs.total_correction.value + self.ctx.electrostatic_correction[defect][str(chg)] = correction_wc.outputs.electrostatic_correction.value + self.ctx.potential_alignment[defect][str(chg)] = correction_wc.outputs.total_alignment.value + else: + self.ctx.defect_data[defect]['charges']['0.0']['E_corr'] = 0.0 + self.ctx.total_correction[defect]['0.0'] = 0.0 + self.ctx.electrostatic_correction[defect]['0.0'] = 0.0 + self.ctx.potential_alignment[defect]['0.0'] = 0.0 + self.out('defect_data', store_dict(orm.Dict(dict=self.ctx.defect_data))) + self.out('total_correction', store_dict(orm.Dict(dict=self.ctx.total_correction))) + self.out('electrostatic_correction', store_dict(orm.Dict(dict=self.ctx.electrostatic_correction))) + self.out('potential_alignment', store_dict(orm.Dict(dict=self.ctx.potential_alignment))) + self.report('The defect data are: {}'.format(self.ctx.defect_data)) + + def run_fermi_level_workchain(self): + from .fermi_level.fermi_level import ( + FermiLevelWorkchain, ) + + self.report('Running the fermi level workchain...') + + inputs = { + #"defect_data": orm.Dict(dict=self.ctx.defect_data), + #"chem_potentials": self.ctx.chemical_potential, + "temperature": self.inputs.temperature, + "valence_band_maximum": orm.Float(self.ctx.vbm), + "number_of_electrons": orm.Float(self.ctx.number_of_electrons), + "unitcell": self.inputs.unitcell, + "DOS": self.ctx.dos, + "band_gap": orm.Float(self.ctx.band_gap), + #"dopant": Dict(dict={'X_1':{'c': 1E18, 'q':-1}}) + } + + intrinsic_defects = {} + for defect, properties in self.ctx.defect_data.items(): + if is_intrinsic_defect(properties['species'], self.inputs.compound.value): + intrinsic_defects[defect] = properties + + for dopant in self.ctx.sc_fermi_dopants: + defect_temp = intrinsic_defects.copy() + if dopant != 'intrinsic': + for defect, properties in self.ctx.defect_data.items(): + if dopant in properties['species'].keys(): + defect_temp[defect] = properties + + inputs['defect_data'] = orm.Dict(dict=defect_temp) + inputs['chem_potentials'] = orm.Dict(dict=self.ctx.chemical_potential[dopant]) + #self.report('Defect data {}: {}'.format(dopant, defect_temp)) + workchain_future = self.submit(FermiLevelWorkchain, **inputs) + label = "fermi_level_wc_{}".format(dopant) + workchain_future.label = dopant + self.to_context(**{label: workchain_future}) + + def check_fermi_level_workchain(self): + """ + Check if the fermi level workchain have finished correctly. + If yes, assign the output to context + """ + + #for dopant, ef_dict in self.ctx.all_dopants.items(): + for dopant in self.ctx.sc_fermi_dopants: + fermi_level_wc = self.ctx["fermi_level_wc_{}".format(dopant)] + if not fermi_level_wc.is_finished_ok: + self.report( + "Fermi level workchain of {} defect failed with status {}".format( + dopant, fermi_level_wc.exit_status)) + return self.exit_codes.ERROR_FERMI_LEVEL_WORKCHAIN_FAILED + else: + self.ctx.fermi_level[dopant] = fermi_level_wc.outputs.fermi_level.get_array('data').item() # get the value from 0-d numpy array + self.report('Fermi level: {}'.format(self.ctx.fermi_level)) + self.out('fermi_level', store_dict(orm.Dict(dict=self.ctx.fermi_level))) + + def compute_defect_formation_energy(self): + ''' + Computing the defect formation energies of all defects considered in the materials. + ''' + + #self.report('The defect data is :{}'.format(self.ctx.defect_data)) + #self.report('All dopants: {}'.format(self.ctx.all_dopants)) + #self.report('The potential alignment is :{}'.format(self.ctx.potential_alignment)) + #self.report('The chemical potentials are :{}'.format(self.ctx.chemical_potential)) + #self.report('The fermi level are :{}'.format(self.ctx.fermi_level)) + + self.ctx.defect_formation_energy = get_defect_formation_energy( + orm.Dict(dict=self.ctx.defect_data), + #self.inputs.formation_energy_dict, + #orm.Dict(dict=self.ctx.all_dopants), + orm.Dict(dict=self.ctx.fermi_level), + orm.Dict(dict=self.ctx.potential_alignment), + orm.Dict(dict=self.ctx.chemical_potential), + self.inputs.compound + ) + + self.report('The defect formation energy is :{}'.format(self.ctx.defect_formation_energy.get_dict())) + self.out("defect_formation_energy", self.ctx.defect_formation_energy) + diff --git a/aiida_defects/formation_energy/defect_chemistry_qe.py b/aiida_defects/formation_energy/defect_chemistry_qe.py new file mode 100644 index 0000000..bad45e8 --- /dev/null +++ b/aiida_defects/formation_energy/defect_chemistry_qe.py @@ -0,0 +1,763 @@ +from __future__ import absolute_import + +import numpy as np + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, while_, submit +from aiida.plugins import WorkflowFactory +from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain +# from aiida_quantumespresso.calculations.pp import PpCalculation +from aiida.plugins import CalculationFactory, DataFactory +from aiida.orm.nodes.data.upf import get_pseudos_from_structure + +from aiida_defects.formation_energy.new_defect_chemistry_base import DefectChemistryWorkchainBase +from aiida_defects.formation_energy.utils import run_pw_calculation +#from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy +from .utils import * +import copy +import pymatgen + +PwCalculation = CalculationFactory('quantumespresso.pw') +PpCalculation = CalculationFactory('quantumespresso.pp') +PhCalculation = CalculationFactory('quantumespresso.ph') +DosCalculation = CalculationFactory('quantumespresso.dos') + +class DefectChemistryWorkchainQE(DefectChemistryWorkchainBase): + """ + Compute the formation energy for a given defect using QuantumESPRESSO + """ + @classmethod + def define(cls, spec): + super(DefectChemistryWorkchainQE, cls).define(spec) + + # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here + # we keep track of things with two separate namespaces. An additional code, and an additional + # namespace, is used for postprocessing + spec.input_namespace('qe.dft.supercell', + help="Inputs for DFT calculations on supercells") + spec.input_namespace('qe.dft.unitcell', + help="Inputs for a DFT calculation on an alternative host cell for use DOS and/or DFPT") + spec.input_namespace('qe.dos', + help="Inputs for DOS calculation which is needed for the Fermi level workchain") + spec.input_namespace('qe.dfpt', required=False, + help="Inputs for DFPT calculation for calculating the relative permittivity of the host material") + spec.input_namespace('qe.pp', + help="Inputs for postprocessing calculations") + + # spec.input('nbands', valid_type=orm.Int, + # help="The number of bands used in pw calculation for the unitcell. Need to specify it because we want it to be larger than the default value so that we can get the band gap which is need for the FermiLevelWorkchain.") + spec.input('k_points_distance', valid_type=orm.Float, required=False, default=lambda: orm.Float(0.2), + help='distance (in 1/Angstrom) between adjacent kpoints') + + # DFT inputs (PW.x) + spec.input("qe.dft.supercell.code", valid_type=orm.Code, + help="The pw.x code to use for the calculations") + #spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, + # help="The k-point grid to use for the calculations") + spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, + help="Parameters for the PWSCF calcuations. Some will be set automatically") + spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the PW.x calculations") + spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, + help="Settings for the PW.x calculations") +# spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, +# help="The pseudopotential family for use with the code, if required") + spec.input("qe.dft.supercell.pseudopotential_family", valid_type=orm.Str, + help="The pseudopotential family for use with the code") + + # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant + spec.input("qe.dft.unitcell.code", valid_type=orm.Code, + help="The pw.x code to use for the calculations") + #spec.input("qe.dft.unitcell.kpoints", valid_type=orm.KpointsData, + # help="The k-point grid to use for the calculations") + spec.input("qe.dft.unitcell.parameters", valid_type=orm.Dict, + help="Parameters for the PWSCF calcuations. Some will be set automatically") + spec.input("qe.dft.unitcell.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the PW.x calculations") +# spec.input_namespace("qe.dft.unitcell.pseudopotentials",valid_type=orm.UpfData, dynamic=True, +# help="The pseudopotential family for use with the code, if required") + spec.input("qe.dft.unitcell.pseudopotential_family", valid_type=orm.Str, + help="The pseudopotential family for use with the code") + + # DOS inputs (DOS.x) + spec.input("qe.dos.code", valid_type=orm.Code, + help="The dos.x code to use for the calculations") + spec.input("qe.dos.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the dos.x calculations") + + # Postprocessing inputs (PP.x) + spec.input("qe.pp.code", valid_type=orm.Code, + help="The pp.x code to use for the calculations") + spec.input("qe.pp.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the PP.x calculations") + + # DFPT inputs (PH.x) + spec.input("qe.dfpt.code", valid_type=orm.Code, required=False, + help="The ph.x code to use for the calculations") + spec.input("qe.dfpt.scheduler_options", valid_type=orm.Dict, required=False, + help="Scheduler options for the PH.x calculations") + + spec.outline( + cls.setup, + if_(cls.if_restart_wc)( + cls.retrieve_previous_results + ), + cls.run_chemical_potential_workchain, + cls.check_chemical_potential_workchain, + if_(cls.if_rerun_calc_unitcell)( + cls.prep_unitcell_dft_calculation, + cls.check_unitcell_dft_calculation, + ), + if_(cls.if_rerun_calc_dos)( + cls.prep_dos_calculation, + cls.check_dos_calculation, + ), + if_(cls.if_run_dfpt)( + cls.prep_dfpt_calculation + ), + cls.check_dfpt_calculation, + cls.prep_dft_calculations, + cls.check_dft_calculations, + cls.prep_dft_potentials_calculations, + cls.check_dft_potentials_calculations, + #cls.prep_charge_density_calculations, + #cls.check_charge_density_calculations, + cls.run_gaussian_correction_workchain, + cls.check_correction_workchain, + cls.run_fermi_level_workchain, + cls.check_fermi_level_workchain, + cls.compute_defect_formation_energy + ) + + def retrieve_previous_results(self): + """ + Retrieve all the converged calculations from the previous run + """ + + self.report('Retrieving results from previous calculations...') + Node = orm.load_node(self.inputs.restart_node.value) + + # Merging and retreiving data from previous run with the that of the additional dopants + if Node.is_finished_ok: + self.ctx.chemical_potential = Node.outputs.chemical_potential.get_dict() + self.ctx.fermi_level = Node.outputs.fermi_level.get_dict() + self.ctx.total_correction = Node.outputs.total_correction.get_dict() + self.ctx.electrostatic_correction = Node.outputs.electrostatic_correction.get_dict() + self.ctx.potential_alignment = Node.outputs.potential_alignment.get_dict() + self.ctx.defect_data = Node.outputs.defect_data.get_dict() + + self.ctx.sc_fermi_dopants = list(set(self.ctx.fermi_level.keys()).union(set(self.inputs.formation_energy_dict.get_dict().keys()))) + + for defect, properties in self.ctx.all_defects.items(): + # In case we want to add new charge states to the same defects from previous calculations + if defect not in self.ctx.defect_data.keys(): + self.ctx.total_correction[defect] = {} + self.ctx.electrostatic_correction[defect] = {} + self.ctx.potential_alignment[defect] = {} + self.ctx.defect_data[defect] = {'N_site': properties['N_site'], 'species': properties['species'], 'charges': {}} + if 0.0 not in properties['charges']: + self.ctx.all_defects[defect]['charges'].append(0.0) + for chg in self.ctx.all_defects[defect]['charges']: + self.ctx.defect_data[defect]['charges'][str(chg)] = {} + + for entry in Node.get_outgoing(): + try: + process_label = entry.node.attributes['process_label'] + #self.report('{}'.format(process_label)) + except KeyError: + continue + + #if process_label == 'PwBaseWorkChain': + # calc_label = entry.node.label + # if 'host' in calc_label: + # calc_name = 'calc_'+calc_label + # self.report('{}'.format(calc_name)) + # pw_host_dopants.remove(calc_label[5:]) + # self.ctx[calc_name] = entry.node + + if process_label == 'FermiLevelWorkchain': + self.ctx.dos = entry.node.inputs.DOS + vbm = entry.node.inputs.valence_band_maximum.value + N_electrons = entry.node.inputs.number_of_electrons.value + band_gap = entry.node.inputs.band_gap.value + self.ctx['output_unitcell'] = {'number_of_electrons': N_electrons, 'vbm': vbm, 'band_gap': band_gap} + + else: + for dopant, Ef in Node.inputs.formation_energy_dict.get_dict().items(): + if dopant not in self.ctx.all_dopants.keys(): + self.ctx.all_dopants[dopant] = Ef + chempot_dopants = copy.deepcopy(self.ctx.all_dopants) + sc_fermi_dopants = list(self.ctx.all_dopants.keys()) #copy.deepcopy(self.ctx.all_dopants) + pw_host_dopants = list(self.ctx.all_dopants.keys()) + + for defect, info in Node.inputs.defect_info.get_dict().items(): + if defect not in self.ctx.all_defects.keys(): + self.ctx.all_defects[defect] = info + if 0.0 not in self.ctx.all_defects[defect]['charges']: + self.ctx.all_defects[defect]['charges'].append(0.0) + pw_defects = copy.deepcopy(self.ctx.all_defects) + phi_defects = copy.deepcopy(self.ctx.all_defects) + rho_defects = copy.deepcopy(self.ctx.all_defects) + gc_correction_defects = copy.deepcopy(self.ctx.all_defects) + + for entry in Node.get_outgoing(): + try: + process_label = entry.node.attributes['process_label'] + #self.report('{}'.format(process_label)) + except KeyError: + continue + + if process_label == 'PwBaseWorkChain': + calc_label = entry.node.label + if calc_label == 'unitcell': + #calc_name = 'calc_unitcell' + #self.ctx['calc_unitcell'] = entry.node + vbm = get_vbm(entry.node) + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(entry.node.outputs.output_band) + N_electrons = entry.node.outputs.output_parameters.get_dict()['number_of_electrons'] + self.ctx['output_unitcell'] = {'number_of_electrons': N_electrons, 'vbm': vbm, 'band_gap': band_gap} + elif 'host' in calc_label: + calc_name = 'calc_'+calc_label + self.report('{}'.format(calc_name)) + if entry.node.is_finished_ok: + pw_host_dopants.remove(calc_label[5:]) + self.ctx[calc_name] = entry.node + else: + calc_name = 'calc_defect_'+calc_label + if entry.node.is_finished_ok: + #self.report('{}'.format(calc_name)) + self.ctx[calc_name] = entry.node + defect, chg = get_defect_and_charge_from_label(calc_label) + pw_defects[defect]['charges'].remove(chg) + if not pw_defects[defect]['charges']: + pw_defects.pop(defect) + + elif process_label == 'PpCalculation': + calc_label = entry.node.label + if entry.node.is_finished_ok: + self.ctx[calc_label] = entry.node + if 'host' not in calc_label: + defect, chg = get_defect_and_charge_from_label(calc_label[14:]) + self.report('{}, {}, {}'.format(calc_label, defect, chg)) + if 'phi' in calc_label: + # self.report('{}'.format(phi_defects)) + phi_defects[defect]['charges'].remove(chg) + if not phi_defects[defect]['charges']: + phi_defects.pop(defect) + if 'rho' in calc_label: + #self.report('{}'.format(phi_defects)) + rho_defects[defect]['charges'].remove(chg) + if not rho_defects[defect]['charges']: + rho_defects.pop(defect) + + elif process_label == 'DosCalculation': + #self.ctx['calc_dos'] = entry.node + self.ctx.dos = entry.node.outputs.output_dos + + elif process_label == 'GaussianCounterChargeWorkchain': + calc_label = entry.node.label + if entry.node.is_finished_ok: + self.ctx[calc_label] = entry.node + defect, chg = get_defect_and_charge_from_label(calc_label.replace('correction_wc_', '')) + gc_correction_defects[defect]['charges'].remove(chg) + #if not gc_correction_defects[defect]['charges']: + if gc_correction_defects[defect]['charges'] == [0.0]: + gc_correction_defects.pop(defect) + + elif process_label == 'ChemicalPotentialWorkchain': + dopant = entry.node.label + if entry.node.is_finished_ok: + self.ctx["chem_potential_wc_{}".format(dopant)] = entry.node + chempot_dopants.pop(dopant) + +# elif process_label == 'FermiLevelWorkchain': +# dopant = entry.node.label +# if entry.node.is_finished_ok: +# self.ctx["fermi_level_wc_{}".format(dopant)] = entry.node +# sc_fermi_dopants.pop(dopant) + + else: + pass + + self.ctx.chempot_dopants = chempot_dopants + self.ctx.sc_fermi_dopants = sc_fermi_dopants + self.ctx.pw_host_dopants = pw_host_dopants + self.ctx.pw_defects = pw_defects + self.ctx.phi_defects = phi_defects + self.ctx.rho_defects = rho_defects + self.ctx.gc_correction_defects = gc_correction_defects + + self.report('chempot dopant: {}'.format(self.ctx.chempot_dopants.keys())) + self.report('pw host dopant: {}'.format(self.ctx.pw_host_dopants)) + self.report('sc fermi dopants: {}'.format(self.ctx.sc_fermi_dopants)) + self.report('pw defects: {}'.format(self.ctx.pw_defects.keys())) + self.report('phi defects: {}'.format(self.ctx.phi_defects.keys())) + self.report('rho defects: {}'.format(self.ctx.rho_defects.keys())) + self.report('phi defects: {}'.format(self.ctx.phi_defects.keys())) + self.report('rho defects: {}'.format(self.ctx.rho_defects.keys())) + self.report('gc correction defects: {}'.format(self.ctx.gc_correction_defects.keys())) + + def prep_unitcell_dft_calculation(self): + """ + Run a DFT calculation on the structure to be used for the computation of the + DOS and/or dielectric constant + """ + self.report("DFT calculation for the unitcell has been requested") + + # Another code may be desirable - N.B. in AiiDA a code refers to a specific + # executable on a specific computer. As the PH calculation may have to be run on + # an HPC cluster, the PW calculation must be run on the same machine and so this + # may necessitate that a different code is used than that for the supercell calculations. + +# #pw_inputs = self.inputs.qe.dft.unitcell.code.get_builder() +# pw_inputs = PwCalculation.get_builder() +# +# # These are not necessarily the same as for the other DFT calculations +# pw_inputs.code = self.inputs.qe.dft.unitcell.code +# #pw_inputs.pseudos = self.inputs.qe.dft.unitcell.pseudopotentials +# pw_inputs.pseudos = get_pseudos_from_structure(self.inputs.unitcell, self.inputs.qe.dft.unitcell.pseudopotential_family.value) + + kpoints = orm.KpointsData() + kpoints.set_cell_from_structure(self.inputs.unitcell) + kpoints.set_kpoints_mesh_from_density(self.inputs.k_points_distance.value) +# pw_inputs.kpoints = kpoints + + #pw_inputs.metadata = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() + scheduler_options = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() + scheduler_options['label'] = 'unitcell' +# pw_inputs.metadata = scheduler_options + +# pw_inputs.structure = self.inputs.unitcell + parameters = self.inputs.qe.dft.unitcell.parameters.get_dict() + #parameters['SYSTEM']['nbnd'] = self.inputs.nbands.value +# pw_inputs.parameters = orm.Dict(dict=parameters) + + inputs = { + 'pw':{ + 'code' : self.inputs.qe.dft.unitcell.code, + 'structure' : self.inputs.unitcell, + 'pseudos': get_pseudos_from_structure(self.inputs.unitcell, self.inputs.qe.dft.unitcell.pseudopotential_family.value), + 'parameters' : orm.Dict(dict=parameters), + 'metadata' : scheduler_options, + }, + 'kpoints': kpoints, + } + + future = self.submit(PwBaseWorkChain, **inputs) + self.report( + 'Launching PWSCF for the unitcell structure (PK={}) at node PK={}'.format(self.inputs.unitcell.pk, future.pk)) + future.label = 'unitcell' + self.to_context(**{'calc_unitcell': future}) + + def check_unitcell_dft_calculation(self): + """ + Check if the DFT calculation of the unitcell has completed successfully. + """ + + unitcell_calc = self.ctx['calc_unitcell'] + if not unitcell_calc.is_finished_ok: + self.report( + 'PWSCF for the unitcell structure has failed with status {}'. + format(unitcell_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(unitcell_calc.outputs.output_band) + if not is_insulator: + self.report('WARNING! Metallic ground state!') + self.ctx.vbm = get_vbm(unitcell_calc) + #self.ctx.number_of_electrons = unitcell_calc.res.number_of_electrons + self.ctx.number_of_electrons = unitcell_calc.outputs.output_parameters.get_dict()['number_of_electrons'] + self.ctx.band_gap = band_gap + self.report("The band gap of the material is: {} eV".format(band_gap)) + + def prep_dos_calculation(self): + ''' + Run a calculation to extract the DOS of the unitcell. + ''' + dos_inputs = DosCalculation.get_builder() + dos_inputs.code = self.inputs.qe.dos.code + dos_inputs.parent_folder = self.ctx['calc_unitcell'].outputs.remote_folder + + parameters = orm.Dict(dict={'DOS':{ + 'Emin': -180.0, 'Emax': 40.0, 'degauss':0.0005, 'DeltaE': 0.005} + }) + dos_inputs.parameters = parameters + + dos_inputs.metadata = self.inputs.qe.dos.scheduler_options.get_dict() + + future = self.submit(DosCalculation, **dos_inputs) + self.report('Launching DOS for unitcell structure (PK={}) at node PK={}'.format(self.inputs.unitcell.pk, future.pk)) + self.to_context(**{'calc_dos': future}) + + def check_dos_calculation(self): + ''' + Retrieving the DOS of the unitcell + ''' + + dos_calc = self.ctx['calc_dos'] + if dos_calc.is_finished_ok: + Dos = dos_calc.outputs.output_dos + x = Dos.get_x() + y = Dos.get_y() + DOS = np.vstack((x[1]-self.ctx.vbm, y[1][1])).T + #plt.plot(DOS[:,0], DOS[:,1]) + #plt.show() + mask = (DOS[:,0] <= 0.05) + N_electron = np.trapz(DOS[:,1][mask], DOS[:,0][mask]) + if np.absolute(N_electron - self.ctx.number_of_electrons) > 5e-3: + self.report('The number of electrons obtained from the integration of DOS is: {}'.format(N_electron)) + self.report('The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input') + return self.exit_codes.ERROR_DOS_INTEGRATION_FAILED + else: + self.ctx.dos = dos_calc.outputs.output_dos + else: + self.report('DOS calculation for the unitcell has failed with status {}'.format(dos_calc.exit_status)) + return self.exit_codes.ERROR_DOS_CALCULATION_FAILED + + def prep_dfpt_calculation(self): + """ + Run a DFPT calculation to compute the dielectric constant for the pristine material + """ + + ph_inputs = PhCalculation.get_builder() + ph_inputs.code = self.inputs.qe.dfpt.code + + # Setting up the calculation depends on whether the parent SCF calculation is either + # the host supercell or an alternative host unitcell + if self.inputs.unitcell: + ph_inputs.parent_folder = self.ctx['calc_unitcell'].outputs.remote_folder + else: + ph_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + + parameters = orm.Dict(dict={ + 'INPUTPH': { + "tr2_ph" : 1e-16, + 'epsil': True, + 'trans': False + } + }) + ph_inputs.parameters = parameters + + # Set the q-points for a Gamma-point calculation + # N.B. Setting a 1x1x1 mesh is not equivalent as this will trigger a full phonon dispersion calculation + qpoints = orm.KpointsData() + if self.inputs.host_unitcell: + qpoints.set_cell_from_structure(structuredata=self.ctx['calc_unitcell'].inputs.structure) + else: + qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host'].inputs.structure) + qpoints.set_kpoints([[0.,0.,0.]]) + qpoints.get_kpoints(cartesian=True) + ph_inputs.qpoints = qpoints + + ph_inputs.metadata = self.inputs.qe.dfpt.scheduler_options.get_dict() + + future = self.submit(PhCalculation, **ph_inputs) + self.report('Launching PH for host structure at node PK={}'.format(self.inputs.host_structure.pk, future.pk)) + self.to_context(**{'calc_dfpt': future}) + + def check_dfpt_calculation(self): + """ + Compute the dielectric constant to be used in the correction + """ + if self.inputs.epsilon == 0.0: + dfpt_calc = self.ctx['calc_dfpt'] + if dfpt_calc.is_finished_ok: + epsilion_tensor = np.array(dfpt_calc.outputs.output_parameters.get_dict()['dielectric_constant']) + self.ctx.epsilon = orm.Float(np.trace(epsilion_tensor/3.)) + self.report('The computed relative permittivity is {}'.format(self.ctx.epsilon.value)) + else: + self.report( + 'PH for the host structure has failed with status {}'.format(dfpt_calc.exit_status)) + return self.exit_codes.ERROR_DFPT_CALCULATION_FAILED + else: + self.ctx.epsilon = self.inputs.epsilon + + def prep_dft_calculations(self): + """ + Run DFT calculation of the perfect host lattice as well as all the possible defects considered in the material. + """ + +# pw_inputs = PwCalculation.get_builder() +# pw_inputs.code = self.inputs.qe.dft.supercell.code + + kpoints = orm.KpointsData() + kpoints.set_cell_from_structure(self.inputs.host_structure) + kpoints.set_kpoints_mesh_from_density(self.inputs.k_points_distance.value) +# pw_inputs.kpoints = kpoints + +# pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() +# pw_inputs.settings = self.inputs.qe.dft.supercell.settings + scheduler_options = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + parameters = self.inputs.qe.dft.supercell.parameters.get_dict() + + # We set 'tot_charge' later so throw an error if the user tries to set it to avoid + # any ambiguity or unseen modification of user input + if 'tot_charge' in parameters['SYSTEM']: + self.report('You cannot set the "tot_charge" PW.x parameter explicitly') + return self.exit_codes.ERROR_PARAMETER_OVERRIDE + +# pw_inputs.structure = self.inputs.host_structure + parameters['SYSTEM']['tot_charge'] = orm.Float(0.) +# pw_inputs.parameters = orm.Dict(dict=parameters) + + inputs = { + 'pw':{ + 'code' : self.inputs.qe.dft.supercell.code, + 'structure' : self.inputs.host_structure, + 'parameters' : orm.Dict(dict=parameters), + 'settings': self.inputs.qe.dft.supercell.settings, + }, + 'kpoints': kpoints, + } + + for dopant in self.ctx.pw_host_dopants[:1]: + pseudos = get_pseudos_from_structure(self.inputs.host_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) + scheduler_options['label'] = 'host_{}'.format(dopant) +# pw_inputs.metadata = scheduler_options + + inputs['pw']['pseudos'] = pseudos + inputs['pw']['metadata'] = scheduler_options + + future = self.submit(PwBaseWorkChain, **inputs) + self.report('Launching PWSCF for host structure (PK={}) at node PK={}' + .format(self.inputs.host_structure.pk, future.pk)) + future.label = 'host_{}'.format(dopant) + self.to_context(**{'calc_host_{}'.format(dopant): future}) + + #defect_info = self.inputs.defect_info.get_dict() + for defect, properties in self.ctx.pw_defects.items(): + defect_structure = generate_defect_structure(self.inputs.host_structure, properties['defect_position'], properties['species']) +# temp_structure = pymatgen.Structure.from_file('/home/sokseiham/Documents/Defect_calculations/LiK2AlF6/Structures/Ba-K.cif') +# defect_structure = orm.StructureData(pymatgen=temp_structure) + pseudos = get_pseudos_from_structure(defect_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) + + inputs['pw']['structure'] = defect_structure + inputs['pw']['pseudos'] = pseudos + + parameters['SYSTEM']['nspin'] = 2 + parameters['SYSTEM']['tot_magnetization'] = 0.0 + + for chg in properties['charges']: + parameters['SYSTEM']['tot_charge'] = orm.Float(chg) +# pw_inputs.parameters = orm.Dict(dict=parameters) + scheduler_options['label'] = '{}[{}]'.format(defect, chg) +# pw_inputs.metadata = scheduler_options + + inputs['pw']['metadata'] = scheduler_options + inputs['pw']['parameters'] = orm.Dict(dict=parameters) + + future = self.submit(PwBaseWorkChain, **inputs) + self.report('Launching PWSCF for {} defect structure with charge {} at node PK={}' + .format(defect, chg, future.pk)) + future.label = '{}[{}]'.format(defect, chg) + self.to_context(**{'calc_defect_{}[{}]'.format(defect, chg): future}) + + def check_dft_calculations(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + for dopant in self.ctx.pw_host_dopants[:1]: + host_calc = self.ctx['calc_host_{}'.format(dopant)] +# if host_calc.is_finished_ok: +# self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV +# self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) +# self.ctx.host_vbm = orm.Float(get_vbm(host_calc)) +# self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + if not host_calc.is_finished_ok: + self.report( + 'PWSCF for the host structure has failed with status {}'.format(host_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + # Defects + #defect_info = self.inputs.defect_info.get_dict() + defect_info = self.ctx.all_defects + for defect, properties in defect_info.items(): + dopant = get_dopant(properties['species'], self.inputs.compound.value) + #self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_{}'.format(dopant)]) + #self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_{}'.format(dopant)].outputs.output_parameters.get_dict()['energy'] + if self.ctx.pw_host_dopants == []: + self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_intrinsic']) + self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_intrinsic'].outputs.output_parameters.get_dict()['energy'] + else: + self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])]) + self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.output_parameters.get_dict()['energy'] + for chg in properties['charges']: + defect_calc = self.ctx['calc_defect_{}[{}]'.format(defect, chg)] + if not defect_calc.is_finished_ok: + self.report('PWSCF for the {} defect structure with charge {} has failed with status {}' + .format(defect, chg, defect_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(defect_calc.outputs.output_band) + if not is_insulator: + self.report('WARNING! The ground state of {} defect structure with charge {} is metallic!'.format(defect, chg)) + self.ctx.defect_data[defect]['charges'][str(chg)]['E'] = defect_calc.outputs.output_parameters.get_dict()['energy'] # eV + self.report('The energy of {} defect structure with charge {} is: {} eV' + .format(defect, chg, defect_calc.outputs.output_parameters.get_dict()['energy'])) +# self.report('The defect data is :{}'.format(self.ctx.defect_data)) + + def prep_dft_potentials_calculations(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = PpCalculation.get_builder() + pp_inputs.code = self.inputs.qe.pp.code + + scheduler_options = self.inputs.qe.pp.scheduler_options.get_dict() + scheduler_options['label'] = 'pp_phi_host' + pp_inputs.metadata = scheduler_options + + # Fixed settings + #pp_inputs.plot_number = orm.Int(11) # Electrostatic potential + #pp_inputs.plot_dimension = orm.Int(3) # 3D + + parameters = orm.Dict(dict={ + 'INPUTPP': { + "plot_num" : 11, + }, + 'PLOT': { + "iflag" : 3 + } + }) + pp_inputs.parameters = parameters + + # Host + # assuming that the electrostatic potential doesnt vary much with the cutoff + # pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder + self.report('pw_host_dopants: {}'.format(self.ctx.pw_host_dopants)) + if self.ctx.pw_host_dopants == []: + pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder + else: + pp_inputs.parent_folder = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for electrostatic potential for the host structure at node PK={}' + .format(future.pk)) + self.to_context(**{'pp_phi_host': future}) + + #Defects + for defect, properties in self.ctx.phi_defects.items(): + for chg in properties['charges']: + scheduler_options['label'] = 'pp_phi_defect_{}[{}]'.format(defect, chg) + pp_inputs.metadata = scheduler_options + pp_inputs.parent_folder = self.ctx['calc_defect_{}[{}]'.format(defect, chg)].outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for electrostatic potential for {} defect structure with charge {} at node PK={}' + .format(defect, chg, future.pk)) + self.to_context(**{'pp_phi_defect_{}[{}]'.format(defect, chg): future}) + + def check_dft_potentials_calculations(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['pp_phi_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.phi_host = v_data + else: + self.report( + 'Post processing for electrostatic potential the host structure has failed with status {}'.format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defects + defect_info = self.ctx.all_defects + for defect, properties in defect_info.items(): + for chg in properties['charges']: + defect_pp = self.ctx['pp_phi_defect_{}[{}]'.format(defect, chg)] + if defect_pp.is_finished_ok: + data_array = defect_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx['phi_defect_{}[{}]'.format(defect, chg)] = v_data + else: + self.report('Post processing for electrostatic potential for {} defect structure with charge {} has failed with status {}' + .format(defect, chg, defect_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + def prep_charge_density_calculations(self): + """ + Obtain electronic charge density from the PWSCF calculations. + """ + # User inputs + pp_inputs = PpCalculation.get_builder() + pp_inputs.code = self.inputs.qe.pp.code + scheduler_options = self.inputs.qe.pp.scheduler_options.get_dict() + scheduler_options['label'] = 'pp_rho_host' + pp_inputs.metadata = scheduler_options + + # Fixed settings + #pp_inputs.plot_number = orm.Int(0) # Charge density + #pp_inputs.plot_dimension = orm.Int(3) # 3D + + parameters = orm.Dict(dict={ + 'INPUTPP': { + "plot_num" : 0, + }, + 'PLOT': { + "iflag" : 3 + } + }) + pp_inputs.parameters = parameters + + # Host + # assuming that the charge density doesn't vary much with the cutoff + pp_inputs.parent_folder = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.remote_folder + #pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder + + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for charge density for host structure at node PK={}' + .format(future.pk)) + self.to_context(**{'pp_rho_host': future}) + + #Defects + for defect, properties in self.ctx.rho_defects.items(): + for chg in properties['charges']: + pp_inputs.parent_folder = self.ctx['calc_defect_{}[{}]'.format(defect, chg)].outputs.remote_folder + scheduler_options['label'] = 'pp_rho_defect_{}[{}]'.format(defect, chg) + pp_inputs.metadata = scheduler_options + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for charge density for {} defect structure with charge {} at node PK={}' + .format(defect, chg, future.pk)) + self.to_context(**{'pp_rho_defect_{}[{}]'.format(defect, chg): future}) + + def check_charge_density_calculations(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # Host + host_pp = self.ctx['pp_rho_host'] + if host_pp.is_finished_ok: + data_array = host_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx.rho_host = v_data + else: + self.report( + 'Post processing for charge density for the host structure has failed with status {}'.format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defects + defect_info = self.ctx.all_defects + for defect, properties in defect_info.items(): + for chg in properties['charges']: + defect_pp = self.ctx['pp_rho_defect_{}[{}]'.format(defect, chg)] + if defect_pp.is_finished_ok: + data_array = defect_pp.outputs.output_data.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + self.ctx['rho_defect_{}[{}]'.format(defect, chg)] = v_data + else: + self.report('Post processing for charge density for {} defect structure with charge {} has failed with status {}' + .format(defect, chg, defect_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + From a2829f2aa40cf3c89f48f7cd573b78072f17e8b8 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Thu, 17 Dec 2020 15:10:10 +0100 Subject: [PATCH 26/60] reverse back to the use of gaussian with a fixed width. --- .../gaussian_countercharge.py | 57 +++++++++++-------- .../model_potential/model_potential.py | 6 +- .../model_potential/utils.py | 6 +- .../gaussian_countercharge/utils.py | 2 +- 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 8a22828..d864d02 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -9,7 +9,7 @@ from aiida.engine import WorkChain, calcfunction, ToContext, while_ from aiida import orm -from qe_tools.constants import hartree_to_ev +#from qe_tools.constants import hartree_to_ev from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain from .model_potential.model_potential import ModelPotentialWorkchain @@ -43,11 +43,11 @@ def define(cls, spec): help="Dielectric constant for the host material.") spec.input("model_iterations_required", valid_type=orm.Int, - default=orm.Int(3), + default=lambda: orm.Int(3), help="The number of model charge systems to compute. More may improve convergence.") spec.input("cutoff", valid_type=orm.Float, - default=orm.Float(40.), + default=lambda: orm.Float(100.), help="Plane wave cutoff for electrostatic model.") spec.input("v_host", valid_type=orm.ArrayData, @@ -58,20 +58,23 @@ def define(cls, spec): spec.input("v_defect_q", valid_type=orm.ArrayData, help="The electrostatic potential of the defect system in the target charge state (in eV).") - spec.input("rho_host", - valid_type=orm.ArrayData, - help="The charge density of the host system.") - spec.input("rho_defect_q", - valid_type=orm.ArrayData, - help="The charge density of the defect system in the target charge state.") +# spec.input("rho_host", +# valid_type=orm.ArrayData, +# help="The charge density of the host system.") +# spec.input("rho_defect_q", +# valid_type=orm.ArrayData, +# help="The charge density of the defect system in the target charge state.") spec.input("charge_fit_tolerance", valid_type=orm.Float, help="Permissable error for any fitted charge model parameter.", - default=orm.Float(1.0e-3)) + default=lambda: orm.Float(1.0e-3)) spec.input("strict_fit", valid_type=orm.Bool, help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", - default=orm.Bool(True)) + default=lambda: orm.Bool(True)) + spec.input("sigma", + valid_type=orm.Float, default=lambda: orm.Float(1.0), + help="The spread of the gaussian.") spec.outline( cls.setup, @@ -163,21 +166,25 @@ def fit_charge_model(self): Fit an anisotropic gaussian to the charge state electron density """ - fit = get_charge_model_fit( - self.inputs.rho_host, - self.inputs.rho_defect_q, - self.inputs.host_structure) +# fit = get_charge_model_fit( +# self.inputs.rho_host, +# self.inputs.rho_defect_q, +# self.inputs.host_structure) +# +# self.report('fit: {}'.format(fit.get_dict())) +# +# self.ctx.fitted_params = orm.List(list=fit['fit']) +# self.ctx.peak_charge = orm.Float(fit['peak_charge']) +# +# for parameter in fit['error']: +# if parameter > self.inputs.charge_fit_tolerance: +# self.logger.warning("Charge fitting parameter worse than allowed tolerance") +# if self.inputs.strict_fit: +# return self.exit_codes.ERROR_BAD_CHARGE_FIT - self.ctx.fitted_params = orm.List(list=fit['fit']) - self.ctx.peak_charge = orm.Float(fit['peak_charge']) - - - for parameter in fit['error']: - if parameter > self.inputs.charge_fit_tolerance: - self.logger.warning("Charge fitting parameter worse than allowed tolerance") - if self.inputs.strict_fit: - return self.exit_codes.ERROR_BAD_CHARGE_FIT - + sigma = self.inputs.sigma + self.ctx.fitted_params = orm.List(list=self.inputs.defect_site.get_list()+[sigma, sigma, sigma, 0.0, 0.0, 0.0]) + self.ctx.peak_charge = orm.Float(1.0) def should_run_model(self): """ diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index 94b3c23..4dd0616 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -11,7 +11,7 @@ from aiida import orm from aiida.engine import WorkChain, calcfunction, while_ -from qe_tools.constants import bohr_to_ang +from qe_tools._constants import DEFAULT from .utils import (create_model_structure, get_cell_matrix, get_reciprocal_cell, get_reciprocal_grid, get_charge_model, @@ -87,8 +87,8 @@ def get_model_structure(self): # Get cell matrices self.ctx.real_cell = get_cell_matrix(self.ctx.model_structure) self.ctx.reciprocal_cell = get_reciprocal_cell(self.ctx.real_cell) - self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) - limits = np.array(self.ctx.model_structure.cell_lengths) / bohr_to_ang +# self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) + limits = np.array(self.ctx.model_structure.cell_lengths) / DEFAULT.bohr_to_ang self.ctx.limits = orm.List(list=limits.tolist()) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py index fa23cd6..fe54745 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py @@ -14,7 +14,7 @@ from aiida import orm from aiida.engine import calcfunction -from qe_tools.constants import hartree_to_ev, bohr_to_ang +from qe_tools._constants import DEFAULT @@ -45,7 +45,7 @@ def get_cell_matrix(structure): 3x3 cell matrix array in units of Bohr """ - cell_matrix = np.array(structure.cell) / bohr_to_ang # Angstrom to Bohr + cell_matrix = np.array(structure.cell) / DEFAULT.bohr_to_ang # Angstrom to Bohr return cell_matrix @@ -480,6 +480,6 @@ def get_energy(potential, charge_density, cell_matrix): potential = potential.get_array('model_potential') charge_density = charge_density.get_array('model_charge') - energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix) * hartree_to_ev) + energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix) * DEFAULT.hartree_to_ev) return orm.Float(energy) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index 33a3cc1..315a42d 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -11,7 +11,7 @@ from aiida import orm from aiida.engine import calcfunction -from qe_tools.constants import bohr_to_ang +#from qe_tools.constants import bohr_to_ang """ Utility functions for the gaussian countercharge workchain From f15e6ef0edd396d9732c5891a24cc92ef38665d7 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Thu, 17 Dec 2020 21:34:25 +0100 Subject: [PATCH 27/60] Re-organize the code in such a way that all the computations are done by calcfunctions in the utils.py. Also added options to compute chemical potentials in the presence of aliovalent dopants --- .../chemical_potential/chemical_potential.py | 245 +++++++----------- .../chemical_potential/utils.py | 208 ++++++++++++--- 2 files changed, 278 insertions(+), 175 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index a4fda21..ec44f62 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -23,169 +23,122 @@ class ChemicalPotentialWorkchain(WorkChain): of that compound. Here we implement method similar to Buckeridge et al., (https://doi.org/10.1016/j.cpc.2013.08.026), """ - ref_energy = {'Li':-195.51408, 'P':-191.03878, 'O':-557.49850, 'S':-326.67885, 'Cl':-451.66500, 'B':-86.50025, 'Zn':-6275.54609, - 'Mg':-445.18254, 'Ta':-1928.66788, 'Zr':-1348.75011, 'Sn':-2162.23795, 'Mo':-1865.95416, 'Ta':-1928.66325, 'Be':-382.31135, - 'C':-246.491433, 'Si':-154.27445, 'Na': -1294.781, 'K': -1515.34028, 'Rb': -665.48096, 'Cs': -855.71637, 'Ca': -1018.30809, - 'Sr': -953.20309, 'Ba': -5846.81333} + @classmethod def define(cls, spec): super(ChemicalPotentialWorkchain, cls).define(spec) - spec.input("formation_energy_dict", valid_type=Dict) - spec.input("compound", valid_type=Str) - spec.input("dependent_element", valid_type=Str) - spec.input("defect_specie", valid_type=Str) - #spec.input("ref_energy", valid_type=Float) - spec.input("tolerance", valid_type=Float) + spec.input("formation_energy_dict", valid_type=Dict, + help="The formation energies of all compounds in the phase diagram to which belong the material of interest") + spec.input("compound", valid_type=Str, + help="The name of the material of interest") + spec.input("dependent_element", valid_type=Str, + help="In a N-element phase diagram, the chemical potential of depedent_element is fixed by that of the other N-1 elements") + spec.input("dopant_elements", valid_type=List, required=False, default=lambda: List(list=[]), + help="The aliovalent dopants that might be introduce into the prestine material. Several dopants might be present in co-doping scenario.") + spec.input("ref_energy", valid_type=Dict, + help="The reference chemical potential of elements in the structure. Format of the dictionary: {'Element_symbol': energy, ...}") + spec.input("tolerance", valid_type=Float, default=lambda: Float(1E-4), + help="Use to determine if a point in the chemical potential space is a corner of the stability region or not") spec.outline( - cls.set_matrix_of_constraint, - cls.solve_matrix_of_constraint, - cls.get_centroid, - cls.chemical_potential, + cls.setup, + cls.generate_matrix_of_constraints, + cls.solve_matrix_of_constraints, + cls.get_chemical_potential, ) - #spec.output(stability_corners', valid_type=ArrayData) + spec.output('stability_corners', valid_type=ArrayData) spec.output('matrix_of_constraints', valid_type=ArrayData) - spec.output('chemical_potential', valid_type=Float) + spec.output('chemical_potential', valid_type=Dict) spec.exit_code(601, "ERROR_CHEMICAL_POTENTIAL_FAILED", message="The stability region can't be determined. The compound is probably unstable" ) + spec.exit_code(602, "ERROR_INVALID_DEPENDENT_ELEMENT", + message="In the case of aliovalent substitution, the dopant element has to be different from dependent element." + ) + + def setup(self): + if self.inputs.dependent_element.value in self.inputs.dopant_elements.get_list(): + self.report('In the case of aliovalent substitution, the dopant element has to be different from dependent element. Please choose a different dependent element.') + return self.exit_codes.ERROR_INVALID_DEPENDENT_ELEMENT + + composition = Composition(self.inputs.compound.value) + element_list = [atom for atom in composition] + + if self.inputs.dopant_elements.get_list(): # check if the list empty + element_list += [Element(atom) for atom in self.inputs.dopant_elements.get_list()] # List concatenation + N_species = len(composition) + len(self.inputs.dopant_elements.get_list()) + else: + N_species = len(composition) + + self.ctx.element_list = element_list + self.ctx.N_species = Int(N_species) + formation_energy_dict = self.inputs.formation_energy_dict.get_dict() + + # check if the compound is stable or not. If not shift its energy down to put it on the convex hull and issue a warning. + E_hull = get_e_above_hull(self.inputs.compound.value, element_list, formation_energy_dict) + if E_hull > 0: + self.report('WARNING! The compound {} is predicted to be unstable. For the purpose of determining the stability region, we shift its formation energy down so that it is on the convex hull. Use with care!'.format(self.inputs.compound.value)) + formation_energy_dict[self.inputs.compound.value] -= composition.num_atoms*(E_hull+0.005) # the factor 0.005 is added for numerical reason + + self.ctx.formation_energy_dict = Dict(dict=formation_energy_dict) - def set_matrix_of_constraint(self): - compound_of_interest = Composition(self.inputs.compound.value) - N_species = len(compound_of_interest) - N_competing_phases = len(self.inputs.formation_energy_dict.get_dict()) - 1 - + def generate_matrix_of_constraints(self): + ''' + Construct the set of constraints given by each compounds in the phase diagram and which delineate the stability region. + ''' column_order = {} # To track which element corresponds to each column, the dependent element is always the last column i = 0 - for ele in compound_of_interest: + for ele in self.ctx.element_list: if ele.symbol != self.inputs.dependent_element.value: column_order[ele.symbol] = i i += 1 - column_order[self.inputs.dependent_element.value] = N_species - 1 + column_order[self.inputs.dependent_element.value] = self.ctx.N_species.value - 1 self.ctx.column_order = Dict(dict=column_order) - - ############################################################################## - # Construct matrix containing all linear equations. The last column is the rhs - # of the system of equations - ############################################################################## - - # Construct the 1st equation corresponding to the compound of interest - eqns = np.zeros(N_species+1) - for ele in compound_of_interest: - eqns[column_order[ele.symbol]] = -1.0*compound_of_interest[ele] - eqns[N_species] = -1.0*self.inputs.formation_energy_dict.get_dict()[self.inputs.compound.value] - self.ctx.first_eqn = eqns - #print(eqns) - - # Now loop through all the competing phases - for key in self.inputs.formation_energy_dict.keys(): - # if key != compound: - if not same_composition(key, self.inputs.compound.value): - tmp = np.zeros(N_species+1) - temp_composition = Composition(key) - for ele in temp_composition: - tmp[column_order[ele.symbol]] = temp_composition[ele] - tmp[N_species] = self.inputs.formation_energy_dict.get_dict()[key] - eqns = np.vstack((eqns, tmp)) - #print(eqns) - - # Add constraints corresponding to the stability with respect to decomposition into - # elements and combine it with the constraint on the stability of compound of interest - for ele in compound_of_interest: - if ele.symbol != self.inputs.dependent_element.value: - tmp = np.zeros(N_species+1) - tmp[column_order[ele.symbol]] = 1.0 - eqns = np.vstack((eqns, tmp)) - tmp = np.zeros(N_species+1) - tmp[column_order[ele.symbol]] = -1.0 - tmp[N_species] = -1.*self.inputs.formation_energy_dict.get_dict()[self.inputs.compound.value]/compound_of_interest[ele] - eqns = np.vstack((eqns, tmp)) - #print(eqns) - - # Eliminate the dependent element (variable) from the equations - mask = eqns[1:, N_species-1] != 0.0 - eqns_0 = eqns[1:,:][mask] - common_factor = compound_of_interest[self.inputs.dependent_element.value]/eqns_0[:, N_species-1] - eqns_0 = eqns_0*np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting - eqns_0 = (eqns_0+eqns[0,:])/np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting - eqns[1:,:][mask] = eqns_0 - #print(eqns) - - # Store the matrix of constraint (before removing the depedent-element row) in the database - temp_data = ArrayData() - temp_data.set_array('data', eqns) - set_of_constraints = return_matrix_of_constraint(temp_data) - #self.ctx.constraints = set_of_constraints - self.out('matrix_of_constraints', set_of_constraints) - - matrix = np.delete(eqns, N_species-1, axis=1) - matrix_data = ArrayData() - matrix_data.set_array('set_of_constraints', matrix) - self.ctx.matrix_eqns = matrix_data - - def solve_matrix_of_constraint(self): - matrix_eqns = self.ctx.matrix_eqns.get_array('set_of_constraints') - N_species = matrix_eqns.shape[1] - - ### Look at all combination of lines and find their intersections - comb = combinations(np.arange(np.shape(matrix_eqns)[0]), N_species-1) - intersecting_points = [] - for item in list(comb): - try: - point = np.linalg.solve(matrix_eqns[item,:-1], matrix_eqns[item,-1]) - intersecting_points.append(point) - except np.linalg.LinAlgError: - ### Singular matrix: lines are parallels therefore don't have any intersection - pass - - intersecting_points = np.array(intersecting_points) - get_constraint = np.dot(intersecting_points, matrix_eqns[:,:-1].T) - check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= self.inputs.tolerance.value - bool_mask = [not(False in x) for x in check_constraint] - corners_of_stability_region = intersecting_points[bool_mask] - #corners_of_stability_region = remove_duplicate(corners_of_stability_region) + #self.report('Column order: {}'.format(column_order)) + + # Construct matrix containing all linear equations. The last column is the rhs of the system of equations + self.ctx.matrix_eqns = get_matrix_of_constraints( + self.ctx.N_species, + self.inputs.compound, + self.inputs.dependent_element, + self.ctx.column_order, + self.ctx.formation_energy_dict + ) + self.out('matrix_of_constraints', self.ctx.matrix_eqns) + + def solve_matrix_of_constraints(self): + ''' + Solve the system of (linear) constraints to get the coordinates of the corners of polyhedra that delineate the stability region + ''' + self.ctx.stability_corners = get_stability_corners( + self.ctx.matrix_eqns, + self.ctx.N_species, + self.inputs.compound, + self.inputs.tolerance + ) + #self.report('The stability corner is : {}'.format(ordered_stability_corners.get_array('data'))) + self.out("stability_corners", self.ctx.stability_corners) + + def get_chemical_potential(self): + ''' + Compute the centroid of the stability region + ''' + centroid = get_center_of_stability( + self.inputs.compound, + self.inputs.dependent_element, + self.ctx.stability_corners, + self.ctx.N_species, + self.ctx.matrix_eqns + ) + self.report('Centroid of the stability region is {}'.format(centroid.get_array('data'))) - if corners_of_stability_region.size == 0: - self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(self.inputs.compound.value)) - return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED - - ### compute the corresponding chemical potential of the dependent element - with_dependent = (self.ctx.first_eqn[-1]-np.sum(corners_of_stability_region*self.ctx.first_eqn[:-2], axis=1))/self.ctx.first_eqn[-2] - corners_of_stability_region = np.hstack((corners_of_stability_region, np.reshape(with_dependent,(len(with_dependent),1)))) - #print(corners_of_stability_region) - - stability_data = ArrayData() - stability_data.set_array('stability_corners', corners_of_stability_region) - self.ctx.stability_corners = stability_data - #self.out("stability_corners", self.ctx.stability_corners) - - def get_centroid(self): - - ### Use to determine centroid (as oppose to center). Applicable only in 2D chemical potential map (ternary systems) - #stability_corners = Order_point_clockwise(self.ctx.stability_corners.get_array('stability_corners')) - #P = Polygon(stability_corners) - #centroid_of_stability = np.array([P.centroid.x, P.centroid.y]) - - stability_corners = self.ctx.stability_corners.get_array('stability_corners') - M = self.ctx.matrix_eqns.get_array('set_of_constraints') - grid = get_grid(stability_corners[:,:-1], M) - ctr_stability = get_centroid(grid) #without the dependent element - #ctr_stability = np.mean(stability_corners[:,:-1], axis=0) #without the dependent element - - ### Add the corresponding chemical potential of the dependent element - with_dependent = (self.ctx.first_eqn[-1]-np.sum(ctr_stability*self.ctx.first_eqn[:-2]))/self.ctx.first_eqn[-2] - centroid_of_stability = np.append(ctr_stability, with_dependent) - self.report('center of stability is {}'.format(centroid_of_stability)) - ctrd = ArrayData() - ctrd.set_array('data', centroid_of_stability) - self.ctx.centroid = ctrd - #self.out("centroid", self.ctx.centroid) + # Recover the absolute chemical potential by adding the energy of the reference elements to centroid + self.ctx.chemical_potential = get_chemical_potential( + centroid, + self.inputs.ref_energy, + self.ctx.column_order + ) + self.out('chemical_potential', self.ctx.chemical_potential) + self.report('The chemical potential is {}'.format(self.ctx.chemical_potential.get_dict())) - def chemical_potential(self): - index = self.ctx.column_order[self.inputs.defect_specie.value] - #chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), self.inputs.ref_energy) - chemical_potential = get_chemical_potential(Float(self.ctx.centroid.get_array('data')[index]), Float(self.ref_energy[self.inputs.defect_specie.value])) - self.ctx.chemical_potential = chemical_potential - self.out('chemical_potential', chemical_potential) - self.report('The chemical potential of {} is {}'.format(self.inputs.defect_specie.value, chemical_potential.value)) diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py index 12d01cc..03c277a 100644 --- a/aiida_defects/formation_energy/chemical_potential/utils.py +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -10,10 +10,162 @@ from aiida.engine import calcfunction import numpy as np from pymatgen.core.composition import Composition -from aiida.orm import ArrayData, Float +from aiida.orm import ArrayData, Float, Dict from pymatgen import Element -from shapely.geometry import Polygon from itertools import combinations +from pymatgen.analysis.phase_diagram import * +from pymatgen.entries.computed_entries import ComputedEntry + +@calcfunction +def get_matrix_of_constraints(N_species, compound, dependent_element, column_order, formation_energy_dict): + N_species = N_species.value + compound = compound.value + dependent_element = dependent_element.value + column_order = column_order.get_dict() + formation_energy_dict = formation_energy_dict.get_dict() + + compound_of_interest = Composition(compound) + + # Construct the 1st equation corresponding to the compound of interest + eqns = np.zeros(N_species+1) + for ele in compound_of_interest: + eqns[column_order[ele.symbol]] = -1.0*compound_of_interest[ele] + eqns[N_species] = -1.0*formation_energy_dict[compound] + #self.ctx.first_eqn = eqns + + # Now loop through all the competing phases + for key in formation_energy_dict: + # if key != compound: + if not same_composition(key, compound): + tmp = np.zeros(N_species+1) + temp_composition = Composition(key) + for ele in temp_composition: + tmp[column_order[ele.symbol]] = temp_composition[ele] + tmp[N_species] = formation_energy_dict[key] + eqns = np.vstack((eqns, tmp)) + #print(eqns) + + # Add constraints corresponding to the stability with respect to decomposition into + # elements and combine it with the constraint on the stability of compound of interest + for ele in compound_of_interest: + if ele.symbol != dependent_element: + tmp = np.zeros(N_species+1) + tmp[column_order[ele.symbol]] = 1.0 + eqns = np.vstack((eqns, tmp)) + tmp = np.zeros(N_species+1) + tmp[column_order[ele.symbol]] = -1.0 + tmp[N_species] = -1.*formation_energy_dict[compound]/compound_of_interest[ele] + eqns = np.vstack((eqns, tmp)) + #print(eqns) + + # Eliminate the dependent element (variable) from the equations + mask = eqns[1:, N_species-1] != 0.0 + eqns_0 = eqns[1:,:][mask] + common_factor = compound_of_interest[dependent_element]/eqns_0[:, N_species-1] + eqns_0 = eqns_0*np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting + eqns_0 = (eqns_0+eqns[0,:])/np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting + eqns[1:,:][mask] = eqns_0 + #print(eqns) + + # Removing column corresponding to the dependent element from the set of equations correponding to the constraints + # that delineate the stability region + matrix = np.delete(eqns, N_species-1, axis=1) + matrix_data = ArrayData() + matrix_data.set_array('data', matrix) + return matrix_data + +@calcfunction +def get_stability_corners(matrix_eqns, N_species, compound, tolerance): + matrix_eqns = matrix_eqns.get_array('data') + N_species = N_species.value + tolerance = tolerance.value + compound = compound.value + + ### Look at all combination of lines and find their intersections + comb = combinations(np.arange(np.shape(matrix_eqns)[0]), N_species-1) + intersecting_points = [] + for item in list(comb): + try: + point = np.linalg.solve(matrix_eqns[item,:-1], matrix_eqns[item,-1]) + intersecting_points.append(point) + except np.linalg.LinAlgError: + ### Singular matrix: lines are parallels therefore don't have any intersection + pass + + ### Determine the points that form the 'corners' of stability region. These are intersecting point that verify all the constraints. + intersecting_points = np.array(intersecting_points) + get_constraint = np.dot(intersecting_points, matrix_eqns[:,:-1].T) + check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= tolerance + bool_mask = [not(False in x) for x in check_constraint] + corners_of_stability_region = intersecting_points[bool_mask] + ### In some cases, we may have several solutions corresponding to the same points. Hence, the remove_duplicate method + corners_of_stability_region = remove_duplicate(corners_of_stability_region) + + if corners_of_stability_region.size == 0: + self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(compound)) + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED + + ordered_stability_corner = ArrayData() + ordered_stability_corner.set_array('data', Order_point_clockwise(corners_of_stability_region)) + #ordered_stability_corners = Order_point_clockwise(stability_data) + #self.ctx.stability_corners = ordered_stability_corners + + #self.report('The stability corner is : {}'.format(ordered_stability_corners.get_array('data'))) + return ordered_stability_corner + +@calcfunction +def get_center_of_stability(compound, dependent_element, stability_corners, N_species, matrix_eqns): + ''' + Use to determine centroid (as oppose to center). The center is defined as the average coordinates of the corners + while a centroid is the average cooridinates of every point inside the polygone or polyhedron. + For binary compounds, the stability region is a one-dimensional segment. The centroid coincides with the center. + For ternary and quarternary compounds, the centroid is returned. + For quinternary compound and hight, the center is returned. + ''' + compound = compound.value + dependent_element = dependent_element.value + N_species = N_species.value + stability_corners = stability_corners.get_array('data') + matrix_eqns = matrix_eqns.get_array('data') + + if N_species == 2: + ctr_stability = np.mean(stability_corners, axis=0) #without the dependent element + else: + grid = get_grid(stability_corners, matrix_eqns) + ctr_stability = get_centroid(grid) #without the dependent element + + ### Add the corresponding chemical potential of the dependent element + composition = Composition(compound) + first_eqn = matrix_eqns[0] + with_dependent = -1.0*(first_eqn[-1]-np.sum(ctr_stability*first_eqn[:-1]))/composition[dependent_element] + centroid_of_stability = np.append(ctr_stability, with_dependent) +# self.report('Centroid of the stability region is {}'.format(centroid_of_stability)) + + ctrd = ArrayData() + ctrd.set_array('data', centroid_of_stability) + return ctrd + + +def get_e_above_hull(compound, element_list, formation_energy_dict): + ''' + Get the energy above the convex hull. When the compound is unstable, e_hull > 0. + ''' + composition = Composition(compound) + mp_entries = [] + + idx = 0 + for i, (material, Ef) in enumerate(formation_energy_dict.items()): + if material == compound: + idx = i + mp_entries.append(ComputedEntry(Composition(material), Ef)) + for ref in element_list: + mp_entries.append(ComputedEntry(Composition(ref.symbol), 0.0)) + #mp_entries.append(ComputedEntry(composition, E_formation)) + + pd = PhaseDiagram(mp_entries) + ehull = pd.get_e_above_hull(mp_entries[idx]) + + return ehull def same_composition(compound_1, compound_2): composition_1 = Composition(compound_1) @@ -42,17 +194,7 @@ def remove_duplicate(array): non_duplicate_array.append(point) return np.array(non_duplicate_array) -def Order_point_clockwise(points): - center = np.mean(points, axis=0) - # compute angle - t = np.arctan2(points[:,0]-center[0], points[:,1]-center[1]) - sort_t = np.sort(t) - t = list(t) - u = [t.index(element) for element in sort_t] - ordered_points = points[u] - return ordered_points - -def get_grid(stability_corners, matrix_eqns, N_point=100, tolerance=1E-4): +def get_grid(stability_corners, matrix_eqns, N_point=50, tolerance=1E-4): xmin = np.amin(stability_corners[:,0]) xmax = np.amax(stability_corners[:,0]) ymin = np.amin(stability_corners[:,1]) @@ -85,21 +227,29 @@ def get_grid(stability_corners, matrix_eqns, N_point=100, tolerance=1E-4): def get_centroid(stability_region): return np.mean(stability_region, axis=0) -def PolygoneArea(stability_corners): - # stability corners must be ordered clockwise or anticlockwise - x = stability_corners[:,0] - y = stability_corners[:,1] - return 0.5*np.abs(np.dot(x,np.roll(y,1))-np.dot(y,np.roll(x,1))) - -@calcfunction -def return_matrix_of_constraint(matrix_data): - matrix = matrix_data.get_array('data') - x = matrix + np.zeros_like(matrix) - mat = ArrayData() - mat.set_array('data', x) - #matrix_data.set_array('data', eqn) - return mat +def Order_point_clockwise(points): +# points = points.get_array('data') + if len(points[0]) == 1: + points_order = points + else: + center = np.mean(points, axis=0) + # compute angle + t = np.arctan2(points[:,0]-center[0], points[:,1]-center[1]) + sort_t = np.sort(t) + t = list(t) + u = [t.index(element) for element in sort_t] + points_order = points[u] +# ordered_points = ArrayData() +# ordered_points.set_array('data', points_order) +# return ordered_points + return points_order @calcfunction -def get_chemical_potential(ref_energy, chem_pot): - return Float(ref_energy.value + chem_pot.value) +def get_chemical_potential(centroid, ref_energy, column_order): + centroid = centroid.get_array('data') + ref_energy = ref_energy.get_dict() + column_order = column_order.get_dict() + chem_pot = {} + for element in column_order.keys(): + chem_pot[element] = ref_energy[element]+centroid[column_order[element]] + return Dict(dict=chem_pot) From 7d5b46ca919a22aa0d923f5d7c67348e9db50f0a Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Fri, 25 Dec 2020 20:07:03 +0100 Subject: [PATCH 28/60] return to fixed gaussian width --- .../formation_energy/formation_energy_base.py | 4 ++-- .../formation_energy/formation_energy_qe.py | 16 ++++++++-------- aiida_defects/formation_energy/utils.py | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 4619323..71b4d07 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -193,9 +193,9 @@ def run_gaussian_correction_workchain(self): "v_host": self.ctx.v_host, "v_defect_q0": self.ctx.v_defect_q0, "v_defect_q": self.ctx.v_defect_q, - "rho_host": self.ctx.rho_host, + #"rho_host": self.ctx.rho_host, #"rho_host": self.ctx.rho_defect_q0, - "rho_defect_q": self.ctx.rho_defect_q, + #"rho_defect_q": self.ctx.rho_defect_q, "defect_charge": self.inputs.defect_charge, "defect_site": self.inputs.defect_site, "host_structure": self.inputs.host_structure, diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 541ca30..7342821 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -50,9 +50,9 @@ def define(cls, spec): spec.input('run_v_host', valid_type=orm.Bool, required=True) spec.input('run_v_defect_q0', valid_type=orm.Bool, required=True) spec.input('run_v_defect_q', valid_type=orm.Bool, required=True) - spec.input('run_rho_host', valid_type=orm.Bool, required=True) - spec.input('run_rho_defect_q0', valid_type=orm.Bool, required=True) - spec.input('run_rho_defect_q', valid_type=orm.Bool, required=True) +# spec.input('run_rho_host', valid_type=orm.Bool, required=True) +# spec.input('run_rho_defect_q0', valid_type=orm.Bool, required=True) +# spec.input('run_rho_defect_q', valid_type=orm.Bool, required=True) spec.input('run_dfpt', valid_type=orm.Bool, required=True) spec.input('host_node', valid_type=orm.Int, required=False) @@ -61,9 +61,9 @@ def define(cls, spec): spec.input('v_host_node', valid_type=orm.Int, required=False) spec.input('v_defect_q0_node', valid_type=orm.Int, required=False) spec.input('v_defect_q_node', valid_type=orm.Int, required=False) - spec.input('rho_host_node', valid_type=orm.Int, required=False) - spec.input('rho_defect_q0_node', valid_type=orm.Int, required=False) - spec.input('rho_defect_q_node', valid_type=orm.Int, required=False) +# spec.input('rho_host_node', valid_type=orm.Int, required=False) +# spec.input('rho_defect_q0_node', valid_type=orm.Int, required=False) +# spec.input('rho_defect_q_node', valid_type=orm.Int, required=False) spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) # DFT inputs (PW.x) @@ -130,8 +130,8 @@ def define(cls, spec): cls.get_dft_potentials_gaussian_correction, cls.check_dft_potentials_gaussian_correction, #cls.get_kohn_sham_potentials, - cls.get_charge_density, - cls.check_charge_density_calculations, + #cls.get_charge_density, + #cls.check_charge_density_calculations, if_(cls.if_run_dfpt)( cls.prep_hostcell_calc_for_dfpt, cls.check_hostcell_calc_for_dfpt, diff --git a/aiida_defects/formation_energy/utils.py b/aiida_defects/formation_energy/utils.py index 2e8516d..3960d84 100644 --- a/aiida_defects/formation_energy/utils.py +++ b/aiida_defects/formation_energy/utils.py @@ -11,7 +11,7 @@ import numpy as np def get_vbm(calc_node): - N_electron = calc_node.res.number_of_electrons + N_electron = calc_node.outputs.output_parameters.get_dict()['number_of_electrons'] vb_index = int(N_electron/2)-1 vbm = np.amax(calc_node.outputs.output_band.get_array('bands')[:,vb_index]) From fad78cea1392781854ca829b54c5293ad661d0b4 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Sun, 10 Jan 2021 18:42:38 +0100 Subject: [PATCH 29/60] Adding the FermiLevelWorkchain to compute the (self-consistent) Fermi level. --- .../formation_energy/fermi_level/__init__.py | 7 + .../fermi_level/fermi_level.py | 105 ++++++++++ .../formation_energy/fermi_level/utils.py | 189 ++++++++++++++++++ 3 files changed, 301 insertions(+) create mode 100644 aiida_defects/formation_energy/fermi_level/__init__.py create mode 100644 aiida_defects/formation_energy/fermi_level/fermi_level.py create mode 100644 aiida_defects/formation_energy/fermi_level/utils.py diff --git a/aiida_defects/formation_energy/fermi_level/__init__.py b/aiida_defects/formation_energy/fermi_level/__init__.py new file mode 100644 index 0000000..4d27567 --- /dev/null +++ b/aiida_defects/formation_energy/fermi_level/__init__.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## diff --git a/aiida_defects/formation_energy/fermi_level/fermi_level.py b/aiida_defects/formation_energy/fermi_level/fermi_level.py new file mode 100644 index 0000000..2c26ea5 --- /dev/null +++ b/aiida_defects/formation_energy/fermi_level/fermi_level.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData, XyData, StructureData +from aiida.engine import WorkChain, calcfunction, ToContext, while_ +import sys +import numpy as np +from scipy.optimize.nonlin import NoConvergence +from pymatgen.core.composition import Composition + +from .utils import * + +class FermiLevelWorkchain(WorkChain): + ''' + Compute the self-consistent Fermi level by imposing the overall charge neutrality + Here we implement method similar to Buckeridge et al., (doi:10.1016/j.cpc.2019.06.017) + ''' + @classmethod + def define(cls, spec): + super(FermiLevelWorkchain, cls).define(spec) + spec.input("defect_data", valid_type=Dict) + spec.input("chem_potentials", valid_type=Dict) + spec.input("temperature", valid_type=Float) + spec.input("valence_band_maximum", valid_type=Float) + spec.input("number_of_electrons", valid_type=Float, help="number of electrons in the unitcell used to compute the DOS") + spec.input("unitcell", valid_type=StructureData) + spec.input("DOS", valid_type=XyData) + spec.input("band_gap", valid_type=Float) + spec.input("dopant", valid_type=Dict, default=lambda: Dict(dict=None), + help="aliovalent dopants specified by its charge and concentration. Used to compute the change in the defect concentrations with frozen defect approach") + spec.input("tolerance_factor", valid_type=Float, default=lambda: Float(1e-10), + help="tolerance factor use in the non-linear solver to solve for the self-consistent fermi level") + + spec.outline( + cls.setup, + cls.compute_sc_fermi_level, + ) + spec.output('fermi_level', valid_type=ArrayData) # we use ArrayData instead of Float in other to be general and be able to accomodate the situtation where the chemical potential is a numpy array allowing to vectorize the calculations of defect concentrations in stability region instead of doing one value of chemical potential at a time. + + spec.exit_code(701, "ERROR_FERMI_LEVEL_FAILED", + message="The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input" + ) + spec.exit_code(702, "ERROR_NON_LINEAR_SOLVER_FAILED", + message="The non-linear solver used to solve for the self-consistent Fermi level failed. The tolerance factor might be too small" + ) + + def setup(self): + """ + Setup the calculation + """ + chempot_dict = self.inputs.chem_potentials.get_dict() + for key in chempot_dict: + data_array = np.ones_like(chempot_dict[key]) + v_data = ArrayData() + v_data.set_array('data', data_array) + self.ctx.input_chem_shape = v_data + + # extracting the DOS of the unitcell, assuming that the calculation is non-spin polarized. + dos_x = self.inputs.DOS.get_x()[1] - self.inputs.valence_band_maximum.value + v_data = ArrayData() + v_data.set_array('data', dos_x) + self.ctx.dos_x = v_data + + dos_y = self.inputs.DOS.get_y()[1][1] + v_data = ArrayData() + v_data.set_array('data', dos_y) + self.ctx.dos_y = v_data + + mask = (dos_x <= 0.05) + N_electron = np.trapz(dos_y[mask], dos_x[mask]) + if np.absolute(N_electron-self.inputs.number_of_electrons.value) > 5e-3: + self.report('The number of electrons obtained from the integration of DOS is: {}'.format(N_electron)) + self.report('The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input') + return self.exit_codes.ERROR_FERMI_LEVEL_FAILED + + #is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(unitcell_node.outputs.output_band) + #if not is_insulator: + #self.report('WARNING!') + #self.report('The compound is metallic!') + + def compute_sc_fermi_level(self): + try: + E_Fermi = solve_for_sc_fermi(self.inputs.defect_data, + self.inputs.chem_potentials, + self.ctx.input_chem_shape, + self.inputs.temperature, + self.inputs.unitcell, + self.inputs.band_gap, + self.ctx.dos_x, + self.ctx.dos_y, + self.inputs.dopant, + self.inputs.tolerance_factor) + + self.ctx.sc_fermi_level = E_Fermi + self.out('fermi_level', E_Fermi) + self.report('The self-consistent Fermi level is: {} eV'.format(E_Fermi.get_array('data'))) + except NoConvergence: + self.report("The non-linear solver used to solve for the self-consistent Fermi level failed. The tolerance factor might be too small") + return self.exit_codes.ERROR_NON_LINEAR_SOLVER_FAILED diff --git a/aiida_defects/formation_energy/fermi_level/utils.py b/aiida_defects/formation_energy/fermi_level/utils.py new file mode 100644 index 0000000..f5043d3 --- /dev/null +++ b/aiida_defects/formation_energy/fermi_level/utils.py @@ -0,0 +1,189 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida.engine import calcfunction +import numpy as np +from pymatgen.core.composition import Composition +from aiida.orm import ArrayData, Float +from pymatgen import Element +from scipy.optimize import broyden1 +from scipy.optimize.nonlin import NoConvergence + +def _get_first_element(x): + ''' + This is needed in the electron_concentration and hole_concentration methods because we want to accept + the chemical potential (and fermi level) of any shape as input to vectorize the numpy operations but + the two methods accept only a scalar. + ''' + if x.ndim == 0: + return x + elif x.ndim == 1: + return x[0] + else: + return x[0,0] + +def compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant): + ''' + This is a nested function that return a function (with E_Fermi as variable) to be use in the + non-linear solver to obtain the self-consistent Fermi level. + + arguments: + defect_data : dictionary containing information required to compute the formation energy of each defect + chem_potentials : dictionary containing the chemical potential of all elements constituting the compound. Can be a float or numpy array + input_chem_shape : the shape of values of chem_potentials. this is needed because we want the code to work both for float or numpy array + for ex. when computing the concentration of a particular defect in the stability region. We can of course do that one + value at a time but it is much slower than vectorization using numpy + dopant : aliovalent dopants specified by its charge and concentration with the format {'X_1': {'c':, 'q':}, 'X_2': {'c':, 'q':}, ...}. + Used to compute the change in the defect concentrations with 'frozen defect' approach + uniticell : is the structure used to compute the Dos, NOT the host supercell used to compute the formation energy + ''' + + dE = dos_x[1] - dos_x[0] + k_B = 8.617333262145E-05 + convert = 1E24 + + def defect_formation_energy(E_Fermi): + ''' + Compute the defect formation energy of all defects given in the input file as a function of the fermi level + E_Fermi. + ''' + E_defect_formation = {} + for defect in defect_data.keys(): + temp = defect_data[defect] + Ef = {} + for chg in temp['charges'].keys(): + E_formation = temp['charges'][chg]['E']-temp['E_host']+float(chg)*(E_Fermi+temp['vbm'])+temp['charges'][chg]['E_corr'] + for spc in temp['species'].keys(): + E_formation -= temp['species'][spc]*input_chem_shape*chem_potentials[spc] + Ef[chg] = E_formation + E_defect_formation[defect] = Ef + print(E_defect_formation) + return E_defect_formation + + def electron_concentration(E_Fermi): + ''' + Compute electron concentration + ''' + upper_dos = dos_y[dos_x>=band_gap] + E_upper = dos_x[dos_x>=band_gap] + + ndim = E_Fermi.ndim + E_Fermi = np.expand_dims(E_Fermi, axis=ndim) # To broadcast with E_upper + mask_n = ((E_upper-E_Fermi)/(k_B*temperature) < 700.0) # To avoid overflow in the exp + for i in range(ndim): + upper_dos = np.repeat(np.expand_dims(upper_dos, axis=0), E_Fermi.shape[ndim-i-1], axis=0) + upper_dos[~mask_n] = 0 + temp = E_upper-E_Fermi + temp[~mask_n] = 0 + temp_n = upper_dos/(np.exp(temp/(k_B*temperature))+1.0) + + return convert*np.sum(temp_n, axis=ndim)*dE/unitcell.volume + + def hole_concentration(E_Fermi): + ''' + Compute hole concentration + ''' + lower_dos = dos_y[dos_x<=0.0] + E_lower = dos_x[dos_x<=0.0] + + ndim = E_Fermi.ndim + E_Fermi = np.expand_dims(E_Fermi, axis=ndim) # To broadcast with E_lower + mask_p = ((E_Fermi-E_lower)/(k_B*temperature) < 700.0) # To avoid overflow in the exp + for i in range(ndim): + lower_dos = np.repeat(np.expand_dims(lower_dos, axis=0), E_Fermi.shape[ndim-i-1], axis=0) + lower_dos[~mask_p] = 0 + temp = E_Fermi-E_lower + temp[~mask_p] = 0 + temp_p = lower_dos/(np.exp(temp/(k_B*temperature))+1.0) + + return convert*np.sum(temp_p, axis=ndim)*dE/unitcell.volume + +# def electron_concentration(E_Fermi): +# ''' +# compute the concentration of electrons +# ''' +# +# E_Fermi = _get_first_element(E_Fermi) +# upper_dos = dos_y[dos_x>=band_gap] +# E_upper = dos_x[dos_x>=band_gap] +# # plt.plot(E_upper, upper_dos) +# mask_n = ((E_upper-E_Fermi)/(k_B*temperature) < 700.0) # To avoid overflow in the exp +# temp_n = upper_dos[mask_n]/(np.exp((E_upper[mask_n]-E_Fermi)/(k_B*temperature))+1.0) +# return input_chem_shape*convert*np.sum(temp_n)*dE/unitcell.volume + +# def hole_concentration(E_Fermi): +# ''' +# compute the concentration of holes +# ''' +# +# E_Fermi = _get_first_element(E_Fermi) +# lower_dos = dos_y[dos_x<=0.0] +# E_lower = dos_x[dos_x<=0.0] +# # plt.plot(E_lower, lower_dos) +# mask_p = ((E_Fermi-E_lower)/(k_B*temperature) < 700.0) # To avoid overflow in the exp +# temp_p = lower_dos[mask_p]/(np.exp((E_Fermi-E_lower[mask_p])/(k_B*temperature))+1.0) +# return input_chem_shape*convert*np.sum(temp_p)*dE/unitcell.volume + + def c_defect(N_site, Ef): + ''' + compute the concentration of defects having formation energy Ef and can exist in N_sites in the unitcell + ''' + return convert*N_site*np.exp(-1.0*Ef/(k_B*temperature))/unitcell.volume + + def Net_charge(E_Fermi): + ''' + compute the total charge of the system. The self-consistent Fermi level is the one for with this net (or total) charge is zero. + ''' + n = electron_concentration(E_Fermi) + p = hole_concentration(E_Fermi) + E_defect_formation = defect_formation_energy(E_Fermi) + # print(n, p) + # positive_charge = np.zeros(4) + # negative_charge = np.zeros(4) + positive_charge = 0.0 + negative_charge = 0.0 + for key in E_defect_formation.keys(): + for chg in E_defect_formation[key]: + # print(chg) + if float(chg) > 0: + positive_charge += float(chg)*c_defect(defect_data[key]['N_site'], E_defect_formation[key][chg]) + else: + negative_charge += float(chg)*c_defect(defect_data[key]['N_site'], E_defect_formation[key][chg]) + if dopant != None: + for key in dopant.keys(): + if dopant[key]['q'] > 0: + positive_charge += dopant[key]['q']*dopant[key]['c'] + else: + negative_charge += dopant[key]['q']*dopant[key]['c'] + return np.log(p + positive_charge) - np.log(n + abs(negative_charge)) + + return Net_charge + +@calcfunction +def solve_for_sc_fermi(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant, f_tol): + ''' + solve the non-linear equation with E_fermi as variable to obtain the self-consistent Fermi level. The non-linear solver broyden1 in + scipy is used. + ''' + + defect_data = defect_data.get_dict() + chem_potentials = chem_potentials.get_dict() + input_chem_shape = input_chem_shape.get_array('data') + temperature = temperature.value + unitcell = unitcell.get_pymatgen_structure() + dos_x = dos_x.get_array('data') + dos_y = dos_y.get_array('data') + band_gap = band_gap.value + tolerance = f_tol.value + + net_charge = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant) + sc_fermi = broyden1(net_charge, input_chem_shape*band_gap/2, f_tol=tolerance) + v_data = ArrayData() + v_data.set_array('data', sc_fermi) + return v_data From 7170594d9fa27bd11206aadc0bed58d92d465338 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Wed, 13 Jan 2021 09:38:10 +0000 Subject: [PATCH 30/60] Fix imports from qe_tools We rely on qe_tools for unit conversion constants in order to be consistent with AiiDA-QE. However the import signature changed in qe_tools at some point, breaking our imports. Fix these and also remove legacy unused imports. --- .../gaussian_countercharge/gaussian_countercharge.py | 1 - .../model_potential/model_potential.py | 4 ++-- .../gaussian_countercharge/model_potential/utils.py | 8 +++----- .../corrections/gaussian_countercharge/utils.py | 2 -- .../potential_alignment/potential_alignment.py | 4 ++-- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 55d260c..290170c 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -9,7 +9,6 @@ from aiida.engine import WorkChain, calcfunction, ToContext, while_ from aiida import orm -from qe_tools.constants import hartree_to_ev from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain from .model_potential.model_potential import ModelPotentialWorkchain diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index 8d9d64a..fdfa40a 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -11,7 +11,7 @@ from aiida import orm from aiida.engine import WorkChain, calcfunction, while_ -from qe_tools.constants import bohr_to_ang +from qe_tools import CONSTANTS from .utils import (create_model_structure, get_cell_matrix, get_reciprocal_cell, get_reciprocal_grid, get_charge_model, @@ -88,7 +88,7 @@ def get_model_structure(self): self.ctx.real_cell = get_cell_matrix(self.ctx.model_structure) self.ctx.reciprocal_cell = get_reciprocal_cell(self.ctx.real_cell) self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) - limits = np.array(self.ctx.model_structure.cell_lengths) / bohr_to_ang + limits = np.array(self.ctx.model_structure.cell_lengths) / CONSTANTS.bohr_to_ang self.ctx.limits = orm.List(list=limits.tolist()) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py index fa23cd6..f790a09 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py @@ -11,11 +11,9 @@ from scipy.optimize import curve_fit from scipy.stats import multivariate_normal - from aiida import orm from aiida.engine import calcfunction -from qe_tools.constants import hartree_to_ev, bohr_to_ang - +from qe_tools import CONSTANTS @calcfunction @@ -45,7 +43,7 @@ def get_cell_matrix(structure): 3x3 cell matrix array in units of Bohr """ - cell_matrix = np.array(structure.cell) / bohr_to_ang # Angstrom to Bohr + cell_matrix = np.array(structure.cell) / CONSTANTS.bohr_to_ang # Angstrom to Bohr return cell_matrix @@ -480,6 +478,6 @@ def get_energy(potential, charge_density, cell_matrix): potential = potential.get_array('model_potential') charge_density = charge_density.get_array('model_charge') - energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix) * hartree_to_ev) + energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix) * CONSTANTS.hartree_to_ev) return orm.Float(energy) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index 33a3cc1..2157790 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -11,8 +11,6 @@ from aiida import orm from aiida.engine import calcfunction -from qe_tools.constants import bohr_to_ang - """ Utility functions for the gaussian countercharge workchain """ diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 2957ea2..797339a 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -12,7 +12,7 @@ from aiida import orm from aiida.common import AttributeDict from aiida.engine import WorkChain, calcfunction, if_ -from qe_tools.constants import hartree_to_ev +from qe_tools import CONSTANTS from .utils import get_interpolation from .lany_zunger.lany_zunger import LanyZungerAlignmentWorkchain @@ -220,5 +220,5 @@ def results(self): """ self.report( "Completed alignment. An alignment of {} eV is required".format( - self.ctx.alignment.value * hartree_to_ev/2.0 )) + self.ctx.alignment.value * CONSTANTS.hartree_to_ev/2.0 )) self.out('alignment_required', self.ctx.alignment) From a90909172d4ebb4aff8928c6ff1e7b584b43b423 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 18 Jan 2021 15:59:25 +0100 Subject: [PATCH 31/60] correct for the conversion factor --- .../potential_alignment.py | 5 +- aiida_defects/formation_energy/utils.py | 151 +++++++++++++++++- 2 files changed, 149 insertions(+), 7 deletions(-) diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 2957ea2..2a2d8cf 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -12,7 +12,8 @@ from aiida import orm from aiida.common import AttributeDict from aiida.engine import WorkChain, calcfunction, if_ -from qe_tools.constants import hartree_to_ev +#from qe_tools.constants import hartree_to_ev +from qe_tools._constants import DEFAULT from .utils import get_interpolation from .lany_zunger.lany_zunger import LanyZungerAlignmentWorkchain @@ -220,5 +221,5 @@ def results(self): """ self.report( "Completed alignment. An alignment of {} eV is required".format( - self.ctx.alignment.value * hartree_to_ev/2.0 )) + self.ctx.alignment.value * DEFAULT.hartree_to_ev/2.0 )) self.out('alignment_required', self.ctx.alignment) diff --git a/aiida_defects/formation_energy/utils.py b/aiida_defects/formation_energy/utils.py index 3960d84..b9d82ee 100644 --- a/aiida_defects/formation_energy/utils.py +++ b/aiida_defects/formation_energy/utils.py @@ -7,16 +7,154 @@ ######################################################################################## from __future__ import absolute_import +from aiida import orm from aiida.engine import calcfunction import numpy as np +import pymatgen +from pymatgen.core.composition import Composition +from pymatgen.core.sites import PeriodicSite +from pymatgen.core.periodic_table import Element +from pymatgen.core.structure import Structure +def generate_defect_structure(host, site_coord, species): + ''' + To create defective structure at the site_coord in the host structure. species specify the type of defect to be created. + ''' + structure = host.get_pymatgen_structure() + defect_structure = structure.copy() + for atom, sign in species.items(): + if sign == 1: + defect_structure.append(atom, site_coord) + else: + site_index = find_index_of_site(structure, site_coord) + if site_index == None: + print('WARNING! the index of the defect site cannot be found') + defect_structure.remove_sites([site_index]) +# defect_structure.to(filename='tempo.cif') +# defect_structure = Structure.from_file('tempo.cif') + return orm.StructureData(pymatgen=defect_structure) + +def find_index_of_site(structure, site_coord): + #structure = host.get_pymatgen_structure() + lattice = structure.lattice + defect_site = PeriodicSite(Element('Li'), site_coord, lattice) # Li is just a dummy element. Any other element also works + for i, site in enumerate(structure): + if defect_site.distance(site) < 5E-4: + return i + def get_vbm(calc_node): + #N_electron = calc_node.res.number_of_electrons N_electron = calc_node.outputs.output_parameters.get_dict()['number_of_electrons'] vb_index = int(N_electron/2)-1 vbm = np.amax(calc_node.outputs.output_band.get_array('bands')[:,vb_index]) return vbm +def is_intrinsic_defect(species, compound): + """ + Check if a defect is an intrisic or extrinsic defect + """ + composition = Composition(compound) + element_list = [atom.symbol for atom in composition] + + for atom in species.keys(): + if atom not in element_list: + return False + return True + +def get_dopant(species, compound): + """ + Get the dopant + """ + composition = Composition(compound) + element_list = [atom.symbol for atom in composition] + for atom in species.keys(): + if atom not in element_list: + return atom + return 'intrinsic' + +def get_defect_and_charge_from_label(calc_label): + spl = calc_label.split('[') + defect = spl[0] + chg = float(spl[1].split(']')[0]) + return defect, chg + +def defect_formation_energy(defect_data, E_Fermi, chem_potentials, pot_alignments): + ''' + Computing the defec tformation energy with and without electrostatic and potential alignment corrections + Note: 'E_corr' in the defect_data contains the total correction, i.e electrostatic and potential alignment + ''' + # defect_data = defect_data.get_dict() + # E_Fermi = E_Fermi.get_array('data') + # chem_potentials = chem_potentials.get_dict() + # pot_alignments = pot_alignments.get_dict() + + E_defect_formation = {'uncorrected':{}, 'electrostatic': {}, 'electrostatic and alignment': {}} + for defect, properties in defect_data.items(): + E_defect_formation['uncorrected'][defect] = {} + E_defect_formation['electrostatic'][defect] = {} + E_defect_formation['electrostatic and alignment'][defect] = {} + + for chg in properties['charges'].keys(): + Ef_raw = properties['charges'][chg]['E']-properties['E_host']+float(chg)*(E_Fermi+properties['vbm']) + # for spc in properties['species'].keys(): + # Ef_raw -= properties['species'][spc]*chem_potentials[spc] + for spc, sign in properties['species'].items(): + Ef_raw -= sign*chem_potentials[spc] + Ef_corrected = Ef_raw + properties['charges'][chg]['E_corr'] + + E_defect_formation['uncorrected'][defect][str(chg)] = Ef_raw + E_defect_formation['electrostatic'][defect][str(chg)] = Ef_corrected - pot_alignments[defect][str(chg)] + E_defect_formation['electrostatic and alignment'][defect][str(chg)] = Ef_corrected + + # return orm.Dict(dict=E_defect_formation) + return E_defect_formation + +@calcfunction +def get_defect_formation_energy(defect_data, E_Fermi, pot_alignments, chem_potentials, compound): + + defect_data = defect_data.get_dict() + #formation_energy_dict = formation_energy_dict.get_dict() + E_Fermi = E_Fermi.get_dict() + chem_potentials = chem_potentials.get_dict() + pot_alignments = pot_alignments.get_dict() + compound = compound.value + + intrinsic_defects = {} + for defect, properties in defect_data.items(): + if is_intrinsic_defect(properties['species'], compound): + intrinsic_defects[defect] = properties + + defect_Ef = {} + for dopant, e_fermi in E_Fermi.items(): + defect_temp = intrinsic_defects.copy() + if dopant != 'intrinsic': + for defect, properties in defect_data.items(): + if dopant in properties['species'].keys(): + defect_temp[defect] = properties + + defect_Ef[dopant] = defect_formation_energy( + defect_temp, + e_fermi, + chem_potentials[dopant], + pot_alignments + ) + + return orm.Dict(dict=defect_Ef) + +@calcfunction +def store_dict(data_dict): + new_dict = {} + for k, v in data_dict.get_dict().items(): + new_dict[k] = v + return orm.Dict(dict=new_dict) + +@calcfunction +def store_dos(DOS): + dos_x = DOS.get_x()[1] + dos_y = DOS.get_y()[1][1] + return DOS + def run_pw_calculation(pw_inputs, structure, charge): """ Run a QuantumESPRESSO PW.x calculation by invoking the appropriate workchain. @@ -52,15 +190,18 @@ def run_pw_calculation(pw_inputs, structure, charge): @calcfunction -def get_raw_formation_energy(defect_energy, host_energy, add_or_remove, chemical_potential, +def get_raw_formation_energy(defect_energy, host_energy, chempot_sign, chemical_potential, charge, fermi_energy, valence_band_maximum): """ Compute the formation energy without correction """ - sign_of_mu = {'add': +1.0, 'remove': -1.0} - e_f_uncorrected = defect_energy - host_energy - sign_of_mu[add_or_remove.value]*chemical_potential + ( - charge * (valence_band_maximum + fermi_energy)) - return e_f_uncorrected + chempot_sign = chempot_sign.get_dict() + chemical_potential = chemical_potential.get_dict() + + e_f_uncorrected = defect_energy.value - host_energy.value + charge.value*(valence_band_maximum.value + fermi_energy.value) + for specie, sign in chempot_sign.items(): + e_f_uncorrected -= sign*chemical_potential[specie] + return orm.Float(e_f_uncorrected) @calcfunction From 07c83620309e37a7e661910d4d5edc196eff5cfd Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Wed, 13 Jan 2021 11:27:39 +0000 Subject: [PATCH 32/60] Reintroduce option to specify gaussian to use for model charge distribution The GaussianCountercharge workchain had been limited to only using a fitted gaussian charge distribution. In some cases, this fitting fails and the workchain cannot continue. It's desirable to be able to specify a fixed width gaussian for stability. As the workchain already can generate a model gaussian of any shape via 9 parameters (which are found by fitting), now the user can specify these directly. --- .../gaussian_countercharge.py | 72 +++++++++++++++++-- .../formation_energy/formation_energy_base.py | 62 ++++++++-------- .../test_gaussian_countercharge.py | 6 +- 3 files changed, 103 insertions(+), 37 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 290170c..396cb88 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -7,7 +7,7 @@ ######################################################################################## from __future__ import absolute_import -from aiida.engine import WorkChain, calcfunction, ToContext, while_ +from aiida.engine import WorkChain, calcfunction, ToContext, while_, if_ from aiida import orm from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain @@ -28,6 +28,8 @@ class GaussianCounterChargeWorkchain(WorkChain): def define(cls, spec): super(GaussianCounterChargeWorkchain, cls).define(spec) + + spec.input("host_structure", valid_type=orm.StructureData, help="The structure of the host system.") @@ -63,18 +65,39 @@ def define(cls, spec): spec.input("rho_defect_q", valid_type=orm.ArrayData, help="The charge density of the defect system in the target charge state.") - spec.input("charge_fit_tolerance", + + # Charge Model Settings + spec.input_namespace('charge_model', + help="Namespace for settings related to different charge models") + spec.input("charge_model.model_type", + valid_type=orm.Str, + help="Charge model type: 'fixed' or 'fitted'", + default=lambda: orm.Str('fitted')) + # Fixed + spec.input_namespace('charge_model.fixed', required=False, + help="Inputs for a fixed charge model using a user-specified multivariate gaussian") + spec.input("charge_model.fixed.gaussian_params", + valid_type=orm.List, + help="A length 9 list of parameters needed to construct the " + "gaussian charge distribution. The format required is " + "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + # Fitted + spec.input_namespace('charge_model.fitted', required=False, + help="Inputs for a fitted charge model using a multivariate anisotropic gaussian.") + spec.input("charge_model.fitted.tolerance", valid_type=orm.Float, help="Permissable error for any fitted charge model parameter.", default=lambda: orm.Float(1.0e-3)) - spec.input("strict_fit", + spec.input("charge_model.fitted.strict_fit", valid_type=orm.Bool, help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", default=lambda: orm.Bool(True)) spec.outline( cls.setup, - cls.fit_charge_model, + if_(cls.should_fit_charge)( + cls.fit_charge_model, + ), while_(cls.should_run_model)( cls.compute_model_potential, ), @@ -101,6 +124,12 @@ def define(cls, spec): spec.exit_code(202, 'ERROR_BAD_INPUT_ITERATIONS_REQUIRED', message='The required number of iterations must be at least 3') + spec.exit_code(203, + 'ERROR_INVALID_CHARGE_MODEL', + message='the charge model type is not known') + spec.exit_code(204, + 'ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS', + message='Only the parameters relating to the chosen charge model should be specified') spec.exit_code(301, 'ERROR_SUB_PROCESS_FAILED_ALIGNMENT', message='the electrostatic potentials could not be aligned') @@ -121,10 +150,31 @@ def setup(self): """ ## Verification + # Minimum number of iterations required. + # TODO: Replace this with an input ports validator if self.inputs.model_iterations_required < 3: self.report('The requested number of iterations, {}, is too low. At least 3 are required to achieve an adequate data fit'.format(self.inputs.model_iterations_required.value)) return self.exit_codes.ERROR_BAD_INPUT_ITERATIONS_REQUIRED + # Check if charge model scheme is valid: + model_schemes_available = ["fixed", "fitted"] + self.ctx.charge_model = self.inputs.charge_model.model_type + if self.ctx.charge_model not in model_schemes_available: + return self.exit_codes.ERROR_INVALID_CHARGE_MODEL + + # Check if required charge model namespace is specified + # TODO: Replace with input ports validator + if self.ctx.charge_model == 'fitted': + if not self.inputs.charge_model.fitted: #Wanted fitted, but no params given + return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS + elif self.inputs.charge_model.fixed: #Wanted fitted, but gave fixed params + return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS + elif self.charge.model == 'fixed': + if not self.inputs.charge_model.fixed: #Wanted fixed, but no params given + return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS + elif self.inputs.charge_model.fitted: #Wanted fixed, but gave fitted params + return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS + # Track iteration number self.ctx.model_iteration = orm.Int(0) @@ -157,6 +207,13 @@ def setup(self): return + def should_fit_charge(self): + """ + Return whether the charge model should be fitted + """ + return (self.ctx.charge_model == 'fitted') + + def fit_charge_model(self): """ Fit an anisotropic gaussian to the charge state electron density @@ -195,6 +252,11 @@ def compute_model_potential(self): self.report("Computing model potential for scale factor {}".format( scale_factor.value)) + if self.charge_model == 'fitted': + gaussian_params = self.ctx.fitted_params + else: + gaussian_params = self.inputs.charge_model.fixed.gaussian_params + inputs = { 'peak_charge': self.ctx.peak_charge, 'defect_charge': self.inputs.defect_charge, @@ -203,7 +265,7 @@ def compute_model_potential(self): 'defect_site': self.inputs.defect_site, 'cutoff': self.inputs.cutoff, 'epsilon': self.inputs.epsilon, - 'gaussian_params' : self.ctx.fitted_params + 'gaussian_params' : gaussian_params } workchain_future = self.submit(ModelPotentialWorkchain, **inputs) label = 'model_potential_scale_factor_{}'.format(scale_factor.value) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 0401226..386dc1c 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -10,11 +10,14 @@ from aiida import orm from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit +from .corrections.gaussian_countercharge.gaussian_countercharge import ( + GaussianCounterChargeWorkchain) from .utils import ( get_raw_formation_energy, get_corrected_formation_energy, - get_corrected_aligned_formation_energy, -) + get_corrected_aligned_formation_energy) + + class FormationEnergyWorkchainBase(WorkChain): """ @@ -85,48 +88,39 @@ def define(cls, spec): spec.input( "correction_scheme", valid_type=orm.Str, - help="The correction scheme to apply", - ) + help="The correction scheme to apply") + # Optional parameters to override the gaussian charge model settings + spec.expose_inputs(GaussianCounterChargeWorkchain, + namespace='gaussian', + include=['charge_model']) # Outputs spec.output( - "formation_energy_uncorrected", valid_type=orm.Float, required=True - ) + "formation_energy_uncorrected", valid_type=orm.Float, required=True) spec.output( - "formation_energy_corrected", valid_type=orm.Float, required=True - ) + "formation_energy_corrected", valid_type=orm.Float, required=True) spec.output( - "formation_energy_corrected_aligned", valid_type=orm.Float, required=True - ) + "formation_energy_corrected_aligned", valid_type=orm.Float, required=True) # Error codes spec.exit_code(201, "ERROR_INVALID_CORRECTION", - message="The requested correction scheme is not recognised", - ) + message="The requested correction scheme is not recognised",) spec.exit_code(202, "ERROR_PARAMETER_OVERRIDE", - message="Input parameter dictionary key cannot be set explicitly", - ) + message="Input parameter dictionary key cannot be set explicitly",) spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", - message="The correction scheme sub-workchain failed", - ) + message="The correction scheme sub-workchain failed",) spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", - message="DFT calculation failed", - ) + message="DFT calculation failed",) spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", - message="A post-processing calculation failed", - ) + message="A post-processing calculation failed",) spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", - message="DFPT calculation failed" - ) + message="DFPT calculation failed") spec.exit_code(406, "ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED", - message="The chemical potential calculation failed" - ) + message="The chemical potential calculation failed") spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", - message="Input parameter dictionary key cannot be set explicitly" - ) + message="Input parameter dictionary key cannot be set explicitly") spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", - message="The requested method is not yet implemented", - ) + message="The requested method is not yet implemented") # fmt: on def setup(self): @@ -178,12 +172,17 @@ def run_gaussian_correction_workchain(self): """ Run the workchain for the Gaussian Countercharge correction """ - from .corrections.gaussian_countercharge.gaussian_countercharge import ( - GaussianCounterChargeWorkchain, - ) self.report("Computing correction via the Gaussian Countercharge scheme") + if self.inputs.gaussian.charge_model: + charge_model_dict = self.inputs.gaussian.charge_model + else: + charge_model_dict = { + 'model_type': Str('fitted'), + 'fitted': {} + } + inputs = { "v_host": self.ctx.v_host, "v_defect_q0": self.ctx.v_defect_q0, @@ -194,6 +193,7 @@ def run_gaussian_correction_workchain(self): "defect_site": self.inputs.defect_site, "host_structure": self.inputs.host_structure, "epsilon": self.ctx.epsilon, + 'charge_model': charge_model_dict } workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) diff --git a/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py b/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py index 2c5b4a6..0be8985 100644 --- a/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py +++ b/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py @@ -8,7 +8,7 @@ """Tests for the `GaussianCounterChargeWorkchain` class.""" import pytest from aiida.common import AttributeDict -from aiida.orm import Float, List, Dict, Int +from aiida.orm import Float, List, Dict, Int, Str from aiida_defects.formation_energy.corrections.gaussian_countercharge.gaussian_countercharge import GaussianCounterChargeWorkchain @pytest.fixture @@ -30,6 +30,10 @@ def _generate_inputs_gaussian_countercharge(): 'v_defect_q' : mock_array, 'rho_host' : mock_array, 'rho_defect_q' : mock_array, + 'charge_model': { + 'model_type': Str('fitted'), + 'fitted': {} + } } return inputs From 0ab5b67c2e87288eff3b7fc78a83e2a489a29509 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Sun, 7 Feb 2021 12:27:38 +0000 Subject: [PATCH 33/60] Implement mean absolute error based potential alignment scheme Add a potential aligment scheme based on a 3D minimisation of the sum of the mean absolute error. Values close to the defect site are exlcuded based on a spherical cutoff radius applied with respect to periodic boundary conditions. --- .../gaussian_countercharge.py | 6 +- .../model_potential/model_potential.py | 12 +- .../gaussian_countercharge/utils.py | 2 +- .../potential_alignment/mae/mae.py | 99 ++++++++++++++++ .../potential_alignment/mae/utils.py | 92 +++++++++++++++ .../potential_alignment.py | 7 +- aiida_defects/utils.py | 108 ++++++++++++++++++ 7 files changed, 315 insertions(+), 11 deletions(-) create mode 100644 aiida_defects/formation_energy/potential_alignment/mae/mae.py create mode 100644 aiida_defects/formation_energy/potential_alignment/mae/utils.py create mode 100644 aiida_defects/utils.py diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 396cb88..6193dd4 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -312,10 +312,10 @@ def submit_alignment_workchains(self): # Compute the alignment between the defect, in q=0, and the host inputs = { - "density_weighted":{ + "mae":{ "first_potential": self.inputs.v_defect_q0, "second_potential": self.inputs.v_host, - "charge_density": self.ctx.charge_model + "defect_site": self.inputs.defect_site }, "allow_interpolation": orm.Bool(True) } @@ -335,7 +335,7 @@ def submit_alignment_workchains(self): "density_weighted":{ "first_potential": self.ctx.v_defect_q_q0, "second_potential": v_model, - "charge_density": self.ctx.charge_model + 'host_structure': self.inputs.host_structure, }, "allow_interpolation": orm.Bool(True) } diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index fdfa40a..fe53d2a 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -25,23 +25,23 @@ class ModelPotentialWorkchain(WorkChain): @classmethod def define(cls, spec): super(ModelPotentialWorkchain, cls).define(spec) - spec.input('peak_charge', + spec.input('peak_charge', valid_type=orm.Float, help="Peak charge of the defect charge density distribution") - spec.input("defect_charge", + spec.input("defect_charge", valid_type=orm.Float, help="The target defect charge state") - spec.input('scale_factor', + spec.input('scale_factor', valid_type=orm.Int, help="Scale factor to apply when constructing the model system") - spec.input('host_structure', + spec.input('host_structure', valid_type=orm.StructureData, help="The unscaled host structure") spec.input('defect_site', valid_type=orm.List, help="Defect site position in crystal coordinates") - spec.input('cutoff', - valid_type=orm.Float, + spec.input('cutoff', + valid_type=orm.Float, default=lambda: orm.Float(40.), help="Energy cutoff for grids in Rydberg") spec.input('epsilon', diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index 2157790..4f71c9b 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -95,7 +95,7 @@ def fit_energies(dimensions_dict, energies_dict): AiiDA dictionary of the form: structure : energy """ - from scipy.optimize import curve_fit + from scipy.optimize import curve_fit def fitting_func(x, a, b, c): """ diff --git a/aiida_defects/formation_energy/potential_alignment/mae/mae.py b/aiida_defects/formation_energy/potential_alignment/mae/mae.py new file mode 100644 index 0000000..a1c1888 --- /dev/null +++ b/aiida_defects/formation_energy/potential_alignment/mae/mae.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida import orm +from aiida.engine import WorkChain, calcfunction + +from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference +from .utils import get_alignment, AllValuesMaskedError + + +class MaeAlignmentWorkchain(WorkChain): + """ + Compute the alignment needed between two electrostatic potentials. + Data points are included or excluded based on their distance from the defect site. + The largest possible sphere + + The root mean squared difference between two potentials is computed using: + \begin{equation} + x = \int \left| ( V_2 - V_1 + \Delta z ) \right| + \end{equation} + where: + * V_1 and V_2 are the potentials to align + * \Delta_z is the required alignment + + """ + + @classmethod + def define(cls, spec): + super(RmsAlignmentWorkchain, cls).define(spec) + spec.input('first_potential', + valid_type=orm.ArrayData, + help="The first electrostatic potential array") + spec.input('second_potential', + valid_type=orm.ArrayData, + help="The second electrostatic potential array") + spec.input("defect_site", + valid_type=orm.List, + help="Defect site position in crystal coordinates.") + + spec.outline( + cls.setup, + cls.compute_difference, + cls.calculate_alignment, + cls.results, + ) + spec.output('alignment_required', + valid_type=orm.Float, + required=True, + help="The computed potential alignment required") + spec.output('potential_difference', + valid_type=orm.ArrayData, + required=True, + help="The unmasked difference in electrostatic potentials") + + # Exit codes + spec.exit_code(301, 'ERROR_ALL_VALUES_MASKED', + message='All values in the potential difference array were masked. ' + 'Try increasing the tolerance to include fewer elements from the charge density array.') + + + def setup(self): + pass + + + def compute_difference(self): + """ + Compute the difference of the two potentials + """ + self.ctx.potential_difference = get_potential_difference( + first_potential = self.inputs.first_potential, + second_potential = self.inputs.second_potential + ) + + + def calculate_alignment(self): + """ + Compute the alignment + """ + try: + self.ctx.alignment = get_alignment( + potential_difference = self.ctx.potential_difference, + defect_site= self.inputs.defect_site + ) + except AllValuesMaskedError: + return self.exit_codes.ERROR_ALL_VALUES_MASKED + + + def results(self): + """ + Pack the results + """ + self.out('alignment_required', self.ctx.alignment) + self.out('potential_difference', self.ctx.potential_difference) \ No newline at end of file diff --git a/aiida_defects/formation_energy/potential_alignment/mae/utils.py b/aiida_defects/formation_energy/potential_alignment/mae/utils.py new file mode 100644 index 0000000..d36b72a --- /dev/null +++ b/aiida_defects/formation_energy/potential_alignment/mae/utils.py @@ -0,0 +1,92 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +import numpy as np + +from aiida.engine import calcfunction +from aiida import orm + +from aiida_defects.utils import get_cell_matrix, get_grid + +""" +Utility functions for the potential alignment workchain +""" + +class AllValuesMaskedError(ValueError): + """ + Error raised when no values are left after the masking procedure. + If one proceeds to compute averages using an array in which all values + are masked, the resulting object is an instance of 'numpy.ma.core.MaskedConstant' + which cannot be stored by AiiDA and is, in any case, meaningless. + """ + pass + +@calcfunction +def get_alignment(potential_difference, defect_site, cutoff_radius=0.5): + """ + Compute the mean-absolute error potential alignment + + Parameters + ---------- + potential_difference - numpy array + The difference in the electrostatic potentials to be aligned + defect_site - length 3 list, tuple or array + defect postion in crystal coordinates + cutoff_radius - float + distance cutoff from defect site in crystal coordinates. Coordinates + less than this distance are considered to be influenced by the defect + and are excluded from the alignment + """ + # Unpack ArrayData object + v_diff = potential_difference.get_array( + potential_difference.get_arraynames()[0]) + + # Generate a crystal grid of the same dimension as the data + ijk_array = get_grid(v_diff.shape) + # Compute the distance from the defect site to every other. + distance_vectors = np.array(defect_site).reshape(3,1) - ijk_array + # Apply minimum image + min_image_vectors = (distance_vectors - np.rint(distance_vectors)) + # Compute distances and reshape to match input data + distances = np.linalg.norm(min_image_vectors, axis=0).reshape(v_diff.shape) + + # In crystal coordinates, the maximum separation between interacting + # images is d=1 so look for coordinates at a distance of less than d=0.5. + # These are the coordinates within the shphere of interaction of the defect. + # Mask these and only compute the alignment the remaining, most distance points. + mask = np.ma.less(distances, cutoff_radius) + v_diff_masked = np.ma.masked_array(v_diff, mask=mask) + values_remaining = (v_diff_masked.count()/np.prod(v_diff.shape))*100.0 + print('{:.2f}% of values remain'.format(values_remaining)) + + # Check if any values are left after masking + if v_diff_masked.count() == 0: + raise AllValuesMaskedError + + fit_result = fit_potential(v_diff_masked) + alignment = fit_result.x + + return orm.Float(alignment) + + +def fit_potential(v_diff): + """ + Find the offset between two potentials, delta_z, that minimises the summed absolute error. + """ + from scipy.optimize import minimize + + def obj(delta_z): + """ + Objective function. Delta_z is the alignment of potentials + """ + return np.sum(np.abs(v_diff-delta_z)) + + initial_guess = 1.0 + result = minimize(obj, initial_guess) + return result diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 797339a..81e3ef4 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -17,11 +17,13 @@ from .utils import get_interpolation from .lany_zunger.lany_zunger import LanyZungerAlignmentWorkchain from .density_weighted.density_weighted import DensityWeightedAlignmentWorkchain +from .mae.mae import MaeAlignmentWorkchain valid_schemes = { 'lany_zunger' : LanyZungerAlignmentWorkchain, - 'density_weighted': DensityWeightedAlignmentWorkchain + 'density_weighted': DensityWeightedAlignmentWorkchain, + 'mae': MaeAlignmentWorkchain } class PotentialAlignmentWorkchain(WorkChain): @@ -39,6 +41,9 @@ def define(cls, spec): spec.expose_inputs(DensityWeightedAlignmentWorkchain, namespace='density_weighted', namespace_options={'required': False, 'populate_defaults': False}) + spec.expose_inputs(MaeAlignmentWorkchain, + namespace='mae', + namespace_options={'required': False, 'populate_defaults': False}) spec.expose_inputs(LanyZungerAlignmentWorkchain, namespace='lany_zunger', namespace_options={'required': False, 'populate_defaults': False}) diff --git a/aiida_defects/utils.py b/aiida_defects/utils.py new file mode 100644 index 0000000..9a73314 --- /dev/null +++ b/aiida_defects/utils.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +import numpy as np + +from qe_tools import CONSTANTS + +# This a collection of common, generic methods for common tasks + +def get_cell_matrix(structure): + """ + Get the cell matrix (in bohr) from an AiiDA StructureData object + + Parameters + ---------- + structure: AiiDA StructureData + The structure object of interest + + Returns + ------- + cell_matrix + 3x3 cell matrix array in units of Bohr + + """ + cell_matrix = np.array(structure.cell) / CONSTANTS.bohr_to_ang # Angstrom to Bohr + return cell_matrix + + +def get_reciprocal_cell(cell_matrix): + """ + For a given cell_matrix, compute the reciprocal cell matrix + + Parameters + ---------- + cell_matrix: 3x3 array + Cell matrix of the real space cell + + Returns + ------- + reciprocal_cell + 3x3 cell matrix array in reciprocal units + """ + from numpy.linalg import inv + reciprocal_cell = (2 * np.pi * inv(cell_matrix)).transpose() # Alternative definition (2pi) + + return reciprocal_cell + +def calc_pair_distance_xyz(cellmat,ri,rj): + """" + Calculate the distance between two atoms accross periodic boundary conditions + starting from cartesian coords. + Uses the general algorithm for the minimum image (Appendix B - Eq 9.) from: + M. E. Tuckerman. Statistical Mechanics: Theory and Molecular Simulation. + Oxford University Press, Oxford, UK, 2010. + + Parameters + ---------- + cellmat_inv - 3x3 matrix + The inverse of the 3x3 matrix describing the simulation cell + ri,rj - 3x1 vector + numpy vectors describing the position of atoms i and j + + Returns + --------- + dist - float + The distance between the atoms i and j, according the minimum image + convention. + + """ + si=np.dot(cellmat_inv,ri) + sj=np.dot(cellmat_inv,rj) + sij=si-sj + sij=sij-np.rint(sij) + rij=np.dot(cellmat,sij) + + # Get the magnitude of the vector + dist=np.sqrt(np.dot(rij,rij)) + + return dist + +def get_grid(dimensions, endpoint=True): + """ + Generate an array of coordinates + """ + # Generate a grid of coordinates + i = np.linspace(0., 1., dimensions[0], endpoint) + j = np.linspace(0., 1., dimensions[1], endpoint) + k = np.linspace(0., 1., dimensions[2], endpoint) + # Generate NxN arrays of coords + iii, jjj, kkk = np.meshgrid(i, j, k, indexing='ij') + # Flatten this to a 3xNN array + ijk_array = np.array([iii.ravel(), jjj.ravel(), kkk.ravel()]) + + return ijk_array + +def get_xyz_coords(cell_matrix, dimensions): + """ + For a given array, generate an array of xyz coordinates in the cartesian basis + """ + ijk_array = get_grid(dimensions) + # Change the crystal basis to a cartesian basis + xyz_array = np.dot(cell_matrix.T, ijk_array) + + return xyz_array \ No newline at end of file From e6fd6b9233de8f9e00eaa3fca0cdb4154b7546be Mon Sep 17 00:00:00 2001 From: ConradJohnston <40352432+ConradJohnston@users.noreply.github.com> Date: Sun, 7 Feb 2021 21:15:29 +0000 Subject: [PATCH 34/60] Update README.rst Update the AiiDA paper reference. Add section introducing example Jupyter notebook. --- README.rst | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index b427ef3..24c7a3b 100644 --- a/README.rst +++ b/README.rst @@ -11,7 +11,7 @@ If you use AiiDA-Defects in your work, please cite: *paper reference (doi)* -Please also remember to cite the `AiiDA paper `_. +Please also remember to cite the `AiiDA paper `_. Quick Setup @@ -35,9 +35,16 @@ To build the local docs, run: $ cd docs/ $ make html -Note: You will need to have ``make`` installed on your operating system. +Note: You will need to have ``make`` installed on your operating system to compile the documentation + + +Getting Started +=============== + +Expample usage of the workchains is documented in the collection of Jupyter notebooks in the ``examples`` directory. + Acknowledgements ================ -This work is funded by... \ No newline at end of file +This work is funded by... From 26ea139e7ae10d41c8a970e6b9980530cd2f863f Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Sun, 7 Feb 2021 21:20:10 +0000 Subject: [PATCH 35/60] Fix grid generation to ensure it is comenserate with the electrostatic potential --- aiida_defects/formation_energy/potential_alignment/mae/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiida_defects/formation_energy/potential_alignment/mae/utils.py b/aiida_defects/formation_energy/potential_alignment/mae/utils.py index d36b72a..344ee35 100644 --- a/aiida_defects/formation_energy/potential_alignment/mae/utils.py +++ b/aiida_defects/formation_energy/potential_alignment/mae/utils.py @@ -48,7 +48,7 @@ def get_alignment(potential_difference, defect_site, cutoff_radius=0.5): potential_difference.get_arraynames()[0]) # Generate a crystal grid of the same dimension as the data - ijk_array = get_grid(v_diff.shape) + ijk_array = get_grid(v_diff.shape, endpoint=False) # Compute the distance from the defect site to every other. distance_vectors = np.array(defect_site).reshape(3,1) - ijk_array # Apply minimum image From 67d6d97c902f660215c9849331405f66b7fb3c12 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 9 Feb 2021 22:13:11 +0100 Subject: [PATCH 36/60] Adding an option to run the ChemicalPotential workchain or providing the chemical potentials directly. --- .../chemical_potential/chemical_potential.py | 24 ++++---- .../chemical_potential/utils.py | 26 +++----- .../formation_energy/formation_energy_base.py | 60 ++++++++++--------- .../formation_energy/formation_energy_qe.py | 17 +++--- 4 files changed, 63 insertions(+), 64 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index 2a28908..ec44f62 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -36,7 +36,7 @@ def define(cls, spec): spec.input("dopant_elements", valid_type=List, required=False, default=lambda: List(list=[]), help="The aliovalent dopants that might be introduce into the prestine material. Several dopants might be present in co-doping scenario.") spec.input("ref_energy", valid_type=Dict, - help="The reference chemical potential of elements in the structure") + help="The reference chemical potential of elements in the structure. Format of the dictionary: {'Element_symbol': energy, ...}") spec.input("tolerance", valid_type=Float, default=lambda: Float(1E-4), help="Use to determine if a point in the chemical potential space is a corner of the stability region or not") @@ -84,10 +84,9 @@ def setup(self): self.ctx.formation_energy_dict = Dict(dict=formation_energy_dict) def generate_matrix_of_constraints(self): - #compound_of_interest = Composition(self.inputs.compound.value) - #N_competing_phases = len(self.ctx.formation_energy_dict.get_dict()) - 1 - #N_species = self.ctx.N_species - + ''' + Construct the set of constraints given by each compounds in the phase diagram and which delineate the stability region. + ''' column_order = {} # To track which element corresponds to each column, the dependent element is always the last column i = 0 for ele in self.ctx.element_list: @@ -98,11 +97,7 @@ def generate_matrix_of_constraints(self): self.ctx.column_order = Dict(dict=column_order) #self.report('Column order: {}'.format(column_order)) - ############################################################################## - # Construct matrix containing all linear equations. The last column is the rhs - # of the system of equations - ############################################################################## - + # Construct matrix containing all linear equations. The last column is the rhs of the system of equations self.ctx.matrix_eqns = get_matrix_of_constraints( self.ctx.N_species, self.inputs.compound, @@ -113,6 +108,9 @@ def generate_matrix_of_constraints(self): self.out('matrix_of_constraints', self.ctx.matrix_eqns) def solve_matrix_of_constraints(self): + ''' + Solve the system of (linear) constraints to get the coordinates of the corners of polyhedra that delineate the stability region + ''' self.ctx.stability_corners = get_stability_corners( self.ctx.matrix_eqns, self.ctx.N_species, @@ -123,6 +121,9 @@ def solve_matrix_of_constraints(self): self.out("stability_corners", self.ctx.stability_corners) def get_chemical_potential(self): + ''' + Compute the centroid of the stability region + ''' centroid = get_center_of_stability( self.inputs.compound, self.inputs.dependent_element, @@ -131,7 +132,8 @@ def get_chemical_potential(self): self.ctx.matrix_eqns ) self.report('Centroid of the stability region is {}'.format(centroid.get_array('data'))) - + + # Recover the absolute chemical potential by adding the energy of the reference elements to centroid self.ctx.chemical_potential = get_chemical_potential( centroid, self.inputs.ref_energy, diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py index b6ef9db..03c277a 100644 --- a/aiida_defects/formation_energy/chemical_potential/utils.py +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -67,10 +67,6 @@ def get_matrix_of_constraints(N_species, compound, dependent_element, column_ord eqns[1:,:][mask] = eqns_0 #print(eqns) - # Store the matrix of constraint (before removing the depedent-element column) - # constraints_with_dependent_element = ArrayData() - # constraints_with_dependent_element.set_array('data', eqns) - # Removing column corresponding to the dependent element from the set of equations correponding to the constraints # that delineate the stability region matrix = np.delete(eqns, N_species-1, axis=1) @@ -102,6 +98,7 @@ def get_stability_corners(matrix_eqns, N_species, compound, tolerance): check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= tolerance bool_mask = [not(False in x) for x in check_constraint] corners_of_stability_region = intersecting_points[bool_mask] + ### In some cases, we may have several solutions corresponding to the same points. Hence, the remove_duplicate method corners_of_stability_region = remove_duplicate(corners_of_stability_region) if corners_of_stability_region.size == 0: @@ -150,6 +147,9 @@ def get_center_of_stability(compound, dependent_element, stability_corners, N_sp def get_e_above_hull(compound, element_list, formation_energy_dict): + ''' + Get the energy above the convex hull. When the compound is unstable, e_hull > 0. + ''' composition = Composition(compound) mp_entries = [] @@ -227,9 +227,8 @@ def get_grid(stability_corners, matrix_eqns, N_point=50, tolerance=1E-4): def get_centroid(stability_region): return np.mean(stability_region, axis=0) -@calcfunction def Order_point_clockwise(points): - points = points.get_array('data') +# points = points.get_array('data') if len(points[0]) == 1: points_order = points else: @@ -240,17 +239,10 @@ def Order_point_clockwise(points): t = list(t) u = [t.index(element) for element in sort_t] points_order = points[u] - ordered_points = ArrayData() - ordered_points.set_array('data', points_order) - return ordered_points - #return points_order - -@calcfunction -def remove_column_of_dependent_element(set_of_constraints, N_species): - matrix = np.delete(set_of_constraints.get_array('data'), N_species.value-1, axis=1) - matrix_data = ArrayData() - matrix_data.set_array('data', matrix) - return matrix_data +# ordered_points = ArrayData() +# ordered_points.set_array('data', points_order) +# return ordered_points + return points_order @calcfunction def get_chemical_potential(centroid, ref_energy, column_order): diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 71b4d07..55f22b5 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -54,33 +54,32 @@ def define(cls, spec): "defect_charge", valid_type=orm.Float, help="Defect charge state") -# spec.input( -# "defect_specie", -# valid_type=orm.Str) spec.input( "defect_site", valid_type=orm.List, help="Defect site position in crystal coordinates" ) - #spec.input('ref_energy',valid_type=orm.Float) spec.input( "fermi_level", valid_type=orm.Float, default=lambda: orm.Float(0.0), help="Fermi level position with respect to the valence band maximum") + spec.input("chempot_sign", + valid_type=orm.Dict, + help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") + + # Chemical potential + spec.input('run_chem_pot_wc', valid_type=orm.Bool, default=lambda: orm.Bool(True)) + spec.input('formation_energy_dict', valid_type=orm.Dict) + spec.input('compound', valid_type=orm.Str) + spec.input('dependent_element', valid_type=orm.Str) + spec.input("ref_energy", valid_type=orm.Dict, help="The reference chemical potential of elements in the structure") + spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) spec.input( "chemical_potential", - valid_type=orm.Dict, + valid_type=orm.Dict, required=False, help="The chemical potential of the given defect type. The convention is that removing an atom is positive") - spec.input("chempot_sign", valid_type=orm.Dict, - help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") - - # Chemical potential - #spec.input('formation_energy_dict', valid_type=orm.Dict) - #spec.input('compound', valid_type=orm.Str) - #spec.input('dependent_element', valid_type=orm.Str) - #spec.input("ref_energy", valid_type=Dict, help="The reference chemical potential of elements in the structure") - #spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) - spec.input('sigma', valid_type=orm.Float) + + spec.input('sigma', valid_type=orm.Float, required=False) spec.input("run_dfpt", valid_type=orm.Bool) @@ -148,6 +147,9 @@ def setup(self): def if_run_dfpt(self): return self.inputs.run_dfpt + def if_run_chem_pot_wc(self): + return self.inputs.run_chem_pot_wc + def correction_required(self): """ Check if correction is requested @@ -259,13 +261,12 @@ def run_chemical_potential_workchain(self): from .chemical_potential.chemical_potential import ( ChemicalPotentialWorkchain, ) - self.report('Computing the chemical potential of {}'.format(self.inputs.defect_specie.value)) + self.report('Submitting the chemical potential workchain') inputs = { "formation_energy_dict": self.inputs.formation_energy_dict, "compound": self.inputs.compound, "dependent_element": self.inputs.dependent_element, - "defect_specie": self.inputs.defect_specie, - #"ref_energy": self.inputs.ref_energy, + "ref_energy": self.inputs.ref_energy, "tolerance": self.inputs.tolerance, } workchain_future = self.submit(ChemicalPotentialWorkchain, **inputs) @@ -277,18 +278,21 @@ def check_chemical_potential_workchain(self): Check if the chemical potential workchain have finished correctly. If yes, assign the output to context """ - - chem_potential_wc = self.ctx["chemical_potential_workchain"] - if not chem_potential_wc.is_finished_ok: - self.report( - "Chemical potential workchain failed with status {}".format( - chem_potential_wc.exit_status + + if self.inputs.run_chem_pot_wc: + chem_potential_wc = self.ctx["chemical_potential_workchain"] + if not chem_potential_wc.is_finished_ok: + self.report( + "Chemical potential workchain failed with status {}".format( + chem_potential_wc.exit_status + ) ) - ) - return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED - #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED + #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION + else: + self.ctx.chemical_potential = chem_potential_wc.outputs.chemical_potential else: - self.ctx.chemical_potential = chem_potential_wc.outputs.chemical_potential + self.ctx.chemical_potential = self.inputs.chemical_potential def compute_formation_energy(self): """ diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 7342821..7be66b4 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -50,9 +50,9 @@ def define(cls, spec): spec.input('run_v_host', valid_type=orm.Bool, required=True) spec.input('run_v_defect_q0', valid_type=orm.Bool, required=True) spec.input('run_v_defect_q', valid_type=orm.Bool, required=True) -# spec.input('run_rho_host', valid_type=orm.Bool, required=True) -# spec.input('run_rho_defect_q0', valid_type=orm.Bool, required=True) -# spec.input('run_rho_defect_q', valid_type=orm.Bool, required=True) + spec.input('run_rho_host', valid_type=orm.Bool, required=True) + spec.input('run_rho_defect_q0', valid_type=orm.Bool, required=True) + spec.input('run_rho_defect_q', valid_type=orm.Bool, required=True) spec.input('run_dfpt', valid_type=orm.Bool, required=True) spec.input('host_node', valid_type=orm.Int, required=False) @@ -123,15 +123,18 @@ def define(cls, spec): spec.outline( cls.setup, + if_(cls.if_run_chem_pot_wc)( + cls.run_chemical_potential_workchain, + ), + cls.check_chemical_potential_workchain, if_(cls.correction_required)( if_(cls.is_gaussian_scheme)( cls.prep_dft_calcs_gaussian_correction, cls.check_dft_calcs_gaussian_correction, cls.get_dft_potentials_gaussian_correction, cls.check_dft_potentials_gaussian_correction, - #cls.get_kohn_sham_potentials, - #cls.get_charge_density, - #cls.check_charge_density_calculations, + cls.get_charge_density, + cls.check_charge_density_calculations, if_(cls.if_run_dfpt)( cls.prep_hostcell_calc_for_dfpt, cls.check_hostcell_calc_for_dfpt, @@ -145,8 +148,6 @@ def define(cls, spec): #cls.run_point_correction_workchain), ), cls.check_correction_workchain), -# cls.run_chemical_potential_workchain, -# cls.check_chemical_potential_workchain, cls.compute_formation_energy ) From 7998bc2427a7bd3df884bc23d13ebbe159e0f193 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 9 Feb 2021 23:13:58 +0100 Subject: [PATCH 37/60] Correct a small error in compute_formation_energy --- aiida_defects/formation_energy/formation_energy_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 55f22b5..89e14f7 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -303,7 +303,7 @@ def compute_formation_energy(self): self.ctx.defect_energy, self.ctx.host_energy, self.inputs.chempot_sign, - self.inputs.chemical_potential, + self.ctx.chemical_potential, self.inputs.defect_charge, self.inputs.fermi_level, self.ctx.host_vbm From 33e74e1b166c19d98afcc1d4aff21613899d4d78 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Mon, 15 Feb 2021 13:37:46 +0000 Subject: [PATCH 38/60] Fixes, interface changes and code style tidy up --- .../gaussian_countercharge.py | 33 +++++----- .../model_potential/model_potential.py | 12 ++-- .../model_potential/utils.py | 62 ++++++++++--------- .../gaussian_countercharge/utils.py | 8 +-- .../potential_alignment/mae/mae.py | 2 +- .../potential_alignment/mae/utils.py | 2 +- .../potential_alignment.py | 12 ++-- examples/GaussianCountercharge.ipynb | 47 +++++++++++--- 8 files changed, 104 insertions(+), 74 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 6193dd4..5723d27 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -28,8 +28,6 @@ class GaussianCounterChargeWorkchain(WorkChain): def define(cls, spec): super(GaussianCounterChargeWorkchain, cls).define(spec) - - spec.input("host_structure", valid_type=orm.StructureData, help="The structure of the host system.") @@ -72,9 +70,9 @@ def define(cls, spec): spec.input("charge_model.model_type", valid_type=orm.Str, help="Charge model type: 'fixed' or 'fitted'", - default=lambda: orm.Str('fitted')) + default=lambda: orm.Str('fixed')) # Fixed - spec.input_namespace('charge_model.fixed', required=False, + spec.input_namespace('charge_model.fixed', required=False, populate_defaults=False, help="Inputs for a fixed charge model using a user-specified multivariate gaussian") spec.input("charge_model.fixed.gaussian_params", valid_type=orm.List, @@ -82,7 +80,7 @@ def define(cls, spec): "gaussian charge distribution. The format required is " "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") # Fitted - spec.input_namespace('charge_model.fitted', required=False, + spec.input_namespace('charge_model.fitted', required=False, populate_defaults=False, help="Inputs for a fitted charge model using a multivariate anisotropic gaussian.") spec.input("charge_model.fitted.tolerance", valid_type=orm.Float, @@ -165,14 +163,14 @@ def setup(self): # Check if required charge model namespace is specified # TODO: Replace with input ports validator if self.ctx.charge_model == 'fitted': - if not self.inputs.charge_model.fitted: #Wanted fitted, but no params given + if 'fitted' not in self.inputs.charge_model: #Wanted fitted, but no params given return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS - elif self.inputs.charge_model.fixed: #Wanted fitted, but gave fixed params + elif 'fixed' in self.inputs.charge_model: #Wanted fitted, but gave fixed params return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS - elif self.charge.model == 'fixed': - if not self.inputs.charge_model.fixed: #Wanted fixed, but no params given + elif self.ctx.charge_model == 'fixed': + if 'fixed' not in self.inputs.charge_model: #Wanted fixed, but no params given return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS - elif self.inputs.charge_model.fitted: #Wanted fixed, but gave fitted params + elif 'fitted' in self.inputs.charge_model: #Wanted fixed, but gave fitted params return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS # Track iteration number @@ -252,13 +250,15 @@ def compute_model_potential(self): self.report("Computing model potential for scale factor {}".format( scale_factor.value)) - if self.charge_model == 'fitted': + if self.ctx.charge_model == 'fitted': gaussian_params = self.ctx.fitted_params + peak_charge = self.ctx.peak_charge else: gaussian_params = self.inputs.charge_model.fixed.gaussian_params + peak_charge = orm.Float(0.) inputs = { - 'peak_charge': self.ctx.peak_charge, + 'peak_charge': peak_charge, 'defect_charge': self.inputs.defect_charge, 'scale_factor': scale_factor, 'host_structure': self.inputs.host_structure, @@ -312,12 +312,12 @@ def submit_alignment_workchains(self): # Compute the alignment between the defect, in q=0, and the host inputs = { + "allow_interpolation": orm.Bool(True), "mae":{ "first_potential": self.inputs.v_defect_q0, "second_potential": self.inputs.v_host, "defect_site": self.inputs.defect_site }, - "allow_interpolation": orm.Bool(True) } workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) @@ -332,12 +332,13 @@ def submit_alignment_workchains(self): # Compute the alignment between the defect DFT difference potential, and the model inputs = { - "density_weighted":{ + + "allow_interpolation": orm.Bool(True), + "mae":{ "first_potential": self.ctx.v_defect_q_q0, "second_potential": v_model, - 'host_structure': self.inputs.host_structure, + "defect_site": self.inputs.defect_site }, - "allow_interpolation": orm.Bool(True) } workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) label = 'workchain_alignment_dft_to_model' diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index fe53d2a..42f927d 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -25,9 +25,6 @@ class ModelPotentialWorkchain(WorkChain): @classmethod def define(cls, spec): super(ModelPotentialWorkchain, cls).define(spec) - spec.input('peak_charge', - valid_type=orm.Float, - help="Peak charge of the defect charge density distribution") spec.input("defect_charge", valid_type=orm.Float, help="The target defect charge state") @@ -52,6 +49,10 @@ def define(cls, spec): help="A length 9 list of parameters needed to construct the " "gaussian charge distribution. The format required is " "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + spec.input('peak_charge', + valid_type=orm.Float, + default=lambda: orm.Float(0.0), + help="Peak charge of the defect charge density distribution. If set to zero, no scaling will be done.") spec.outline( cls.setup, @@ -107,9 +108,12 @@ def compute_model_charge(self): self.ctx.cell_matrix = orm.ArrayData() self.ctx.cell_matrix.set_array('cell_matrix', self.ctx.real_cell) + if self.inputs.peak_charge == 0.0: + peak_charge = None + self.ctx.charge_model = get_charge_model( cell_matrix = self.ctx.cell_matrix, - peak_charge = self.inputs.peak_charge, + peak_charge = peak_charge, defect_charge = self.inputs.defect_charge, dimensions = self.ctx.grid_dimensions, gaussian_params = self.inputs.gaussian_params diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py index f790a09..6bc959a 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py @@ -98,7 +98,7 @@ def get_reciprocal_grid(cell_matrix, cutoff): if grid_max[axis] % 2 == 0: grid_max[axis] += 1 - return orm.List(list=grid_max.tolist()) + return orm.List(list=grid_max.tolist()) def get_xyz_coords(cell_matrix, dimensions): @@ -120,7 +120,7 @@ def get_xyz_coords(cell_matrix, dimensions): return xyz_array -def generate_charge_model(cell_matrix, peak_charge): +def generate_charge_model(cell_matrix, peak_charge=None): """ Return a function to compute a periodic gaussian on a grid. The returned function can be used for fitting. @@ -136,49 +136,49 @@ def generate_charge_model(cell_matrix, peak_charge): Returns ------- compute_charge - A function that will compute a periodic gaussian on a grid + A function that will compute a periodic gaussian on a grid for a given cell and peak charge intensity """ def compute_charge( xyz_real, - x0, y0, z0, + x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz): """ - For a given system charge, create a model charge distribution using + For a given system charge, create a model charge distribution using an anisotropic periodic 3D gaussian. The charge model for now is a Gaussian. - NOTE: - The values for sigma and cov are not the values used in construction - of the Gaussian. After the covariance matrix is constructed, its - transpose is multiplied by itself (that is to construct a Gram matrix) - to ensure that it is positive-semidefinite. It is this matrix which is - the real covariance matrix. This transformation is to allow this - function to be used directly by the fitting algorithm without a danger - of crashing. + NOTE: + The values for sigma and cov are not the values used in construction + of the Gaussian. After the covariance matrix is constructed, its + transpose is multiplied by itself (that is to construct a Gram matrix) + to ensure that it is positive-semidefinite. It is this matrix which is + the real covariance matrix. This transformation is to allow this + function to be used directly by the fitting algorithm without a danger + of crashing. Parameters ---------- - xyz_real: 3xN array + xyz_real: 3xN array Coordinates to compute the Gaussian for in cartesian coordinates. x0, y0, z0: float Center of the Gaussian in crystal coordinates. sigma_x, sigma_y, sigma_z: float Spread of the Gaussian (not the real values used, see note above). cov_xy, cov_xz, cov_yz: float - Covariance values controlling the rotation of the Gaussian + Covariance values controlling the rotation of the Gaussian (not the real values used, see note above). Returns ------- g - Values of the Gaussian computed at all of the desired coordinates and + Values of the Gaussian computed at all of the desired coordinates and scaled by the value of charge_integral. """ - + # Construct the pseudo-covariance matrix V = np.array([[sigma_x, cov_xy, cov_xz],[cov_xy, sigma_y, cov_yz], [cov_xz, cov_yz, sigma_z]]) # Construct the actual covariance matrix in a way that is always positive semi-definite @@ -194,7 +194,7 @@ def compute_charge( # Compute the periodic origin in crystal coordinates origin_crystal = (gauss_position + np.array([ii, jj, kk])).reshape(3,1) # Convert this to cartesian coordinates - origin_real = np.dot(cell_matrix.T, origin_crystal) + origin_real = np.dot(cell_matrix.T, origin_crystal) # Compute the Gaussian centred at this position g = g + get_gaussian_3d(xyz_real.T, origin_real, covar) @@ -202,7 +202,8 @@ def compute_charge( print("DEBUG: g.max() = {}".format(g.max())) # Scale the result to match the peak charge density - g = g * (peak_charge / g.max()) + if peak_charge: + g = g * (peak_charge / g.max()) print("DEBUG: Peak Charge target = {}".format(peak_charge)) print("DEBUG: Peak Charge scaled = {}".format(g.max())) print("DEBUG: Integrated charge density (scaled) = {}".format(get_integral(g, cell_matrix))) @@ -213,7 +214,7 @@ def compute_charge( @calcfunction -def get_charge_model(cell_matrix, peak_charge, defect_charge, dimensions, gaussian_params): +def get_charge_model(cell_matrix, defect_charge, dimensions, gaussian_params, peak_charge=None): """ For a given system charge, create a model charge distribution. @@ -237,9 +238,10 @@ def get_charge_model(cell_matrix, peak_charge, defect_charge, dimensions, gaussi The grid with the charge data as an AiiDA ArrayData object """ - + cell_matrix = cell_matrix.get_array('cell_matrix') - peak_charge = peak_charge.value + if peak_charge: + peak_charge = peak_charge.value defect_charge = defect_charge.value dimensions = np.array(dimensions) gaussian_params = gaussian_params.get_list() @@ -258,11 +260,11 @@ def get_charge_model(cell_matrix, peak_charge, defect_charge, dimensions, gaussi print("DEBUG: Integrated charge density target = {}".format(defect_charge)) g = g * (defect_charge / get_integral(g, cell_matrix)) print("DEBUG: Integrated charge density (scaled) = {}".format(get_integral(g, cell_matrix))) - + # Compensating jellium background g = g - np.sum(g)/np.prod(g.shape) print("DEBUG: Integrated charge density (jellium) = {}".format(get_integral(g, cell_matrix))) - + # Pack the array model_charge_array = orm.ArrayData() model_charge_array.set_array('model_charge', g) @@ -349,9 +351,9 @@ def get_gaussian_3d(grid, origin, covar): Array on which to compute gaussian origin: array Centre of gaussian - covar: 3x3 array + covar: 3x3 array Covariance matrix of gaussian - + Returns ------- gaussian @@ -439,8 +441,8 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): dimensions = dimensions // 2 #floor division ijk_array = np.mgrid[ - -dimensions[0]:dimensions[0] + 1, - -dimensions[1]:dimensions[1] + 1, + -dimensions[0]:dimensions[0] + 1, + -dimensions[1]:dimensions[1] + 1, -dimensions[2]:dimensions[2] + 1].T # Get G vectors @@ -460,7 +462,7 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): V_model_g[dimensions[0] + 1, dimensions[1] + 1, dimensions[2] + 1] = 0.0 # Get the model potential in real space - V_model_r = get_inverse_fft(V_model_g) + V_model_r = get_inverse_fft(V_model_g) * CONSTANTS.hartree_to_ev # Pack up the array V_model_array = orm.ArrayData() @@ -478,6 +480,6 @@ def get_energy(potential, charge_density, cell_matrix): potential = potential.get_array('model_potential') charge_density = charge_density.get_array('model_charge') - energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix) * CONSTANTS.hartree_to_ev) + energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix)) return orm.Float(energy) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index 4f71c9b..cfb0779 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -187,12 +187,12 @@ def get_charge_model_fit(rho_host, rho_defect_q, host_structure): rho_defect_q_data = rho_defect_q.get_array(rho_defect_q.get_arraynames()[0]) rho_host_data = rho_host.get_array(rho_host.get_arraynames()[0]) - # Charge density from QE is in e/cubic-bohr, so convert if necessary + # Charge density from QE is in e/cubic-bohr, so convert if necessary # TODO: Check if the CUBE file format is strictly Bohr or if this is a QE thing - #rho_diff = (rho_host_data - rho_defect_q_data)/(bohr_to_ang**3) - rho_diff = rho_host_data - rho_defect_q_data + #rho_diff = (rho_host_data - rho_defect_q_data)/(bohr_to_ang**3) + rho_diff = rho_host_data - rho_defect_q_data - # Detect the centre of the charge in the data + # Detect the centre of the charge in the data max_pos_mat = np.array(np.unravel_index(rho_diff.argmax(), rho_diff.shape)) # matrix coords max_pos_ijk = (max_pos_mat*1.)/(np.array(rho_diff.shape)-1) # Compute crystal coords max_i = max_pos_ijk[0] diff --git a/aiida_defects/formation_energy/potential_alignment/mae/mae.py b/aiida_defects/formation_energy/potential_alignment/mae/mae.py index a1c1888..1a6866a 100644 --- a/aiida_defects/formation_energy/potential_alignment/mae/mae.py +++ b/aiida_defects/formation_energy/potential_alignment/mae/mae.py @@ -32,7 +32,7 @@ class MaeAlignmentWorkchain(WorkChain): @classmethod def define(cls, spec): - super(RmsAlignmentWorkchain, cls).define(spec) + super(MaeAlignmentWorkchain, cls).define(spec) spec.input('first_potential', valid_type=orm.ArrayData, help="The first electrostatic potential array") diff --git a/aiida_defects/formation_energy/potential_alignment/mae/utils.py b/aiida_defects/formation_energy/potential_alignment/mae/utils.py index 344ee35..9a0a5f8 100644 --- a/aiida_defects/formation_energy/potential_alignment/mae/utils.py +++ b/aiida_defects/formation_energy/potential_alignment/mae/utils.py @@ -28,7 +28,7 @@ class AllValuesMaskedError(ValueError): pass @calcfunction -def get_alignment(potential_difference, defect_site, cutoff_radius=0.5): +def get_alignment(potential_difference, defect_site, cutoff_radius=lambda: orm.Float(0.5)): """ Compute the mean-absolute error potential alignment diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 81e3ef4..d52a186 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -95,7 +95,6 @@ def setup(self): else: return self.exit_codes.ERROR_INPUT_BAD_SCHEME - # Collect the inputs from the selected scheme inputs = AttributeDict( self.exposed_inputs(valid_schemes[self.ctx.alignment_scheme], @@ -180,7 +179,9 @@ def do_interpolation(self): interpolated_arrays[array_name] = get_interpolation( input_array=array, target_shape=target_shape) - self.ctx.interpolated_arrays = interpolated_arrays + # Replace input arrays with interpolated versions + for array_name, array in interpolated_arrays.items(): + self.ctx.inputs[array_name] = array return @@ -193,10 +194,6 @@ def calculate_alignment(self): inputs = self.ctx.inputs - # Replace input arrays with interpolated versions - for array_name, array in self.ctx.interpolated_arrays.items(): - inputs[array_name] = array - workchain_future = self.submit(alignment_workchain, **inputs) self.to_context(**{'alignment_wc': workchain_future}) @@ -224,6 +221,5 @@ def results(self): Collect results """ self.report( - "Completed alignment. An alignment of {} eV is required".format( - self.ctx.alignment.value * CONSTANTS.hartree_to_ev/2.0 )) + "Completed alignment. An alignment of {} eV is required".format(self.ctx.alignment)) self.out('alignment_required', self.ctx.alignment) diff --git a/examples/GaussianCountercharge.ipynb b/examples/GaussianCountercharge.ipynb index cf3261e..90d47bc 100644 --- a/examples/GaussianCountercharge.ipynb +++ b/examples/GaussianCountercharge.ipynb @@ -32,7 +32,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -55,7 +55,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": {}, "outputs": [], "source": [ @@ -73,7 +73,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -88,12 +88,21 @@ "\n", "# Create an arbitrary array\n", "placeholder_array = orm.ArrayData()\n", - "placeholder_array.set_array('test', np.ones(3))\n", + "placeholder_array.set_array('test', np.ones([3,3,3]))\n", "\n", "# Assign it to the inputs\n", "builder.v_host = placeholder_array\n", "builder.v_defect_q0 = placeholder_array\n", "builder.v_defect_q = placeholder_array\n", + "builder.rho_host = placeholder_array\n", + "builder.rho_defect_q = placeholder_array\n", + "\n", + "builder.charge_model.model_type = orm.Str('fixed')\n", + "builder.charge_model.fixed.gaussian_params = orm.List(list=[\n", + " 0.5, 0.5, 0.5, \n", + " 1.0, 1.0, 1.0,\n", + " 0.0, 0.0, 0.0\n", + "])\n", "\n", "# Prepare a structre. Only the host structure is required as the user sets the defect location explicitly.\n", "# Here, a dummy strucute data with no atoms is used, but any valid StructureData object can passed in. \n", @@ -117,7 +126,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -170,6 +179,24 @@ "The modelled interaction (q/r) is smooth and so good results are possible at the default of 40 Ry. In principle, increasing this value improves the accuracy of the results, in exchange for increased computational expense, but equally, the overall method has low sensitivity to this parameter.\n" ] }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "array_shapes=[(3,3,3),(3,3,3)]" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "len(set(array_shapes))" + ] + }, { "cell_type": "code", "execution_count": null, @@ -180,21 +207,21 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3.7.4 64-bit ('aiidapy': virtualenv)", "language": "python", - "name": "python2" + "name": "python37464bitaiidapyvirtualenv941d830aa424405eb828f69d9163a2ed" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.10" + "pygments_lexer": "ipython3", + "version": "3.7.9" } }, "nbformat": 4, From 4c05f2194ea434ef4ed7fd8686e21478027e6987 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Wed, 17 Feb 2021 14:05:15 +0100 Subject: [PATCH 39/60] Adding an option to use a fixed gaussian or fitted it to the charge density difference. --- .../gaussian_countercharge.py | 140 ++++++++++++------ .../model_potential/model_potential.py | 30 ++-- .../model_potential/utils.py | 68 ++++----- .../gaussian_countercharge/utils.py | 12 +- .../formation_energy/formation_energy_base.py | 56 +++++-- .../formation_energy/formation_energy_qe.py | 6 +- .../potential_alignment/mae/mae.py | 99 +++++++++++++ .../potential_alignment/mae/utils.py | 92 ++++++++++++ .../potential_alignment.py | 22 +-- aiida_defects/utils.py | 108 ++++++++++++++ 10 files changed, 512 insertions(+), 121 deletions(-) create mode 100644 aiida_defects/formation_energy/potential_alignment/mae/mae.py create mode 100644 aiida_defects/formation_energy/potential_alignment/mae/utils.py create mode 100644 aiida_defects/utils.py diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index d864d02..5723d27 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -7,9 +7,8 @@ ######################################################################################## from __future__ import absolute_import -from aiida.engine import WorkChain, calcfunction, ToContext, while_ +from aiida.engine import WorkChain, calcfunction, ToContext, while_, if_ from aiida import orm -#from qe_tools.constants import hartree_to_ev from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain from .model_potential.model_potential import ModelPotentialWorkchain @@ -47,7 +46,7 @@ def define(cls, spec): help="The number of model charge systems to compute. More may improve convergence.") spec.input("cutoff", valid_type=orm.Float, - default=lambda: orm.Float(100.), + default=lambda: orm.Float(40.), help="Plane wave cutoff for electrostatic model.") spec.input("v_host", valid_type=orm.ArrayData, @@ -58,27 +57,45 @@ def define(cls, spec): spec.input("v_defect_q", valid_type=orm.ArrayData, help="The electrostatic potential of the defect system in the target charge state (in eV).") -# spec.input("rho_host", -# valid_type=orm.ArrayData, -# help="The charge density of the host system.") -# spec.input("rho_defect_q", -# valid_type=orm.ArrayData, -# help="The charge density of the defect system in the target charge state.") - spec.input("charge_fit_tolerance", + spec.input("rho_host", + valid_type=orm.ArrayData, + help="The charge density of the host system.") + spec.input("rho_defect_q", + valid_type=orm.ArrayData, + help="The charge density of the defect system in the target charge state.") + + # Charge Model Settings + spec.input_namespace('charge_model', + help="Namespace for settings related to different charge models") + spec.input("charge_model.model_type", + valid_type=orm.Str, + help="Charge model type: 'fixed' or 'fitted'", + default=lambda: orm.Str('fixed')) + # Fixed + spec.input_namespace('charge_model.fixed', required=False, populate_defaults=False, + help="Inputs for a fixed charge model using a user-specified multivariate gaussian") + spec.input("charge_model.fixed.gaussian_params", + valid_type=orm.List, + help="A length 9 list of parameters needed to construct the " + "gaussian charge distribution. The format required is " + "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + # Fitted + spec.input_namespace('charge_model.fitted', required=False, populate_defaults=False, + help="Inputs for a fitted charge model using a multivariate anisotropic gaussian.") + spec.input("charge_model.fitted.tolerance", valid_type=orm.Float, help="Permissable error for any fitted charge model parameter.", default=lambda: orm.Float(1.0e-3)) - spec.input("strict_fit", + spec.input("charge_model.fitted.strict_fit", valid_type=orm.Bool, help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", default=lambda: orm.Bool(True)) - spec.input("sigma", - valid_type=orm.Float, default=lambda: orm.Float(1.0), - help="The spread of the gaussian.") spec.outline( cls.setup, - cls.fit_charge_model, + if_(cls.should_fit_charge)( + cls.fit_charge_model, + ), while_(cls.should_run_model)( cls.compute_model_potential, ), @@ -105,6 +122,12 @@ def define(cls, spec): spec.exit_code(202, 'ERROR_BAD_INPUT_ITERATIONS_REQUIRED', message='The required number of iterations must be at least 3') + spec.exit_code(203, + 'ERROR_INVALID_CHARGE_MODEL', + message='the charge model type is not known') + spec.exit_code(204, + 'ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS', + message='Only the parameters relating to the chosen charge model should be specified') spec.exit_code(301, 'ERROR_SUB_PROCESS_FAILED_ALIGNMENT', message='the electrostatic potentials could not be aligned') @@ -125,10 +148,31 @@ def setup(self): """ ## Verification + # Minimum number of iterations required. + # TODO: Replace this with an input ports validator if self.inputs.model_iterations_required < 3: self.report('The requested number of iterations, {}, is too low. At least 3 are required to achieve an adequate data fit'.format(self.inputs.model_iterations_required.value)) return self.exit_codes.ERROR_BAD_INPUT_ITERATIONS_REQUIRED + # Check if charge model scheme is valid: + model_schemes_available = ["fixed", "fitted"] + self.ctx.charge_model = self.inputs.charge_model.model_type + if self.ctx.charge_model not in model_schemes_available: + return self.exit_codes.ERROR_INVALID_CHARGE_MODEL + + # Check if required charge model namespace is specified + # TODO: Replace with input ports validator + if self.ctx.charge_model == 'fitted': + if 'fitted' not in self.inputs.charge_model: #Wanted fitted, but no params given + return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS + elif 'fixed' in self.inputs.charge_model: #Wanted fitted, but gave fixed params + return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS + elif self.ctx.charge_model == 'fixed': + if 'fixed' not in self.inputs.charge_model: #Wanted fixed, but no params given + return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS + elif 'fitted' in self.inputs.charge_model: #Wanted fixed, but gave fitted params + return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS + # Track iteration number self.ctx.model_iteration = orm.Int(0) @@ -161,30 +205,32 @@ def setup(self): return + def should_fit_charge(self): + """ + Return whether the charge model should be fitted + """ + return (self.ctx.charge_model == 'fitted') + + def fit_charge_model(self): - """ + """ Fit an anisotropic gaussian to the charge state electron density """ -# fit = get_charge_model_fit( -# self.inputs.rho_host, -# self.inputs.rho_defect_q, -# self.inputs.host_structure) -# -# self.report('fit: {}'.format(fit.get_dict())) -# -# self.ctx.fitted_params = orm.List(list=fit['fit']) -# self.ctx.peak_charge = orm.Float(fit['peak_charge']) -# -# for parameter in fit['error']: -# if parameter > self.inputs.charge_fit_tolerance: -# self.logger.warning("Charge fitting parameter worse than allowed tolerance") -# if self.inputs.strict_fit: -# return self.exit_codes.ERROR_BAD_CHARGE_FIT - - sigma = self.inputs.sigma - self.ctx.fitted_params = orm.List(list=self.inputs.defect_site.get_list()+[sigma, sigma, sigma, 0.0, 0.0, 0.0]) - self.ctx.peak_charge = orm.Float(1.0) + fit = get_charge_model_fit( + self.inputs.rho_host, + self.inputs.rho_defect_q, + self.inputs.host_structure) + + self.ctx.fitted_params = orm.List(list=fit['fit']) + self.ctx.peak_charge = orm.Float(fit['peak_charge']) + + for parameter in fit['error']: + if parameter > self.inputs.charge_fit_tolerance: + self.logger.warning("Charge fitting parameter worse than allowed tolerance") + if self.inputs.strict_fit: + return self.exit_codes.ERROR_BAD_CHARGE_FIT + def should_run_model(self): """ @@ -204,15 +250,22 @@ def compute_model_potential(self): self.report("Computing model potential for scale factor {}".format( scale_factor.value)) + if self.ctx.charge_model == 'fitted': + gaussian_params = self.ctx.fitted_params + peak_charge = self.ctx.peak_charge + else: + gaussian_params = self.inputs.charge_model.fixed.gaussian_params + peak_charge = orm.Float(0.) + inputs = { - 'peak_charge': self.ctx.peak_charge, + 'peak_charge': peak_charge, 'defect_charge': self.inputs.defect_charge, 'scale_factor': scale_factor, 'host_structure': self.inputs.host_structure, 'defect_site': self.inputs.defect_site, 'cutoff': self.inputs.cutoff, 'epsilon': self.inputs.epsilon, - 'gaussian_params' : self.ctx.fitted_params + 'gaussian_params' : gaussian_params } workchain_future = self.submit(ModelPotentialWorkchain, **inputs) label = 'model_potential_scale_factor_{}'.format(scale_factor.value) @@ -259,12 +312,12 @@ def submit_alignment_workchains(self): # Compute the alignment between the defect, in q=0, and the host inputs = { - "density_weighted":{ + "allow_interpolation": orm.Bool(True), + "mae":{ "first_potential": self.inputs.v_defect_q0, "second_potential": self.inputs.v_host, - "charge_density": self.ctx.charge_model + "defect_site": self.inputs.defect_site }, - "allow_interpolation": orm.Bool(True) } workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) @@ -279,12 +332,13 @@ def submit_alignment_workchains(self): # Compute the alignment between the defect DFT difference potential, and the model inputs = { - "density_weighted":{ + + "allow_interpolation": orm.Bool(True), + "mae":{ "first_potential": self.ctx.v_defect_q_q0, "second_potential": v_model, - "charge_density": self.ctx.charge_model + "defect_site": self.inputs.defect_site }, - "allow_interpolation": orm.Bool(True) } workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) label = 'workchain_alignment_dft_to_model' diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index 4dd0616..42f927d 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -11,7 +11,7 @@ from aiida import orm from aiida.engine import WorkChain, calcfunction, while_ -from qe_tools._constants import DEFAULT +from qe_tools import CONSTANTS from .utils import (create_model_structure, get_cell_matrix, get_reciprocal_cell, get_reciprocal_grid, get_charge_model, @@ -25,24 +25,21 @@ class ModelPotentialWorkchain(WorkChain): @classmethod def define(cls, spec): super(ModelPotentialWorkchain, cls).define(spec) - spec.input('peak_charge', - valid_type=orm.Float, - help="Peak charge of the defect charge density distribution") - spec.input("defect_charge", + spec.input("defect_charge", valid_type=orm.Float, help="The target defect charge state") - spec.input('scale_factor', + spec.input('scale_factor', valid_type=orm.Int, help="Scale factor to apply when constructing the model system") - spec.input('host_structure', + spec.input('host_structure', valid_type=orm.StructureData, help="The unscaled host structure") spec.input('defect_site', valid_type=orm.List, help="Defect site position in crystal coordinates") - spec.input('cutoff', - valid_type=orm.Float, - default=orm.Float(40.), + spec.input('cutoff', + valid_type=orm.Float, + default=lambda: orm.Float(40.), help="Energy cutoff for grids in Rydberg") spec.input('epsilon', valid_type=orm.Float, @@ -52,6 +49,10 @@ def define(cls, spec): help="A length 9 list of parameters needed to construct the " "gaussian charge distribution. The format required is " "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + spec.input('peak_charge', + valid_type=orm.Float, + default=lambda: orm.Float(0.0), + help="Peak charge of the defect charge density distribution. If set to zero, no scaling will be done.") spec.outline( cls.setup, @@ -87,8 +88,8 @@ def get_model_structure(self): # Get cell matrices self.ctx.real_cell = get_cell_matrix(self.ctx.model_structure) self.ctx.reciprocal_cell = get_reciprocal_cell(self.ctx.real_cell) -# self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) - limits = np.array(self.ctx.model_structure.cell_lengths) / DEFAULT.bohr_to_ang + self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) + limits = np.array(self.ctx.model_structure.cell_lengths) / CONSTANTS.bohr_to_ang self.ctx.limits = orm.List(list=limits.tolist()) @@ -107,9 +108,12 @@ def compute_model_charge(self): self.ctx.cell_matrix = orm.ArrayData() self.ctx.cell_matrix.set_array('cell_matrix', self.ctx.real_cell) + if self.inputs.peak_charge == 0.0: + peak_charge = None + self.ctx.charge_model = get_charge_model( cell_matrix = self.ctx.cell_matrix, - peak_charge = self.inputs.peak_charge, + peak_charge = peak_charge, defect_charge = self.inputs.defect_charge, dimensions = self.ctx.grid_dimensions, gaussian_params = self.inputs.gaussian_params diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py index fe54745..6bc959a 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py @@ -11,11 +11,9 @@ from scipy.optimize import curve_fit from scipy.stats import multivariate_normal - from aiida import orm from aiida.engine import calcfunction -from qe_tools._constants import DEFAULT - +from qe_tools import CONSTANTS @calcfunction @@ -45,7 +43,7 @@ def get_cell_matrix(structure): 3x3 cell matrix array in units of Bohr """ - cell_matrix = np.array(structure.cell) / DEFAULT.bohr_to_ang # Angstrom to Bohr + cell_matrix = np.array(structure.cell) / CONSTANTS.bohr_to_ang # Angstrom to Bohr return cell_matrix @@ -100,7 +98,7 @@ def get_reciprocal_grid(cell_matrix, cutoff): if grid_max[axis] % 2 == 0: grid_max[axis] += 1 - return orm.List(list=grid_max.tolist()) + return orm.List(list=grid_max.tolist()) def get_xyz_coords(cell_matrix, dimensions): @@ -122,7 +120,7 @@ def get_xyz_coords(cell_matrix, dimensions): return xyz_array -def generate_charge_model(cell_matrix, peak_charge): +def generate_charge_model(cell_matrix, peak_charge=None): """ Return a function to compute a periodic gaussian on a grid. The returned function can be used for fitting. @@ -138,49 +136,49 @@ def generate_charge_model(cell_matrix, peak_charge): Returns ------- compute_charge - A function that will compute a periodic gaussian on a grid + A function that will compute a periodic gaussian on a grid for a given cell and peak charge intensity """ def compute_charge( xyz_real, - x0, y0, z0, + x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz): """ - For a given system charge, create a model charge distribution using + For a given system charge, create a model charge distribution using an anisotropic periodic 3D gaussian. The charge model for now is a Gaussian. - NOTE: - The values for sigma and cov are not the values used in construction - of the Gaussian. After the covariance matrix is constructed, its - transpose is multiplied by itself (that is to construct a Gram matrix) - to ensure that it is positive-semidefinite. It is this matrix which is - the real covariance matrix. This transformation is to allow this - function to be used directly by the fitting algorithm without a danger - of crashing. + NOTE: + The values for sigma and cov are not the values used in construction + of the Gaussian. After the covariance matrix is constructed, its + transpose is multiplied by itself (that is to construct a Gram matrix) + to ensure that it is positive-semidefinite. It is this matrix which is + the real covariance matrix. This transformation is to allow this + function to be used directly by the fitting algorithm without a danger + of crashing. Parameters ---------- - xyz_real: 3xN array + xyz_real: 3xN array Coordinates to compute the Gaussian for in cartesian coordinates. x0, y0, z0: float Center of the Gaussian in crystal coordinates. sigma_x, sigma_y, sigma_z: float Spread of the Gaussian (not the real values used, see note above). cov_xy, cov_xz, cov_yz: float - Covariance values controlling the rotation of the Gaussian + Covariance values controlling the rotation of the Gaussian (not the real values used, see note above). Returns ------- g - Values of the Gaussian computed at all of the desired coordinates and + Values of the Gaussian computed at all of the desired coordinates and scaled by the value of charge_integral. """ - + # Construct the pseudo-covariance matrix V = np.array([[sigma_x, cov_xy, cov_xz],[cov_xy, sigma_y, cov_yz], [cov_xz, cov_yz, sigma_z]]) # Construct the actual covariance matrix in a way that is always positive semi-definite @@ -196,7 +194,7 @@ def compute_charge( # Compute the periodic origin in crystal coordinates origin_crystal = (gauss_position + np.array([ii, jj, kk])).reshape(3,1) # Convert this to cartesian coordinates - origin_real = np.dot(cell_matrix.T, origin_crystal) + origin_real = np.dot(cell_matrix.T, origin_crystal) # Compute the Gaussian centred at this position g = g + get_gaussian_3d(xyz_real.T, origin_real, covar) @@ -204,7 +202,8 @@ def compute_charge( print("DEBUG: g.max() = {}".format(g.max())) # Scale the result to match the peak charge density - g = g * (peak_charge / g.max()) + if peak_charge: + g = g * (peak_charge / g.max()) print("DEBUG: Peak Charge target = {}".format(peak_charge)) print("DEBUG: Peak Charge scaled = {}".format(g.max())) print("DEBUG: Integrated charge density (scaled) = {}".format(get_integral(g, cell_matrix))) @@ -215,7 +214,7 @@ def compute_charge( @calcfunction -def get_charge_model(cell_matrix, peak_charge, defect_charge, dimensions, gaussian_params): +def get_charge_model(cell_matrix, defect_charge, dimensions, gaussian_params, peak_charge=None): """ For a given system charge, create a model charge distribution. @@ -239,9 +238,10 @@ def get_charge_model(cell_matrix, peak_charge, defect_charge, dimensions, gaussi The grid with the charge data as an AiiDA ArrayData object """ - + cell_matrix = cell_matrix.get_array('cell_matrix') - peak_charge = peak_charge.value + if peak_charge: + peak_charge = peak_charge.value defect_charge = defect_charge.value dimensions = np.array(dimensions) gaussian_params = gaussian_params.get_list() @@ -260,11 +260,11 @@ def get_charge_model(cell_matrix, peak_charge, defect_charge, dimensions, gaussi print("DEBUG: Integrated charge density target = {}".format(defect_charge)) g = g * (defect_charge / get_integral(g, cell_matrix)) print("DEBUG: Integrated charge density (scaled) = {}".format(get_integral(g, cell_matrix))) - + # Compensating jellium background g = g - np.sum(g)/np.prod(g.shape) print("DEBUG: Integrated charge density (jellium) = {}".format(get_integral(g, cell_matrix))) - + # Pack the array model_charge_array = orm.ArrayData() model_charge_array.set_array('model_charge', g) @@ -351,9 +351,9 @@ def get_gaussian_3d(grid, origin, covar): Array on which to compute gaussian origin: array Centre of gaussian - covar: 3x3 array + covar: 3x3 array Covariance matrix of gaussian - + Returns ------- gaussian @@ -441,8 +441,8 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): dimensions = dimensions // 2 #floor division ijk_array = np.mgrid[ - -dimensions[0]:dimensions[0] + 1, - -dimensions[1]:dimensions[1] + 1, + -dimensions[0]:dimensions[0] + 1, + -dimensions[1]:dimensions[1] + 1, -dimensions[2]:dimensions[2] + 1].T # Get G vectors @@ -462,7 +462,7 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): V_model_g[dimensions[0] + 1, dimensions[1] + 1, dimensions[2] + 1] = 0.0 # Get the model potential in real space - V_model_r = get_inverse_fft(V_model_g) + V_model_r = get_inverse_fft(V_model_g) * CONSTANTS.hartree_to_ev # Pack up the array V_model_array = orm.ArrayData() @@ -480,6 +480,6 @@ def get_energy(potential, charge_density, cell_matrix): potential = potential.get_array('model_potential') charge_density = charge_density.get_array('model_charge') - energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix) * DEFAULT.hartree_to_ev) + energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix)) return orm.Float(energy) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index 315a42d..cfb0779 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -11,8 +11,6 @@ from aiida import orm from aiida.engine import calcfunction -#from qe_tools.constants import bohr_to_ang - """ Utility functions for the gaussian countercharge workchain """ @@ -97,7 +95,7 @@ def fit_energies(dimensions_dict, energies_dict): AiiDA dictionary of the form: structure : energy """ - from scipy.optimize import curve_fit + from scipy.optimize import curve_fit def fitting_func(x, a, b, c): """ @@ -189,12 +187,12 @@ def get_charge_model_fit(rho_host, rho_defect_q, host_structure): rho_defect_q_data = rho_defect_q.get_array(rho_defect_q.get_arraynames()[0]) rho_host_data = rho_host.get_array(rho_host.get_arraynames()[0]) - # Charge density from QE is in e/cubic-bohr, so convert if necessary + # Charge density from QE is in e/cubic-bohr, so convert if necessary # TODO: Check if the CUBE file format is strictly Bohr or if this is a QE thing - #rho_diff = (rho_host_data - rho_defect_q_data)/(bohr_to_ang**3) - rho_diff = rho_host_data - rho_defect_q_data + #rho_diff = (rho_host_data - rho_defect_q_data)/(bohr_to_ang**3) + rho_diff = rho_host_data - rho_defect_q_data - # Detect the centre of the charge in the data + # Detect the centre of the charge in the data max_pos_mat = np.array(np.unravel_index(rho_diff.argmax(), rho_diff.shape)) # matrix coords max_pos_ijk = (max_pos_mat*1.)/(np.array(rho_diff.shape)-1) # Compute crystal coords max_i = max_pos_ijk[0] diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 89e14f7..5e6d0c9 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -69,17 +69,46 @@ def define(cls, spec): # Chemical potential spec.input('run_chem_pot_wc', valid_type=orm.Bool, default=lambda: orm.Bool(True)) - spec.input('formation_energy_dict', valid_type=orm.Dict) - spec.input('compound', valid_type=orm.Str) - spec.input('dependent_element', valid_type=orm.Str) - spec.input("ref_energy", valid_type=orm.Dict, help="The reference chemical potential of elements in the structure") + spec.input('formation_energy_dict', required=False, valid_type=orm.Dict) + spec.input('compound', required=False, valid_type=orm.Str) + spec.input('dependent_element', required=False, valid_type=orm.Str) + spec.input("dopant_elements", valid_type=orm.List, default=lambda: orm.List(list=[])) + spec.input("ref_energy", valid_type=orm.Dict, required=False, help="The reference chemical potential of elements in the structure") spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) spec.input( "chemical_potential", valid_type=orm.Dict, required=False, help="The chemical potential of the given defect type. The convention is that removing an atom is positive") - spec.input('sigma', valid_type=orm.Float, required=False) + # Input for correction workchain + # Charge Model Settings + spec.input_namespace('charge_model', + help="Namespace for settings related to different charge models") + spec.input("charge_model.model_type", + valid_type=orm.Str, + help="Charge model type: 'fixed' or 'fitted'", + default=lambda: orm.Str('fixed')) + # Fixed + spec.input_namespace('charge_model.fixed', required=False, populate_defaults=False, + help="Inputs for a fixed charge model using a user-specified multivariate gaussian") + spec.input("charge_model.fixed.gaussian_params", + valid_type=orm.List, + help="A length 9 list of parameters needed to construct the " + "gaussian charge distribution. The format required is " + "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + # Fitted + spec.input_namespace('charge_model.fitted', required=False, populate_defaults=False, + help="Inputs for a fitted charge model using a multivariate anisotropic gaussian.") + spec.input("charge_model.fitted.tolerance", + valid_type=orm.Float, + help="Permissable error for any fitted charge model parameter.", + default=lambda: orm.Float(1.0e-3)) + spec.input("charge_model.fitted.strict_fit", + valid_type=orm.Bool, + help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", + default=lambda: orm.Bool(True)) +# spec.input('sigma', valid_type=orm.Float, required=False) + spec.input("cutoff", valid_type=orm.Float) spec.input("run_dfpt", valid_type=orm.Bool) @@ -89,7 +118,6 @@ def define(cls, spec): valid_type=orm.Str, help="The correction scheme to apply", ) - spec.input("cutoff", valid_type=orm.Float) # Outputs @@ -195,16 +223,23 @@ def run_gaussian_correction_workchain(self): "v_host": self.ctx.v_host, "v_defect_q0": self.ctx.v_defect_q0, "v_defect_q": self.ctx.v_defect_q, - #"rho_host": self.ctx.rho_host, - #"rho_host": self.ctx.rho_defect_q0, - #"rho_defect_q": self.ctx.rho_defect_q, + "rho_host": self.ctx.rho_host, + "rho_defect_q": self.ctx.rho_defect_q, "defect_charge": self.inputs.defect_charge, "defect_site": self.inputs.defect_site, "host_structure": self.inputs.host_structure, "epsilon": self.ctx.epsilon, - "sigma" : self.inputs.sigma, "cutoff" : self.inputs.cutoff, + 'charge_model': { + 'model_type': self.inputs.charge_model.model_type + } + } + if self.inputs.charge_model.model_type.value == 'fixed': + inputs['charge_model']['fixed'] = {'gaussian_params': self.inputs.charge_model.fixed.gaussian_params} + else: + inputs['charge_model']['fitted'] = {'tolerance': self.inputs.charge_model.fitted.tolerance, + 'strict_fit': self.inputs.charge_model.fitted.strict_fit} workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) label = "correction_workchain" @@ -266,6 +301,7 @@ def run_chemical_potential_workchain(self): "formation_energy_dict": self.inputs.formation_energy_dict, "compound": self.inputs.compound, "dependent_element": self.inputs.dependent_element, + "dopant_elements": self.inputs.dopant_elements, "ref_energy": self.inputs.ref_energy, "tolerance": self.inputs.tolerance, } diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 7be66b4..5902b76 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -61,9 +61,9 @@ def define(cls, spec): spec.input('v_host_node', valid_type=orm.Int, required=False) spec.input('v_defect_q0_node', valid_type=orm.Int, required=False) spec.input('v_defect_q_node', valid_type=orm.Int, required=False) -# spec.input('rho_host_node', valid_type=orm.Int, required=False) -# spec.input('rho_defect_q0_node', valid_type=orm.Int, required=False) -# spec.input('rho_defect_q_node', valid_type=orm.Int, required=False) + spec.input('rho_host_node', valid_type=orm.Int, required=False) + spec.input('rho_defect_q0_node', valid_type=orm.Int, required=False) + spec.input('rho_defect_q_node', valid_type=orm.Int, required=False) spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) # DFT inputs (PW.x) diff --git a/aiida_defects/formation_energy/potential_alignment/mae/mae.py b/aiida_defects/formation_energy/potential_alignment/mae/mae.py new file mode 100644 index 0000000..1a6866a --- /dev/null +++ b/aiida_defects/formation_energy/potential_alignment/mae/mae.py @@ -0,0 +1,99 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida import orm +from aiida.engine import WorkChain, calcfunction + +from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference +from .utils import get_alignment, AllValuesMaskedError + + +class MaeAlignmentWorkchain(WorkChain): + """ + Compute the alignment needed between two electrostatic potentials. + Data points are included or excluded based on their distance from the defect site. + The largest possible sphere + + The root mean squared difference between two potentials is computed using: + \begin{equation} + x = \int \left| ( V_2 - V_1 + \Delta z ) \right| + \end{equation} + where: + * V_1 and V_2 are the potentials to align + * \Delta_z is the required alignment + + """ + + @classmethod + def define(cls, spec): + super(MaeAlignmentWorkchain, cls).define(spec) + spec.input('first_potential', + valid_type=orm.ArrayData, + help="The first electrostatic potential array") + spec.input('second_potential', + valid_type=orm.ArrayData, + help="The second electrostatic potential array") + spec.input("defect_site", + valid_type=orm.List, + help="Defect site position in crystal coordinates.") + + spec.outline( + cls.setup, + cls.compute_difference, + cls.calculate_alignment, + cls.results, + ) + spec.output('alignment_required', + valid_type=orm.Float, + required=True, + help="The computed potential alignment required") + spec.output('potential_difference', + valid_type=orm.ArrayData, + required=True, + help="The unmasked difference in electrostatic potentials") + + # Exit codes + spec.exit_code(301, 'ERROR_ALL_VALUES_MASKED', + message='All values in the potential difference array were masked. ' + 'Try increasing the tolerance to include fewer elements from the charge density array.') + + + def setup(self): + pass + + + def compute_difference(self): + """ + Compute the difference of the two potentials + """ + self.ctx.potential_difference = get_potential_difference( + first_potential = self.inputs.first_potential, + second_potential = self.inputs.second_potential + ) + + + def calculate_alignment(self): + """ + Compute the alignment + """ + try: + self.ctx.alignment = get_alignment( + potential_difference = self.ctx.potential_difference, + defect_site= self.inputs.defect_site + ) + except AllValuesMaskedError: + return self.exit_codes.ERROR_ALL_VALUES_MASKED + + + def results(self): + """ + Pack the results + """ + self.out('alignment_required', self.ctx.alignment) + self.out('potential_difference', self.ctx.potential_difference) \ No newline at end of file diff --git a/aiida_defects/formation_energy/potential_alignment/mae/utils.py b/aiida_defects/formation_energy/potential_alignment/mae/utils.py new file mode 100644 index 0000000..9a0a5f8 --- /dev/null +++ b/aiida_defects/formation_energy/potential_alignment/mae/utils.py @@ -0,0 +1,92 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +import numpy as np + +from aiida.engine import calcfunction +from aiida import orm + +from aiida_defects.utils import get_cell_matrix, get_grid + +""" +Utility functions for the potential alignment workchain +""" + +class AllValuesMaskedError(ValueError): + """ + Error raised when no values are left after the masking procedure. + If one proceeds to compute averages using an array in which all values + are masked, the resulting object is an instance of 'numpy.ma.core.MaskedConstant' + which cannot be stored by AiiDA and is, in any case, meaningless. + """ + pass + +@calcfunction +def get_alignment(potential_difference, defect_site, cutoff_radius=lambda: orm.Float(0.5)): + """ + Compute the mean-absolute error potential alignment + + Parameters + ---------- + potential_difference - numpy array + The difference in the electrostatic potentials to be aligned + defect_site - length 3 list, tuple or array + defect postion in crystal coordinates + cutoff_radius - float + distance cutoff from defect site in crystal coordinates. Coordinates + less than this distance are considered to be influenced by the defect + and are excluded from the alignment + """ + # Unpack ArrayData object + v_diff = potential_difference.get_array( + potential_difference.get_arraynames()[0]) + + # Generate a crystal grid of the same dimension as the data + ijk_array = get_grid(v_diff.shape, endpoint=False) + # Compute the distance from the defect site to every other. + distance_vectors = np.array(defect_site).reshape(3,1) - ijk_array + # Apply minimum image + min_image_vectors = (distance_vectors - np.rint(distance_vectors)) + # Compute distances and reshape to match input data + distances = np.linalg.norm(min_image_vectors, axis=0).reshape(v_diff.shape) + + # In crystal coordinates, the maximum separation between interacting + # images is d=1 so look for coordinates at a distance of less than d=0.5. + # These are the coordinates within the shphere of interaction of the defect. + # Mask these and only compute the alignment the remaining, most distance points. + mask = np.ma.less(distances, cutoff_radius) + v_diff_masked = np.ma.masked_array(v_diff, mask=mask) + values_remaining = (v_diff_masked.count()/np.prod(v_diff.shape))*100.0 + print('{:.2f}% of values remain'.format(values_remaining)) + + # Check if any values are left after masking + if v_diff_masked.count() == 0: + raise AllValuesMaskedError + + fit_result = fit_potential(v_diff_masked) + alignment = fit_result.x + + return orm.Float(alignment) + + +def fit_potential(v_diff): + """ + Find the offset between two potentials, delta_z, that minimises the summed absolute error. + """ + from scipy.optimize import minimize + + def obj(delta_z): + """ + Objective function. Delta_z is the alignment of potentials + """ + return np.sum(np.abs(v_diff-delta_z)) + + initial_guess = 1.0 + result = minimize(obj, initial_guess) + return result diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 2a2d8cf..d52a186 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -12,17 +12,18 @@ from aiida import orm from aiida.common import AttributeDict from aiida.engine import WorkChain, calcfunction, if_ -#from qe_tools.constants import hartree_to_ev -from qe_tools._constants import DEFAULT +from qe_tools import CONSTANTS from .utils import get_interpolation from .lany_zunger.lany_zunger import LanyZungerAlignmentWorkchain from .density_weighted.density_weighted import DensityWeightedAlignmentWorkchain +from .mae.mae import MaeAlignmentWorkchain valid_schemes = { 'lany_zunger' : LanyZungerAlignmentWorkchain, - 'density_weighted': DensityWeightedAlignmentWorkchain + 'density_weighted': DensityWeightedAlignmentWorkchain, + 'mae': MaeAlignmentWorkchain } class PotentialAlignmentWorkchain(WorkChain): @@ -40,6 +41,9 @@ def define(cls, spec): spec.expose_inputs(DensityWeightedAlignmentWorkchain, namespace='density_weighted', namespace_options={'required': False, 'populate_defaults': False}) + spec.expose_inputs(MaeAlignmentWorkchain, + namespace='mae', + namespace_options={'required': False, 'populate_defaults': False}) spec.expose_inputs(LanyZungerAlignmentWorkchain, namespace='lany_zunger', namespace_options={'required': False, 'populate_defaults': False}) @@ -91,7 +95,6 @@ def setup(self): else: return self.exit_codes.ERROR_INPUT_BAD_SCHEME - # Collect the inputs from the selected scheme inputs = AttributeDict( self.exposed_inputs(valid_schemes[self.ctx.alignment_scheme], @@ -176,7 +179,9 @@ def do_interpolation(self): interpolated_arrays[array_name] = get_interpolation( input_array=array, target_shape=target_shape) - self.ctx.interpolated_arrays = interpolated_arrays + # Replace input arrays with interpolated versions + for array_name, array in interpolated_arrays.items(): + self.ctx.inputs[array_name] = array return @@ -189,10 +194,6 @@ def calculate_alignment(self): inputs = self.ctx.inputs - # Replace input arrays with interpolated versions - for array_name, array in self.ctx.interpolated_arrays.items(): - inputs[array_name] = array - workchain_future = self.submit(alignment_workchain, **inputs) self.to_context(**{'alignment_wc': workchain_future}) @@ -220,6 +221,5 @@ def results(self): Collect results """ self.report( - "Completed alignment. An alignment of {} eV is required".format( - self.ctx.alignment.value * DEFAULT.hartree_to_ev/2.0 )) + "Completed alignment. An alignment of {} eV is required".format(self.ctx.alignment)) self.out('alignment_required', self.ctx.alignment) diff --git a/aiida_defects/utils.py b/aiida_defects/utils.py new file mode 100644 index 0000000..9a73314 --- /dev/null +++ b/aiida_defects/utils.py @@ -0,0 +1,108 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +import numpy as np + +from qe_tools import CONSTANTS + +# This a collection of common, generic methods for common tasks + +def get_cell_matrix(structure): + """ + Get the cell matrix (in bohr) from an AiiDA StructureData object + + Parameters + ---------- + structure: AiiDA StructureData + The structure object of interest + + Returns + ------- + cell_matrix + 3x3 cell matrix array in units of Bohr + + """ + cell_matrix = np.array(structure.cell) / CONSTANTS.bohr_to_ang # Angstrom to Bohr + return cell_matrix + + +def get_reciprocal_cell(cell_matrix): + """ + For a given cell_matrix, compute the reciprocal cell matrix + + Parameters + ---------- + cell_matrix: 3x3 array + Cell matrix of the real space cell + + Returns + ------- + reciprocal_cell + 3x3 cell matrix array in reciprocal units + """ + from numpy.linalg import inv + reciprocal_cell = (2 * np.pi * inv(cell_matrix)).transpose() # Alternative definition (2pi) + + return reciprocal_cell + +def calc_pair_distance_xyz(cellmat,ri,rj): + """" + Calculate the distance between two atoms accross periodic boundary conditions + starting from cartesian coords. + Uses the general algorithm for the minimum image (Appendix B - Eq 9.) from: + M. E. Tuckerman. Statistical Mechanics: Theory and Molecular Simulation. + Oxford University Press, Oxford, UK, 2010. + + Parameters + ---------- + cellmat_inv - 3x3 matrix + The inverse of the 3x3 matrix describing the simulation cell + ri,rj - 3x1 vector + numpy vectors describing the position of atoms i and j + + Returns + --------- + dist - float + The distance between the atoms i and j, according the minimum image + convention. + + """ + si=np.dot(cellmat_inv,ri) + sj=np.dot(cellmat_inv,rj) + sij=si-sj + sij=sij-np.rint(sij) + rij=np.dot(cellmat,sij) + + # Get the magnitude of the vector + dist=np.sqrt(np.dot(rij,rij)) + + return dist + +def get_grid(dimensions, endpoint=True): + """ + Generate an array of coordinates + """ + # Generate a grid of coordinates + i = np.linspace(0., 1., dimensions[0], endpoint) + j = np.linspace(0., 1., dimensions[1], endpoint) + k = np.linspace(0., 1., dimensions[2], endpoint) + # Generate NxN arrays of coords + iii, jjj, kkk = np.meshgrid(i, j, k, indexing='ij') + # Flatten this to a 3xNN array + ijk_array = np.array([iii.ravel(), jjj.ravel(), kkk.ravel()]) + + return ijk_array + +def get_xyz_coords(cell_matrix, dimensions): + """ + For a given array, generate an array of xyz coordinates in the cartesian basis + """ + ijk_array = get_grid(dimensions) + # Change the crystal basis to a cartesian basis + xyz_array = np.dot(cell_matrix.T, ijk_array) + + return xyz_array \ No newline at end of file From 7f525fd8f9a97000ebc431d5e948de01694a79a7 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Fri, 19 Feb 2021 15:13:01 +0100 Subject: [PATCH 40/60] If the gaussian charge model is isotropic, the isolated energy will be computed analytically. --- .../gaussian_countercharge.py | 45 ++++++++++++------- .../model_potential/model_potential.py | 4 +- 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 5723d27..a5f4edc 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -14,7 +14,8 @@ from .model_potential.model_potential import ModelPotentialWorkchain from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference from .utils import get_total_correction, get_total_alignment, get_charge_model_fit, fit_energies, calc_correction - +from qe_tools import CONSTANTS +import numpy as np class GaussianCounterChargeWorkchain(WorkChain): """ @@ -107,6 +108,7 @@ def define(cls, spec): cls.get_model_corrections, cls.compute_correction, ) + spec.output('gaussian_parameters', valid_type=orm.Dict, required=False) spec.output('v_dft_difference', valid_type=orm.ArrayData) spec.output('alignment_q0_to_host', valid_type=orm.Float) spec.output('alignment_dft_to_model', valid_type=orm.Float) @@ -150,7 +152,7 @@ def setup(self): ## Verification # Minimum number of iterations required. # TODO: Replace this with an input ports validator - if self.inputs.model_iterations_required < 3: + if self.inputs.charge_model.model_type == 'fitted' and self.inputs.model_iterations_required < 3: self.report('The requested number of iterations, {}, is too low. At least 3 are required to achieve an adequate data fit'.format(self.inputs.model_iterations_required.value)) return self.exit_codes.ERROR_BAD_INPUT_ITERATIONS_REQUIRED @@ -168,6 +170,7 @@ def setup(self): elif 'fixed' in self.inputs.charge_model: #Wanted fitted, but gave fixed params return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS elif self.ctx.charge_model == 'fixed': + self.inputs.model_iterations_required = orm.Int(1) if 'fixed' not in self.inputs.charge_model: #Wanted fixed, but no params given return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS elif 'fitted' in self.inputs.charge_model: #Wanted fixed, but gave fitted params @@ -224,9 +227,11 @@ def fit_charge_model(self): self.ctx.fitted_params = orm.List(list=fit['fit']) self.ctx.peak_charge = orm.Float(fit['peak_charge']) + self.out('gaussian_parameters', fit) + self.report('DEBUG: the gaussian parameters obtained from fitting are: {}'.format(fit['fit'])) for parameter in fit['error']: - if parameter > self.inputs.charge_fit_tolerance: + if parameter > self.inputs.charge_model.fitted.tolerance: self.logger.warning("Charge fitting parameter worse than allowed tolerance") if self.inputs.strict_fit: return self.exit_codes.ERROR_BAD_CHARGE_FIT @@ -284,7 +289,7 @@ def check_model_potential_workchains(self): if not model_workchain.is_finished_ok: self.report( 'Model potential workchain for scale factor {} failed with status {}' - .format(model_workchain.scale_factor, + .format(scale_factor, model_workchain.exit_status)) return self.exit_codes.ERROR_SUB_PROCESS_FAILED_MODEL_POTENTIAL else: @@ -376,20 +381,30 @@ def get_isolated_energy(self): """ Fit the calculated model energies and obtain an estimate for the isolated model energy """ + + if self.inputs.charge_model.model_type == 'fitted': + # Get the linear dimensions of the structures + linear_dimensions = {} - # Get the linear dimensions of the structures - linear_dimensions = {} + for scale, structure in self.ctx.model_structures.items(): + volume = structure.get_cell_volume() + linear_dimensions[scale] = 1 / (volume**(1 / 3.)) - for scale, structure in self.ctx.model_structures.items(): - volume = structure.get_cell_volume() - linear_dimensions[scale] = 1 / (volume**(1 / 3.)) + self.report( + "Fitting the model energies to obtain the model energy for the isolated case" + ) + self.ctx.isolated_energy = fit_energies( + orm.Dict(dict=linear_dimensions), + orm.Dict(dict=self.ctx.model_energies)) + else: + sigma = self.inputs.charge_model.fixed.gaussian_params.get_list()[3] + defect_charge = self.inputs.defect_charge.value + epsilon = self.inputs.epsilon.value + self.report( + "Computing the energy of the isolated gaussian analytically" + ) + self.ctx.isolated_energy = orm.Float(defect_charge**2/(2*epsilon*sigma*np.sqrt(np.pi))*CONSTANTS.hartree_to_ev) - self.report( - "Fitting the model energies to obtain the model energy for the isolated case" - ) - self.ctx.isolated_energy = fit_energies( - orm.Dict(dict=linear_dimensions), - orm.Dict(dict=self.ctx.model_energies)) self.report("The isolated model energy is {} eV".format( self.ctx.isolated_energy.value)) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index 42f927d..e85196b 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -88,7 +88,7 @@ def get_model_structure(self): # Get cell matrices self.ctx.real_cell = get_cell_matrix(self.ctx.model_structure) self.ctx.reciprocal_cell = get_reciprocal_cell(self.ctx.real_cell) - self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) +# self.report("DEBUG: recip cell: {}".format(self.ctx.reciprocal_cell)) limits = np.array(self.ctx.model_structure.cell_lengths) / CONSTANTS.bohr_to_ang self.ctx.limits = orm.List(list=limits.tolist()) @@ -110,6 +110,8 @@ def compute_model_charge(self): if self.inputs.peak_charge == 0.0: peak_charge = None + else: + peak_charge = self.inputs.peak_charge self.ctx.charge_model = get_charge_model( cell_matrix = self.ctx.cell_matrix, From 9a290b3480272e98d0bd981ebcc549439cfa83af Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 22 Feb 2021 18:20:16 +0100 Subject: [PATCH 41/60] Check if gaussian is isotropic --- aiida_defects/formation_energy/Test.py | 107 --- .../gaussian_countercharge.py | 25 +- .../gaussian_countercharge/utils.py | 7 + .../formation_energy/defect_chemistry_base.py | 397 --------- .../formation_energy/defect_chemistry_qe.py | 763 ------------------ 5 files changed, 26 insertions(+), 1273 deletions(-) delete mode 100644 aiida_defects/formation_energy/Test.py delete mode 100644 aiida_defects/formation_energy/defect_chemistry_base.py delete mode 100644 aiida_defects/formation_energy/defect_chemistry_qe.py diff --git a/aiida_defects/formation_energy/Test.py b/aiida_defects/formation_energy/Test.py deleted file mode 100644 index 3c49f77..0000000 --- a/aiida_defects/formation_energy/Test.py +++ /dev/null @@ -1,107 +0,0 @@ -import json -import numpy as np -import re -from pymatgen.core.structure import Structure -from pymatgen.core.composition import Composition -from aiida.engine import submit -from aiida.orm import StructureData -from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData, XyData, StructureData -from aiida_defects.formation_energy.utils import get_vbm -from aiida_defects.formation_energy.fermi_level.fermi_level import FermiLevelWorkchain -#from aiida_defects.formation_energy.fermi_level.utils import compute_net_charge - -with open('/home/sokseiham/Documents/Defect_calculations/Li7PS6/defect_dict.json') as f: - defect_dict = json.load(f) - dos = np.array(defect_dict['DOS']) - host_structure = Structure.from_dict(defect_dict['unitcell']) - defect_data = defect_dict['defect_data'] - band_gap = defect_dict['band_gap'] - Ef = defect_dict['Ef'] - -# While save in json, floats in the dict key were converted into strings. We need to convert those keys back to float. -for key in defect_data: - key_list = list(defect_data[key]['charge'].keys()) - for chg in key_list: - defect_data[key]['charge'][float(chg)] = defect_data[key]['charge'].pop(chg) - -# site = {'S_1': 1, 'S_2': 2, 'S_3': 1, 'S_oct': 1, 'S_tet': 1, 'Li_1': 2, 'Li_2': 1, 'Li_3': 2, 'Li_4': 2} -# for key in defect_data: -# # print(defect_data[key]['N_site']) -# for defect in site.keys(): -# if defect in key: -# defect_data[key]['N_site'] = site[defect] -# break - -temp = {} -aliovalent = 'Br' -for defect in defect_data: - split = re.split('_|-', defect) - if '-' in defect: - # if split[0] == aliovalent: - # temp[defect] = defect_data[defect] - pass - else: - # if split[0] == 'V': - temp[defect] = defect_data[defect] -defect_data = temp -#print(defect_data) - -compound = 'Li7PS6' -dependent_element = 'P' -temperature = 300.0 -# dopant = None - -dos_node = load_node(48514) -unitcell_node = load_node(48495) -vbm = get_vbm(unitcell_node) -Dos = dos_node.outputs.output_dos -dos_x = Dos.get_x()[1] - vbm -dos_y = Dos.get_y()[1][1] -chem_potentials = {'Li': -1.923-195.514, 'P':-191.038, 'S':-0.835-326.678} -#chem_potentials = {'Li': -1.923-195.514*np.ones(3), 'P':-191.038*np.ones(3), 'S':-0.835-326.678*np.ones(3)} -#chem_potentials = {'Li': -1.923-195.514*np.ones((3,3)), 'P':-191.038*np.ones((3,3)), 'S':-0.835-326.678*np.ones((3,3))} -#print(chem_potentials) -input_chem_shape = np.ones_like(chem_potentials['Li']) - -#f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, host_structure, dos_x, dos_y, band_gap, dopant=None) -#print(f(0.2*input_chem_shape)) - -inputs = { - "defect_data": Dict(dict=defect_data), - "chem_potentials": Dict(dict=chem_potentials), - "temperature": Float(temperature), - "valence_band_maximum": Float(vbm), - "number_of_electrons": Float(unitcell_node.res.number_of_electrons), - "unitcell": StructureData(pymatgen=host_structure), - "DOS": Dos, - "band_gap": Float(band_gap), - "dopant": Dict(dict={'X_1':{'c': 1E18, 'q':-1}}) - } -#print(inputs["defect_data"].get_dict()) -#defect_data = inputs["defect_data"].get_dict() -#E_Fermi = 0.0 -#E_defect_formation = {} -#for defect in defect_data.keys(): -# temp = defect_data[defect] -# Ef = {} -# for chg in temp['charge'].keys(): -# E_formation = temp['charge'][chg]['E']-temp['E_host']+chg*(E_Fermi+temp['vbm'])+temp['charge'][chg]['E_corr'] -# for spc in temp['species'].keys(): -# E_formation -= temp['species'][spc]*chem_potentials[spc] -# Ef[chg] = E_formation -# E_defect_formation[defect] = Ef -#print(E_defect_formation) - -#defect_data = inputs["defect_data"].get_dict() -#chem_potentials = inputs["chem_potentials"].get_dict() -#temperature = inputs["temperature"].value -#unitcell = inputs["unitcell"].get_pymatgen_structure() -#dos_x = dos_x.get_array('data') -#dos_y = dos_y.get_array('data') -#band_gap = inputs["band_gap"].value - -#f = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, dos_x, dos_y, band_gap, dopant=None) -#print(f(0.2*input_chem_shape)) - -workchain_future = submit(FermiLevelWorkchain, **inputs) -print('Submitted workchain with PK=' + str(workchain_future.pk)) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index a5f4edc..9a534d0 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -13,7 +13,7 @@ from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain from .model_potential.model_potential import ModelPotentialWorkchain from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference -from .utils import get_total_correction, get_total_alignment, get_charge_model_fit, fit_energies, calc_correction +from .utils import get_total_correction, get_total_alignment, get_charge_model_fit, fit_energies, calc_correction, is_gaussian_isotrope from qe_tools import CONSTANTS import numpy as np @@ -101,10 +101,11 @@ def define(cls, spec): cls.compute_model_potential, ), cls.check_model_potential_workchains, + cls.get_isolated_energy, cls.compute_dft_difference_potential, cls.submit_alignment_workchains, cls.check_alignment_workchains, - cls.get_isolated_energy, + #cls.get_isolated_energy, cls.get_model_corrections, cls.compute_correction, ) @@ -170,7 +171,12 @@ def setup(self): elif 'fixed' in self.inputs.charge_model: #Wanted fitted, but gave fixed params return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS elif self.ctx.charge_model == 'fixed': - self.inputs.model_iterations_required = orm.Int(1) + # check if the gaussian parameters correspond to an isotropic gaussian + if is_gaussian_isotrope(self.inputs.charge_model.fixed.gaussian_params.get_list()[3:]): + self.report('DEBUG: the given gaussian parameters correspond to isotropic gaussian') + self.inputs.model_iterations_required = orm.Int(1) + self.ctx.is_gaussian_isotrope = True + self.ctx.sigma = np.mean(self.inputs.charge_model.fixed.gaussian_params.get_list()[3:6]) if 'fixed' not in self.inputs.charge_model: #Wanted fixed, but no params given return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS elif 'fitted' in self.inputs.charge_model: #Wanted fixed, but gave fitted params @@ -235,7 +241,14 @@ def fit_charge_model(self): self.logger.warning("Charge fitting parameter worse than allowed tolerance") if self.inputs.strict_fit: return self.exit_codes.ERROR_BAD_CHARGE_FIT - + + if is_gaussian_isotrope(self.ctx.fitted_params.get_list()[3:]): + self.report('The fitted gaussian is isotropic. The isolated model energy will be computed analytically') + self.inputs.model_iterations_required = orm.Int(1) + self.ctx.is_gaussian_isotrope = True + self.ctx.sigma = np.mean(self.ctx.fitted_params.get_list()[3:6]) + else: + self.ctx.is_gaussian_isotrope = False def should_run_model(self): """ @@ -382,7 +395,7 @@ def get_isolated_energy(self): Fit the calculated model energies and obtain an estimate for the isolated model energy """ - if self.inputs.charge_model.model_type == 'fitted': + if not self.ctx.is_gaussian_isotrope: # Get the linear dimensions of the structures linear_dimensions = {} @@ -397,7 +410,7 @@ def get_isolated_energy(self): orm.Dict(dict=linear_dimensions), orm.Dict(dict=self.ctx.model_energies)) else: - sigma = self.inputs.charge_model.fixed.gaussian_params.get_list()[3] + sigma = self.ctx.sigma defect_charge = self.inputs.defect_charge.value epsilon = self.inputs.epsilon.value self.report( diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index cfb0779..068ca84 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -15,6 +15,13 @@ Utility functions for the gaussian countercharge workchain """ +def is_gaussian_isotrope(gaussian_params): + eps = 0.01 + average_sigma = np.mean(gaussian_params[:3]) + #check if the off-diagonal elements sigma_xy, sigma_xz and simga_yz are all close to zero + test_1 = all(np.array(gaussian_params[3:])/average_sigma < eps) + test_2 = all(abs((np.array(gaussian_params[:3])/average_sigma) - 1.0) < eps) + return test_1 and test_2 @calcfunction def create_model_structure(base_structure, scale_factor): diff --git a/aiida_defects/formation_energy/defect_chemistry_base.py b/aiida_defects/formation_energy/defect_chemistry_base.py deleted file mode 100644 index d80e9ea..0000000 --- a/aiida_defects/formation_energy/defect_chemistry_base.py +++ /dev/null @@ -1,397 +0,0 @@ -# -*- coding: utf-8 -*- -######################################################################################## -# Copyright (c), The AiiDA-Defects authors. All rights reserved. # -# # -# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # -# For further information on the license, see the LICENSE.txt file # -######################################################################################## -from __future__ import absolute_import - -from aiida import orm -from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit -import numpy as np -from .chemical_potential.chemical_potential import ChemicalPotentialWorkchain - -# from .utils import ( -# get_raw_formation_energy, -# get_corrected_formation_energy, -# get_corrected_aligned_formation_energy, -# ) -from .utils import * - -class DefectChemistryWorkchainBase(WorkChain): - """ - The base class to determine the defect chemistry of a given material, containing the - generic, code-agnostic methods, error codes, etc. Defect chemistry refer to the concentration or defect formation - energy of all possible defects (vacancies, interstitials, substitutions,...) which can exist in the material at - thermodynamics equilibrium. - - Any computational code can be used to calculate the required energies and relative permittivity. - However, different codes must be setup in specific ways, and so separate classes are used to implement these - possibilities. This is an abstract class and should not be used directly, but rather the - concrete code-specific classes should be used instead. - """ - - @classmethod - def define(cls, spec): - super(DefectChemistryWorkchainBase, cls).define(spec) - - spec.input('restart_wc', valid_type=orm.Bool, required=False, default=lambda: orm.Bool(False), - help="whether to restart the workchain from previous run or to start from scratch") - spec.input('restart_node', valid_type=orm.Int, required=False, - help="if restart from previous run, provide the node corresponding to that run") - spec.input("unitcell", valid_type=orm.StructureData, - help="Pristine structure to use in the calculation of permittivity and DOS", required=False) - spec.input("host_structure", valid_type=orm.StructureData, - help="Pristine supercell without defect") - spec.input('defect_info', valid_type=orm.Dict, - help="Dictionary containing the information about defects included in the calculations of defect chemistry") - - # Chemical potential workchain - spec.expose_inputs(ChemicalPotentialWorkchain) - - # Fermi level workchain - spec.input("temperature", valid_type=orm.Float, - help="temperature at which the defect chemistry is determined. Enter in the calculaion of electron, hole and defect concentrations") - spec.input("dopant", valid_type=orm.Float, required=False, - help="Charge and concentration of aliovalent dopants added to the system. Used in the 'frozen' defect approach") - - # Correction workchain - spec.input("correction_scheme", valid_type=orm.Str, - help="The correction scheme to apply") - spec.input("epsilon", valid_type=orm.Float, required=False, - help="Dielectric constant of the host") - - # Outputs -# spec.output( -# "density_of_states", valid_type=orm.XyData, required=True) - spec.output( - "defect_formation_energy", valid_type=orm.Dict, required=True) - spec.output( - "chemical_potential", valid_type=orm.Dict, required=True) - spec.output( - "fermi_level", valid_type=orm.Dict, required=True) - spec.output( - "defect_data", valid_type=orm.Dict, required=True) - spec.output( - "total_correction", valid_type=orm.Dict, required=True) - spec.output( - "electrostatic_correction", valid_type=orm.Dict, required=True) - spec.output( - "potential_alignment", valid_type=orm.Dict, required=True) - - # Error codes - spec.exit_code(201, "ERROR_INVALID_CORRECTION", - message="The requested correction scheme is not recognised") - spec.exit_code(202, "ERROR_PARAMETER_OVERRIDE", - message="Input parameter dictionary key cannot be set explicitly") - spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", - message="The correction scheme sub-workchain failed") - spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", - message="DFT calculation failed") - spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", - message="A post-processing calculation failed") - spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", - message="DFPT calculation failed") - spec.exit_code(305, "ERROR_DOS_CALCULATION_FAILED", - message="DOS calculation failed") - spec.exit_code(306, "ERROR_DOS_INTEGRATION_FAILED", - message="The number of electrons obtained from the integration of the DOS is different from the expected number of electrons") - spec.exit_code(401, "ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED", - message="The chemical potential calculation failed") - spec.exit_code(402, "ERROR_FERMI_LEVEL_WORKCHAIN_FAILED", - message="The self-consistent fermi level calculation failed") - spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", - message="Input parameter dictionary key cannot be set explicitly") - spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", - message="The requested method is not yet implemented") - - def setup(self): - """ - Setup the workchain - """ - - self.ctx.inputs_chempots = self.exposed_inputs(ChemicalPotentialWorkchain) - - # Check if correction scheme is valid: - correction_schemes_available = ["gaussian", "point"] - if self.inputs.correction_scheme is not None: - if self.inputs.correction_scheme not in correction_schemes_available: - return self.exit_codes.ERROR_INVALID_CORRECTION - - self.ctx.all_dopants = self.inputs.formation_energy_dict.get_dict() - self.ctx.chempot_dopants = self.ctx.all_dopants - self.ctx.sc_fermi_dopants = list(self.inputs.formation_energy_dict.get_dict().keys()) - self.ctx.pw_host_dopants = list(self.inputs.formation_energy_dict.get_dict().keys()) - self.ctx.chemical_potential = {} - self.ctx.fermi_level = {} - - self.ctx['output_unitcell'] = {} - #self.ctx['calc_dos'] = {} - self.ctx.dos = {} - - self.ctx.all_defects = self.inputs.defect_info.get_dict() - - self.ctx.pw_defects = self.inputs.defect_info.get_dict() - self.ctx.phi_defects = self.inputs.defect_info.get_dict() - self.ctx.rho_defects = self.inputs.defect_info.get_dict() - self.ctx.gc_correction_defects = self.inputs.defect_info.get_dict() - - self.ctx.total_correction = {} - self.ctx.electrostatic_correction = {} - self.ctx.potential_alignment = {} - - # defect_data contains all the information requires to compute defect formation energy such as E_corr, E_host, vbm,... - self.ctx.defect_data = {} - for defect, properties in self.ctx.all_defects.items(): - self.ctx.total_correction[defect] = {} - self.ctx.electrostatic_correction[defect] = {} - self.ctx.potential_alignment[defect] = {} - self.ctx.defect_data[defect] = {'N_site': properties['N_site'], 'species': properties['species'], 'charges': {}} - # Add neutral defect to the calculation even if the user doesn't specify it because it is needed to generate the charge model - if 0.0 not in properties['charges']: - self.ctx.all_defects[defect]['charges'].append(0.0) - self.ctx.pw_defects[defect]['charges'].append(0.0) - self.ctx.phi_defects[defect]['charges'].append(0.0) - self.ctx.rho_defects[defect]['charges'].append(0.0) - for chg in self.ctx.all_defects[defect]['charges']: - self.ctx.defect_data[defect]['charges'][str(chg)] = {} - #self.report('The defect data are: {}'.format(self.ctx.defect_data)) - - - def if_restart_wc(self): - return self.inputs.restart_wc.value - - def if_rerun_calc_unitcell(self): - if not self.ctx['output_unitcell']: - return True -# elif self.ctx['calc_unitcell'].is_finished_ok: -# is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(self.ctx['calc_unitcell'].outputs.output_band) -# self.ctx.vbm = get_vbm(self.ctx['calc_unitcell']) -# self.ctx.number_of_electrons = self.ctx['calc_unitcell'].outputs.output_parameters.get_dict()['number_of_electrons'] -# self.ctx.band_gap = band_gap -# return False - else: - self.ctx.number_of_electrons = self.ctx.output_unitcell['number_of_electrons'] - self.ctx.vbm = self.ctx.output_unitcell['vbm'] - self.ctx.band_gap = self.ctx.output_unitcell['band_gap'] - return False - - def if_rerun_calc_dos(self): -# if not self.ctx['calc_dos']: -# #self.report('start from scratch') -# return True -# elif self.ctx['calc_dos'].is_finished_ok: -# self.ctx.dos = self.ctx['calc_dos'].outputs.output_dos -# #self.report('finished ok') -# return False -# else: -# #self.report('not finished correctly') -# return True - if not self.ctx.dos: - #self.report('start from scratch') - return True - else: - #sefl.out('density_of_states', store_dos(self.ctx.dos)) - return False - - def if_run_dfpt(self): - return self.inputs.epsilon == 0.0 - - def run_chemical_potential_workchain(self): - from .chemical_potential.chemical_potential import ( - ChemicalPotentialWorkchain, ) - - self.report('Computing the chemical potentials...') -# inputs = { -# #"formation_energy_dict": self.inputs.formation_energy_dict, -# "compound": self.inputs.compound, -# "dependent_element": self.inputs.dependent_element, -# "ref_energy": self.inputs.ref_energy, -# "tolerance": self.inputs.tolerance, -# } - inputs = { - "compound": self.ctx.inputs_chempots.compound, - "dependent_element": self.ctx.inputs_chempots.dependent_element, - "ref_energy": self.ctx.inputs_chempots.ref_energy, - "tolerance": self.ctx.inputs_chempots.tolerance, - } - - for key, ef_dict in self.ctx.chempot_dopants.items(): - inputs['formation_energy_dict'] = orm.Dict(dict=ef_dict) - if key != 'intrinsic': - inputs['dopant_elements'] = orm.List(list=[key]) - - workchain_future = self.submit(ChemicalPotentialWorkchain, **inputs) - workchain_future.label = key - label = "chem_potential_wc_{}".format(key) - self.to_context(**{label: workchain_future}) - # Re-initialize dopant_elements to [] - inputs['dopant_elements'] = orm.List(list=[]) - - def check_chemical_potential_workchain(self): - """ - Check if the chemical potential workchain have finished correctly. - If yes, assign the output to context - """ - - for key, ef_dict in self.ctx.all_dopants.items(): - chem_potential_wc = self.ctx["chem_potential_wc_{}".format(key)] - if not chem_potential_wc.is_finished_ok: - self.report( - "Chemical potential workchain failed with status {}".format( - chem_potential_wc.exit_status - ) - ) - return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED - #return self.exit_codes.ERROR_SUB_PROCESS_FAILED_CORRECTION - else: - self.ctx.chemical_potential[key] = chem_potential_wc.outputs.chemical_potential.get_dict() - #self.ctx.stability_corners = chem_potential_wc.outputs.stability_corners - #self.ctx.matrix_of_constraints = chem_potential_wc.outputs.matrix_of_constraints - self.report('Chemical potentials: {}'.format(self.ctx.chemical_potential)) - self.out('chemical_potential', store_dict(orm.Dict(dict=self.ctx.chemical_potential))) - - def run_gaussian_correction_workchain(self): - """ - Run the workchain for the Gaussian Countercharge correction - """ - from .corrections.gaussian_countercharge.gaussian_countercharge import ( - GaussianCounterChargeWorkchain, - ) - - self.report("Computing correction via the Gaussian Countercharge scheme") - - inputs = { - "v_host": self.ctx.phi_host, - #"rho_host": self.ctx.rho_host, - "host_structure": self.inputs.host_structure, - "epsilon": self.ctx.epsilon, - } - - #defect_info = self.ctx.all_defects - for defect, properties in self.ctx.gc_correction_defects.items(): - inputs['defect_site'] = orm.List(list=properties['defect_position']) - inputs["v_defect_q0"] = self.ctx['phi_defect_{}[{}]'.format(defect, 0.0)] - for chg in properties['charges']: - if chg != 0.0: - inputs["defect_charge"] = orm.Float(chg) - inputs["v_defect_q"] = self.ctx['phi_defect_{}[{}]'.format(defect, chg)] - #inputs["rho_defect_q"] = self.ctx['rho_defect_{}[{}]'.format(defect, chg)] - workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) - label = "correction_wc_{}[{}]".format(defect, chg) - workchain_future.label = label - self.to_context(**{label: workchain_future}) - - def check_correction_workchain(self): - """ - Check if the potential alignment workchains have finished correctly. - If yes, assign the outputs to the context - """ - - for defect, properties in self.ctx.all_defects.items(): - for chg in properties['charges']: - if chg != 0.0: - correction_wc = self.ctx["correction_wc_{}[{}]".format(defect, chg)] - if not correction_wc.is_finished_ok: - self.report("Correction workchain failed with status {}" - .format(correction_wc.exit_status) - ) - return self.exit_codes.ERROR_CORRECTION_WORKCHAIN_FAILED - else: - self.ctx.defect_data[defect]['charges'][str(chg)]['E_corr'] = correction_wc.outputs.total_correction.value - self.ctx.total_correction[defect][str(chg)] = correction_wc.outputs.total_correction.value - self.ctx.electrostatic_correction[defect][str(chg)] = correction_wc.outputs.electrostatic_correction.value - self.ctx.potential_alignment[defect][str(chg)] = correction_wc.outputs.total_alignment.value - else: - self.ctx.defect_data[defect]['charges']['0.0']['E_corr'] = 0.0 - self.ctx.total_correction[defect]['0.0'] = 0.0 - self.ctx.electrostatic_correction[defect]['0.0'] = 0.0 - self.ctx.potential_alignment[defect]['0.0'] = 0.0 - self.out('defect_data', store_dict(orm.Dict(dict=self.ctx.defect_data))) - self.out('total_correction', store_dict(orm.Dict(dict=self.ctx.total_correction))) - self.out('electrostatic_correction', store_dict(orm.Dict(dict=self.ctx.electrostatic_correction))) - self.out('potential_alignment', store_dict(orm.Dict(dict=self.ctx.potential_alignment))) - self.report('The defect data are: {}'.format(self.ctx.defect_data)) - - def run_fermi_level_workchain(self): - from .fermi_level.fermi_level import ( - FermiLevelWorkchain, ) - - self.report('Running the fermi level workchain...') - - inputs = { - #"defect_data": orm.Dict(dict=self.ctx.defect_data), - #"chem_potentials": self.ctx.chemical_potential, - "temperature": self.inputs.temperature, - "valence_band_maximum": orm.Float(self.ctx.vbm), - "number_of_electrons": orm.Float(self.ctx.number_of_electrons), - "unitcell": self.inputs.unitcell, - "DOS": self.ctx.dos, - "band_gap": orm.Float(self.ctx.band_gap), - #"dopant": Dict(dict={'X_1':{'c': 1E18, 'q':-1}}) - } - - intrinsic_defects = {} - for defect, properties in self.ctx.defect_data.items(): - if is_intrinsic_defect(properties['species'], self.inputs.compound.value): - intrinsic_defects[defect] = properties - - for dopant in self.ctx.sc_fermi_dopants: - defect_temp = intrinsic_defects.copy() - if dopant != 'intrinsic': - for defect, properties in self.ctx.defect_data.items(): - if dopant in properties['species'].keys(): - defect_temp[defect] = properties - - inputs['defect_data'] = orm.Dict(dict=defect_temp) - inputs['chem_potentials'] = orm.Dict(dict=self.ctx.chemical_potential[dopant]) - #self.report('Defect data {}: {}'.format(dopant, defect_temp)) - workchain_future = self.submit(FermiLevelWorkchain, **inputs) - label = "fermi_level_wc_{}".format(dopant) - workchain_future.label = dopant - self.to_context(**{label: workchain_future}) - - def check_fermi_level_workchain(self): - """ - Check if the fermi level workchain have finished correctly. - If yes, assign the output to context - """ - - #for dopant, ef_dict in self.ctx.all_dopants.items(): - for dopant in self.ctx.sc_fermi_dopants: - fermi_level_wc = self.ctx["fermi_level_wc_{}".format(dopant)] - if not fermi_level_wc.is_finished_ok: - self.report( - "Fermi level workchain of {} defect failed with status {}".format( - dopant, fermi_level_wc.exit_status)) - return self.exit_codes.ERROR_FERMI_LEVEL_WORKCHAIN_FAILED - else: - self.ctx.fermi_level[dopant] = fermi_level_wc.outputs.fermi_level.get_array('data').item() # get the value from 0-d numpy array - self.report('Fermi level: {}'.format(self.ctx.fermi_level)) - self.out('fermi_level', store_dict(orm.Dict(dict=self.ctx.fermi_level))) - - def compute_defect_formation_energy(self): - ''' - Computing the defect formation energies of all defects considered in the materials. - ''' - - #self.report('The defect data is :{}'.format(self.ctx.defect_data)) - #self.report('All dopants: {}'.format(self.ctx.all_dopants)) - #self.report('The potential alignment is :{}'.format(self.ctx.potential_alignment)) - #self.report('The chemical potentials are :{}'.format(self.ctx.chemical_potential)) - #self.report('The fermi level are :{}'.format(self.ctx.fermi_level)) - - self.ctx.defect_formation_energy = get_defect_formation_energy( - orm.Dict(dict=self.ctx.defect_data), - #self.inputs.formation_energy_dict, - #orm.Dict(dict=self.ctx.all_dopants), - orm.Dict(dict=self.ctx.fermi_level), - orm.Dict(dict=self.ctx.potential_alignment), - orm.Dict(dict=self.ctx.chemical_potential), - self.inputs.compound - ) - - self.report('The defect formation energy is :{}'.format(self.ctx.defect_formation_energy.get_dict())) - self.out("defect_formation_energy", self.ctx.defect_formation_energy) - diff --git a/aiida_defects/formation_energy/defect_chemistry_qe.py b/aiida_defects/formation_energy/defect_chemistry_qe.py deleted file mode 100644 index bad45e8..0000000 --- a/aiida_defects/formation_energy/defect_chemistry_qe.py +++ /dev/null @@ -1,763 +0,0 @@ -from __future__ import absolute_import - -import numpy as np - -from aiida import orm -from aiida.engine import WorkChain, calcfunction, ToContext, if_, while_, submit -from aiida.plugins import WorkflowFactory -from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain -# from aiida_quantumespresso.calculations.pp import PpCalculation -from aiida.plugins import CalculationFactory, DataFactory -from aiida.orm.nodes.data.upf import get_pseudos_from_structure - -from aiida_defects.formation_energy.new_defect_chemistry_base import DefectChemistryWorkchainBase -from aiida_defects.formation_energy.utils import run_pw_calculation -#from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy -from .utils import * -import copy -import pymatgen - -PwCalculation = CalculationFactory('quantumespresso.pw') -PpCalculation = CalculationFactory('quantumespresso.pp') -PhCalculation = CalculationFactory('quantumespresso.ph') -DosCalculation = CalculationFactory('quantumespresso.dos') - -class DefectChemistryWorkchainQE(DefectChemistryWorkchainBase): - """ - Compute the formation energy for a given defect using QuantumESPRESSO - """ - @classmethod - def define(cls, spec): - super(DefectChemistryWorkchainQE, cls).define(spec) - - # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here - # we keep track of things with two separate namespaces. An additional code, and an additional - # namespace, is used for postprocessing - spec.input_namespace('qe.dft.supercell', - help="Inputs for DFT calculations on supercells") - spec.input_namespace('qe.dft.unitcell', - help="Inputs for a DFT calculation on an alternative host cell for use DOS and/or DFPT") - spec.input_namespace('qe.dos', - help="Inputs for DOS calculation which is needed for the Fermi level workchain") - spec.input_namespace('qe.dfpt', required=False, - help="Inputs for DFPT calculation for calculating the relative permittivity of the host material") - spec.input_namespace('qe.pp', - help="Inputs for postprocessing calculations") - - # spec.input('nbands', valid_type=orm.Int, - # help="The number of bands used in pw calculation for the unitcell. Need to specify it because we want it to be larger than the default value so that we can get the band gap which is need for the FermiLevelWorkchain.") - spec.input('k_points_distance', valid_type=orm.Float, required=False, default=lambda: orm.Float(0.2), - help='distance (in 1/Angstrom) between adjacent kpoints') - - # DFT inputs (PW.x) - spec.input("qe.dft.supercell.code", valid_type=orm.Code, - help="The pw.x code to use for the calculations") - #spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, - # help="The k-point grid to use for the calculations") - spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, - help="Parameters for the PWSCF calcuations. Some will be set automatically") - spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, - help="Scheduler options for the PW.x calculations") - spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, - help="Settings for the PW.x calculations") -# spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, -# help="The pseudopotential family for use with the code, if required") - spec.input("qe.dft.supercell.pseudopotential_family", valid_type=orm.Str, - help="The pseudopotential family for use with the code") - - # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant - spec.input("qe.dft.unitcell.code", valid_type=orm.Code, - help="The pw.x code to use for the calculations") - #spec.input("qe.dft.unitcell.kpoints", valid_type=orm.KpointsData, - # help="The k-point grid to use for the calculations") - spec.input("qe.dft.unitcell.parameters", valid_type=orm.Dict, - help="Parameters for the PWSCF calcuations. Some will be set automatically") - spec.input("qe.dft.unitcell.scheduler_options", valid_type=orm.Dict, - help="Scheduler options for the PW.x calculations") -# spec.input_namespace("qe.dft.unitcell.pseudopotentials",valid_type=orm.UpfData, dynamic=True, -# help="The pseudopotential family for use with the code, if required") - spec.input("qe.dft.unitcell.pseudopotential_family", valid_type=orm.Str, - help="The pseudopotential family for use with the code") - - # DOS inputs (DOS.x) - spec.input("qe.dos.code", valid_type=orm.Code, - help="The dos.x code to use for the calculations") - spec.input("qe.dos.scheduler_options", valid_type=orm.Dict, - help="Scheduler options for the dos.x calculations") - - # Postprocessing inputs (PP.x) - spec.input("qe.pp.code", valid_type=orm.Code, - help="The pp.x code to use for the calculations") - spec.input("qe.pp.scheduler_options", valid_type=orm.Dict, - help="Scheduler options for the PP.x calculations") - - # DFPT inputs (PH.x) - spec.input("qe.dfpt.code", valid_type=orm.Code, required=False, - help="The ph.x code to use for the calculations") - spec.input("qe.dfpt.scheduler_options", valid_type=orm.Dict, required=False, - help="Scheduler options for the PH.x calculations") - - spec.outline( - cls.setup, - if_(cls.if_restart_wc)( - cls.retrieve_previous_results - ), - cls.run_chemical_potential_workchain, - cls.check_chemical_potential_workchain, - if_(cls.if_rerun_calc_unitcell)( - cls.prep_unitcell_dft_calculation, - cls.check_unitcell_dft_calculation, - ), - if_(cls.if_rerun_calc_dos)( - cls.prep_dos_calculation, - cls.check_dos_calculation, - ), - if_(cls.if_run_dfpt)( - cls.prep_dfpt_calculation - ), - cls.check_dfpt_calculation, - cls.prep_dft_calculations, - cls.check_dft_calculations, - cls.prep_dft_potentials_calculations, - cls.check_dft_potentials_calculations, - #cls.prep_charge_density_calculations, - #cls.check_charge_density_calculations, - cls.run_gaussian_correction_workchain, - cls.check_correction_workchain, - cls.run_fermi_level_workchain, - cls.check_fermi_level_workchain, - cls.compute_defect_formation_energy - ) - - def retrieve_previous_results(self): - """ - Retrieve all the converged calculations from the previous run - """ - - self.report('Retrieving results from previous calculations...') - Node = orm.load_node(self.inputs.restart_node.value) - - # Merging and retreiving data from previous run with the that of the additional dopants - if Node.is_finished_ok: - self.ctx.chemical_potential = Node.outputs.chemical_potential.get_dict() - self.ctx.fermi_level = Node.outputs.fermi_level.get_dict() - self.ctx.total_correction = Node.outputs.total_correction.get_dict() - self.ctx.electrostatic_correction = Node.outputs.electrostatic_correction.get_dict() - self.ctx.potential_alignment = Node.outputs.potential_alignment.get_dict() - self.ctx.defect_data = Node.outputs.defect_data.get_dict() - - self.ctx.sc_fermi_dopants = list(set(self.ctx.fermi_level.keys()).union(set(self.inputs.formation_energy_dict.get_dict().keys()))) - - for defect, properties in self.ctx.all_defects.items(): - # In case we want to add new charge states to the same defects from previous calculations - if defect not in self.ctx.defect_data.keys(): - self.ctx.total_correction[defect] = {} - self.ctx.electrostatic_correction[defect] = {} - self.ctx.potential_alignment[defect] = {} - self.ctx.defect_data[defect] = {'N_site': properties['N_site'], 'species': properties['species'], 'charges': {}} - if 0.0 not in properties['charges']: - self.ctx.all_defects[defect]['charges'].append(0.0) - for chg in self.ctx.all_defects[defect]['charges']: - self.ctx.defect_data[defect]['charges'][str(chg)] = {} - - for entry in Node.get_outgoing(): - try: - process_label = entry.node.attributes['process_label'] - #self.report('{}'.format(process_label)) - except KeyError: - continue - - #if process_label == 'PwBaseWorkChain': - # calc_label = entry.node.label - # if 'host' in calc_label: - # calc_name = 'calc_'+calc_label - # self.report('{}'.format(calc_name)) - # pw_host_dopants.remove(calc_label[5:]) - # self.ctx[calc_name] = entry.node - - if process_label == 'FermiLevelWorkchain': - self.ctx.dos = entry.node.inputs.DOS - vbm = entry.node.inputs.valence_band_maximum.value - N_electrons = entry.node.inputs.number_of_electrons.value - band_gap = entry.node.inputs.band_gap.value - self.ctx['output_unitcell'] = {'number_of_electrons': N_electrons, 'vbm': vbm, 'band_gap': band_gap} - - else: - for dopant, Ef in Node.inputs.formation_energy_dict.get_dict().items(): - if dopant not in self.ctx.all_dopants.keys(): - self.ctx.all_dopants[dopant] = Ef - chempot_dopants = copy.deepcopy(self.ctx.all_dopants) - sc_fermi_dopants = list(self.ctx.all_dopants.keys()) #copy.deepcopy(self.ctx.all_dopants) - pw_host_dopants = list(self.ctx.all_dopants.keys()) - - for defect, info in Node.inputs.defect_info.get_dict().items(): - if defect not in self.ctx.all_defects.keys(): - self.ctx.all_defects[defect] = info - if 0.0 not in self.ctx.all_defects[defect]['charges']: - self.ctx.all_defects[defect]['charges'].append(0.0) - pw_defects = copy.deepcopy(self.ctx.all_defects) - phi_defects = copy.deepcopy(self.ctx.all_defects) - rho_defects = copy.deepcopy(self.ctx.all_defects) - gc_correction_defects = copy.deepcopy(self.ctx.all_defects) - - for entry in Node.get_outgoing(): - try: - process_label = entry.node.attributes['process_label'] - #self.report('{}'.format(process_label)) - except KeyError: - continue - - if process_label == 'PwBaseWorkChain': - calc_label = entry.node.label - if calc_label == 'unitcell': - #calc_name = 'calc_unitcell' - #self.ctx['calc_unitcell'] = entry.node - vbm = get_vbm(entry.node) - is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(entry.node.outputs.output_band) - N_electrons = entry.node.outputs.output_parameters.get_dict()['number_of_electrons'] - self.ctx['output_unitcell'] = {'number_of_electrons': N_electrons, 'vbm': vbm, 'band_gap': band_gap} - elif 'host' in calc_label: - calc_name = 'calc_'+calc_label - self.report('{}'.format(calc_name)) - if entry.node.is_finished_ok: - pw_host_dopants.remove(calc_label[5:]) - self.ctx[calc_name] = entry.node - else: - calc_name = 'calc_defect_'+calc_label - if entry.node.is_finished_ok: - #self.report('{}'.format(calc_name)) - self.ctx[calc_name] = entry.node - defect, chg = get_defect_and_charge_from_label(calc_label) - pw_defects[defect]['charges'].remove(chg) - if not pw_defects[defect]['charges']: - pw_defects.pop(defect) - - elif process_label == 'PpCalculation': - calc_label = entry.node.label - if entry.node.is_finished_ok: - self.ctx[calc_label] = entry.node - if 'host' not in calc_label: - defect, chg = get_defect_and_charge_from_label(calc_label[14:]) - self.report('{}, {}, {}'.format(calc_label, defect, chg)) - if 'phi' in calc_label: - # self.report('{}'.format(phi_defects)) - phi_defects[defect]['charges'].remove(chg) - if not phi_defects[defect]['charges']: - phi_defects.pop(defect) - if 'rho' in calc_label: - #self.report('{}'.format(phi_defects)) - rho_defects[defect]['charges'].remove(chg) - if not rho_defects[defect]['charges']: - rho_defects.pop(defect) - - elif process_label == 'DosCalculation': - #self.ctx['calc_dos'] = entry.node - self.ctx.dos = entry.node.outputs.output_dos - - elif process_label == 'GaussianCounterChargeWorkchain': - calc_label = entry.node.label - if entry.node.is_finished_ok: - self.ctx[calc_label] = entry.node - defect, chg = get_defect_and_charge_from_label(calc_label.replace('correction_wc_', '')) - gc_correction_defects[defect]['charges'].remove(chg) - #if not gc_correction_defects[defect]['charges']: - if gc_correction_defects[defect]['charges'] == [0.0]: - gc_correction_defects.pop(defect) - - elif process_label == 'ChemicalPotentialWorkchain': - dopant = entry.node.label - if entry.node.is_finished_ok: - self.ctx["chem_potential_wc_{}".format(dopant)] = entry.node - chempot_dopants.pop(dopant) - -# elif process_label == 'FermiLevelWorkchain': -# dopant = entry.node.label -# if entry.node.is_finished_ok: -# self.ctx["fermi_level_wc_{}".format(dopant)] = entry.node -# sc_fermi_dopants.pop(dopant) - - else: - pass - - self.ctx.chempot_dopants = chempot_dopants - self.ctx.sc_fermi_dopants = sc_fermi_dopants - self.ctx.pw_host_dopants = pw_host_dopants - self.ctx.pw_defects = pw_defects - self.ctx.phi_defects = phi_defects - self.ctx.rho_defects = rho_defects - self.ctx.gc_correction_defects = gc_correction_defects - - self.report('chempot dopant: {}'.format(self.ctx.chempot_dopants.keys())) - self.report('pw host dopant: {}'.format(self.ctx.pw_host_dopants)) - self.report('sc fermi dopants: {}'.format(self.ctx.sc_fermi_dopants)) - self.report('pw defects: {}'.format(self.ctx.pw_defects.keys())) - self.report('phi defects: {}'.format(self.ctx.phi_defects.keys())) - self.report('rho defects: {}'.format(self.ctx.rho_defects.keys())) - self.report('phi defects: {}'.format(self.ctx.phi_defects.keys())) - self.report('rho defects: {}'.format(self.ctx.rho_defects.keys())) - self.report('gc correction defects: {}'.format(self.ctx.gc_correction_defects.keys())) - - def prep_unitcell_dft_calculation(self): - """ - Run a DFT calculation on the structure to be used for the computation of the - DOS and/or dielectric constant - """ - self.report("DFT calculation for the unitcell has been requested") - - # Another code may be desirable - N.B. in AiiDA a code refers to a specific - # executable on a specific computer. As the PH calculation may have to be run on - # an HPC cluster, the PW calculation must be run on the same machine and so this - # may necessitate that a different code is used than that for the supercell calculations. - -# #pw_inputs = self.inputs.qe.dft.unitcell.code.get_builder() -# pw_inputs = PwCalculation.get_builder() -# -# # These are not necessarily the same as for the other DFT calculations -# pw_inputs.code = self.inputs.qe.dft.unitcell.code -# #pw_inputs.pseudos = self.inputs.qe.dft.unitcell.pseudopotentials -# pw_inputs.pseudos = get_pseudos_from_structure(self.inputs.unitcell, self.inputs.qe.dft.unitcell.pseudopotential_family.value) - - kpoints = orm.KpointsData() - kpoints.set_cell_from_structure(self.inputs.unitcell) - kpoints.set_kpoints_mesh_from_density(self.inputs.k_points_distance.value) -# pw_inputs.kpoints = kpoints - - #pw_inputs.metadata = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() - scheduler_options = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() - scheduler_options['label'] = 'unitcell' -# pw_inputs.metadata = scheduler_options - -# pw_inputs.structure = self.inputs.unitcell - parameters = self.inputs.qe.dft.unitcell.parameters.get_dict() - #parameters['SYSTEM']['nbnd'] = self.inputs.nbands.value -# pw_inputs.parameters = orm.Dict(dict=parameters) - - inputs = { - 'pw':{ - 'code' : self.inputs.qe.dft.unitcell.code, - 'structure' : self.inputs.unitcell, - 'pseudos': get_pseudos_from_structure(self.inputs.unitcell, self.inputs.qe.dft.unitcell.pseudopotential_family.value), - 'parameters' : orm.Dict(dict=parameters), - 'metadata' : scheduler_options, - }, - 'kpoints': kpoints, - } - - future = self.submit(PwBaseWorkChain, **inputs) - self.report( - 'Launching PWSCF for the unitcell structure (PK={}) at node PK={}'.format(self.inputs.unitcell.pk, future.pk)) - future.label = 'unitcell' - self.to_context(**{'calc_unitcell': future}) - - def check_unitcell_dft_calculation(self): - """ - Check if the DFT calculation of the unitcell has completed successfully. - """ - - unitcell_calc = self.ctx['calc_unitcell'] - if not unitcell_calc.is_finished_ok: - self.report( - 'PWSCF for the unitcell structure has failed with status {}'. - format(unitcell_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - else: - is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(unitcell_calc.outputs.output_band) - if not is_insulator: - self.report('WARNING! Metallic ground state!') - self.ctx.vbm = get_vbm(unitcell_calc) - #self.ctx.number_of_electrons = unitcell_calc.res.number_of_electrons - self.ctx.number_of_electrons = unitcell_calc.outputs.output_parameters.get_dict()['number_of_electrons'] - self.ctx.band_gap = band_gap - self.report("The band gap of the material is: {} eV".format(band_gap)) - - def prep_dos_calculation(self): - ''' - Run a calculation to extract the DOS of the unitcell. - ''' - dos_inputs = DosCalculation.get_builder() - dos_inputs.code = self.inputs.qe.dos.code - dos_inputs.parent_folder = self.ctx['calc_unitcell'].outputs.remote_folder - - parameters = orm.Dict(dict={'DOS':{ - 'Emin': -180.0, 'Emax': 40.0, 'degauss':0.0005, 'DeltaE': 0.005} - }) - dos_inputs.parameters = parameters - - dos_inputs.metadata = self.inputs.qe.dos.scheduler_options.get_dict() - - future = self.submit(DosCalculation, **dos_inputs) - self.report('Launching DOS for unitcell structure (PK={}) at node PK={}'.format(self.inputs.unitcell.pk, future.pk)) - self.to_context(**{'calc_dos': future}) - - def check_dos_calculation(self): - ''' - Retrieving the DOS of the unitcell - ''' - - dos_calc = self.ctx['calc_dos'] - if dos_calc.is_finished_ok: - Dos = dos_calc.outputs.output_dos - x = Dos.get_x() - y = Dos.get_y() - DOS = np.vstack((x[1]-self.ctx.vbm, y[1][1])).T - #plt.plot(DOS[:,0], DOS[:,1]) - #plt.show() - mask = (DOS[:,0] <= 0.05) - N_electron = np.trapz(DOS[:,1][mask], DOS[:,0][mask]) - if np.absolute(N_electron - self.ctx.number_of_electrons) > 5e-3: - self.report('The number of electrons obtained from the integration of DOS is: {}'.format(N_electron)) - self.report('The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input') - return self.exit_codes.ERROR_DOS_INTEGRATION_FAILED - else: - self.ctx.dos = dos_calc.outputs.output_dos - else: - self.report('DOS calculation for the unitcell has failed with status {}'.format(dos_calc.exit_status)) - return self.exit_codes.ERROR_DOS_CALCULATION_FAILED - - def prep_dfpt_calculation(self): - """ - Run a DFPT calculation to compute the dielectric constant for the pristine material - """ - - ph_inputs = PhCalculation.get_builder() - ph_inputs.code = self.inputs.qe.dfpt.code - - # Setting up the calculation depends on whether the parent SCF calculation is either - # the host supercell or an alternative host unitcell - if self.inputs.unitcell: - ph_inputs.parent_folder = self.ctx['calc_unitcell'].outputs.remote_folder - else: - ph_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder - - parameters = orm.Dict(dict={ - 'INPUTPH': { - "tr2_ph" : 1e-16, - 'epsil': True, - 'trans': False - } - }) - ph_inputs.parameters = parameters - - # Set the q-points for a Gamma-point calculation - # N.B. Setting a 1x1x1 mesh is not equivalent as this will trigger a full phonon dispersion calculation - qpoints = orm.KpointsData() - if self.inputs.host_unitcell: - qpoints.set_cell_from_structure(structuredata=self.ctx['calc_unitcell'].inputs.structure) - else: - qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host'].inputs.structure) - qpoints.set_kpoints([[0.,0.,0.]]) - qpoints.get_kpoints(cartesian=True) - ph_inputs.qpoints = qpoints - - ph_inputs.metadata = self.inputs.qe.dfpt.scheduler_options.get_dict() - - future = self.submit(PhCalculation, **ph_inputs) - self.report('Launching PH for host structure at node PK={}'.format(self.inputs.host_structure.pk, future.pk)) - self.to_context(**{'calc_dfpt': future}) - - def check_dfpt_calculation(self): - """ - Compute the dielectric constant to be used in the correction - """ - if self.inputs.epsilon == 0.0: - dfpt_calc = self.ctx['calc_dfpt'] - if dfpt_calc.is_finished_ok: - epsilion_tensor = np.array(dfpt_calc.outputs.output_parameters.get_dict()['dielectric_constant']) - self.ctx.epsilon = orm.Float(np.trace(epsilion_tensor/3.)) - self.report('The computed relative permittivity is {}'.format(self.ctx.epsilon.value)) - else: - self.report( - 'PH for the host structure has failed with status {}'.format(dfpt_calc.exit_status)) - return self.exit_codes.ERROR_DFPT_CALCULATION_FAILED - else: - self.ctx.epsilon = self.inputs.epsilon - - def prep_dft_calculations(self): - """ - Run DFT calculation of the perfect host lattice as well as all the possible defects considered in the material. - """ - -# pw_inputs = PwCalculation.get_builder() -# pw_inputs.code = self.inputs.qe.dft.supercell.code - - kpoints = orm.KpointsData() - kpoints.set_cell_from_structure(self.inputs.host_structure) - kpoints.set_kpoints_mesh_from_density(self.inputs.k_points_distance.value) -# pw_inputs.kpoints = kpoints - -# pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() -# pw_inputs.settings = self.inputs.qe.dft.supercell.settings - scheduler_options = self.inputs.qe.dft.supercell.scheduler_options.get_dict() - parameters = self.inputs.qe.dft.supercell.parameters.get_dict() - - # We set 'tot_charge' later so throw an error if the user tries to set it to avoid - # any ambiguity or unseen modification of user input - if 'tot_charge' in parameters['SYSTEM']: - self.report('You cannot set the "tot_charge" PW.x parameter explicitly') - return self.exit_codes.ERROR_PARAMETER_OVERRIDE - -# pw_inputs.structure = self.inputs.host_structure - parameters['SYSTEM']['tot_charge'] = orm.Float(0.) -# pw_inputs.parameters = orm.Dict(dict=parameters) - - inputs = { - 'pw':{ - 'code' : self.inputs.qe.dft.supercell.code, - 'structure' : self.inputs.host_structure, - 'parameters' : orm.Dict(dict=parameters), - 'settings': self.inputs.qe.dft.supercell.settings, - }, - 'kpoints': kpoints, - } - - for dopant in self.ctx.pw_host_dopants[:1]: - pseudos = get_pseudos_from_structure(self.inputs.host_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) - scheduler_options['label'] = 'host_{}'.format(dopant) -# pw_inputs.metadata = scheduler_options - - inputs['pw']['pseudos'] = pseudos - inputs['pw']['metadata'] = scheduler_options - - future = self.submit(PwBaseWorkChain, **inputs) - self.report('Launching PWSCF for host structure (PK={}) at node PK={}' - .format(self.inputs.host_structure.pk, future.pk)) - future.label = 'host_{}'.format(dopant) - self.to_context(**{'calc_host_{}'.format(dopant): future}) - - #defect_info = self.inputs.defect_info.get_dict() - for defect, properties in self.ctx.pw_defects.items(): - defect_structure = generate_defect_structure(self.inputs.host_structure, properties['defect_position'], properties['species']) -# temp_structure = pymatgen.Structure.from_file('/home/sokseiham/Documents/Defect_calculations/LiK2AlF6/Structures/Ba-K.cif') -# defect_structure = orm.StructureData(pymatgen=temp_structure) - pseudos = get_pseudos_from_structure(defect_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) - - inputs['pw']['structure'] = defect_structure - inputs['pw']['pseudos'] = pseudos - - parameters['SYSTEM']['nspin'] = 2 - parameters['SYSTEM']['tot_magnetization'] = 0.0 - - for chg in properties['charges']: - parameters['SYSTEM']['tot_charge'] = orm.Float(chg) -# pw_inputs.parameters = orm.Dict(dict=parameters) - scheduler_options['label'] = '{}[{}]'.format(defect, chg) -# pw_inputs.metadata = scheduler_options - - inputs['pw']['metadata'] = scheduler_options - inputs['pw']['parameters'] = orm.Dict(dict=parameters) - - future = self.submit(PwBaseWorkChain, **inputs) - self.report('Launching PWSCF for {} defect structure with charge {} at node PK={}' - .format(defect, chg, future.pk)) - future.label = '{}[{}]'.format(defect, chg) - self.to_context(**{'calc_defect_{}[{}]'.format(defect, chg): future}) - - def check_dft_calculations(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - - # Host - for dopant in self.ctx.pw_host_dopants[:1]: - host_calc = self.ctx['calc_host_{}'.format(dopant)] -# if host_calc.is_finished_ok: -# self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV -# self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) -# self.ctx.host_vbm = orm.Float(get_vbm(host_calc)) -# self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) - if not host_calc.is_finished_ok: - self.report( - 'PWSCF for the host structure has failed with status {}'.format(host_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - - # Defects - #defect_info = self.inputs.defect_info.get_dict() - defect_info = self.ctx.all_defects - for defect, properties in defect_info.items(): - dopant = get_dopant(properties['species'], self.inputs.compound.value) - #self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_{}'.format(dopant)]) - #self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_{}'.format(dopant)].outputs.output_parameters.get_dict()['energy'] - if self.ctx.pw_host_dopants == []: - self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_intrinsic']) - self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_intrinsic'].outputs.output_parameters.get_dict()['energy'] - else: - self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])]) - self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.output_parameters.get_dict()['energy'] - for chg in properties['charges']: - defect_calc = self.ctx['calc_defect_{}[{}]'.format(defect, chg)] - if not defect_calc.is_finished_ok: - self.report('PWSCF for the {} defect structure with charge {} has failed with status {}' - .format(defect, chg, defect_calc.exit_status)) - return self.exit_codes.ERROR_DFT_CALCULATION_FAILED - else: - is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(defect_calc.outputs.output_band) - if not is_insulator: - self.report('WARNING! The ground state of {} defect structure with charge {} is metallic!'.format(defect, chg)) - self.ctx.defect_data[defect]['charges'][str(chg)]['E'] = defect_calc.outputs.output_parameters.get_dict()['energy'] # eV - self.report('The energy of {} defect structure with charge {} is: {} eV' - .format(defect, chg, defect_calc.outputs.output_parameters.get_dict()['energy'])) -# self.report('The defect data is :{}'.format(self.ctx.defect_data)) - - def prep_dft_potentials_calculations(self): - """ - Obtain the electrostatic potentials from the PWSCF calculations. - """ - # User inputs - pp_inputs = PpCalculation.get_builder() - pp_inputs.code = self.inputs.qe.pp.code - - scheduler_options = self.inputs.qe.pp.scheduler_options.get_dict() - scheduler_options['label'] = 'pp_phi_host' - pp_inputs.metadata = scheduler_options - - # Fixed settings - #pp_inputs.plot_number = orm.Int(11) # Electrostatic potential - #pp_inputs.plot_dimension = orm.Int(3) # 3D - - parameters = orm.Dict(dict={ - 'INPUTPP': { - "plot_num" : 11, - }, - 'PLOT': { - "iflag" : 3 - } - }) - pp_inputs.parameters = parameters - - # Host - # assuming that the electrostatic potential doesnt vary much with the cutoff - # pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder - self.report('pw_host_dopants: {}'.format(self.ctx.pw_host_dopants)) - if self.ctx.pw_host_dopants == []: - pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder - else: - pp_inputs.parent_folder = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.remote_folder - future = self.submit(PpCalculation, **pp_inputs) - self.report('Launching PP.x for electrostatic potential for the host structure at node PK={}' - .format(future.pk)) - self.to_context(**{'pp_phi_host': future}) - - #Defects - for defect, properties in self.ctx.phi_defects.items(): - for chg in properties['charges']: - scheduler_options['label'] = 'pp_phi_defect_{}[{}]'.format(defect, chg) - pp_inputs.metadata = scheduler_options - pp_inputs.parent_folder = self.ctx['calc_defect_{}[{}]'.format(defect, chg)].outputs.remote_folder - future = self.submit(PpCalculation, **pp_inputs) - self.report('Launching PP.x for electrostatic potential for {} defect structure with charge {} at node PK={}' - .format(defect, chg, future.pk)) - self.to_context(**{'pp_phi_defect_{}[{}]'.format(defect, chg): future}) - - def check_dft_potentials_calculations(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - - # Host - host_pp = self.ctx['pp_phi_host'] - if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.phi_host = v_data - else: - self.report( - 'Post processing for electrostatic potential the host structure has failed with status {}'.format(host_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defects - defect_info = self.ctx.all_defects - for defect, properties in defect_info.items(): - for chg in properties['charges']: - defect_pp = self.ctx['pp_phi_defect_{}[{}]'.format(defect, chg)] - if defect_pp.is_finished_ok: - data_array = defect_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx['phi_defect_{}[{}]'.format(defect, chg)] = v_data - else: - self.report('Post processing for electrostatic potential for {} defect structure with charge {} has failed with status {}' - .format(defect, chg, defect_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - def prep_charge_density_calculations(self): - """ - Obtain electronic charge density from the PWSCF calculations. - """ - # User inputs - pp_inputs = PpCalculation.get_builder() - pp_inputs.code = self.inputs.qe.pp.code - scheduler_options = self.inputs.qe.pp.scheduler_options.get_dict() - scheduler_options['label'] = 'pp_rho_host' - pp_inputs.metadata = scheduler_options - - # Fixed settings - #pp_inputs.plot_number = orm.Int(0) # Charge density - #pp_inputs.plot_dimension = orm.Int(3) # 3D - - parameters = orm.Dict(dict={ - 'INPUTPP': { - "plot_num" : 0, - }, - 'PLOT': { - "iflag" : 3 - } - }) - pp_inputs.parameters = parameters - - # Host - # assuming that the charge density doesn't vary much with the cutoff - pp_inputs.parent_folder = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.remote_folder - #pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder - - future = self.submit(PpCalculation, **pp_inputs) - self.report('Launching PP.x for charge density for host structure at node PK={}' - .format(future.pk)) - self.to_context(**{'pp_rho_host': future}) - - #Defects - for defect, properties in self.ctx.rho_defects.items(): - for chg in properties['charges']: - pp_inputs.parent_folder = self.ctx['calc_defect_{}[{}]'.format(defect, chg)].outputs.remote_folder - scheduler_options['label'] = 'pp_rho_defect_{}[{}]'.format(defect, chg) - pp_inputs.metadata = scheduler_options - future = self.submit(PpCalculation, **pp_inputs) - self.report('Launching PP.x for charge density for {} defect structure with charge {} at node PK={}' - .format(defect, chg, future.pk)) - self.to_context(**{'pp_rho_defect_{}[{}]'.format(defect, chg): future}) - - def check_charge_density_calculations(self): - """ - Check if the required calculations for the Gaussian Countercharge correction workchain - have finished correctly. - """ - - # Host - host_pp = self.ctx['pp_rho_host'] - if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.rho_host = v_data - else: - self.report( - 'Post processing for charge density for the host structure has failed with status {}'.format(host_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - # Defects - defect_info = self.ctx.all_defects - for defect, properties in defect_info.items(): - for chg in properties['charges']: - defect_pp = self.ctx['pp_rho_defect_{}[{}]'.format(defect, chg)] - if defect_pp.is_finished_ok: - data_array = defect_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx['rho_defect_{}[{}]'.format(defect, chg)] = v_data - else: - self.report('Post processing for charge density for {} defect structure with charge {} has failed with status {}' - .format(defect, chg, defect_pp.exit_status)) - return self.exit_codes.ERROR_PP_CALCULATION_FAILED - From 02398cd30416e0bc18bf7ebeb62582b3bb5f399c Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Fri, 5 Mar 2021 10:52:13 +0000 Subject: [PATCH 42/60] Drop `six` from dependancies Remove `six` from setup.json as we no longer support Python2 --- setup.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.json b/setup.json index 5b4e556..3b2fd23 100644 --- a/setup.json +++ b/setup.json @@ -29,8 +29,7 @@ "install_requires": [ "aiida-core >= 1.0.0b1,<2.0.0", "aiida-quantumespresso>='3.1.0'", - "pymatgen", - "six" + "pymatgen" ], "extras_require": { "dev_precommit": [ From f9440bca7a137cf72d0dd367600bcf38c7779065 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Fri, 19 Mar 2021 12:59:28 +0100 Subject: [PATCH 43/60] Use lambda function to set default values in inputs --- aiida_defects/formation_energy/chemical_potential/utils.py | 2 +- .../gaussian_countercharge/gaussian_countercharge.py | 4 ++-- .../density_weighted/density_weighted.py | 4 ++-- .../potential_alignment/lany_zunger/lany_zunger.py | 6 +++--- .../potential_alignment/potential_alignment.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py index 03c277a..36cbcf0 100644 --- a/aiida_defects/formation_energy/chemical_potential/utils.py +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -238,7 +238,7 @@ def Order_point_clockwise(points): sort_t = np.sort(t) t = list(t) u = [t.index(element) for element in sort_t] - points_order = points[u] + points_order = points[u] # ordered_points = ArrayData() # ordered_points.set_array('data', points_order) # return ordered_points diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 9a534d0..66d01e4 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -84,7 +84,7 @@ def define(cls, spec): spec.input_namespace('charge_model.fitted', required=False, populate_defaults=False, help="Inputs for a fitted charge model using a multivariate anisotropic gaussian.") spec.input("charge_model.fitted.tolerance", - valid_type=orm.Float, + valid_type=orm.Float, help="Permissable error for any fitted charge model parameter.", default=lambda: orm.Float(1.0e-3)) spec.input("charge_model.fitted.strict_fit", @@ -239,7 +239,7 @@ def fit_charge_model(self): for parameter in fit['error']: if parameter > self.inputs.charge_model.fitted.tolerance: self.logger.warning("Charge fitting parameter worse than allowed tolerance") - if self.inputs.strict_fit: + if self.inputs.charge_model.fitted.strict_fit: return self.exit_codes.ERROR_BAD_CHARGE_FIT if is_gaussian_isotrope(self.ctx.fitted_params.get_list()[3:]): diff --git a/aiida_defects/formation_energy/potential_alignment/density_weighted/density_weighted.py b/aiida_defects/formation_energy/potential_alignment/density_weighted/density_weighted.py index 2340394..6477f5f 100644 --- a/aiida_defects/formation_energy/potential_alignment/density_weighted/density_weighted.py +++ b/aiida_defects/formation_energy/potential_alignment/density_weighted/density_weighted.py @@ -34,7 +34,7 @@ def define(cls, spec): help="The fitted model charge density array") spec.input('tolerance', valid_type=orm.Float, - default=orm.Float(1.0e-3), + default=lambda: orm.Float(1.0e-3), help="The threshold for determining whether a given array element has charge density present") spec.outline( @@ -95,4 +95,4 @@ def results(self): Pack the results """ self.out('alignment_required', self.ctx.alignment) - self.out('potential_difference', self.ctx.potential_difference) \ No newline at end of file + self.out('potential_difference', self.ctx.potential_difference) diff --git a/aiida_defects/formation_energy/potential_alignment/lany_zunger/lany_zunger.py b/aiida_defects/formation_energy/potential_alignment/lany_zunger/lany_zunger.py index 54a73ee..b018f07 100644 --- a/aiida_defects/formation_energy/potential_alignment/lany_zunger/lany_zunger.py +++ b/aiida_defects/formation_energy/potential_alignment/lany_zunger/lany_zunger.py @@ -29,15 +29,15 @@ def define(cls, spec): spec.input( 'e_tol', valid_type=orm.Float, - default=orm.Float(0.2), + default=lambda: orm.Float(0.2), help="Energy tolerance to decide which atoms to exclude to compute alignment") spec.input('first_potential', valid_type=orm.ArrayData) spec.input('second_potential', valid_type=orm.ArrayData) spec.input( 'alignment_scheme', valid_type=orm.Str, - default=orm.Str('lany-zunger')) - spec.input('interpolate', valid_type=orm.Bool, default=orm.Bool(False)) + default=lambda: orm.Str('lany-zunger')) + spec.input('interpolate', valid_type=orm.Bool, default=lambda: orm.Bool(False)) spec.outline( ) #spec.expose_outputs(PwBaseWorkChain, exclude=('output_structure',)) diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index d52a186..2c3e76e 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -36,7 +36,7 @@ def define(cls, spec): super(PotentialAlignmentWorkchain, cls).define(spec) spec.input('allow_interpolation', valid_type=orm.Bool, - default=orm.Bool(False), + default=lambda: orm.Bool(False), help="Whether to allow arrays of different shapes to be interpolated") spec.expose_inputs(DensityWeightedAlignmentWorkchain, namespace='density_weighted', From 1b8d998c1c0ea358217fa158c91e7c6493ea0aba Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Sun, 21 Mar 2021 23:13:34 +0100 Subject: [PATCH 44/60] adding the potential alignment between the of DFT potential of defect_q and host to the potential of the model --- .../gaussian_countercharge.py | 57 ++++++++++++++----- .../potential_alignment/mae/utils.py | 3 +- .../potential_alignment.py | 2 +- 3 files changed, 46 insertions(+), 16 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 66d01e4..515a454 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -110,9 +110,10 @@ def define(cls, spec): cls.compute_correction, ) spec.output('gaussian_parameters', valid_type=orm.Dict, required=False) - spec.output('v_dft_difference', valid_type=orm.ArrayData) +# spec.output('v_dft_difference', valid_type=orm.ArrayData) spec.output('alignment_q0_to_host', valid_type=orm.Float) - spec.output('alignment_dft_to_model', valid_type=orm.Float) + spec.output('alignment_diff_q_q0_to_model', valid_type=orm.Float) + spec.output('alignment_diff_q_host_to_model', valid_type=orm.Float) spec.output('total_alignment', valid_type=orm.Float, required=True) spec.output('total_correction', valid_type=orm.Float) spec.output('electrostatic_correction', valid_type=orm.Float) @@ -319,7 +320,11 @@ def compute_dft_difference_potential(self): """ self.ctx.v_defect_q_q0 = get_potential_difference( self.inputs.v_defect_q, self.inputs.v_defect_q0) - self.out('v_dft_difference', self.ctx.v_defect_q_q0) + #self.out('v_dft_difference', self.ctx.v_defect_q_q0) + + self.ctx.v_defect_q_host = get_potential_difference( + self.inputs.v_defect_q, self.inputs.v_host) + #self.out('v_dft_difference', self.ctx.v_defect_q_q0) def submit_alignment_workchains(self): @@ -342,13 +347,14 @@ def submit_alignment_workchains(self): label = 'workchain_alignment_q0_to_host' self.to_context(**{label: workchain_future}) - # Convert units from model potential workchain, and also change sign + # Convert units from from eV in model potential to Ryd unit as in DFT potential, and also change sign + # The potential alignment has to be converted back to eV. It is done in the mae/utils.py. Not pretty, has to be cleaned # TODO: Check if this breaks provenance graph v_model = orm.ArrayData() v_model.set_array('data', - self.ctx.v_model.get_array(self.ctx.v_model.get_arraynames()[0])*-2.0) # Ha to Ry - This is dirty - need to harmonise units + self.ctx.v_model.get_array(self.ctx.v_model.get_arraynames()[0])/(-1.0*CONSTANTS.ry_to_ev)) # eV to Ry unit of potential - This is dirty - need to harmonise units - # Compute the alignment between the defect DFT difference potential, and the model + # Compute the alignment between the difference of DFT potentials v_q and v_q0, and the model inputs = { "allow_interpolation": orm.Bool(True), @@ -359,9 +365,22 @@ def submit_alignment_workchains(self): }, } workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) - label = 'workchain_alignment_dft_to_model' + label = 'workchain_alignment_q-q0_to_model' self.to_context(**{label: workchain_future}) + # Compute the alignment between the difference of DFT potentials v_q and v_host, and the model + inputs = { + + "allow_interpolation": orm.Bool(True), + "mae":{ + "first_potential": self.ctx.v_defect_q_host, + "second_potential": v_model, + "defect_site": self.inputs.defect_site + }, + } + workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) + label = 'workchain_alignment_q-host_to_model' + self.to_context(**{label: workchain_future}) def check_alignment_workchains(self): """ @@ -379,16 +398,25 @@ def check_alignment_workchains(self): else: self.ctx.alignment_q0_to_host = alignment_wc.outputs.alignment_required - # DFT diff to model - alignment_wc = self.ctx['workchain_alignment_dft_to_model'] + # DFT q-q0 to model + alignment_wc = self.ctx['workchain_alignment_q-q0_to_model'] if not alignment_wc.is_finished_ok: self.report( - 'Potential alignment workchain (DFT diff to model) failed with status {}' + 'Potential alignment workchain (DFT q-q0 to model) failed with status {}' .format(alignment_wc.exit_status)) return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT else: - self.ctx.alignment_dft_to_model = alignment_wc.outputs.alignment_required + self.ctx['alignment_q-q0_to_model'] = alignment_wc.outputs.alignment_required + # DFT q-host to model + alignment_wc = self.ctx['workchain_alignment_q-host_to_model'] + if not alignment_wc.is_finished_ok: + self.report( + 'Potential alignment workchain (DFT q-host to model) failed with status {}' + .format(alignment_wc.exit_status)) + return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT + else: + self.ctx['alignment_q-host_to_model'] = alignment_wc.outputs.alignment_required def get_isolated_energy(self): """ @@ -440,8 +468,8 @@ def compute_correction(self): electrostatic_correction = self.ctx.model_correction_energies['1'] - total_alignment = get_total_alignment(self.ctx.alignment_dft_to_model, - self.ctx.alignment_q0_to_host, + total_alignment = get_total_alignment(self.ctx['alignment_q-q0_to_model'], + self.ctx['alignment_q0_to_host'], self.inputs.defect_charge) total_correction = get_total_correction(electrostatic_correction, @@ -462,6 +490,7 @@ def compute_correction(self): # Store additional outputs self.out('alignment_q0_to_host', self.ctx.alignment_q0_to_host) - self.out('alignment_dft_to_model', self.ctx.alignment_dft_to_model) + self.out('alignment_diff_q_q0_to_model', self.ctx['alignment_q-q0_to_model']) + self.out('alignment_diff_q_host_to_model', self.ctx['alignment_q-host_to_model']) self.report('Gaussian Countercharge workchain completed successfully') diff --git a/aiida_defects/formation_energy/potential_alignment/mae/utils.py b/aiida_defects/formation_energy/potential_alignment/mae/utils.py index 9a0a5f8..50701e1 100644 --- a/aiida_defects/formation_energy/potential_alignment/mae/utils.py +++ b/aiida_defects/formation_energy/potential_alignment/mae/utils.py @@ -8,6 +8,7 @@ from __future__ import absolute_import import numpy as np +from qe_tools import CONSTANTS from aiida.engine import calcfunction from aiida import orm @@ -70,7 +71,7 @@ def get_alignment(potential_difference, defect_site, cutoff_radius=lambda: orm.F raise AllValuesMaskedError fit_result = fit_potential(v_diff_masked) - alignment = fit_result.x + alignment = fit_result.x*CONSTANTS.ry_to_ev return orm.Float(alignment) diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 2c3e76e..d21cdbb 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -221,5 +221,5 @@ def results(self): Collect results """ self.report( - "Completed alignment. An alignment of {} eV is required".format(self.ctx.alignment)) + "Completed alignment. An alignment of {} eV is required".format(self.ctx.alignment.value)) self.out('alignment_required', self.ctx.alignment) From c9b85a863e6cd5709c1f3cc77898f55b56c33278 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Wed, 24 Mar 2021 15:47:26 +0100 Subject: [PATCH 45/60] unpack defect_position list in mae/utils.py. Speed up the calculation considerably. --- .../formation_energy/potential_alignment/mae/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aiida_defects/formation_energy/potential_alignment/mae/utils.py b/aiida_defects/formation_energy/potential_alignment/mae/utils.py index 50701e1..21d5195 100644 --- a/aiida_defects/formation_energy/potential_alignment/mae/utils.py +++ b/aiida_defects/formation_energy/potential_alignment/mae/utils.py @@ -51,7 +51,7 @@ def get_alignment(potential_difference, defect_site, cutoff_radius=lambda: orm.F # Generate a crystal grid of the same dimension as the data ijk_array = get_grid(v_diff.shape, endpoint=False) # Compute the distance from the defect site to every other. - distance_vectors = np.array(defect_site).reshape(3,1) - ijk_array + distance_vectors = np.array(defect_site.get_list()).reshape(3,1) - ijk_array # Apply minimum image min_image_vectors = (distance_vectors - np.rint(distance_vectors)) # Compute distances and reshape to match input data @@ -61,7 +61,7 @@ def get_alignment(potential_difference, defect_site, cutoff_radius=lambda: orm.F # images is d=1 so look for coordinates at a distance of less than d=0.5. # These are the coordinates within the shphere of interaction of the defect. # Mask these and only compute the alignment the remaining, most distance points. - mask = np.ma.less(distances, cutoff_radius) + mask = np.ma.less(distances, cutoff_radius.value) v_diff_masked = np.ma.masked_array(v_diff, mask=mask) values_remaining = (v_diff_masked.count()/np.prod(v_diff.shape))*100.0 print('{:.2f}% of values remain'.format(values_remaining)) From 4234d9a1c26c1d6a1160f442574cae7937f2ddc1 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 19 Apr 2021 16:06:30 +0200 Subject: [PATCH 46/60] Adding the potential alignment between v_defect_q-v_bulk and v_model --- .../formation_energy/chemical_potential/chemical_potential.py | 4 ++-- aiida_defects/formation_energy/formation_energy_base.py | 3 ++- aiida_defects/formation_energy/formation_energy_qe.py | 4 +--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index ec44f62..6bf2d66 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -79,7 +79,7 @@ def setup(self): E_hull = get_e_above_hull(self.inputs.compound.value, element_list, formation_energy_dict) if E_hull > 0: self.report('WARNING! The compound {} is predicted to be unstable. For the purpose of determining the stability region, we shift its formation energy down so that it is on the convex hull. Use with care!'.format(self.inputs.compound.value)) - formation_energy_dict[self.inputs.compound.value] -= composition.num_atoms*(E_hull+0.005) # the factor 0.005 is added for numerical reason + formation_energy_dict[self.inputs.compound.value] -= composition.num_atoms*(E_hull+0.005) # the factor 0.005 is added for numerical precision to make sure that the compound is now on the convex hull self.ctx.formation_energy_dict = Dict(dict=formation_energy_dict) @@ -117,7 +117,7 @@ def solve_matrix_of_constraints(self): self.inputs.compound, self.inputs.tolerance ) - #self.report('The stability corner is : {}'.format(ordered_stability_corners.get_array('data'))) + #self.report('The stability corner is : {}'.format(self.ctx.stability_corners.get_array('data'))) self.out("stability_corners", self.ctx.stability_corners) def get_chemical_potential(self): diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 5e6d0c9..7b7bbf1 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -108,7 +108,8 @@ def define(cls, spec): help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", default=lambda: orm.Bool(True)) # spec.input('sigma', valid_type=orm.Float, required=False) - spec.input("cutoff", valid_type=orm.Float) + spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=True) + spec.input("cutoff", valid_type=orm.Float, required=False) spec.input("run_dfpt", valid_type=orm.Bool) diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index 5902b76..e6f31fd 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -77,8 +77,6 @@ def define(cls, spec): help="Scheduler options for the PW.x calculations") spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, help="Settings for the PW.x calculations") - #spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, - # help="The pseudopotential family for use with the code, if required") spec.input("qe.dft.supercell.pseudopotential_family", valid_type=orm.Str, help="The pseudopotential family for use with the code") @@ -201,7 +199,7 @@ def prep_dft_calcs_gaussian_correction(self): 'Launching PWSCF for host structure (PK={}) with charge {} (PK={})' .format(self.inputs.host_structure.pk, "0.0", future.pk)) self.to_context(**{'calc_host': future}) - + # Defect structure; neutral charge state if self.inputs.run_pw_defect_q0: pseudos = get_pseudos_from_structure(self.inputs.defect_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) From 20192f8928e704c27fa9a1fec89d2fd7d3d9f58b Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 19 Apr 2021 16:09:19 +0200 Subject: [PATCH 47/60] Adding the QE protocol for the DFT calculations of the host and defect structures. It is now possible to relax or vc-relax the structures as well. --- .../formation_energy/formation_energy_qe.py | 233 +++++++++++------- 1 file changed, 138 insertions(+), 95 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index e6f31fd..492d829 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -13,8 +13,9 @@ from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit from aiida.plugins import CalculationFactory, WorkflowFactory from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain -# from aiida_quantumespresso.calculations.pp import PpCalculation -from aiida.orm.nodes.data.upf import get_pseudos_from_structure +from aiida_quantumespresso.workflows.pw.relax import PwRelaxWorkChain +from aiida_quantumespresso.workflows.protocols.utils import recursive_merge +from aiida_quantumespresso.common.types import RelaxType from aiida_defects.formation_energy.formation_energy_base import FormationEnergyWorkchainBase from aiida_defects.formation_energy.utils import run_pw_calculation @@ -64,14 +65,14 @@ def define(cls, spec): spec.input('rho_host_node', valid_type=orm.Int, required=False) spec.input('rho_defect_q0_node', valid_type=orm.Int, required=False) spec.input('rho_defect_q_node', valid_type=orm.Int, required=False) - spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=False) + spec.input("relaxation_scheme", valid_type=orm.Str, required=False, + default=lambda: orm.Str('vc-relax'), + help="Option to relax the cell. Possible options are : ['fixed', 'relax', 'vc-relax']") # DFT inputs (PW.x) spec.input("qe.dft.supercell.code", valid_type=orm.Code, help="The pw.x code to use for the calculations") -# spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, -# help="The k-point grid to use for the calculations") - spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, + spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, required=False, help="Parameters for the PWSCF calcuations. Some will be set automatically") spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, help="Scheduler options for the PW.x calculations") @@ -81,28 +82,19 @@ def define(cls, spec): help="The pseudopotential family for use with the code") # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant - spec.input("qe.dft.unitcell.code", - valid_type=orm.Code, + spec.input("qe.dft.unitcell.code", valid_type=orm.Code, help="The pw.x code to use for the calculations") -# spec.input("qe.dft.unitcell.kpoints", -# valid_type=orm.KpointsData, -# help="The k-point grid to use for the calculations") spec.input("qe.dft.unitcell.parameters", - valid_type=orm.Dict, + valid_type=orm.Dict, required=False, help="Parameters for the PWSCF calcuations. Some will be set automatically") spec.input("qe.dft.unitcell.scheduler_options", valid_type=orm.Dict, help="Scheduler options for the PW.x calculations") -# spec.input_namespace("qe.dft.unitcell.pseudopotentials", -# valid_type=orm.UpfData, -# dynamic=True, -# help="The pseudopotential family for use with the code, if required") + spec.input("qe.dft.unitcell.settings", valid_type=orm.Dict, + help="Settings for the PW.x calculations") spec.input("qe.dft.unitcell.pseudopotential_family", valid_type=orm.Str, help="The pseudopotential family for use with the code") - spec.input('k_points_distance', valid_type=orm.Float, required=False, default=lambda: orm.Float(0.2), - help='distance (in 1/Angstrom) between adjacent kpoints') - # Postprocessing inputs (PP.x) spec.input("qe.pp.code", valid_type=orm.Code, @@ -158,80 +150,104 @@ def prep_dft_calcs_gaussian_correction(self): self.report("Setting up the Gaussian Countercharge correction workchain") - kpoints = orm.KpointsData() - kpoints.set_cell_from_structure(self.inputs.host_structure) - kpoints.set_kpoints_mesh_from_density(self.inputs.k_points_distance.value) - - inputs = { - 'pw':{ - 'code' : self.inputs.qe.dft.supercell.code, - #'pseudos': get_pseudos_from_structure(self.inputs.unitcell, self.inputs.qe.dft.unitcell.pseudopotential_family.value), - 'metadata' : self.inputs.qe.dft.supercell.scheduler_options.get_dict(), - 'settings' : self.inputs.qe.dft.supercell.settings, - }, - 'kpoints': kpoints, - } - -# pw_inputs = self.inputs.qe.dft.supercell.code.get_builder() -# pw_inputs.pseudos = self.inputs.qe.dft.supercell.pseudopotentials -# pw_inputs.kpoints = self.inputs.qe.dft.supercell.kpoints -# pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() -# pw_inputs.settings = self.inputs.qe.dft.supercell.settings - - parameters = self.inputs.qe.dft.supercell.parameters.get_dict() - - # We set 'tot_charge' later so throw an error if the user tries to set it to avoid - # any ambiguity or unseen modification of user input - if 'tot_charge' in parameters['SYSTEM']: - self.report('You cannot set the "tot_charge" PW.x parameter explicitly') - return self.exit_codes.ERROR_PARAMETER_OVERRIDE + relax_type = {'fixed': RelaxType.NONE, 'relax': RelaxType.POSITIONS, 'vc-relax': RelaxType.POSITIONS_CELL} + + overrides = { + 'base':{ + # 'pseudo_family': self.inputs.qe.dft.supercell.pseudopotential_family.value, + 'pw': { + 'parameters': {}, + # 'metadata': self.inputs.qe.dft.supercell.scheduler_options.get_dict(), + 'settings': self.inputs.qe.dft.supercell.settings.get_dict(), + } + }, + 'base_final_scf':{ + # 'pseudo_family': self.inputs.qe.dft.supercell.pseudopotential_family.value, + 'pw': { + 'parameters': {}, + # 'metadata': self.inputs.qe.dft.supercell.scheduler_options.get_dict(), + 'settings': self.inputs.qe.dft.supercell.settings.get_dict(), + } + }, + 'clean_workdir' : orm.Bool(False), + } + + if 'pseudopotential_family' in self.inputs.qe.dft.supercell: + overrides['base']['pseudo_family'] = self.inputs.qe.dft.supercell.pseudopotential_family.value + overrides['base_final_scf']['pseudo_family'] = self.inputs.qe.dft.supercell.pseudopotential_family.value + if 'parameters' in self.inputs.qe.dft.supercell: + overrides['base']['pw']['parameters'] = self.inputs.qe.dft.supercell.parameters.get_dict() + overrides['base_final_scf']['pw']['parameters'] = self.inputs.qe.dft.supercell.parameters.get_dict() + # else: + # overrides['base']['pw']['parameters'] = {} + # overrides['base_final_scf']['pw']['parameters'] = {} # Host structure if self.inputs.run_pw_host: - pseudos = get_pseudos_from_structure(self.inputs.host_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) - parameters['SYSTEM']['tot_charge'] = orm.Float(0.) - inputs['pw']['parameters'] = orm.Dict(dict=parameters) - inputs['pw']['structure'] = self.inputs.host_structure - inputs['pw']['pseudos'] = pseudos - - future = self.submit(PwBaseWorkChain, **inputs) + inputs = PwRelaxWorkChain.get_builder_from_protocol( + code = self.inputs.qe.dft.supercell.code, + structure = self.inputs.host_structure, + overrides = overrides, + relax_type = relax_type[self.inputs.relaxation_scheme.value] + ) + + inputs['base']['pw']['metadata'] = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + inputs['base']['pw']['settings'] = self.inputs.qe.dft.supercell.settings + inputs['base_final_scf']['pw']['metadata'] = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + inputs['base_final_scf']['pw']['settings'] = self.inputs.qe.dft.supercell.settings + + #future = self.submit(PwRelaxWorkChain, **inputs) + future = self.submit(inputs) self.report( - 'Launching PWSCF for host structure (PK={}) with charge {} (PK={})' + 'Launching PWSCF for the host structure (PK={}) with charge {} (PK={})' .format(self.inputs.host_structure.pk, "0.0", future.pk)) self.to_context(**{'calc_host': future}) - + # Defect structure; neutral charge state if self.inputs.run_pw_defect_q0: - pseudos = get_pseudos_from_structure(self.inputs.defect_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) - parameters['SYSTEM']['tot_charge'] = orm.Float(0.) - parameters['SYSTEM']['nspin'] = 2 - parameters['SYSTEM']['tot_magnetization'] = 0.0 - inputs['pw']['parameters'] = orm.Dict(dict=parameters) - inputs['pw']['structure'] = self.inputs.defect_structure - inputs['pw']['pseudos'] = pseudos - - future = self.submit(PwBaseWorkChain, **inputs) + inputs = PwRelaxWorkChain.get_builder_from_protocol( + code = self.inputs.qe.dft.supercell.code, + structure = self.inputs.defect_structure, + overrides = overrides, + relax_type = relax_type[self.inputs.relaxation_scheme.value] + ) + + inputs['base']['pw']['metadata'] = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + inputs['base']['pw']['settings'] = self.inputs.qe.dft.supercell.settings + inputs['base_final_scf']['pw']['metadata'] = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + inputs['base_final_scf']['pw']['settings'] = self.inputs.qe.dft.supercell.settings + + #future = self.submit(PwRelaxWorkChain, **inputs) + future = self.submit(inputs) self.report( - 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' + 'Launching PWSCF for the defect structure (PK={}) with charge {} (PK={})' .format(self.inputs.defect_structure.pk, "0.0", future.pk)) self.to_context(**{'calc_defect_q0': future}) # Defect structure; target charge state if self.inputs.run_pw_defect_q: - pseudos = get_pseudos_from_structure(self.inputs.defect_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) - parameters['SYSTEM']['tot_charge'] = self.inputs.defect_charge.value - parameters['SYSTEM']['nspin'] = 2 - parameters['SYSTEM']['tot_magnetization'] = 0.0 - inputs['pw']['parameters'] = orm.Dict(dict=parameters) - inputs['pw']['structure'] = self.inputs.defect_structure - inputs['pw']['pseudos'] = pseudos - - future = self.submit(PwBaseWorkChain, **inputs) + overrides['base']['pw']['parameters'] = recursive_merge(overrides['base']['pw']['parameters'], {'SYSTEM':{'tot_charge': self.inputs.defect_charge.value}}) + overrides['base_final_scf']['pw']['parameters'] = recursive_merge(overrides['base_final_scf']['pw']['parameters'], {'SYSTEM':{'tot_charge': self.inputs.defect_charge.value}}) + + inputs = PwRelaxWorkChain.get_builder_from_protocol( + code = self.inputs.qe.dft.supercell.code, + structure = self.inputs.defect_structure, + overrides = overrides, + relax_type = relax_type[self.inputs.relaxation_scheme.value] + ) + + inputs['base']['pw']['metadata'] = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + inputs['base']['pw']['settings'] = self.inputs.qe.dft.supercell.settings + inputs['base_final_scf']['pw']['metadata'] = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + inputs['base_final_scf']['pw']['settings'] = self.inputs.qe.dft.supercell.settings + + #future = self.submit(PwRelaxWorkChain, **inputs) + future = self.submit(inputs) self.report( - 'Launching PWSCF for defect structure (PK={}) with charge {} (PK={})' + 'Launching PWSCF for the defect structure (PK={}) with charge {} (PK={})' .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) self.to_context(**{'calc_defect_q': future}) - + def check_dft_calcs_gaussian_correction(self): """ Check if the required calculations for the Gaussian Countercharge correction workchain @@ -585,28 +601,55 @@ def prep_hostcell_calc_for_dfpt(self): # executable on a specific computer. As the PH calculation may have to be run on # an HPC cluster, the PW calculation must be run on the same machine and so this # may necessitate that a different code is used than that for the supercell calculations. - pw_inputs = self.inputs.qe.dft.unitcell.code.get_builder() - - # These are not necessarily the same as for the other DFT calculations - pw_inputs.pseudos = self.inputs.qe.dft.unitcell.pseudopotentials - pw_inputs.kpoints = self.inputs.qe.dft.unitcell.kpoints - pw_inputs.metadata = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() - - pw_inputs.structure = self.inputs.host_unitcell - parameters = self.inputs.qe.dft.unitcell.parameters.get_dict() - pw_inputs.parameters = orm.Dict(dict=parameters) - - future = self.submit(pw_inputs) - # self.report( - # 'Launching PWSCF for host unitcell structure (PK={})' - # .format(self.inputs.host_structure.pk, future.pk) - # ) + + relax_type = {'fixed': RelaxType.NONE, 'relax': RelaxType.POSITIONS, 'vc-relax': RelaxType.POSITIONS_CELL} + + overrides = { + 'base':{ + # 'pseudo_family': self.inputs.qe.dft.unitcell.pseudopotential_family.value, + 'pw': { + 'parameters': {}, + # 'metadata': self.inputs.qe.dft.unitcell.scheduler_options.get_dict(), + 'settings': self.inputs.qe.dft.unitcell.settings.get_dict(), + } + }, + 'base_final_scf':{ + # 'pseudo_family': self.inputs.qe.dft.unitcell.pseudopotential_family.value, + 'pw': { + 'parameters': {}, + # 'metadata': self.inputs.qe.dft.unitcell.scheduler_options.get_dict(), + 'settings': self.inputs.qe.dft.unitcell.settings.get_dict(), + } + }, + 'clean_workdir' : orm.Bool(False), + } + + if 'pseudopotential_family' in self.inputs.qe.dft.unitcell: + overrides['base']['pseudo_family'] = self.inputs.qe.dft.unitcell.pseudopotential_family.value + overrides['base_final_scf']['pseudo_family'] = self.inputs.qe.dft.unitcell.pseudopotential_family.value + if 'parameters' in self.inputs.qe.dft.unitcell: + overrides['base']['pw']['parameters'] = self.inputs.qe.dft.unitcell.parameters.get_dict() + overrides['base_final_scf']['pw']['parameters'] = self.inputs.qe.dft.unitcell.parameters.get_dict() + + inputs = PwRelaxWorkChain.get_builder_from_protocol( + code = self.inputs.qe.dft.unitcell.code, + structure = self.inputs.host_unitcell, + overrides = overrides, + relax_type = relax_type[self.inputs.relaxation_scheme.value] + ) + + inputs['base']['pw']['metadata'] = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() + inputs['base']['pw']['settings'] = self.inputs.qe.dft.unitcell.settings + inputs['base_final_scf']['pw']['metadata'] = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() + inputs['base_final_scf']['pw']['settings'] = self.inputs.qe.dft.unitcell.settings + + #future = self.submit(PwRelaxWorkChain, **inputs) + future = self.submit(inputs) self.report( - 'Launching PWSCF for host unitcell structure (PK={})'.format(self.inputs.host_unitcell.pk, future.pk)) + 'Launching PWSCF for host unitcell structure (PK={}) at node (PK={})'. + format(self.inputs.host_unitcell.pk, future.pk)) self.to_context(**{'calc_host_unitcell': future}) - # return ToContext(**{'calc_host_unitcell': future}) - def check_hostcell_calc_for_dfpt(self): """ Check if the DFT calculation to be used for the computation of the From f2d7b39d9cbebcc14236d3dbe859a7f177fa912b Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 20 Apr 2021 13:47:32 +0200 Subject: [PATCH 48/60] Switching to alignment between v_q-v_host and v_model --- .../gaussian_countercharge.py | 10 ++++--- .../gaussian_countercharge/utils.py | 29 ++++++++++++++++++- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 515a454..f7f33a5 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -13,7 +13,7 @@ from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain from .model_potential.model_potential import ModelPotentialWorkchain from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference -from .utils import get_total_correction, get_total_alignment, get_charge_model_fit, fit_energies, calc_correction, is_gaussian_isotrope +from .utils import get_total_correction, get_alignment, get_total_alignment, get_charge_model_fit, fit_energies, calc_correction, is_gaussian_isotrope from qe_tools import CONSTANTS import numpy as np @@ -468,9 +468,11 @@ def compute_correction(self): electrostatic_correction = self.ctx.model_correction_energies['1'] - total_alignment = get_total_alignment(self.ctx['alignment_q-q0_to_model'], - self.ctx['alignment_q0_to_host'], - self.inputs.defect_charge) + # total_alignment = get_total_alignment(self.ctx['alignment_q-q0_to_model'], + # self.ctx['alignment_q0_to_host'], + # self.inputs.defect_charge) + total_alignment = get_alignment(self.ctx['alignment_q-host_to_model'], + self.inputs.defect_charge) total_correction = get_total_correction(electrostatic_correction, total_alignment) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index 068ca84..1c54809 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -59,11 +59,38 @@ def get_total_alignment(alignment_dft_model, alignment_q0_host, charge): """ - total_alignment = -1.0*(charge * alignment_dft_model) + ( + # total_alignment = -1.0*(charge * alignment_dft_model) + ( + # charge * alignment_q0_host) + + # The minus sign is incorrect. It is remove in the corrected formula below: + total_alignment = charge * alignment_dft_model + ( charge * alignment_q0_host) return total_alignment +@calcfunction +def get_alignment(alignment_q_host_to_model, charge): + """ + Calculate the total potential alignment + + Parameters + ---------- + alignment_q_host_to_model: orm.Float + The correction energy derived from the alignment of the DFT difference + potential of the charge defect and the host to the model potential + charge: orm.Float + The charge state of the defect + + Returns + ------- + total_alignment + The calculated total potential alignment + """ + + alignment = charge.value * alignment_q_host_to_model.value + + return orm.Float(alignment) + @calcfunction def get_total_correction(model_correction, total_alignment): From e514947ec7701b913266ed048e9ec01444c71550 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Thu, 6 May 2021 22:49:48 -0700 Subject: [PATCH 49/60] Fix bug in interpolation routine For some cases. interpolation would 'rotate' the output array. This was due to the controversial defualt indexing order of meshgrid(). Fix this by enforcing 'ij' indexing. Also improve the commnents a bit. --- .../formation_energy/potential_alignment/utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aiida_defects/formation_energy/potential_alignment/utils.py b/aiida_defects/formation_energy/potential_alignment/utils.py index a40a11e..0c6cdcf 100644 --- a/aiida_defects/formation_energy/potential_alignment/utils.py +++ b/aiida_defects/formation_energy/potential_alignment/utils.py @@ -69,16 +69,16 @@ def get_interpolation(input_array, target_shape): array = input_array.get_array(input_array.get_arraynames()[0]) target_shape = target_shape.get_list() - # It's a bit complicated to understand map_coordinates - # The coordinates used to understand the data are the matrix coords of the data - # The coords passed are the new coords you want to interpolate for - # So, we meshgrid a new set of coords in units of the matrix coords of the data + # map_coordinates takes two parameters - an input array and a coordinates + # array. It then evaluates what the interpolation of the input array should be + # at the target coordinates. + # Generate the target grid. i = np.linspace(0, array.shape[0]-1, target_shape[0]) j = np.linspace(0, array.shape[1]-1, target_shape[1]) k = np.linspace(0, array.shape[2]-1, target_shape[2]) - - ii,jj,kk = np.meshgrid(i,j,k) + ii,jj,kk = np.meshgrid(i,j,k, indexing='ij') target_coords = np.array([ii,jj,kk]) + # Do the interpolation interp_array = map_coordinates(input=np.real(array), coordinates=target_coords) interpolated_array = orm.ArrayData() From 95c47a5df901e779ad220a9b6aabdec4b97c58be Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Sun, 12 Dec 2021 06:56:15 -0800 Subject: [PATCH 50/60] Improvments to the specification of an anisotropic dielectric --- .../gaussian_countercharge.py | 10 ++++++---- .../model_potential/model_potential.py | 4 ++-- .../model_potential/utils.py | 18 +++++++++++------- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index f7f33a5..e5e8d5c 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -39,8 +39,8 @@ def define(cls, spec): valid_type=orm.List, help="Defect site position in crystal coordinates.") spec.input("epsilon", - valid_type=orm.Float, - help="Dielectric constant for the host material.") + valid_type=orm.ArrayData, + help="Dielectric tensor (3x3) for the host material.") spec.input("model_iterations_required", valid_type=orm.Int, default=lambda: orm.Int(3), @@ -422,7 +422,7 @@ def get_isolated_energy(self): """ Fit the calculated model energies and obtain an estimate for the isolated model energy """ - + if not self.ctx.is_gaussian_isotrope: # Get the linear dimensions of the structures linear_dimensions = {} @@ -440,7 +440,9 @@ def get_isolated_energy(self): else: sigma = self.ctx.sigma defect_charge = self.inputs.defect_charge.value - epsilon = self.inputs.epsilon.value + # Epsilon is now expected to be a tensor, and so to get a scalar here we diagonalise. + epsilon_tensor = self.inputs.epsilon.get_array('epsilon') + epsilon = np.mean(np.diag(epsilon_tensor)) # Approximation to the tensor self.report( "Computing the energy of the isolated gaussian analytically" ) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py index e85196b..46f741d 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/model_potential.py @@ -42,8 +42,8 @@ def define(cls, spec): default=lambda: orm.Float(40.), help="Energy cutoff for grids in Rydberg") spec.input('epsilon', - valid_type=orm.Float, - help="Dielectric constant of the host material") + valid_type=orm.ArrayData, + help="Dielectric tensor (3x3) of the host material") spec.input('gaussian_params', valid_type=orm.List, help="A length 9 list of parameters needed to construct the " diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py index 6bc959a..3826dac 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py @@ -421,8 +421,8 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): The dimensions required for the reciprocal space grid charge_density: array The calculated model charge density on a 3-dimensional real space grid - epsilon: float - The value of the dielectric constant + epsilon: array + 3x3 dielectric tensor Returns ------- @@ -433,7 +433,7 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): dimensions = np.array(dimensions) cell_matrix = cell_matrix.get_array('cell_matrix') charge_density = charge_density.get_array('model_charge') - epsilon = epsilon.value + epsilon = epsilon.get_array('epsilon') # Set up a reciprocal space grid for the potential # Prepare coordinates in a 3D array of ijk vectors @@ -447,17 +447,21 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): # Get G vectors G_array = np.dot(ijk_array, (cell_matrix.T)) + G_array_shape = G_array.shape[0:3] # Drop last axis - we know that each vector is len 3 - # Calculate the square modulus - G_sqmod_array = (np.linalg.norm(G_array, axis=3)**2).T + # Compute permittivity for all g-vectors + dielectric = [] + for gvec in G_array.reshape(-1,3): + dielectric.append(gvec@epsilon@gvec.T) + dielectric = np.array(dielectric).reshape(G_array_shape).T # Get the reciprocal space charge density charge_density_g = get_fft(charge_density) # Compute the model potential v_model = np.divide( - charge_density_g, G_sqmod_array, where=G_sqmod_array != 0.0) - V_model_g = v_model * 4. * np.pi / epsilon + charge_density_g, dielectric, where=dielectric != 0.0) + V_model_g = v_model * 4. * np.pi V_model_g[dimensions[0] + 1, dimensions[1] + 1, dimensions[2] + 1] = 0.0 From 352a35f754311b8d700959840fa2a93885ececf5 Mon Sep 17 00:00:00 2001 From: Conrad Johnston Date: Sun, 12 Dec 2021 21:25:37 -0800 Subject: [PATCH 51/60] Update tests Update tests to reflect changes to input structure --- .../formation_energy/formation_energy_base.py | 21 +++---------------- .../potential_alignment.py | 4 ---- .../model_potential/test_model_potential.py | 10 ++++++--- .../test_gaussian_countercharge.py | 2 +- .../test_formation_energy_qe.py | 21 ++++++++++++++----- 5 files changed, 27 insertions(+), 31 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 0a51a54..98c720b 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -58,12 +58,9 @@ def define(cls, spec): valid_type=orm.Float, help="Defect charge state") spec.input( -<<<<<<< HEAD "defect_species", valid_type=orm.Str) spec.input( -======= ->>>>>>> anisotropic_gaussian "defect_site", valid_type=orm.List, help="Defect site position in crystal coordinates" ) @@ -76,13 +73,6 @@ def define(cls, spec): valid_type=orm.Dict, help="To determine the sign of the chemical potential. The convention is that removing an atom is negative") -<<<<<<< HEAD - # Chemical potential # TODO: Doc all of this - spec.input('formation_energy_dict', valid_type=orm.Dict) - spec.input('compound', valid_type=orm.Str) - spec.input('dependent_element', valid_type=orm.Str) - spec.input('tolerance', valid_type=orm.Float, default=lambda: orm.Float(1E-4)) -======= # Chemical potential spec.input('run_chem_pot_wc', valid_type=orm.Bool, default=lambda: orm.Bool(True)) spec.input('formation_energy_dict', required=False, valid_type=orm.Dict) @@ -122,13 +112,12 @@ def define(cls, spec): spec.input("charge_model.fitted.strict_fit", valid_type=orm.Bool, help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", - default=lambda: orm.Bool(True)) + default=lambda: orm.Bool(True)) # spec.input('sigma', valid_type=orm.Float, required=False) - spec.input("epsilon", valid_type=orm.Float, help="Dielectric constant of the host", required=True) + spec.input("epsilon", valid_type=orm.ArrayData, help="3x3 dielectric tensor of the host", required=True) spec.input("cutoff", valid_type=orm.Float, required=False) spec.input("run_dfpt", valid_type=orm.Bool) ->>>>>>> anisotropic_gaussian # Methodology spec.input( @@ -243,15 +232,11 @@ def run_gaussian_correction_workchain(self): "defect_site": self.inputs.defect_site, "host_structure": self.inputs.host_structure, "epsilon": self.ctx.epsilon, -<<<<<<< HEAD - 'charge_model': charge_model_dict -======= "cutoff" : self.inputs.cutoff, 'charge_model': { 'model_type': self.inputs.charge_model.model_type } - ->>>>>>> anisotropic_gaussian + } if self.inputs.charge_model.model_type.value == 'fixed': inputs['charge_model']['fixed'] = {'gaussian_params': self.inputs.charge_model.fixed.gaussian_params} diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 545dd8a..d21cdbb 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -221,9 +221,5 @@ def results(self): Collect results """ self.report( -<<<<<<< HEAD - "Completed alignment. An alignment of {} eV is required".format(self.ctx.alignment)) -======= "Completed alignment. An alignment of {} eV is required".format(self.ctx.alignment.value)) ->>>>>>> anisotropic_gaussian self.out('alignment_required', self.ctx.alignment) diff --git a/tests/workflows/formation_energy/corrections/gaussian_countercharge/model_potential/test_model_potential.py b/tests/workflows/formation_energy/corrections/gaussian_countercharge/model_potential/test_model_potential.py index 1eab708..5ccaf85 100644 --- a/tests/workflows/formation_energy/corrections/gaussian_countercharge/model_potential/test_model_potential.py +++ b/tests/workflows/formation_energy/corrections/gaussian_countercharge/model_potential/test_model_potential.py @@ -7,24 +7,28 @@ ######################################################################################## """Tests for the `ModelPotentialWorkchain` class.""" import pytest +import numpy as np + from aiida.common import AttributeDict -from aiida.orm import Float, List, Dict, Int, StructureData +from aiida.orm import Float, List, ArrayData, Dict, Int, StructureData from aiida_defects.formation_energy.corrections.gaussian_countercharge.model_potential.model_potential import ModelPotentialWorkchain @pytest.fixture -def generate_inputs_model_potential(generate_structure): +def generate_inputs_model_potential(generate_structure, generate_array_data): """Generate default inputs for `ModelPotentialWorkchain`""" def _generate_inputs_model_potential(): """Generate default inputs for `ModelPotentialWorkchain`""" + mock_array = generate_array_data(3) + inputs = { 'peak_charge': Float(1.0), 'defect_charge': Float(1.0), 'scale_factor': Int(2), 'host_structure': generate_structure(), 'defect_site': List(list=[0.5,0.5,0.5]), - 'epsilon': Float(1.0), + 'epsilon': mock_array, 'gaussian_params': List(list=[1.,1.,1.,1.,1.,1.,1.,1.,1.]) } diff --git a/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py b/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py index 0be8985..504b0a6 100644 --- a/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py +++ b/tests/workflows/formation_energy/corrections/gaussian_countercharge/test_gaussian_countercharge.py @@ -24,7 +24,7 @@ def _generate_inputs_gaussian_countercharge(): 'host_structure' : generate_structure(), 'defect_charge' : Float(-2.), 'defect_site' : List(list=[0.5,0.5,0.5]), - 'epsilon' : Float(11.68), + 'epsilon' : mock_array, 'v_host' : mock_array, 'v_defect_q0' : mock_array, 'v_defect_q' : mock_array, diff --git a/tests/workflows/formation_energy/test_formation_energy_qe.py b/tests/workflows/formation_energy/test_formation_energy_qe.py index 1ed195b..d8e3fac 100644 --- a/tests/workflows/formation_energy/test_formation_energy_qe.py +++ b/tests/workflows/formation_energy/test_formation_energy_qe.py @@ -25,6 +25,16 @@ def _generate_inputs_formation_energy_qe(): mock_pseudos = {'Si': generate_upf_data('Si')} inputs = { + 'run_pw_host': Bool(True), + 'run_pw_defect_q0': Bool(True), + 'run_pw_defect_q': Bool(True), + 'run_v_host': Bool(True), + 'run_v_defect_q0': Bool(True), + 'run_v_defect_q': Bool(True), + 'run_rho_host': Bool(True), + 'run_rho_defect_q0': Bool(True), + 'run_rho_defect_q': Bool(True), + 'run_dfpt': Bool(True), "host_structure": mock_structure, "defect_structure": mock_structure, "host_unitcell": mock_structure, @@ -32,12 +42,13 @@ def _generate_inputs_formation_energy_qe(): 'defect_species': Str('Si'), 'defect_site': List(list=[0.5,0.5,0.5]), "fermi_level": Float(1.0), - "add_or_remove": Str('remove'), + "chempot_sign": Dict(dict={}), "formation_energy_dict": Dict(dict={}), "compound": Str("SiO2"), "dependent_element": Str("O"), "correction_scheme": Str('gaussian'), "run_dfpt": Bool(True), + 'epsilon' : mock_array, 'run_pw_host': Bool(True), 'run_pw_defect_q0': Bool(True), 'run_pw_defect_q': Bool(True), @@ -45,17 +56,17 @@ def _generate_inputs_formation_energy_qe(): "dft": { "supercell": { "code": fixture_code('quantumespresso.pw'), - "kpoints": mock_kpoints, "parameters": mock_parameters, "scheduler_options": mock_parameters, - "pseudopotentials": mock_pseudos, + "pseudopotential_family": Str("sssp"), + "settings": mock_parameters, }, "unitcell": { "code": fixture_code('quantumespresso.pw'), - "kpoints": mock_kpoints, "parameters": mock_parameters, "scheduler_options": mock_parameters, - "pseudopotentials": mock_pseudos, + "pseudopotential_family": Str("sssp"), + "settings": mock_parameters, }, }, "pp":{ From 2668afcb5108c7c928283efda97f2c4e201b2b4f Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Thu, 6 Jan 2022 13:22:52 +0100 Subject: [PATCH 52/60] remove defect_species from inputs as it is now included in chempot_sign --- aiida_defects/formation_energy/formation_energy_base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 98c720b..23a77ee 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -57,9 +57,9 @@ def define(cls, spec): "defect_charge", valid_type=orm.Float, help="Defect charge state") - spec.input( - "defect_species", - valid_type=orm.Str) +# spec.input( +# "defect_species", +# valid_type=orm.Str) spec.input( "defect_site", valid_type=orm.List, From 9069cb8751deacaf8ceb60c513674e9753f7be6e Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Fri, 7 Jan 2022 19:45:08 +0100 Subject: [PATCH 53/60] No need to import MPRester as we won't import formation energy from Materials Project --- .../formation_energy/chemical_potential/chemical_potential.py | 2 +- aiida_defects/formation_energy/chemical_potential/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index c6b049a..dc066b9 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -12,7 +12,7 @@ import sys import numpy as np from pymatgen.core.composition import Composition -from pymatgen import MPRester, Composition, Element +from pymatgen.core.periodic_table import Element from itertools import combinations from .utils import * diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py index f0d433f..a91cf24 100644 --- a/aiida_defects/formation_energy/chemical_potential/utils.py +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -11,7 +11,7 @@ import numpy as np from pymatgen.core.composition import Composition from aiida.orm import ArrayData, Float, Dict -from pymatgen import Element +from pymatgen.core.periodic_table import Element from itertools import combinations from pymatgen.analysis.phase_diagram import * from pymatgen.entries.computed_entries import ComputedEntry From c04bd4f6bcd58f1e43a731bfcbee37c6a5aea76f Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 28 Mar 2022 12:23:21 +0200 Subject: [PATCH 54/60] Reorganize the code and make it more transparent by constructing matrix of constraints as a pandas dataframe where both the columns and rows are indexed --- .../chemical_potential/chemical_potential.py | 98 +++-- .../chemical_potential/utils.py | 388 +++++++++++------- 2 files changed, 284 insertions(+), 202 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index c6b049a..01a8ce9 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -12,7 +12,7 @@ import sys import numpy as np from pymatgen.core.composition import Composition -from pymatgen import MPRester, Composition, Element +#from pymatgen import MPRester, Composition, Element from itertools import combinations from .utils import * @@ -36,9 +36,11 @@ def define(cls, spec): spec.input("dopant_elements", valid_type=List, required=False, default=lambda: List(list=[]), help="The aliovalent dopants that might be introduce into the prestine material. Several dopants might be present in co-doping scenario.") spec.input("ref_energy", valid_type=Dict, - help="The reference chemical potential of elements in the structure. Format of the dictionary: {'Element_symbol': energy, ...}") + help="The reference chemical potential of elements in the structure") spec.input("tolerance", valid_type=Float, default=lambda: Float(1E-4), help="Use to determine if a point in the chemical potential space is a corner of the stability region or not") + spec.input("grid_points", valid_type=Int, default=lambda: Int(25), + help="The number of point on each axis to generate the grid of the stability region. This grid is needed to determine the centroid or to plot concentration or defect formation energy directly on top of the stability region") spec.outline( cls.setup, @@ -46,8 +48,8 @@ def define(cls, spec): cls.solve_matrix_of_constraints, cls.get_chemical_potential, ) - spec.output('stability_corners', valid_type=ArrayData) - spec.output('matrix_of_constraints', valid_type=ArrayData) + spec.output('stability_vertices', valid_type=Dict) + spec.output('matrix_of_constraints', valid_type=Dict) spec.output('chemical_potential', valid_type=Dict) spec.exit_code(601, "ERROR_CHEMICAL_POTENTIAL_FAILED", @@ -56,12 +58,12 @@ def define(cls, spec): spec.exit_code(602, "ERROR_INVALID_DEPENDENT_ELEMENT", message="In the case of aliovalent substitution, the dopant element has to be different from dependent element." ) - + def setup(self): if self.inputs.dependent_element.value in self.inputs.dopant_elements.get_list(): self.report('In the case of aliovalent substitution, the dopant element has to be different from dependent element. Please choose a different dependent element.') return self.exit_codes.ERROR_INVALID_DEPENDENT_ELEMENT - + composition = Composition(self.inputs.compound.value) element_list = [atom for atom in composition] @@ -70,74 +72,68 @@ def setup(self): N_species = len(composition) + len(self.inputs.dopant_elements.get_list()) else: N_species = len(composition) - + self.ctx.element_list = element_list self.ctx.N_species = Int(N_species) formation_energy_dict = self.inputs.formation_energy_dict.get_dict() - + # check if the compound is stable or not. If not shift its energy down to put it on the convex hull and issue a warning. E_hull = get_e_above_hull(self.inputs.compound.value, element_list, formation_energy_dict) if E_hull > 0: self.report('WARNING! The compound {} is predicted to be unstable. For the purpose of determining the stability region, we shift its formation energy down so that it is on the convex hull. Use with care!'.format(self.inputs.compound.value)) - formation_energy_dict[self.inputs.compound.value] -= composition.num_atoms*(E_hull+0.005) # the factor 0.005 is added for numerical precision to make sure that the compound is now on the convex hull - + formation_energy_dict[self.inputs.compound.value] -= composition.num_atoms*(E_hull+0.005) # the factor 0.005 is added for numerical reason + self.ctx.formation_energy_dict = Dict(dict=formation_energy_dict) def generate_matrix_of_constraints(self): - ''' - Construct the set of constraints given by each compounds in the phase diagram and which delineate the stability region. - ''' - column_order = {} # To track which element corresponds to each column, the dependent element is always the last column - i = 0 - for ele in self.ctx.element_list: - if ele.symbol != self.inputs.dependent_element.value: - column_order[ele.symbol] = i - i += 1 - column_order[self.inputs.dependent_element.value] = self.ctx.N_species.value - 1 - self.ctx.column_order = Dict(dict=column_order) - #self.report('Column order: {}'.format(column_order)) - # Construct matrix containing all linear equations. The last column is the rhs of the system of equations - self.ctx.matrix_eqns = get_matrix_of_constraints( - self.ctx.N_species, - self.inputs.compound, + + ############################################################################## + # Construct matrix containing all linear equations. The last column is the rhs + # of the system of equations + ############################################################################## + + all_constraints_coefficients = get_full_matrix_of_constraints( + self.ctx.formation_energy_dict, + self.inputs.compound, + self.inputs.dependent_element, + self.inputs.dopant_elements, + ) + + self.ctx.master_eqn = get_master_equation(all_constraints_coefficients, self.inputs.compound) + self.ctx.matrix_eqns = get_reduced_matrix_of_constraints( + all_constraints_coefficients, + self.inputs.compound, self.inputs.dependent_element, - self.ctx.column_order, - self.ctx.formation_energy_dict ) self.out('matrix_of_constraints', self.ctx.matrix_eqns) def solve_matrix_of_constraints(self): - ''' - Solve the system of (linear) constraints to get the coordinates of the corners of polyhedra that delineate the stability region - ''' - self.ctx.stability_corners = get_stability_corners( - self.ctx.matrix_eqns, - self.ctx.N_species, - self.inputs.compound, + self.ctx.stability_vertices = get_stability_vertices( + self.ctx.master_eqn, + self.ctx.matrix_eqns, + self.inputs.compound, + self.inputs.dependent_element, self.inputs.tolerance ) - #self.report('The stability corner is : {}'.format(self.ctx.stability_corners.get_array('data'))) - self.out("stability_corners", self.ctx.stability_corners) + #self.report('The stability vertices are : {}'.format(np.around(self.ctx.stability_vertices.get_dict()['data'], 3))) + self.out("stability_vertices", self.ctx.stability_vertices) def get_chemical_potential(self): - ''' - Compute the centroid of the stability region - ''' - centroid = get_center_of_stability( - self.inputs.compound, + centroid = get_centroid_of_stability_region( + self.ctx.stability_vertices, + self.ctx.master_eqn, + self.ctx.matrix_eqns, + self.inputs.compound, self.inputs.dependent_element, - self.ctx.stability_corners, - self.ctx.N_species, - self.ctx.matrix_eqns + self.inputs.grid_points, + self.inputs.tolerance ) - self.report('Centroid of the stability region is {}'.format(centroid.get_array('data'))) + self.report('Centroid of the stability region is {}'.format(dict(zip(centroid.get_dict()['column'], centroid.get_dict()['data'][0])))) - # Recover the absolute chemical potential by adding the energy of the reference elements to centroid - self.ctx.chemical_potential = get_chemical_potential( - centroid, - self.inputs.ref_energy, - self.ctx.column_order + self.ctx.chemical_potential = get_absolute_chemical_potential( + centroid, + self.inputs.ref_energy, ) self.out('chemical_potential', self.ctx.chemical_potential) self.report('The chemical potential is {}'.format(self.ctx.chemical_potential.get_dict())) diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py index f0d433f..c50e899 100644 --- a/aiida_defects/formation_energy/chemical_potential/utils.py +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -9,93 +9,156 @@ from aiida.engine import calcfunction import numpy as np +import pandas as pd from pymatgen.core.composition import Composition -from aiida.orm import ArrayData, Float, Dict -from pymatgen import Element +from aiida.orm import ArrayData, Float, Dict, List +from pymatgen.core.periodic_table import Element from itertools import combinations from pymatgen.analysis.phase_diagram import * from pymatgen.entries.computed_entries import ComputedEntry -@calcfunction -def get_matrix_of_constraints(N_species, compound, dependent_element, column_order, formation_energy_dict): - N_species = N_species.value +def pandas_df_to_Dict(df, index=False): + ''' + Helper function to convert a pandas dataframe to AiiDA Dict. + If index=False, the index of df won't be converted to (keys, values) pair in the Dict + ''' + if index: + return Dict(dict={'column': df.columns, 'index': df.index, 'data': df.to_numpy()}) + else: + return Dict(dict={'column': df.columns, 'data': df.to_numpy()}) + +def Dict_to_pandas_df(py_dict): + ''' + Helper function to convert a dict to a pandas dataframe + ''' + if 'index' in py_dict.keys(): + return pd.DataFrame(np.array(py_dict['data']), index=py_dict['index'], columns=py_dict['column']) + else: + return pd.DataFrame(np.array(py_dict['data']), columns=py_dict['column']) + +def get_full_matrix_of_constraints(formation_energy_dict, compound, dependent_element, dopant): + ''' + The systems of linear constraints (before eliminating the dependent variable and the 'compound'), i.e. matrix of constraints is constructed as + a pandas dataframe. Each columns corresponds to each element in the compounds and dopants ('Li', 'P', ...) while the last + column is the formation energy (per fu) of each stable compounds in the phase diagram. The column before the last column is + always reserved for the depedent element. Each row is indexed by the formula of each stable compound. + When it is not possible to use pandas dataframe for ex. to pass as argument to a calcfuntion, the dataframe is 'unpacked' as + a python dictionary in the form {'column': , 'index': , 'data': } + ''' + + formation_energy_dict = formation_energy_dict.get_dict() compound = compound.value dependent_element = dependent_element.value - column_order = column_order.get_dict() - formation_energy_dict = formation_energy_dict.get_dict() + dopant = dopant.get_list() compound_of_interest = Composition(compound) - # Construct the 1st equation corresponding to the compound of interest - eqns = np.zeros(N_species+1) - for ele in compound_of_interest: - eqns[column_order[ele.symbol]] = -1.0*compound_of_interest[ele] - eqns[N_species] = -1.0*formation_energy_dict[compound] - #self.ctx.first_eqn = eqns - - # Now loop through all the competing phases - for key in formation_energy_dict: - # if key != compound: - if not same_composition(key, compound): - tmp = np.zeros(N_species+1) - temp_composition = Composition(key) - for ele in temp_composition: - tmp[column_order[ele.symbol]] = temp_composition[ele] - tmp[N_species] = formation_energy_dict[key] - eqns = np.vstack((eqns, tmp)) - #print(eqns) - - # Add constraints corresponding to the stability with respect to decomposition into - # elements and combine it with the constraint on the stability of compound of interest - for ele in compound_of_interest: - if ele.symbol != dependent_element: - tmp = np.zeros(N_species+1) - tmp[column_order[ele.symbol]] = 1.0 - eqns = np.vstack((eqns, tmp)) - tmp = np.zeros(N_species+1) - tmp[column_order[ele.symbol]] = -1.0 - tmp[N_species] = -1.*formation_energy_dict[compound]/compound_of_interest[ele] - eqns = np.vstack((eqns, tmp)) - #print(eqns) - - # Eliminate the dependent element (variable) from the equations - mask = eqns[1:, N_species-1] != 0.0 - eqns_0 = eqns[1:,:][mask] - common_factor = compound_of_interest[dependent_element]/eqns_0[:, N_species-1] - eqns_0 = eqns_0*np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting - eqns_0 = (eqns_0+eqns[0,:])/np.reshape(common_factor, (len(common_factor), 1)) # Use broadcasting - eqns[1:,:][mask] = eqns_0 - #print(eqns) - - # Removing column corresponding to the dependent element from the set of equations correponding to the constraints - # that delineate the stability region - matrix = np.delete(eqns, N_species-1, axis=1) - matrix_data = ArrayData() - matrix_data.set_array('data', matrix) - return matrix_data + # Setting up the matrix of constraints as pd dataframe and initialize it to zeros. + stable_compounds, element_order = [], [] + for key in formation_energy_dict.keys(): + stable_compounds.append(key) + for key in compound_of_interest: + stable_compounds.append(key.symbol) + + element_order = [atom.symbol for atom in compound_of_interest if atom.symbol != dependent_element] + if dopant == []: + element_order.extend([dependent_element, 'Ef']) + N_species = len(compound_of_interest) + else: + element_order.extend(dopant+[dependent_element, 'Ef']) + N_species = len(compound_of_interest) + len(dopant) + stable_compounds.extend(dopant) + + eqns = pd.DataFrame(np.zeros((len(stable_compounds), len(element_order))), index=stable_compounds, columns=element_order) + + # Setting the coefficients of the matrix of constraint + # First, loop through all the competing phases + for k, v in formation_energy_dict.items(): + composition = Composition(k) + for element in composition: + eqns.loc[k, element.symbol] = composition[element] + eqns.loc[k, 'Ef'] = v + # Then, loop over all elemental phases + for element in compound_of_interest: + eqns.loc[element.symbol, element.symbol] = 1.0 + if dopant: + for element in dopant: + eqns.loc[element, element] = 1.0 + + return pandas_df_to_Dict(eqns, index=True) @calcfunction -def get_stability_corners(matrix_eqns, N_species, compound, tolerance): - matrix_eqns = matrix_eqns.get_array('data') - N_species = N_species.value - tolerance = tolerance.value +def get_master_equation(raw_constraint_coefficients, compound): + ''' + The 'master' equation is simply the equality corresponding to the formation energy of the + compound under consideration. For ex. if we are studying the defect in Li3PO4, the master + equation is simply: 3*mu_Li + mu_P + 4*mu_O = Ef where Ef is the formation energy per fu + of Li3PO4. This equation is needed to replace the dependent chemical potential from the set + of other linear constraints and to recover the chemical potential of the dependent element + from the chemical potentials of independent elements + ''' + all_coefficients = raw_constraint_coefficients.get_dict() + eqns = Dict_to_pandas_df(all_coefficients) + master_eqn = eqns.loc[[compound.value],:] + + return pandas_df_to_Dict(master_eqn, index=True) + +@calcfunction +def get_reduced_matrix_of_constraints(full_matrix_of_constraints, compound, dependent_element): + ''' + The reduced matrix of constraints is obtained from the full matrix of constraint by eliminating + the row corresponding to the master equation and the column associated with the dependent element + after substituting the chemical potential of the dependent element by that of the independent + elements using the master equation. Therefore, if the shape of the full matrix of constraint is + NxN, then the shape of the reduced matrix of constraints is (N-1)x(N-1) + ''' compound = compound.value + dependent_element = dependent_element.value + all_coefficients = full_matrix_of_constraints.get_dict() + eqns = Dict_to_pandas_df(all_coefficients) + master_eqn = eqns.loc[[compound],:] + M = master_eqn.loc[compound].to_numpy() + M = np.reshape(M, (1,-1)) + + # Substitute the dependent element (variable) from the equations + tmp = np.reshape(eqns[dependent_element].to_numpy(), (-1,1))*M/master_eqn.loc[compound, dependent_element] + eqns = pd.DataFrame(eqns.to_numpy()-tmp, index=eqns.index, columns=eqns.columns) + # Remove master equation and the column corresponding to the dependent element from the full matrix of constraints + eqns = eqns.drop(compound) + eqns = eqns.drop(columns=dependent_element) + # print(eqns) + + return pandas_df_to_Dict(eqns, index=True) - ### Look at all combination of lines and find their intersections - comb = combinations(np.arange(np.shape(matrix_eqns)[0]), N_species-1) +@calcfunction +def get_stability_vertices(master_eqn, matrix_eqns, compound, dependent_element, tolerance): + ''' + Solving the (reduced) matrix of constraints to obtain the vertices of the stability region. + The last column (or coordinate) corresponds to the dependent element. + ''' + master_eqn = master_eqn.get_dict() + matrix_eqns = matrix_eqns.get_dict() + set_of_constraints = np.array(matrix_eqns['data']) + compound = compound.value + dependent_element = dependent_element.value + tolerance = tolerance.value + N_species = set_of_constraints.shape[1] + + ### Look at all combination of lines (or plans or hyperplans) and find their intersections + comb = combinations(np.arange(np.shape(set_of_constraints)[0]), N_species-1) intersecting_points = [] for item in list(comb): try: - point = np.linalg.solve(matrix_eqns[item,:-1], matrix_eqns[item,-1]) + point = np.linalg.solve(set_of_constraints[item,:-1], set_of_constraints[item,-1]) intersecting_points.append(point) except np.linalg.LinAlgError: ### Singular matrix: lines are parallels therefore don't have any intersection pass - ### Determine the points that form the 'corners' of stability region. These are intersecting point that verify all the constraints. + ### Determine the points that form the vertices of stability region. These are intersecting point that verify all the constraints. intersecting_points = np.array(intersecting_points) - get_constraint = np.dot(intersecting_points, matrix_eqns[:,:-1].T) - check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= tolerance + get_constraint = np.dot(intersecting_points, set_of_constraints[:,:-1].T) + check_constraint = (get_constraint - np.reshape(set_of_constraints[:,-1] ,(1, set_of_constraints.shape[0]))) <= tolerance bool_mask = [not(False in x) for x in check_constraint] corners_of_stability_region = intersecting_points[bool_mask] ### In some cases, we may have several solutions corresponding to the same points. Hence, the remove_duplicate method @@ -105,46 +168,55 @@ def get_stability_corners(matrix_eqns, N_species, compound, tolerance): self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(compound)) return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED - ordered_stability_corner = ArrayData() - ordered_stability_corner.set_array('data', Order_point_clockwise(corners_of_stability_region)) - #ordered_stability_corners = Order_point_clockwise(stability_data) - #self.ctx.stability_corners = ordered_stability_corners + stability_corners = pd.DataFrame(corners_of_stability_region, columns=matrix_eqns['column'][:-1]) + master_eqn = Dict_to_pandas_df(master_eqn) + # get the chemical potentials of the dependent element + dependent_chempot = get_dependent_chempot(master_eqn, stability_corners.to_dict(orient='list'), compound, dependent_element) + stability_corners = np.append(stability_corners, np.reshape(dependent_chempot, (-1,1)), axis =1) + stability_vertices = Dict(dict={'column': matrix_eqns['column'][:-1]+[dependent_element], 'data': stability_corners}) + + return stability_vertices + +def get_dependent_chempot(master_eqn, chempots, compound, dependent_element): + ''' + Calculate the chemical potential of the 'dependent' elements from the chemical potentials of 'independent' elements + ''' + tmp = 0 + for col in master_eqn.columns: + if col != dependent_element and col != 'Ef': + tmp += np.array(chempots[col])*master_eqn.loc[compound, col] + return (master_eqn.loc[compound, 'Ef']-tmp)/master_eqn.loc[compound, dependent_element] - #self.report('The stability corner is : {}'.format(ordered_stability_corners.get_array('data'))) - return ordered_stability_corner @calcfunction -def get_center_of_stability(compound, dependent_element, stability_corners, N_species, matrix_eqns): +def get_centroid_of_stability_region(stability_corners, master_eqn, matrix_eqns, compound, dependent_element, grid_points, tolerance): ''' - Use to determine centroid (as oppose to center). The center is defined as the average coordinates of the corners - while a centroid is the average cooridinates of every point inside the polygone or polyhedron. + Use to determine centroid or in some cases the center of the stability region. The center is defined as the average + coordinates of the vertices while a centroid is the average cooridinates of every point inside the polygone or polyhedron, + i.e. its center of mass. For binary compounds, the stability region is a one-dimensional segment. The centroid coincides with the center. - For ternary and quarternary compounds, the centroid is returned. - For quinternary compound and hight, the center is returned. + For ternary, quarternary and quinary compounds, the centroid is returned. + For compound with more that 5 elements, the center is returned. ''' + stability_corners = np.array(stability_corners.get_dict()['data']) + master_eqn = master_eqn.get_dict() + matrix_eqns = matrix_eqns.get_dict() compound = compound.value dependent_element = dependent_element.value - N_species = N_species.value - stability_corners = stability_corners.get_array('data') - matrix_eqns = matrix_eqns.get_array('data') - - if N_species == 2: - ctr_stability = np.mean(stability_corners, axis=0) #without the dependent element - else: - grid = get_grid(stability_corners, matrix_eqns) - ctr_stability = get_centroid(grid) #without the dependent element + tolerance = tolerance.value + grid_points = grid_points.value - ### Add the corresponding chemical potential of the dependent element - composition = Composition(compound) - first_eqn = matrix_eqns[0] - with_dependent = -1.0*(first_eqn[-1]-np.sum(ctr_stability*first_eqn[:-1]))/composition[dependent_element] - centroid_of_stability = np.append(ctr_stability, with_dependent) -# self.report('Centroid of the stability region is {}'.format(centroid_of_stability)) + points_in_stability_region = get_points_in_stability_region(stability_corners[:,:-1], np.array(matrix_eqns['data']), grid_points, tolerance) + ctr_stability = get_centroid(points_in_stability_region) #without the dependent element + ctr_stability = pd.DataFrame(np.reshape(ctr_stability, (1, -1)), columns=matrix_eqns['column'][:-1]) - ctrd = ArrayData() - ctrd.set_array('data', centroid_of_stability) - return ctrd + master_eqn = Dict_to_pandas_df(master_eqn) + # Add the corresponding chemical potential of the dependent element + dependent_chempot = get_dependent_chempot(master_eqn, ctr_stability.to_dict(orient='list'), compound, dependent_element) + ctr_stability = np.append(ctr_stability, np.reshape(dependent_chempot, (-1,1)), axis =1) + ctr_stability = Dict(dict={'column': matrix_eqns['column'][:-1]+[dependent_element], 'data': ctr_stability}) + return ctr_stability def get_e_above_hull(compound, element_list, formation_energy_dict): ''' @@ -168,61 +240,73 @@ def get_e_above_hull(compound, element_list, formation_energy_dict): return ehull def same_composition(compound_1, compound_2): - composition_1 = Composition(compound_1) - composition_2 = Composition(compound_2) - list_1 = [ele.symbol for ele in composition_1] - list_2 = [ele.symbol for ele in composition_2] - list_1.sort() - list_2.sort() - if list_1 != list_2: - return False - else: - number_ele_1 = [composition_1[ele] for ele in list_1] - number_ele_2 = [composition_2[ele] for ele in list_2] - return number_ele_1 == number_ele_2 + composition_1 = Composition(compound_1) + composition_2 = Composition(compound_2) + list_1 = [ele.symbol for ele in composition_1] + list_2 = [ele.symbol for ele in composition_2] + list_1.sort() + list_2.sort() + if list_1 != list_2: + return False + else: + number_ele_1 = [composition_1[ele] for ele in list_1] + number_ele_2 = [composition_2[ele] for ele in list_2] + return number_ele_1 == number_ele_2 def is_point_in_array(ref_point, ref_array): - for point in ref_array: - if np.array_equal(ref_point, point): - return True - return False + for point in ref_array: + if np.array_equal(ref_point, point): + return True + return False def remove_duplicate(array): - non_duplicate_array = [] - for point in array: - if not is_point_in_array(point, non_duplicate_array): - non_duplicate_array.append(point) - return np.array(non_duplicate_array) - -def get_grid(stability_corners, matrix_eqns, N_point=50, tolerance=1E-4): - xmin = np.amin(stability_corners[:,0]) - xmax = np.amax(stability_corners[:,0]) - ymin = np.amin(stability_corners[:,1]) - ymax = np.amax(stability_corners[:,1]) - x = np.linspace(xmin, xmax, N_point) - y = np.linspace(ymin, ymax, N_point) - - dim = stability_corners.shape[1] - if dim == 2: - xx, yy = np.meshgrid(x, y) - points = np.append(xx.reshape(-1,1),yy.reshape(-1,1),axis=1) - elif dim == 3: - zmin = np.amin(stability_corners[:,2]) - zmax = np.amax(stability_corners[:,2]) - z = np.linspace(zmin, zmax, N_point) - xx, yy, zz = np.meshgrid(x, y, z) - points = np.append(xx.reshape(-1,1),yy.reshape(-1,1),axis=1) - points = np.append(points,zz.reshape(-1,1),axis=1) - else: - print('Not yet implemented for quinternary compounds and higher. Use center instead of centroid') - return stability_corners - - get_constraint = np.dot(points, matrix_eqns[:,:-1].T) - check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1] ,(1, matrix_eqns.shape[0]))) <= tolerance - bool_mask = [not(False in x) for x in check_constraint] - points_in_stable_region = points[bool_mask] - - return points_in_stable_region + non_duplicate_array = [] + for point in array: + if not is_point_in_array(point, non_duplicate_array): + non_duplicate_array.append(point) + return np.array(non_duplicate_array) + +def get_points_in_stability_region(stability_corners, matrix_eqns, N_point, tolerance): + dim = stability_corners.shape[1] + if dim ==1: + return stability_corners + elif dim == 2: + [xmin, ymin] = np.amin(stability_corners, axis=0) + [xmax, ymax] = np.amax(stability_corners, axis=0) + x = np.linspace(xmin, xmax, N_point) + y = np.linspace(ymin, ymax, N_point) + xx, yy = np.meshgrid(x, y) + points = np.append(xx.reshape(-1,1),yy.reshape(-1,1),axis=1) + elif dim == 3: + [xmin, ymin, zmin] = np.amin(stability_corners, axis=0) + [xmax, ymax, zmax] = np.amax(stability_corners, axis=0) + x = np.linspace(xmin, xmax, N_point) + y = np.linspace(ymin, ymax, N_point) + z = np.linspace(zmin, zmax, N_point) + xx, yy, zz = np.meshgrid(x, y, z) + points = np.append(xx.reshape(-1,1), yy.reshape(-1,1), axis=1) + points = np.append(points, zz.reshape(-1,1), axis=1) + elif dim == 4: + [xmin, ymin, zmin, umin] = np.amin(stability_corners, axis=0) + [xmax, ymax, zmax, umax] = np.amax(stability_corners, axis=0) + x = np.linspace(xmin, xmax, N_point) + y = np.linspace(ymin, ymax, N_point) + z = np.linspace(zmin, zmax, N_point) + u = np.linspace(umin, umax, N_point) + xx, yy, zz, uu = np.meshgrid(x, y, z, u) + points = np.append(xx.reshape(-1,1), yy.reshape(-1,1), axis=1) + points = np.append(points, zz.reshape(-1,1), axis=1) + points = np.append(points, uu.reshape(-1,1), axis=1) + else: + print('Not yet implemented for systems having more than 5 elements. Use center instead of centroid') + return stability_corners + + get_constraint = np.dot(points, matrix_eqns[:,:-1].T) + check_constraint = (get_constraint - np.reshape(matrix_eqns[:,-1], (1, matrix_eqns.shape[0]))) <= tolerance + bool_mask = [not(False in x) for x in check_constraint] + points_in_stable_region = points[bool_mask] + + return points_in_stable_region def get_centroid(stability_region): return np.mean(stability_region, axis=0) @@ -245,11 +329,13 @@ def Order_point_clockwise(points): return points_order @calcfunction -def get_chemical_potential(centroid, ref_energy, column_order): - centroid = centroid.get_array('data') +def get_absolute_chemical_potential(relative_chemical_potential, ref_energy): ref_energy = ref_energy.get_dict() - column_order = column_order.get_dict() - chem_pot = {} - for element in column_order.keys(): - chem_pot[element] = ref_energy[element]+centroid[column_order[element]] - return Dict(dict=chem_pot) + relative_chemical_potential = relative_chemical_potential.get_dict() + relative_chempot = Dict_to_pandas_df(relative_chemical_potential) + + absolute_chemical_potential = {} + for element in relative_chempot.columns: + absolute_chemical_potential[element] = ref_energy[element] + np.array(relative_chempot[element]) + + return Dict(dict=absolute_chemical_potential) From a379df2865cf781ca4c1a24cb960757ffbcaa588 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Tue, 17 May 2022 14:02:59 +0200 Subject: [PATCH 55/60] Adding a new datatype, StabilityData to represent data related to the stability of a compounds for ex. chemical potentials, stability region, etc. --- aiida_defects/data/data.py | 522 ++++++++++++++++++ .../chemical_potential/chemical_potential.py | 79 ++- .../chemical_potential/utils.py | 115 +++- setup.json | 4 + 4 files changed, 688 insertions(+), 32 deletions(-) create mode 100644 aiida_defects/data/data.py diff --git a/aiida_defects/data/data.py b/aiida_defects/data/data.py new file mode 100644 index 0000000..7e7ba36 --- /dev/null +++ b/aiida_defects/data/data.py @@ -0,0 +1,522 @@ +from string import Template + +import numpy as np +import pandas as pd +from aiida.common.exceptions import ValidationError +from aiida.common.utils import prettify_labels +from aiida.orm import ArrayData +from aiida_defects.formation_energy.chemical_potential.utils import Order_point_clockwise + +class StabilityData(ArrayData): + ''' + Class to represent the stability region of a compound and all its attributes (vertice of stability region, etc.) + The visualization only works for 2D stability region, i.e. for ternary compounds. For compounds with more than 3 elements, + some chemical potentials have to be set at certain values so that a 'slice' of the stability region can be plotted. + ''' + def set_data(self, matrix_of_constraints, indices, columns, stability_vertices, compound, dependent_element, property_map=None): + self.set_array('matrix', matrix_of_constraints) + if stability_vertices.shape[1] == 3: + self.set_array('vertices', Order_point_clockwise(stability_vertices)) # vertices include the coordinate of the dependent element as well + else: + raise ValueError('The stability vertices must be an Nx3 array where N is the number of compounds in the phase diagram.' + 'The 3 columns corresponds to the chemical potentials of each each elements' + ) + self.column = columns + self.compound = compound + self.dependent_element = dependent_element + self.index = indices + self.property_map = property_map + + def get_constraints(self): + return self.get_array('matrix') + + def get_vertices(self): + return self.get_array('vertices') + + @property + def index(self): + return self.get_attribute('index') + + @index.setter + def index(self, value): + self._set_index(value) + + def _set_index(self, value): + ''' + The equation for the dependent element is the same as that of the compound, therefore we can replace the + dependent element in indices by the compound name which is useful later for plotting purpose. + 'dependent_element' and 'compound' have to be set first + ''' + idx = [l if l != self.dependent_element else self.compound for l in value] + self.set_attribute('index', idx) + + @property + def column(self): + return self.get_attribute('column') + + @column.setter + def column(self, value): + self.set_attribute('column', value) + + @property + def compound(self): + return self.get_attribute('compound') + + @compound.setter + def compound(self, value): + self.set_attribute('compound', value) + + @property + def dependent_element(self): + return self.get_attribute('dependent_element') + + @dependent_element.setter + def dependent_element(self, value): + self.set_attribute('dependent_element', value) + + @property + def property_map(self): + return self.get_attribute('property_map') + + @property_map.setter + def property_map(self, value): + self.set_attribute('property_map', value) + + def _get_stabilityplot_data(self): + ''' + Get data to plot a stability region + Make sure the data are suitable for 2D plot. TO BE DONE. + ''' + + x_axis = np.arange(-10, 0.01, 0.05) + x = [] + y = [] + + ### Lines corresponding to each constraint associated with each compound + M = self.get_constraints() + # print(pd.DataFrame(M, index=self.index, columns=self.column)) + + ### The matrix M has the shape Nx3 where N is the number of compounds and elemental phases. + ### The 1st column is the 'x axis', 2nd column 'y axis' and 3rd column is related to the formation energy + for l in M: + if l[1] == 0.0: # vertical line + x.append([l[2]/l[0]]*len(x_axis)) + y.append(x_axis) + else: + x.append(x_axis) + y.append((l[2]-l[0]*x_axis)/l[1]) + + x = np.array(x) + y = np.array(y) + vertices = self.get_vertices() + + plot_info = {} + plot_info['x'] = x + plot_info['y'] = y + plot_info['vertices'] = vertices + boundary_lines = set() + + ### Find the boundary compounds, i.e. compounds whose corresponding lines form the edge of the stability region + for vtx in plot_info['vertices']: + # Check if a vertex is on the line, i.e its cooridinates verify the equation corresponding to that line + mask = np.abs(M[:,:2]@np.reshape(vtx[:2], (2,1))[:,0] - M[:,-1]) < 1E-4 + # Check all lines that pass through the vertex vtx + idx = [i for i, _ in enumerate(mask) if _] + # Find the corresponding name of the compound associate with that lines + boundary_lines = boundary_lines.union(set([self.index[j] for j in idx])) + plot_info['boundary_lines'] = boundary_lines + + if self.property_map: + plot_info['grid'] = self.property_map['points_in_stable_region'] + plot_info['property'] = self.property_map['property'] + + return plot_info + + def _matplotlib_get_dict( + self, + main_file_name='', + comments=True, + title='', + legend_location=None, + x_max_lim=None, + x_min_lim=None, + y_max_lim=None, + y_min_lim=None, + prettify_format=None, + **kwargs + ): # pylint: disable=unused-argument + """ + Prepare the data to send to the python-matplotlib plotting script. + + :param comments: if True, print comments (if it makes sense for the given + format) + :param plot_info: a dictionary + :param setnumber_offset: an offset to be applied to all set numbers + (i.e. s0 is replaced by s[offset], s1 by s[offset+1], etc.) + :param color_number: the color number for lines, symbols, error bars + and filling (should be less than the parameter MAX_NUM_AGR_COLORS + defined below) + :param title: the title + :param legend_location: the position of legend + :param y_max_lim: the maximum on the y axis (if None, put the + maximum of the bands) + :param y_min_lim: the minimum on the y axis (if None, put the + minimum of the bands) + :param y_origin: the new origin of the y axis -> all bands are replaced + by bands-y_origin + :param prettify_format: if None, use the default prettify format. Otherwise + specify a string with the prettifier to use. + :param kwargs: additional customization variables; only a subset is + accepted, see internal variable 'valid_additional_keywords + """ + # pylint: disable=too-many-arguments,too-many-locals + + # Only these keywords are accepted in kwargs, and then set into the json + valid_additional_keywords = [ + 'bands_color', # Color of band lines + 'bands_linewidth', # linewidth of bands + 'bands_linestyle', # linestyle of bands + 'bands_marker', # marker for bands + 'bands_markersize', # size of the marker of bands + 'bands_markeredgecolor', # marker edge color for bands + 'bands_markeredgewidth', # marker edge width for bands + 'bands_markerfacecolor', # marker face color for bands + 'use_latex', # If true, use latex to render captions + ] + + # Note: I do not want to import matplotlib here, for two reasons: + # 1. I would like to be able to print the script for the user + # 2. I don't want to mess up with the user matplotlib backend + # (that I should do if the user does not have a X server, but that + # I do not want to do if he's e.g. in jupyter) + # Therefore I just create a string that can be executed as needed, e.g. with eval. + # I take care of sanitizing the output. + # if prettify_format is None: + # # Default. Specified like this to allow caller functions to pass 'None' + # prettify_format = 'latex_seekpath' + + # # The default for use_latex is False + # join_symbol = r'\textbar{}' if kwargs.get('use_latex', False) else '|' + + plot_info = self._get_stabilityplot_data() + + all_data = {} + + all_data['x'] = plot_info['x'].tolist() + all_data['compound_lines'] = plot_info['y'].tolist() + all_data['stability_vertices'] = plot_info['vertices'].tolist() + all_data['boundary_lines'] = list(plot_info['boundary_lines']) + all_data['all_compounds'] = self.index + if self.property_map: + all_data['grid'] = plot_info['grid'] + all_data['property'] = plot_info['property'] + # all_data['grid_dx'] = (np.amax(plot_info['vertices'][:, 0]) - np.amin(plot_info['vertices'][:, 0]))/50 + # all_data['grid_dy'] = (np.amax(plot_info['vertices'][:, 1]) - np.amin(plot_info['vertices'][:, 1]))/50 + all_data['legend_location'] = legend_location + all_data['xaxis_label'] = f'Chemical potential of {self.column[0]} (eV)' + all_data['yaxis_label'] = f'Chemical potential of {self.column[1]} (eV)' + all_data['title'] = title + # if comments: + # all_data['comment'] = prepare_header_comment(self.uuid, plot_info, comment_char='#') + + # axis limits + width = np.amax(plot_info['vertices'][:,0]) - np.amin(plot_info['vertices'][:,0]) # width of the stability region + height = np.amax(plot_info['vertices'][:,1]) - np.amin(plot_info['vertices'][:,1]) # height of the stability region + if y_max_lim is None: + y_max_lim = min(0, np.amax(plot_info['vertices'][:,1])+0.2*height) + if y_min_lim is None: + y_min_lim = np.amin(plot_info['vertices'][:,1])-0.2*height + if x_max_lim is None: + x_max_lim = min(0, np.amax(plot_info['vertices'][:,0])+0.2*width) + if x_min_lim is None: + x_min_lim = np.amin(plot_info['vertices'][:,0])-0.2*width + all_data['x_min_lim'] = x_min_lim + all_data['x_max_lim'] = x_max_lim + all_data['y_min_lim'] = y_min_lim + all_data['y_max_lim'] = y_max_lim + + for key, value in kwargs.items(): + if key not in valid_additional_keywords: + raise TypeError(f"_matplotlib_get_dict() got an unexpected keyword argument '{key}'") + all_data[key] = value + + return all_data + + def _prepare_mpl_singlefile(self, *args, **kwargs): + """ + Prepare a python script using matplotlib to plot the bands + + For the possible parameters, see documentation of + :py:meth:`~aiida.orm.nodes.data.array.bands.BandsData._matplotlib_get_dict` + """ + from aiida.common import json + + all_data = self._matplotlib_get_dict(*args, **kwargs) + + s_header = MATPLOTLIB_HEADER_TEMPLATE.substitute() + s_import = MATPLOTLIB_IMPORT_DATA_INLINE_TEMPLATE.substitute(all_data_json=json.dumps(all_data, indent=2)) + s_body = self._get_mpl_body_template(all_data) + # s_body = MATPLOTLIB_BODY_TEMPLATE.substitute() + s_footer = MATPLOTLIB_FOOTER_TEMPLATE_SHOW.substitute() + + string = s_header + s_import + s_body + s_footer + + return string.encode('utf-8'), {} + + def _prepare_mpl_pdf(self, main_file_name='', *args, **kwargs): # pylint: disable=keyword-arg-before-vararg,unused-argument + """ + Prepare a python script using matplotlib to plot the stability region, with the JSON + returned as an independent file. + """ + import os + import tempfile + import subprocess + import sys + + from aiida.common import json + + all_data = self._matplotlib_get_dict(*args, **kwargs) + + # Use the Agg backend + s_header = MATPLOTLIB_HEADER_AGG_TEMPLATE.substitute() + s_import = MATPLOTLIB_IMPORT_DATA_INLINE_TEMPLATE.substitute(all_data_json=json.dumps(all_data, indent=2)) + s_body = self._get_mpl_body_template(all_data) + + # I get a temporary file name + handle, filename = tempfile.mkstemp() + os.close(handle) + os.remove(filename) + + escaped_fname = filename.replace('"', '\"') + + s_footer = MATPLOTLIB_FOOTER_TEMPLATE_EXPORTFILE.substitute(fname=escaped_fname, format='pdf') + + string = s_header + s_import + s_body + s_footer + + # I don't exec it because I might mess up with the matplotlib backend etc. + # I run instead in a different process, with the same executable + # (so it should work properly with virtualenvs) + # with tempfile.NamedTemporaryFile(mode='w+') as handle: + # handle.write(string) + # handle.flush() + # subprocess.check_output([sys.executable, handle.name]) + + if not os.path.exists(filename): + raise RuntimeError('Unable to generate the PDF...') + + with open(filename, 'rb', encoding=None) as handle: + imgdata = handle.read() + os.remove(filename) + + return imgdata, {} + + def _prepare_mpl_withjson(self, main_file_name='', *args, **kwargs): # pylint: disable=keyword-arg-before-vararg + """ + Prepare a python script using matplotlib to plot the bands, with the JSON + returned as an independent file. + + For the possible parameters, see documentation of + :py:meth:`~aiida.orm.nodes.data.array.bands.BandsData._matplotlib_get_dict` + """ + import os + + from aiida.common import json + + all_data = self._matplotlib_get_dict(*args, main_file_name=main_file_name, **kwargs) + + json_fname = os.path.splitext(main_file_name)[0] + '_data.json' + # Escape double_quotes + json_fname = json_fname.replace('"', '\"') + + ext_files = {json_fname: json.dumps(all_data, indent=2).encode('utf-8')} + + s_header = MATPLOTLIB_HEADER_TEMPLATE.substitute() + s_import = MATPLOTLIB_IMPORT_DATA_FROMFILE_TEMPLATE.substitute(json_fname=json_fname) + s_body = self._get_mpl_body_template(all_data) + s_footer = MATPLOTLIB_FOOTER_TEMPLATE_SHOW.substitute() + + string = s_header + s_import + s_body + s_footer + + return string.encode('utf-8'), ext_files + + @staticmethod + def _get_mpl_body_template(all_data): + if all_data.get('grid'): + s_body = MATPLOTLIB_BODY_TEMPLATE.substitute(plot_code=WITH_PROPERTY) + else: + s_body = MATPLOTLIB_BODY_TEMPLATE.substitute(plot_code=WITHOUT_PROPERTY) + return s_body + + def show_mpl(self, **kwargs): + """ + Call a show() command for the band structure using matplotlib. + This uses internally the 'mpl_singlefile' format, with empty + main_file_name. + + Other kwargs are passed to self._exportcontent. + """ + exec(*self._exportcontent(fileformat='mpl_singlefile', main_file_name='', **kwargs)) + + def _prepare_json(self, main_file_name='', comments=True): # pylint: disable=unused-argument + """ + Prepare a json file in a format compatible with the AiiDA band visualizer + + :param comments: if True, print comments (if it makes sense for the given + format) + """ + from aiida import get_file_header + from aiida.common import json + + json_dict = self._get_band_segments(cartesian=True) + json_dict['original_uuid'] = self.uuid + + if comments: + json_dict['comments'] = get_file_header(comment_char='') + + return json.dumps(json_dict).encode('utf-8'), {} + +MATPLOTLIB_HEADER_AGG_TEMPLATE = Template( + """# -*- coding: utf-8 -*- + +import matplotlib +matplotlib.use('Agg') + +from matplotlib import rc +# Uncomment to change default font +#rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) +rc('font', **{'family': 'serif', 'serif': ['Computer Modern', 'CMU Serif', 'Times New Roman', 'DejaVu Serif']}) +# To use proper font for, e.g., Gamma if usetex is set to False +rc('mathtext', fontset='cm') + +rc('text', usetex=True) + +import pylab as pl + +# I use json to make sure the input is sanitized +import json + +print_comment = False +""" +) + +MATPLOTLIB_HEADER_TEMPLATE = Template( + """# -*- coding: utf-8 -*- + +from matplotlib import rc +# Uncomment to change default font +#rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']}) +rc('font', **{'family': 'serif', 'serif': ['Computer Modern', 'CMU Serif', 'Times New Roman', 'DejaVu Serif']}) +# To use proper font for, e.g., Gamma if usetex is set to False +rc('mathtext', fontset='cm') + +rc('text', usetex=True) + +import matplotlib.pyplot as plt +import numpy as np + +# I use json to make sure the input is sanitized +import json + +print_comment = False + +def prettify_compound_name(name): + pretty_name = '' + for char in name: + if char.isnumeric(): + pretty_name += '$$_'+char+'$$' + else: + pretty_name += char + return pretty_name + +""" +) + +MATPLOTLIB_IMPORT_DATA_INLINE_TEMPLATE = Template('''all_data_str = r"""$all_data_json""" +''') + +MATPLOTLIB_IMPORT_DATA_FROMFILE_TEMPLATE = Template( + """with open("$json_fname", encoding='utf8') as f: + all_data_str = f.read() +""" +) + +WITHOUT_PROPERTY = ''' +ax.fill(vertices[:,0], vertices[:,1], color='gray', alpha=0.5) +''' + +WITH_PROPERTY = ''' +from scipy.interpolate import griddata +import matplotlib.colors as colors +import matplotlib.cm as cm + +x_min = np.amin(vertices[:,0]) +x_max = np.amax(vertices[:,0]) +y_min = np.amin(vertices[:,1]) +y_max = np.amax(vertices[:,1]) +num_point = 100 +X = np.linspace(x_min, x_max, num_point) +Y = np.linspace(y_min, y_max, num_point) +xx, yy = np.meshgrid(X, Y) + +interp_c = griddata(all_data['grid'], all_data['property'], (xx, yy), method='linear') +im = ax.pcolor(X, Y, interp_c, norm=colors.LogNorm(vmin=np.nanmin(interp_c)*0.95, vmax=np.nanmax(interp_c)*0.95*1.05), cmap=cm.RdBu, shading='auto') +cbar = fig.colorbar(im, ax=ax, extend='max') +cbar.ax.set_ylabel('Concentration (/cm$^3$)', fontsize=14, rotation=-90, va="bottom") +''' + + +MATPLOTLIB_BODY_TEMPLATE = Template( + """all_data = json.loads(all_data_str) + +if not all_data.get('use_latex', False): + rc('text', usetex=False) + +# Option for bands (all, or those of type 1 if there are two spins) +further_plot_options = {} +further_plot_options['color'] = all_data.get('bands_color', 'k') +further_plot_options['linewidth'] = all_data.get('bands_linewidth', 0.5) +further_plot_options['linestyle'] = all_data.get('bands_linestyle', None) +further_plot_options['marker'] = all_data.get('bands_marker', None) +further_plot_options['markersize'] = all_data.get('bands_markersize', None) +further_plot_options['markeredgecolor'] = all_data.get('bands_markeredgecolor', None) +further_plot_options['markeredgewidth'] = all_data.get('bands_markeredgewidth', None) +further_plot_options['markerfacecolor'] = all_data.get('bands_markerfacecolor', None) + +fig, ax = plt.subplots() + +for h, v in zip(all_data['x'], all_data['compound_lines']): + ax.plot(h, v, linestyle='dashed', linewidth=1.0, color='k') + +for cmp in all_data['boundary_lines']: + idx = all_data['all_compounds'].index(cmp) + ax.plot(all_data['x'][idx], all_data['compound_lines'][idx], linewidth=1.5, label=prettify_compound_name(cmp)) + +vertices = np.array(all_data['stability_vertices']) +ax.scatter(vertices[:,0], vertices[:,1], color='k') + +${plot_code} + +ax.set_xlim([all_data['x_min_lim'], all_data['x_max_lim']]) +ax.set_ylim([all_data['y_min_lim'], all_data['y_max_lim']]) +# p.xaxis.grid(True, which='major', color='#888888', linestyle='-', linewidth=0.5) + +if all_data['title']: + ax.set_title(all_data['title']) +if all_data['legend_location']: + ax.legend(loc=all_data['legend_location']) +ax.set_xlabel(all_data['xaxis_label']) +ax.set_ylabel(all_data['yaxis_label']) + +try: + if print_comment: + print(all_data['comment']) +except KeyError: + pass +""" +) + +MATPLOTLIB_FOOTER_TEMPLATE_SHOW = Template("""plt.show()""") + +MATPLOTLIB_FOOTER_TEMPLATE_EXPORTFILE = Template("""plt.savefig("$fname", format="$format")""") + +MATPLOTLIB_FOOTER_TEMPLATE_EXPORTFILE_WITH_DPI = Template("""plt.savefig("$fname", format="$format", dpi=$dpi)""") \ No newline at end of file diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index 01a8ce9..78370b2 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -9,6 +9,7 @@ from aiida.engine import WorkChain, calcfunction, ToContext, while_ from aiida.orm import Float, Int, Str, List, Bool, Dict, ArrayData +from aiida_defects.data.data import StabilityData import sys import numpy as np from pymatgen.core.composition import Composition @@ -33,7 +34,7 @@ def define(cls, spec): help="The name of the material of interest") spec.input("dependent_element", valid_type=Str, help="In a N-element phase diagram, the chemical potential of depedent_element is fixed by that of the other N-1 elements") - spec.input("dopant_elements", valid_type=List, required=False, default=lambda: List(list=[]), + spec.input("dopant_elements", valid_type=List, default=lambda: List(), help="The aliovalent dopants that might be introduce into the prestine material. Several dopants might be present in co-doping scenario.") spec.input("ref_energy", valid_type=Dict, help="The reference chemical potential of elements in the structure") @@ -47,33 +48,49 @@ def define(cls, spec): cls.generate_matrix_of_constraints, cls.solve_matrix_of_constraints, cls.get_chemical_potential, + cls.get_stability_region_data ) spec.output('stability_vertices', valid_type=Dict) spec.output('matrix_of_constraints', valid_type=Dict) spec.output('chemical_potential', valid_type=Dict) + spec.output('stability_region', valid_type=StabilityData) spec.exit_code(601, "ERROR_CHEMICAL_POTENTIAL_FAILED", message="The stability region can't be determined. The compound is probably unstable" ) spec.exit_code(602, "ERROR_INVALID_DEPENDENT_ELEMENT", - message="In the case of aliovalent substitution, the dopant element has to be different from dependent element." + message="The given dependent element is invalid." + ) + spec.exit_code(603, "ERROR_INVALID_DOPANT_ELEMENT", + message="The given dopant element(s) is invalid." + ) + spec.exit_code(604, "ERROR_INVALID_NUMBER_OF_ELEMENTS", + message="The number of elements is invalid to generate stability data." ) def setup(self): if self.inputs.dependent_element.value in self.inputs.dopant_elements.get_list(): - self.report('In the case of aliovalent substitution, the dopant element has to be different from dependent element. Please choose a different dependent element.') + self.report('In the case of aliovalent substitution, the dopant element has to be different from dependent element. Please choose a different dependent element or dopant(s).') return self.exit_codes.ERROR_INVALID_DEPENDENT_ELEMENT + + for atom in self.inputs.dopant_elements.get_list(): + if atom in Composition(self.inputs.compound.value): + self.report('The dopant element has to be different from the constitutive elements of the given compound, {}.'.format(self.inputs.compound.value)) + return self.exit_codes.ERROR_INVALID_DOPANT_ELEMENT composition = Composition(self.inputs.compound.value) - element_list = [atom for atom in composition] + element_list = [atom.symbol for atom in composition] if self.inputs.dopant_elements.get_list(): # check if the list empty - element_list += [Element(atom) for atom in self.inputs.dopant_elements.get_list()] # List concatenation + element_list += [atom for atom in self.inputs.dopant_elements.get_list()] # List concatenation N_species = len(composition) + len(self.inputs.dopant_elements.get_list()) else: N_species = len(composition) - self.ctx.element_list = element_list + if self.inputs.dependent_element.value not in element_list: + self.report('The dependent element must be one of the constitutive elements of the given compound, {}. Please choose a different dependent element.'.format(self.inputs.compound.value)) + return self.exit_codes.ERROR_INVALID_DEPENDENT_ELEMENT + self.ctx.N_species = Int(N_species) formation_energy_dict = self.inputs.formation_energy_dict.get_dict() @@ -87,7 +104,6 @@ def setup(self): def generate_matrix_of_constraints(self): - ############################################################################## # Construct matrix containing all linear equations. The last column is the rhs # of the system of equations @@ -99,13 +115,21 @@ def generate_matrix_of_constraints(self): self.inputs.dependent_element, self.inputs.dopant_elements, ) - - self.ctx.master_eqn = get_master_equation(all_constraints_coefficients, self.inputs.compound) + # print(Dict_to_pandas_df(all_constraints_coefficients)) + # self.ctx.master_eqn = get_master_equation(all_constraints_coefficients, self.inputs.compound) + self.ctx.master_eqn = get_master_equation( + self.ctx.formation_energy_dict, + self.inputs.compound, + self.inputs.dependent_element, + self.inputs.dopant_elements + ) + # print(Dict_to_pandas_df(self.ctx.master_eqn)) self.ctx.matrix_eqns = get_reduced_matrix_of_constraints( all_constraints_coefficients, self.inputs.compound, self.inputs.dependent_element, ) + # print(Dict_to_pandas_df(self.ctx.matrix_eqns)) self.out('matrix_of_constraints', self.ctx.matrix_eqns) def solve_matrix_of_constraints(self): @@ -116,7 +140,8 @@ def solve_matrix_of_constraints(self): self.inputs.dependent_element, self.inputs.tolerance ) - #self.report('The stability vertices are : {}'.format(np.around(self.ctx.stability_vertices.get_dict()['data'], 3))) + self.report('The stability vertices are : {}'.format(np.around(self.ctx.stability_vertices.get_dict()['data'], 4))) + # print(Dict_to_pandas_df(self.ctx.stability_vertices)) self.out("stability_vertices", self.ctx.stability_vertices) def get_chemical_potential(self): @@ -129,6 +154,7 @@ def get_chemical_potential(self): self.inputs.grid_points, self.inputs.tolerance ) + self.ctx.centroid = centroid self.report('Centroid of the stability region is {}'.format(dict(zip(centroid.get_dict()['column'], centroid.get_dict()['data'][0])))) self.ctx.chemical_potential = get_absolute_chemical_potential( @@ -137,4 +163,37 @@ def get_chemical_potential(self): ) self.out('chemical_potential', self.ctx.chemical_potential) self.report('The chemical potential is {}'.format(self.ctx.chemical_potential.get_dict())) + + def get_stability_region_data(self): + + vertices = self.ctx.stability_vertices.get_dict() + if np.array(vertices['data']).shape[1] == 1: + self.report('The compound has to contain more than one element') + return self.exit_codes.ERROR_INVALID_NUMBER_OF_ELEMENTS + elif np.array(vertices['data']).shape[1] == 2: + self.report('The stability region is simply a line segment and is not plotted') + return self.exit_codes.ERROR_INVALID_NUMBER_OF_ELEMENTS + elif np.array(vertices['data']).shape[1] == 3: + sub_matrix_eqns = self.ctx.matrix_eqns + sub_vertices = self.ctx.stability_vertices + else: + centroid = self.ctx.centroid.get_dict() + fixed_chempot = Dict(dict={k: np.array(centroid['data'])[:,i] for i, k in enumerate(centroid['column'][:-3])}) # Keep the last 3 columns + sub_master_eqn = substitute_chemical_potential(self.ctx.master_eqn, fixed_chempot) + sub_matrix_eqns = substitute_chemical_potential(self.ctx.matrix_eqns, fixed_chempot) + # print(Dict_to_pandas_df(sub_matrix_eqns)) + sub_vertices = get_stability_vertices( + sub_master_eqn, + sub_matrix_eqns, + self.inputs.compound, + self.inputs.dependent_element, + self.inputs.tolerance + ) + stability_region = get_StabilityData( + sub_matrix_eqns, + sub_vertices, + self.inputs.compound, + self.inputs.dependent_element, + ) + self.out('stability_region', stability_region) \ No newline at end of file diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py index c50e899..3ab37c9 100644 --- a/aiida_defects/formation_energy/chemical_potential/utils.py +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -87,8 +87,24 @@ def get_full_matrix_of_constraints(formation_energy_dict, compound, dependent_el return pandas_df_to_Dict(eqns, index=True) +# @calcfunction +# def get_master_equation(raw_constraint_coefficients, compound): +# ''' +# The 'master' equation is simply the equality corresponding to the formation energy of the +# compound under consideration. For ex. if we are studying the defect in Li3PO4, the master +# equation is simply: 3*mu_Li + mu_P + 4*mu_O = Ef where Ef is the formation energy per fu +# of Li3PO4. This equation is needed to replace the dependent chemical potential from the set +# of other linear constraints and to recover the chemical potential of the dependent element +# from the chemical potentials of independent elements +# ''' +# all_coefficients = raw_constraint_coefficients.get_dict() +# eqns = Dict_to_pandas_df(all_coefficients) +# master_eqn = eqns.loc[[compound.value],:] + +# return pandas_df_to_Dict(master_eqn, index=True) + @calcfunction -def get_master_equation(raw_constraint_coefficients, compound): +def get_master_equation(formation_energy_dict, compound, dependent_element, dopant): ''' The 'master' equation is simply the equality corresponding to the formation energy of the compound under consideration. For ex. if we are studying the defect in Li3PO4, the master @@ -97,20 +113,35 @@ def get_master_equation(raw_constraint_coefficients, compound): of other linear constraints and to recover the chemical potential of the dependent element from the chemical potentials of independent elements ''' - all_coefficients = raw_constraint_coefficients.get_dict() - eqns = Dict_to_pandas_df(all_coefficients) - master_eqn = eqns.loc[[compound.value],:] - + Ef_dict = formation_energy_dict.get_dict() + compound = compound.value + composition = Composition(compound) + dependent_element = dependent_element.value + dopant = dopant.get_list() + + element_order = [atom.symbol for atom in composition if atom.symbol != dependent_element] + if dopant == []: + element_order.extend([dependent_element, 'Ef']) + else: + element_order.extend(dopant+[dependent_element, 'Ef']) + master_eqn = pd.DataFrame(np.zeros((1, len(element_order))), index=[compound], columns=element_order) + + for atom in composition: + master_eqn.loc[compound, atom.symbol] = composition[atom] + master_eqn.loc[compound, 'Ef'] = Ef_dict[compound] + return pandas_df_to_Dict(master_eqn, index=True) + @calcfunction def get_reduced_matrix_of_constraints(full_matrix_of_constraints, compound, dependent_element): ''' The reduced matrix of constraints is obtained from the full matrix of constraint by eliminating the row corresponding to the master equation and the column associated with the dependent element after substituting the chemical potential of the dependent element by that of the independent - elements using the master equation. Therefore, if the shape of the full matrix of constraint is - NxN, then the shape of the reduced matrix of constraints is (N-1)x(N-1) + elements using the master equation (which at this stage is the first row of the full matrix of + constraints). Therefore, if the shape of the full matrix of constraint is NxM, then the shape + of the reduced matrix of constraints is (N-1)x(M-1) ''' compound = compound.value dependent_element = dependent_element.value @@ -152,7 +183,7 @@ def get_stability_vertices(master_eqn, matrix_eqns, compound, dependent_element, point = np.linalg.solve(set_of_constraints[item,:-1], set_of_constraints[item,-1]) intersecting_points.append(point) except np.linalg.LinAlgError: - ### Singular matrix: lines are parallels therefore don't have any intersection + ### Singular matrix: lines or (hyper)planes are parallels therefore don't have any intersection pass ### Determine the points that form the vertices of stability region. These are intersecting point that verify all the constraints. @@ -164,9 +195,9 @@ def get_stability_vertices(master_eqn, matrix_eqns, compound, dependent_element, ### In some cases, we may have several solutions corresponding to the same points. Hence, the remove_duplicate method corners_of_stability_region = remove_duplicate(corners_of_stability_region) - if corners_of_stability_region.size == 0: - self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(compound)) - return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED + # if corners_of_stability_region.size != 0: + # self.report('The stability region cannot be determined. The compound {} is probably unstable'.format(compound)) + # return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_FAILED stability_corners = pd.DataFrame(corners_of_stability_region, columns=matrix_eqns['column'][:-1]) master_eqn = Dict_to_pandas_df(master_eqn) @@ -213,7 +244,7 @@ def get_centroid_of_stability_region(stability_corners, master_eqn, matrix_eqns, master_eqn = Dict_to_pandas_df(master_eqn) # Add the corresponding chemical potential of the dependent element dependent_chempot = get_dependent_chempot(master_eqn, ctr_stability.to_dict(orient='list'), compound, dependent_element) - ctr_stability = np.append(ctr_stability, np.reshape(dependent_chempot, (-1,1)), axis =1) + ctr_stability = np.append(ctr_stability, np.reshape(dependent_chempot, (-1,1)), axis=1) ctr_stability = Dict(dict={'column': matrix_eqns['column'][:-1]+[dependent_element], 'data': ctr_stability}) return ctr_stability @@ -231,7 +262,7 @@ def get_e_above_hull(compound, element_list, formation_energy_dict): idx = i mp_entries.append(ComputedEntry(Composition(material), Ef)) for ref in element_list: - mp_entries.append(ComputedEntry(Composition(ref.symbol), 0.0)) + mp_entries.append(ComputedEntry(Composition(ref), 0.0)) #mp_entries.append(ComputedEntry(composition, E_formation)) pd = PhaseDiagram(mp_entries) @@ -311,22 +342,47 @@ def get_points_in_stability_region(stability_corners, matrix_eqns, N_point, tole def get_centroid(stability_region): return np.mean(stability_region, axis=0) +@calcfunction +def substitute_chemical_potential(matrix_eqns, fixed_chempot): + ''' + substitute chemical potentials in the matrix of constraints by some fixed values. + Useful for ex. for determining the 'slice' of stability region. + ''' + matrix_eqns = Dict_to_pandas_df(matrix_eqns.get_dict()) + fixed_chempot = fixed_chempot.get_dict() + for spc in fixed_chempot.keys(): + matrix_eqns.loc[:, 'Ef'] -= matrix_eqns.loc[:, spc]*fixed_chempot[spc] + matrix_eqns = matrix_eqns.drop(columns=spc) + + for spc in fixed_chempot.keys(): + if spc in matrix_eqns.index: + # print('Found!') + matrix_eqns = matrix_eqns.drop(spc) + # print(matrix_eqns) + return pandas_df_to_Dict(matrix_eqns, index=True) + def Order_point_clockwise(points): -# points = points.get_array('data') - if len(points[0]) == 1: - points_order = points - else: + ''' + The vertices of the stability region has to be ordered clockwise or counter-clockwise for plotting. + Work only in 2D stability region + + points: 2d numpy array + + ''' + if points.shape[1] == 3: + # Excluding the column corresponding to the dependent element (last column) + points = points[:,:-1] center = np.mean(points, axis=0) # compute angle t = np.arctan2(points[:,0]-center[0], points[:,1]-center[1]) sort_t = np.sort(t) t = list(t) u = [t.index(element) for element in sort_t] - points_order = points[u] -# ordered_points = ArrayData() -# ordered_points.set_array('data', points_order) -# return ordered_points - return points_order + ordered_points = points[u] + return ordered_points + else: + raise ValueError('The argument has to be a Nx3 numpy array') + @calcfunction def get_absolute_chemical_potential(relative_chemical_potential, ref_energy): @@ -339,3 +395,18 @@ def get_absolute_chemical_potential(relative_chemical_potential, ref_energy): absolute_chemical_potential[element] = ref_energy[element] + np.array(relative_chempot[element]) return Dict(dict=absolute_chemical_potential) + +@calcfunction +def get_StabilityData(matrix_eqns, stability_vertices, compound, dependent_element): + + # from aiida_defects.data.data import StabilityData + from aiida.plugins import DataFactory + + M = matrix_eqns.get_dict() + vertices = stability_vertices.get_dict() + + StabilityData = DataFactory('array.stability') + stability_region = StabilityData() + stability_region.set_data(np.array(M['data']), M['index'], M['column'], np.array(vertices['data']), compound.value, dependent_element.value) + + return stability_region diff --git a/setup.json b/setup.json index 3b2fd23..f992060 100644 --- a/setup.json +++ b/setup.json @@ -14,8 +14,12 @@ "Framework :: AiiDA" ], "entry_points": { + "aiida.data": [ + "array.stability = aiida_defects.data.data:StabilityData" + ], "aiida.workflows": [ "defects.formation_energy.qe = aiida_defects.formation_energy.formation_energy_qe:FormationEnergyWorkchainQE", + "defects.formation_energy.chemical_potential = aiida_defects.formation_energy.chemical_potential.chemical_potential:ChemicalPotentialWorkchain", "defects.formation_energy.siesta = aiida_defects.formation_energy.formation_energy_siesta:FormationEnergyWorkchainSiesta", "defects.formation_energy.corrections.gaussian_countercharge = aiida_defects.formation_energy.corrections.gaussian_countercharge.gaussian_countercharge:GaussianCounterChargeWorkchain", "defects.formation_energy.corrections.gaussian_countercharge.model_potential = aiida_defects.formation_energy.corrections.gaussian_countercharge.model_potential.model_potential:ModelPotentialWorkchain", From fc4c2924e481b67594110b6575a1ba3c6f7f0b72 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Wed, 6 Jul 2022 17:50:19 +0200 Subject: [PATCH 56/60] Fixing the provenance graph --- .../chemical_potential/chemical_potential.py | 4 +- .../gaussian_countercharge.py | 201 ++-- .../model_potential/utils.py | 17 +- .../gaussian_countercharge/utils.py | 125 +-- .../formation_energy/defect_chemistry_base.py | 455 +++++++++ .../formation_energy/defect_chemistry_qe.py | 866 ++++++++++++++++++ .../fermi_level/fermi_level.py | 15 +- .../formation_energy/fermi_level/utils.py | 123 ++- .../formation_energy/formation_energy_base.py | 16 +- .../formation_energy/formation_energy_qe.py | 98 +- .../potential_alignment/mae/mae.py | 17 +- .../potential_alignment/mae/utils.py | 11 +- .../potential_alignment.py | 35 +- .../potential_alignment/utils.py | 7 +- aiida_defects/formation_energy/utils.py | 156 ++-- 15 files changed, 1780 insertions(+), 366 deletions(-) create mode 100644 aiida_defects/formation_energy/defect_chemistry_base.py create mode 100644 aiida_defects/formation_energy/defect_chemistry_qe.py diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index e9469f3..93aebfb 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -140,7 +140,7 @@ def solve_matrix_of_constraints(self): self.inputs.dependent_element, self.inputs.tolerance ) - self.report('The stability vertices are : {}'.format(np.around(self.ctx.stability_vertices.get_dict()['data'], 4))) + #self.report('The stability vertices are : {}'.format(np.around(self.ctx.stability_vertices.get_dict()['data'], 4))) # print(Dict_to_pandas_df(self.ctx.stability_vertices)) self.out("stability_vertices", self.ctx.stability_vertices) @@ -196,4 +196,4 @@ def get_stability_region_data(self): self.inputs.compound, self.inputs.dependent_element, ) - self.out('stability_region', stability_region) \ No newline at end of file + self.out('stability_region', stability_region) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index 360dab8..d5ef3c4 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -12,8 +12,8 @@ from aiida_defects.formation_energy.potential_alignment.potential_alignment import PotentialAlignmentWorkchain from .model_potential.model_potential import ModelPotentialWorkchain -from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference -from .utils import get_total_correction, get_alignment, get_total_alignment, get_charge_model_fit, fit_energies, calc_correction, is_gaussian_isotrope +from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference, get_interpolation +from .utils import get_total_correction, get_charge_model_fit, fit_energies, calc_correction, is_isotrope from qe_tools import CONSTANTS import numpy as np @@ -40,7 +40,7 @@ def define(cls, spec): help="Defect site position in crystal coordinates.") spec.input("epsilon", valid_type=orm.ArrayData, - help="Dielectric tensor (3x3) for the host material.") + help="Dielectric tensor (3x3) for the host material. The name of the array in epsilon") spec.input("model_iterations_required", valid_type=orm.Int, default=lambda: orm.Int(3), @@ -75,11 +75,17 @@ def define(cls, spec): # Fixed spec.input_namespace('charge_model.fixed', required=False, populate_defaults=False, help="Inputs for a fixed charge model using a user-specified multivariate gaussian") - spec.input("charge_model.fixed.gaussian_params", - valid_type=orm.List, - help="A length 9 list of parameters needed to construct the " - "gaussian charge distribution. The format required is " - "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + # spec.input("charge_model.fixed.gaussian_params", + # valid_type=orm.List, + # help="A length 9 list of parameters needed to construct the " + # "gaussian charge distribution. The format required is " + # "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + spec.input("charge_model.fixed.covariance_matrix", + valid_type=orm.ArrayData, + help="The covariance matrix used to construct the gaussian charge distribution.") + # "gaussian charge distribution. The format required is " + # "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + # Fitted spec.input_namespace('charge_model.fitted', required=False, populate_defaults=False, help="Inputs for a fitted charge model using a multivariate anisotropic gaussian.") @@ -111,10 +117,10 @@ def define(cls, spec): ) spec.output('gaussian_parameters', valid_type=orm.Dict, required=False) # spec.output('v_dft_difference', valid_type=orm.ArrayData) - spec.output('alignment_q0_to_host', valid_type=orm.Float) - spec.output('alignment_diff_q_q0_to_model', valid_type=orm.Float) - spec.output('alignment_diff_q_host_to_model', valid_type=orm.Float) - spec.output('total_alignment', valid_type=orm.Float, required=True) +# spec.output('alignment_q0_to_host', valid_type=orm.Float) +# spec.output('alignment_diff_q_q0_to_model', valid_type=orm.Float) +# spec.output('alignment_diff_q_host_to_model', valid_type=orm.Float) + spec.output('potential_alignment', valid_type=orm.Float, required=True) spec.output('total_correction', valid_type=orm.Float) spec.output('electrostatic_correction', valid_type=orm.Float) # spec.output('isolated_energy', valid_type=orm.Float, required=True) # Not sure if anyone would use this @@ -172,12 +178,13 @@ def setup(self): elif 'fixed' in self.inputs.charge_model: #Wanted fitted, but gave fixed params return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS elif self.ctx.charge_model == 'fixed': + self.ctx.is_model_isotrope = False # check if the gaussian parameters correspond to an isotropic gaussian - if is_gaussian_isotrope(self.inputs.charge_model.fixed.gaussian_params.get_list()[3:]): - self.report('DEBUG: the given gaussian parameters correspond to isotropic gaussian') + if is_isotrope(self.inputs.charge_model.fixed.covariance_matrix.get_array('sigma')) and is_isotrope(self.inputs.epsilon.get_array('epsilon')): + self.report('DEBUG: the given gaussian charge distribution and dielectric constant are isotropic') self.inputs.model_iterations_required = orm.Int(1) - self.ctx.is_gaussian_isotrope = True - self.ctx.sigma = np.mean(self.inputs.charge_model.fixed.gaussian_params.get_list()[3:6]) + self.ctx.is_model_isotrope = True + self.ctx.sigma = np.mean(np.diag(self.inputs.charge_model.fixed.covariance_matrix.get_array('sigma'))) if 'fixed' not in self.inputs.charge_model: #Wanted fixed, but no params given return self.exit_codes.ERROR_BAD_INPUT_CHARGE_MODEL_PARAMETERS elif 'fitted' in self.inputs.charge_model: #Wanted fixed, but gave fitted params @@ -243,13 +250,13 @@ def fit_charge_model(self): if self.inputs.charge_model.fitted.strict_fit: return self.exit_codes.ERROR_BAD_CHARGE_FIT - if is_gaussian_isotrope(self.ctx.fitted_params.get_list()[3:]): - self.report('The fitted gaussian is isotropic. The isolated model energy will be computed analytically') + if is_gaussian_isotrope(self.ctx.fitted_params.get_list()[3:]) and is_isotrope(self.inputs.epsilon.get_array('epsilon')): + self.report('The fitted gaussian and the dielectric constant are isotropic. The isolated model energy will be computed analytically') self.inputs.model_iterations_required = orm.Int(1) - self.ctx.is_gaussian_isotrope = True + self.ctx.is_model_isotrope = True self.ctx.sigma = np.mean(self.ctx.fitted_params.get_list()[3:6]) else: - self.ctx.is_gaussian_isotrope = False + self.ctx.is_model_isotrope = False def should_run_model(self): """ @@ -273,7 +280,10 @@ def compute_model_potential(self): gaussian_params = self.ctx.fitted_params peak_charge = self.ctx.peak_charge else: - gaussian_params = self.inputs.charge_model.fixed.gaussian_params + # gaussian_params = self.inputs.charge_model.fixed.gaussian_params + cov_mat = self.inputs.charge_model.fixed.covariance_matrix.get_array('sigma') + params = self.inputs.defect_site.get_list()+list(np.diag(cov_mat))+list(cov_mat[0, 1:])+[cov_mat[1,2]] + gaussian_params = orm.List(list=params) peak_charge = orm.Float(0.) inputs = { @@ -318,13 +328,21 @@ def compute_dft_difference_potential(self): """ Compute the difference in the DFT potentials for the cases of q=q and q=0 """ - self.ctx.v_defect_q_q0 = get_potential_difference( - self.inputs.v_defect_q, self.inputs.v_defect_q0) - #self.out('v_dft_difference', self.ctx.v_defect_q_q0) - - self.ctx.v_defect_q_host = get_potential_difference( - self.inputs.v_defect_q, self.inputs.v_host) + #self.ctx.v_defect_q_q0 = get_potential_difference( + # self.inputs.v_defect_q, self.inputs.v_defect_q0) #self.out('v_dft_difference', self.ctx.v_defect_q_q0) + + first_array_shape = self.inputs.v_defect_q.get_array('data').shape + second_array_shape = self.inputs.v_host.get_array('data').shape + if first_array_shape != second_array_shape: + target_shape = orm.List(list=np.max(np.vstack((first_array_shape, second_array_shape)), axis=0).tolist()) + first_array = get_interpolation(self.inputs.v_defect_q, target_shape)#.get_array('interpolated_array') + second_array = get_interpolation(self.inputs.v_host, target_shape)#.get_array('interpolated_array') + self.ctx.v_defect_q_host = get_potential_difference(first_array, second_array) + else: + self.ctx.v_defect_q_host = get_potential_difference( + self.inputs.v_defect_q, self.inputs.v_host) + #self.out('v_dft_difference', self.ctx.v_defect_q_q0) def submit_alignment_workchains(self): @@ -333,40 +351,43 @@ def submit_alignment_workchains(self): state with the pristine host system """ - # Compute the alignment between the defect, in q=0, and the host - inputs = { - "allow_interpolation": orm.Bool(True), - "mae":{ - "first_potential": self.inputs.v_defect_q0, - "second_potential": self.inputs.v_host, - "defect_site": self.inputs.defect_site - }, - } + # # Compute the alignment between the defect, in q=0, and the host + # inputs = { + # "allow_interpolation": orm.Bool(True), + # "mae":{ + # "first_potential": self.inputs.v_defect_q0, + # "second_potential": self.inputs.v_host, + # "defect_site": self.inputs.defect_site + # }, + # } - workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) - label = 'workchain_alignment_q0_to_host' - self.to_context(**{label: workchain_future}) + # workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) + # label = 'workchain_alignment_q0_to_host' + # self.to_context(**{label: workchain_future}) # Convert units from from eV in model potential to Ryd unit as in DFT potential, and also change sign # The potential alignment has to be converted back to eV. It is done in the mae/utils.py. Not pretty, has to be cleaned # TODO: Check if this breaks provenance graph - v_model = orm.ArrayData() - v_model.set_array('data', - self.ctx.v_model.get_array(self.ctx.v_model.get_arraynames()[0])/(-1.0*CONSTANTS.ry_to_ev)) # eV to Ry unit of potential - This is dirty - need to harmonise units - - # Compute the alignment between the difference of DFT potentials v_q and v_q0, and the model - inputs = { - - "allow_interpolation": orm.Bool(True), - "mae":{ - "first_potential": self.ctx.v_defect_q_q0, - "second_potential": v_model, - "defect_site": self.inputs.defect_site - }, - } - workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) - label = 'workchain_alignment_q-q0_to_model' - self.to_context(**{label: workchain_future}) + # v_model = orm.ArrayData() + # # v_model.set_array('data', + # # self.ctx.v_model.get_array(self.ctx.v_model.get_arraynames()[0])/(-1.0*CONSTANTS.ry_to_ev)) # eV to Ry unit of potential - This is dirty - need to harmonise units + # v_model.set_array('data', + # self.ctx.v_model.get_array(self.ctx.v_model.get_arraynames()[0])*-2.0) # Hartree to Ry unit of potential - This is dirty - need to harmonise units + + # # Compute the alignment between the difference of DFT potentials v_q and v_q0, and the model + # inputs = { + + # "allow_interpolation": orm.Bool(True), + # "mae":{ + # "first_potential": self.ctx.v_defect_q_q0, + # # "second_potential": v_model, + # "second_potential": self.ctx.v_model, + # "defect_site": self.inputs.defect_site + # }, + # } + # workchain_future = self.submit(PotentialAlignmentWorkchain, **inputs) + # label = 'workchain_alignment_q-q0_to_model' + # self.to_context(**{label: workchain_future}) # Compute the alignment between the difference of DFT potentials v_q and v_host, and the model inputs = { @@ -374,7 +395,8 @@ def submit_alignment_workchains(self): "allow_interpolation": orm.Bool(True), "mae":{ "first_potential": self.ctx.v_defect_q_host, - "second_potential": v_model, + # "second_potential": v_model, + "second_potential": self.ctx.v_model, "defect_site": self.inputs.defect_site }, } @@ -388,25 +410,25 @@ def check_alignment_workchains(self): If yes, assign the outputs to the context """ - # q0 to host - alignment_wc = self.ctx['workchain_alignment_q0_to_host'] - if not alignment_wc.is_finished_ok: - self.report( - 'Potential alignment workchain (defect q=0 to host) failed with status {}' - .format(alignment_wc.exit_status)) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT - else: - self.ctx.alignment_q0_to_host = alignment_wc.outputs.alignment_required - - # DFT q-q0 to model - alignment_wc = self.ctx['workchain_alignment_q-q0_to_model'] - if not alignment_wc.is_finished_ok: - self.report( - 'Potential alignment workchain (DFT q-q0 to model) failed with status {}' - .format(alignment_wc.exit_status)) - return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT - else: - self.ctx['alignment_q-q0_to_model'] = alignment_wc.outputs.alignment_required + # # q0 to host + # alignment_wc = self.ctx['workchain_alignment_q0_to_host'] + # if not alignment_wc.is_finished_ok: + # self.report( + # 'Potential alignment workchain (defect q=0 to host) failed with status {}' + # .format(alignment_wc.exit_status)) + # return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT + # else: + # self.ctx.alignment_q0_to_host = alignment_wc.outputs.alignment_required + + # # DFT q-q0 to model + # alignment_wc = self.ctx['workchain_alignment_q-q0_to_model'] + # if not alignment_wc.is_finished_ok: + # self.report( + # 'Potential alignment workchain (DFT q-q0 to model) failed with status {}' + # .format(alignment_wc.exit_status)) + # return self.exit_codes.ERROR_SUB_PROCESS_FAILED_ALIGNMENT + # else: + # self.ctx['alignment_q-q0_to_model'] = alignment_wc.outputs.alignment_required # DFT q-host to model alignment_wc = self.ctx['workchain_alignment_q-host_to_model'] @@ -423,7 +445,7 @@ def get_isolated_energy(self): Fit the calculated model energies and obtain an estimate for the isolated model energy """ - if not self.ctx.is_gaussian_isotrope: + if not self.ctx.is_model_isotrope: # Get the linear dimensions of the structures linear_dimensions = {} @@ -440,9 +462,9 @@ def get_isolated_energy(self): else: sigma = self.ctx.sigma defect_charge = self.inputs.defect_charge.value - # Epsilon is now expected to be a tensor, and so to get a scalar here we diagonalise. - epsilon_tensor = self.inputs.epsilon.get_array('epsilon') - epsilon = np.mean(np.diag(epsilon_tensor)) # Approximation to the tensor + # # Epsilon is now expected to be a tensor, and so to get a scalar here we diagonalise. + # epsilon_tensor = self.inputs.epsilon.get_array('epsilon') + epsilon = np.mean(np.diag(self.inputs.epsilon.get_array('epsilon'))) self.report( "Computing the energy of the isolated gaussian analytically" ) @@ -469,19 +491,20 @@ def compute_correction(self): """ electrostatic_correction = self.ctx.model_correction_energies['1'] + potential_alignment = self.ctx['alignment_q-host_to_model'] # total_alignment = get_total_alignment(self.ctx['alignment_q-q0_to_model'], # self.ctx['alignment_q0_to_host'], # self.inputs.defect_charge) - total_alignment = get_alignment(self.ctx['alignment_q-host_to_model'], - self.inputs.defect_charge) + # total_alignment = get_alignment(self.ctx['alignment_q-host_to_model'], self.inputs.defect_charge) total_correction = get_total_correction(electrostatic_correction, - total_alignment) + potential_alignment, + self.inputs.defect_charge) - self.report('The computed total alignment is {} eV'.format( - total_alignment.value)) - self.out('total_alignment', total_alignment) + self.report('The computed potential alignment is {} eV'.format( + potential_alignment.value)) + self.out('potential_alignment', potential_alignment) self.report('The computed electrostatic correction is {} eV'.format( electrostatic_correction.value)) @@ -493,8 +516,8 @@ def compute_correction(self): self.out('total_correction', total_correction) # Store additional outputs - self.out('alignment_q0_to_host', self.ctx.alignment_q0_to_host) - self.out('alignment_diff_q_q0_to_model', self.ctx['alignment_q-q0_to_model']) - self.out('alignment_diff_q_host_to_model', self.ctx['alignment_q-host_to_model']) + # self.out('alignment_q0_to_host', self.ctx.alignment_q0_to_host) + # self.out('alignment_diff_q_q0_to_model', self.ctx['alignment_q-q0_to_model']) + # self.out('alignment_diff_q_host_to_model', self.ctx['alignment_q-host_to_model']) self.report('Gaussian Countercharge workchain completed successfully') diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py index 3826dac..d51bd2b 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/model_potential/utils.py @@ -228,7 +228,7 @@ def get_charge_model(cell_matrix, defect_charge, dimensions, gaussian_params, pe Charge state of the defect dimensions: 3x1 array-like Dimensions of grid to compute charge on. - gaussian_params: list (length 6) + gaussian_params: list (length 9) Parameters determining the distribution position and shape obtained by the fitting procedure. @@ -262,8 +262,8 @@ def get_charge_model(cell_matrix, defect_charge, dimensions, gaussian_params, pe print("DEBUG: Integrated charge density (scaled) = {}".format(get_integral(g, cell_matrix))) # Compensating jellium background - g = g - np.sum(g)/np.prod(g.shape) - print("DEBUG: Integrated charge density (jellium) = {}".format(get_integral(g, cell_matrix))) + # g = g - np.sum(g)/np.prod(g.shape) + # print("DEBUG: Integrated charge density (jellium) = {}".format(get_integral(g, cell_matrix))) # Pack the array model_charge_array = orm.ArrayData() @@ -461,12 +461,14 @@ def get_model_potential(cell_matrix, dimensions, charge_density, epsilon): # Compute the model potential v_model = np.divide( charge_density_g, dielectric, where=dielectric != 0.0) - V_model_g = v_model * 4. * np.pi - + V_model_g = 4. * np.pi * v_model + + # Set the component G=0 to zero V_model_g[dimensions[0] + 1, dimensions[1] + 1, dimensions[2] + 1] = 0.0 # Get the model potential in real space - V_model_r = get_inverse_fft(V_model_g) * CONSTANTS.hartree_to_ev + # V_model_r = get_inverse_fft(V_model_g) * CONSTANTS.hartree_to_ev + V_model_r = get_inverse_fft(V_model_g) # Pack up the array V_model_array = orm.ArrayData() @@ -481,7 +483,8 @@ def get_energy(potential, charge_density, cell_matrix): Calculate the total energy for a given model potential """ cell_matrix = cell_matrix.get_array('cell_matrix') - potential = potential.get_array('model_potential') + # potential = potential.get_array('model_potential') + potential = potential.get_array('model_potential') * CONSTANTS.hartree_to_ev charge_density = charge_density.get_array('model_charge') energy = np.real(0.5 * get_integral(charge_density*potential, cell_matrix)) diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py index 1c54809..156da9c 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/utils.py @@ -15,12 +15,26 @@ Utility functions for the gaussian countercharge workchain """ -def is_gaussian_isotrope(gaussian_params): - eps = 0.01 - average_sigma = np.mean(gaussian_params[:3]) - #check if the off-diagonal elements sigma_xy, sigma_xz and simga_yz are all close to zero - test_1 = all(np.array(gaussian_params[3:])/average_sigma < eps) - test_2 = all(abs((np.array(gaussian_params[:3])/average_sigma) - 1.0) < eps) +# def is_gaussian_isotrope(gaussian_params): +# eps = 0.01 +# average_sigma = np.mean(gaussian_params[:3]) +# #check if the off-diagonal elements sigma_xy, sigma_xz and simga_yz are all close to zero +# test_1 = all(np.array(gaussian_params[3:])/average_sigma < eps) +# test_2 = all(abs((np.array(gaussian_params[:3])/average_sigma) - 1.0) < eps) +# return test_1 and test_2 + +def is_isotrope(matrix, tol=0.01): + ''' + check if a 3x3 matrix is isotropic i,e. it can be written as a product of a number and an identity matrix + ''' + + # check if all diagonal elements are the same + diagonal = np.diagonal(matrix) + test_1 = np.all(np.abs([diagonal[0]-diagonal[1], diagonal[1]-diagonal[2], diagonal[0]-diagonal[2]]) < tol) + + #check if all the off-diagonal are zero (within the tolerance, tol) + test_2 = np.all(np.abs(matrix - np.diag(np.diagonal(matrix))) < tol) + return test_1 and test_2 @calcfunction @@ -35,65 +49,65 @@ def create_model_structure(base_structure, scale_factor): return model_structure -@calcfunction -def get_total_alignment(alignment_dft_model, alignment_q0_host, charge): - """ - Calculate the total potential alignment +# @calcfunction +# def get_total_alignment(alignment_dft_model, alignment_q0_host, charge): +# """ +# Calculate the total potential alignment - Parameters - ---------- - alignment_dft_model: orm.Float - The correction energy derived from the alignment of the DFT difference - potential and the model potential - alignment_q0_host: orm.Float - The correction energy derived from the alignment of the defect - potential in the q=0 charge state and the potential of the pristine - host structure - charge: orm.Float - The charge state of the defect +# Parameters +# ---------- +# alignment_dft_model: orm.Float +# The correction energy derived from the alignment of the DFT difference +# potential and the model potential +# alignment_q0_host: orm.Float +# The correction energy derived from the alignment of the defect +# potential in the q=0 charge state and the potential of the pristine +# host structure +# charge: orm.Float +# The charge state of the defect - Returns - ------- - total_alignment - The calculated total potential alignment +# Returns +# ------- +# total_alignment +# The calculated total potential alignment - """ +# """ - # total_alignment = -1.0*(charge * alignment_dft_model) + ( - # charge * alignment_q0_host) +# # total_alignment = -1.0*(charge * alignment_dft_model) + ( +# # charge * alignment_q0_host) - # The minus sign is incorrect. It is remove in the corrected formula below: - total_alignment = charge * alignment_dft_model + ( - charge * alignment_q0_host) +# # The minus sign is incorrect. It is remove in the corrected formula below: +# total_alignment = charge * alignment_dft_model + ( +# charge * alignment_q0_host) - return total_alignment +# return total_alignment -@calcfunction -def get_alignment(alignment_q_host_to_model, charge): - """ - Calculate the total potential alignment +# @calcfunction +# def get_alignment(alignment_q_host_to_model, charge): +# """ +# Calculate the total potential alignment - Parameters - ---------- - alignment_q_host_to_model: orm.Float - The correction energy derived from the alignment of the DFT difference - potential of the charge defect and the host to the model potential - charge: orm.Float - The charge state of the defect +# Parameters +# ---------- +# alignment_q_host_to_model: orm.Float +# The correction energy derived from the alignment of the DFT difference +# potential of the charge defect and the host to the model potential +# charge: orm.Float +# The charge state of the defect - Returns - ------- - total_alignment - The calculated total potential alignment - """ +# Returns +# ------- +# total_alignment +# The calculated total potential alignment +# """ - alignment = charge.value * alignment_q_host_to_model.value +# alignment = charge.value * alignment_q_host_to_model.value - return orm.Float(alignment) +# return orm.Float(alignment) @calcfunction -def get_total_correction(model_correction, total_alignment): +def get_total_correction(model_correction, potential_alignment, defect_charge): """ Calculate the total correction, including the potential alignments @@ -101,10 +115,9 @@ def get_total_correction(model_correction, total_alignment): ---------- model_correction: orm.Float The correction energy derived from the electrostatic model - total_alignment: orm.Float - The correction energy derived from the alignment of the DFT difference - potential and the model potential, and alignment of the defect potential - in the q=0 charge state and the potential of the pristine host structure + potential_alignment: orm.Float + The correction derived from the alignment of the difference of DFT + potential of the charge defect and the pristine host structure to the model potential Returns ------- @@ -113,7 +126,7 @@ def get_total_correction(model_correction, total_alignment): """ - total_correction = model_correction - total_alignment + total_correction = model_correction - defect_charge * potential_alignment return total_correction diff --git a/aiida_defects/formation_energy/defect_chemistry_base.py b/aiida_defects/formation_energy/defect_chemistry_base.py new file mode 100644 index 0000000..d2931a0 --- /dev/null +++ b/aiida_defects/formation_energy/defect_chemistry_base.py @@ -0,0 +1,455 @@ +# -*- coding: utf-8 -*- +######################################################################################## +# Copyright (c), The AiiDA-Defects authors. All rights reserved. # +# # +# AiiDA-Defects is hosted on GitHub at https://github.com/ConradJohnston/aiida-defects # +# For further information on the license, see the LICENSE.txt file # +######################################################################################## +from __future__ import absolute_import + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, submit +import numpy as np +from .chemical_potential.chemical_potential import ChemicalPotentialWorkchain + +# from .utils import ( +# get_raw_formation_energy, +# get_corrected_formation_energy, +# get_corrected_aligned_formation_energy, +# ) +from .utils import * + +class DefectChemistryWorkchainBase(WorkChain): + """ + The base class to determine the defect chemistry of a given material, containing the + generic, code-agnostic methods, error codes, etc. Defect chemistry refer to the concentration or defect formation + energy of all possible defects (vacancies, interstitials, substitutions,...) which can exist in the material at + thermodynamics equilibrium. + + Any computational code can be used to calculate the required energies and relative permittivity. + However, different codes must be setup in specific ways, and so separate classes are used to implement these + possibilities. This is an abstract class and should not be used directly, but rather the + concrete code-specific classes should be used instead. + """ + + @classmethod + def define(cls, spec): + super(DefectChemistryWorkchainBase, cls).define(spec) + + spec.input('restart_wc', valid_type=orm.Bool, required=False, default=lambda: orm.Bool(False), + help="whether to restart the workchain from previous run or to start from scratch") + spec.input('restart_node', valid_type=orm.Int, required=False, + help="if restart from previous run, provide the node corresponding to that run") + spec.input("unitcell", valid_type=orm.StructureData, + help="Pristine structure to use in the calculation of permittivity and DOS", required=False) + spec.input("host_structure", valid_type=orm.StructureData, + help="Pristine supercell without defect") + spec.input('defect_info', valid_type=orm.Dict, + help="Dictionary containing the information about defects included in the calculations of defect chemistry") + + # Chemical potential workchain + spec.expose_inputs(ChemicalPotentialWorkchain) + + # Fermi level workchain + spec.input("temperature", valid_type=orm.Float, + help="temperature at which the defect chemistry is determined. Enter in the calculaion of electron, hole and defect concentrations") + spec.input("dopant", valid_type=orm.Float, required=False, + help="Charge and concentration of aliovalent dopants added to the system. Used in the 'frozen' defect approach") + + # Input Correction workchain + spec.input("correction_scheme", valid_type=orm.Str, + help="The correction scheme to apply") + # Charge Model Settings + spec.input_namespace('charge_model', + help="Namespace for settings related to different charge models") + spec.input("charge_model.model_type", + valid_type=orm.Str, + help="Charge model type: 'fixed' or 'fitted'", + default=lambda: orm.Str('fixed')) + # Fixed + spec.input_namespace('charge_model.fixed', required=False, populate_defaults=False, + help="Inputs for a fixed charge model using a user-specified multivariate gaussian") + spec.input("charge_model.fixed.covariance_matrix", + valid_type=orm.ArrayData, + help="The covariance matrix used to construct the gaussian charge distribution.") + # Fitted + spec.input_namespace('charge_model.fitted', required=False, populate_defaults=False, + help="Inputs for a fitted charge model using a multivariate anisotropic gaussian.") + spec.input("charge_model.fitted.tolerance", + valid_type=orm.Float, + help="Permissable error for any fitted charge model parameter.", + default=lambda: orm.Float(1.0e-3)) + spec.input("charge_model.fitted.strict_fit", + valid_type=orm.Bool, + help="When true, exit the workchain if a fitting parameter is outside the specified tolerance.", + default=lambda: orm.Bool(True)) + spec.input("epsilon", valid_type=orm.ArrayData, required=False, + help="Dielectric constant of the host") + spec.input("cutoff", + valid_type=orm.Float, + default=lambda: orm.Float(100.), + help="Plane wave cutoff for electrostatic model.") + + # Outputs + spec.output( + "defect_formation_energy", valid_type=orm.Dict, required=True) + spec.output( + "chemical_potential", valid_type=orm.Dict, required=True) + spec.output( + "fermi_level", valid_type=orm.Dict, required=True) +# spec.output( +# "defect_data", valid_type=orm.Dict, required=True) + spec.output( + "total_correction", valid_type=orm.Dict, required=True) + spec.output( + "electrostatic_correction", valid_type=orm.Dict, required=True) + spec.output( + "potential_alignment", valid_type=orm.Dict, required=True) + + # Error codes + spec.exit_code(201, "ERROR_INVALID_CORRECTION", + message="The requested correction scheme is not recognised") + spec.exit_code(202, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly") + spec.exit_code(301, "ERROR_CORRECTION_WORKCHAIN_FAILED", + message="The correction scheme sub-workchain failed") + spec.exit_code(302, "ERROR_DFT_CALCULATION_FAILED", + message="DFT calculation failed") + spec.exit_code(303, "ERROR_PP_CALCULATION_FAILED", + message="A post-processing calculation failed") + spec.exit_code(304, "ERROR_DFPT_CALCULATION_FAILED", + message="DFPT calculation failed") + spec.exit_code(305, "ERROR_DOS_CALCULATION_FAILED", + message="DOS calculation failed") + spec.exit_code(306, "ERROR_DOS_INTEGRATION_FAILED", + message="The number of electrons obtained from the integration of the DOS is different from the expected number of electrons") + spec.exit_code(401, "ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED", + message="The chemical potential calculation failed") + spec.exit_code(402, "ERROR_FERMI_LEVEL_WORKCHAIN_FAILED", + message="The self-consistent fermi level calculation failed") + spec.exit_code(500, "ERROR_PARAMETER_OVERRIDE", + message="Input parameter dictionary key cannot be set explicitly") + spec.exit_code(999, "ERROR_NOT_IMPLEMENTED", + message="The requested method is not yet implemented") + + def setup(self): + """ + Setup the workchain + """ + + self.ctx.inputs_chempots = self.exposed_inputs(ChemicalPotentialWorkchain) + + # Check if correction scheme is valid: + correction_schemes_available = ["gaussian", "point"] + if self.inputs.correction_scheme is not None: + if self.inputs.correction_scheme not in correction_schemes_available: + return self.exit_codes.ERROR_INVALID_CORRECTION + + self.ctx.all_dopants = self.inputs.formation_energy_dict.get_dict() + self.ctx.chempot_dopants = self.ctx.all_dopants + self.ctx.sc_fermi_dopants = list(self.inputs.formation_energy_dict.get_dict().keys()) + #self.ctx.pw_host_dopants = list(self.inputs.formation_energy_dict.get_dict().keys()) + self.ctx.pw_host_dopants = ['intrinsic'] + + + self.ctx['output_unitcell'] = {} + #self.ctx['calc_dos'] = {} + self.ctx.dos = {} + self.ctx.all_defects = self.inputs.defect_info.get_dict() + + self.ctx.defect_data = {} + self.ctx.chemical_potential = {} + self.ctx.fermi_level = {} + self.ctx.defect_formation_energy = {} + + self.ctx.pw_defects = self.inputs.defect_info.get_dict() + self.ctx.phi_defects = self.inputs.defect_info.get_dict() + self.ctx.rho_defects = self.inputs.defect_info.get_dict() + self.ctx.gc_correction_defects = self.inputs.defect_info.get_dict() + + self.ctx.total_correction = {} + self.ctx.electrostatic_correction = {} + self.ctx.potential_alignment = {} + + # defect_data contains all the information requires to compute defect formation energy such as E_corr, E_host, vbm,... + + for defect, properties in self.ctx.all_defects.items(): + self.ctx.total_correction[defect] = {} + self.ctx.electrostatic_correction[defect] = {} + self.ctx.potential_alignment[defect] = {} + # self.ctx.defect_data[defect] = {'N_site': properties['N_site'], 'species': properties['species'], 'charges': {}} + # Add neutral defect to the calculation even if the user doesn't specify it because it is needed to generate the charge model + if 0.0 not in properties['charges']: + self.ctx.all_defects[defect]['charges'].append(0.0) + self.ctx.pw_defects[defect]['charges'].append(0.0) + self.ctx.phi_defects[defect]['charges'].append(0.0) + self.ctx.rho_defects[defect]['charges'].append(0.0) + # for chg in self.ctx.all_defects[defect]['charges']: + # self.ctx.defect_data[defect]['charges'][str(chg)] = {} + #self.report('The defect data are: {}'.format(self.ctx.defect_data)) + + + def if_restart_wc(self): + return self.inputs.restart_wc.value + + def if_rerun_calc_unitcell(self): + if not self.ctx['output_unitcell']: + return True + else: + self.ctx.number_of_electrons = self.ctx.output_unitcell['number_of_electrons'] + self.ctx.vbm = self.ctx.output_unitcell['vbm'] + self.ctx.band_gap = self.ctx.output_unitcell['band_gap'] + return False + + def if_rerun_calc_dos(self): + if not self.ctx.dos: + #self.report('start from scratch') + return True + else: + #sefl.out('density_of_states', store_dos(self.ctx.dos)) + return False + + def if_run_dfpt(self): + return self.inputs.epsilon == 0.0 + + def run_chemical_potential_workchain(self): + from .chemical_potential.chemical_potential import ( + ChemicalPotentialWorkchain, ) + + self.report('Computing the chemical potentials...') + inputs = { + "compound": self.ctx.inputs_chempots.compound, + "dependent_element": self.ctx.inputs_chempots.dependent_element, + "ref_energy": self.ctx.inputs_chempots.ref_energy, + "tolerance": self.ctx.inputs_chempots.tolerance, + } + + for key, ef_dict in self.ctx.chempot_dopants.items(): + inputs['formation_energy_dict'] = orm.Dict(dict=ef_dict) + if key != 'intrinsic': + inputs['dopant_elements'] = orm.List(list=[key]) + + workchain_future = self.submit(ChemicalPotentialWorkchain, **inputs) + workchain_future.label = key + label = "chem_potential_wc_{}".format(key) + self.to_context(**{label: workchain_future}) + # Re-initialize dopant_elements to [] + inputs['dopant_elements'] = orm.List(list=[]) + + def check_chemical_potential_workchain(self): + """ + Check if the chemical potential workchain have finished correctly. + If yes, assign the output to context + """ + + # self.ctx["chem_potential_wc_N"] = orm.load_node(230917) + # self.ctx["chem_potential_wc_intrinsic"] = orm.load_node(230921) + + for key, ef_dict in self.ctx.all_dopants.items(): + chem_potential_wc = self.ctx["chem_potential_wc_{}".format(key)] + if not chem_potential_wc.is_finished_ok: + self.report( + "Chemical potential workchain failed with status {}".format( + chem_potential_wc.exit_status + ) + ) + return self.exit_codes.ERROR_CHEMICAL_POTENTIAL_WORKCHAIN_FAILED + else: + self.ctx.chemical_potential[key] = chem_potential_wc.outputs.chemical_potential + # self.report('Chemical potentials: {}'.format(self.ctx.chemical_potential[key].get_dict())) + self.out('chemical_potential', store_dict(**self.ctx.chemical_potential)) + + def run_gaussian_correction_workchain(self): + """ + Run the workchain for the Gaussian Countercharge correction + """ + from .corrections.gaussian_countercharge.gaussian_countercharge import ( + GaussianCounterChargeWorkchain, + ) + + self.report("Computing correction via the Gaussian Countercharge scheme") + + # parent_node = orm.load_node(224010) + # self.ctx.phi_host = get_data_array(parent_node.inputs.v_host) + # self.ctx.rho_host = get_data_array(parent_node.inputs.rho_host) + # self.ctx['phi_defect_N-O[0.0]'] = get_data_array(parent_node.inputs.v_defect_q0) + # self.ctx['phi_defect_N-O[-1.0]'] = get_data_array(parent_node.inputs.v_defect_q) + # self.ctx['rho_defect_N-O[-1.0]'] = get_data_array(parent_node.inputs.rho_defect_q) + + # parent_node = orm.load_node(224014) + # self.ctx['phi_defect_V_Cl[0.0]'] = get_data_array(parent_node.inputs.v_defect_q0) + # self.ctx['phi_defect_V_Cl[1.0]'] = get_data_array(parent_node.inputs.v_defect_q) + # self.ctx['rho_defect_V_Cl[1.0]'] = get_data_array(parent_node.inputs.rho_defect_q) + + inputs = { + "v_host": self.ctx.phi_host, + "rho_host": self.ctx.rho_host, + "host_structure": self.inputs.host_structure, + "epsilon": self.ctx.epsilon, + "cutoff" : self.inputs.cutoff, + 'charge_model': { + 'model_type': self.inputs.charge_model.model_type + } + } + + #defect_info = self.ctx.all_defects + for defect, properties in self.ctx.gc_correction_defects.items(): + print(defect, properties) + inputs['defect_site'] = orm.List(list=properties['defect_position']) + inputs["v_defect_q0"] = self.ctx['phi_defect_{}[{}]'.format(defect, 0.0)] + for chg in properties['charges']: + if chg != 0.0: + inputs["defect_charge"] = orm.Float(chg) + inputs["v_defect_q"] = self.ctx['phi_defect_{}[{}]'.format(defect, chg)] + inputs["rho_defect_q"] = self.ctx['rho_defect_{}[{}]'.format(defect, chg)] + + if self.inputs.charge_model.model_type.value == 'fixed': + inputs['charge_model']['fixed'] = {'covariance_matrix': self.inputs.charge_model.fixed.covariance_matrix} + else: + inputs['charge_model']['fitted'] = {'tolerance': self.inputs.charge_model.fitted.tolerance, + 'strict_fit': self.inputs.charge_model.fitted.strict_fit} + + workchain_future = self.submit(GaussianCounterChargeWorkchain, **inputs) + label = "correction_wc_{}[{}]".format(defect, chg) + workchain_future.label = label + self.to_context(**{label: workchain_future}) + + def check_correction_workchain(self): + """ + Check if the potential alignment workchains have finished correctly. + If yes, assign the outputs to the context + """ + + # self.ctx["correction_wc_N-O[-1.0]"] = orm.load_node(231218) + # self.ctx["correction_wc_V_Cl[1.0]"] = orm.load_node(231222) + + total_correction = {} + electrostatic_correction = {} + potential_alignment = {} + for defect, properties in self.ctx.all_defects.items(): + temp_total = {} + temp_electrostatic = {} + temp_alignment ={} + for chg in properties['charges']: + # print(defect, chg) + if chg != 0.0: + correction_wc = self.ctx["correction_wc_{}[{}]".format(defect, chg)] + if not correction_wc.is_finished_ok: + self.report("Correction workchain failed with status {}" + .format(correction_wc.exit_status) + ) + return self.exit_codes.ERROR_CORRECTION_WORKCHAIN_FAILED + else: + temp_total[convert_key(str(chg))] = correction_wc.outputs.total_correction + temp_electrostatic[convert_key(str(chg))] = correction_wc.outputs.electrostatic_correction + temp_alignment[convert_key(str(chg))] = correction_wc.outputs.potential_alignment + # self.ctx.defect_data[defect]['charges'][str(chg)]['E_corr'] = correction_wc.outputs.total_correction.value + else: + temp_total[convert_key('0.0')] = orm.Float(0.0) + temp_electrostatic[convert_key('0.0')] = orm.Float(0.0) + temp_alignment[convert_key('0.0')] = orm.Float(0.0) + # self.ctx.defect_data[defect]['charges']['0.0']['E_corr'] = 0.0 + total_correction[convert_key(defect)] = store_dict(**temp_total) + electrostatic_correction[convert_key(defect)] = store_dict(**temp_electrostatic) + potential_alignment[convert_key(defect)] = store_dict(**temp_alignment) + self.ctx.total_correction = store_dict(**total_correction) + self.ctx.electrostatic_correction = store_dict(**electrostatic_correction) + self.ctx.potential_alignment = store_dict(**potential_alignment) + # self.out('defect_data', store_dict(orm.Dict(dict=self.ctx.defect_data))) + self.out('total_correction', self.ctx.total_correction) + self.out('electrostatic_correction', self.ctx.electrostatic_correction) + self.out('potential_alignment', self.ctx.potential_alignment) + # self.report('The defect data are: {}'.format(self.ctx.defect_data)) + + def create_defect_data(self): + + compound = self.inputs.compound.value + for dopant in self.ctx.sc_fermi_dopants: + pw_calc_outputs = {} + # for defect, properties in self.ctx.all_defect.items(): + for defect, properties in self.inputs.defect_info.get_dict().items(): + if is_intrinsic_defect(properties['species'], compound) or dopant in properties['species'].keys(): + for chg in properties['charges']: + pw_calc_outputs[convert_key(defect)+'_'+convert_key(str(chg))] = self.ctx['calc_defect_{}[{}]'.format(defect, chg)].outputs.output_parameters + self.ctx.defect_data[dopant] = get_defect_data(orm.Str(dopant), + self.inputs.compound, + self.inputs.defect_info, + self.ctx.vbm, + self.ctx['calc_host_intrinsic'].outputs.output_parameters, + self.ctx.total_correction, + **pw_calc_outputs) + self.report('Defect data {}: {}'.format(dopant, self.ctx.defect_data[dopant].get_dict())) + + def run_fermi_level_workchain(self): + from .fermi_level.fermi_level import ( + FermiLevelWorkchain, ) + + self.report('Running the fermi level workchain...') + + # #self.ctx.defect_data = orm.load_node(224094).get_dict() + # self.ctx.vbm = orm.load_node(224104).value + # self.ctx.number_of_electrons = orm.load_node(224105).value + # self.ctx.band_gap = orm.load_node(224106).value + # self.ctx.dos = orm.load_node(223757) + + inputs = { + "temperature": self.inputs.temperature, + "valence_band_maximum": self.ctx.vbm, + "number_of_electrons": orm.Float(self.ctx.number_of_electrons), + "unitcell": self.inputs.unitcell, + "DOS": self.ctx.dos, + "band_gap": orm.Float(self.ctx.band_gap), + #"dopant": Dict(dict={'X_1':{'c': 1E18, 'q':-1}}) + } + + for dopant in self.ctx.sc_fermi_dopants: + inputs['defect_data'] = self.ctx.defect_data[dopant] + # self.report('Defect data {}: {}'.format(dopant, defect_temp)) + inputs['chem_potentials'] = self.ctx["chem_potential_wc_{}".format(dopant)].outputs.chemical_potential + workchain_future = self.submit(FermiLevelWorkchain, **inputs) + label = "fermi_level_wc_{}".format(dopant) + workchain_future.label = dopant + self.to_context(**{label: workchain_future}) + + def check_fermi_level_workchain(self): + """ + Check if the fermi level workchain have finished correctly. + If yes, assign the output to context + """ + + #for dopant, ef_dict in self.ctx.all_dopants.items(): + for dopant in self.ctx.sc_fermi_dopants: + fermi_level_wc = self.ctx["fermi_level_wc_{}".format(dopant)] + if not fermi_level_wc.is_finished_ok: + self.report( + "Fermi level workchain of {} defect failed with status {}".format( + dopant, fermi_level_wc.exit_status)) + return self.exit_codes.ERROR_FERMI_LEVEL_WORKCHAIN_FAILED + else: + self.ctx.fermi_level[dopant] = fermi_level_wc.outputs.fermi_level + # self.ctx.fermi_level[dopant] = fermi_level_wc.outputs.fermi_level.get_array('data').item() # get the value from 0-d numpy array + # self.report('Fermi level: {}'.format(self.ctx.fermi_level[dopant].get_array('data'))) + self.out('fermi_level', store_dict(**self.ctx.fermi_level)) + + def compute_defect_formation_energy(self): + ''' + Computing the defect formation energies of all defects considered in the materials. + ''' + + #self.report('The defect data is :{}'.format(self.ctx.defect_data)) + #self.report('All dopants: {}'.format(self.ctx.all_dopants)) + #self.report('The potential alignment is :{}'.format(self.ctx.potential_alignment)) + #self.report('The chemical potentials are :{}'.format(self.ctx.chemical_potential)) + #self.report('The fermi level are :{}'.format(self.ctx.fermi_level)) + + for dopant in self.ctx.sc_fermi_dopants: + self.ctx.defect_formation_energy[dopant] = get_defect_formation_energy( + self.ctx.defect_data[dopant], + self.ctx.fermi_level[dopant], + self.ctx.chemical_potential[dopant], + self.ctx.potential_alignment, + # self.inputs.compound + ) + + # self.report('The defect formation energy is :{}'.format(self.ctx.defect_formation_energy.get_dict())) + self.out("defect_formation_energy", store_dict(**self.ctx.defect_formation_energy)) diff --git a/aiida_defects/formation_energy/defect_chemistry_qe.py b/aiida_defects/formation_energy/defect_chemistry_qe.py new file mode 100644 index 0000000..ee4f697 --- /dev/null +++ b/aiida_defects/formation_energy/defect_chemistry_qe.py @@ -0,0 +1,866 @@ +from __future__ import absolute_import + +import numpy as np + +from aiida import orm +from aiida.engine import WorkChain, calcfunction, ToContext, if_, while_, submit +from aiida.plugins import WorkflowFactory +from aiida_quantumespresso.workflows.pw.base import PwBaseWorkChain +from aiida_quantumespresso.workflows.pw.relax import PwRelaxWorkChain +from aiida_quantumespresso.workflows.protocols.utils import recursive_merge +from aiida_quantumespresso.common.types import RelaxType +from aiida.plugins import CalculationFactory, DataFactory +from aiida.orm.nodes.data.upf import get_pseudos_from_structure + +from aiida_defects.formation_energy.defect_chemistry_base import DefectChemistryWorkchainBase +from aiida_defects.formation_energy.utils import run_pw_calculation +#from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy +from .utils import * +import copy +import pymatgen + +PwCalculation = CalculationFactory('quantumespresso.pw') +PpCalculation = CalculationFactory('quantumespresso.pp') +PhCalculation = CalculationFactory('quantumespresso.ph') +DosCalculation = CalculationFactory('quantumespresso.dos') + +class DefectChemistryWorkchainQE(DefectChemistryWorkchainBase): + """ + Compute the formation energy for a given defect using QuantumESPRESSO + """ + @classmethod + def define(cls, spec): + super(DefectChemistryWorkchainQE, cls).define(spec) + + # DFT and DFPT calculations with QuantumESPRESSO are handled with different codes, so here + # we keep track of things with two separate namespaces. An additional code, and an additional + # namespace, is used for postprocessing + spec.input_namespace('qe.dft.supercell', + help="Inputs for DFT calculations on supercells") + spec.input_namespace('qe.dft.unitcell', + help="Inputs for a DFT calculation on an alternative host cell for use DOS and/or DFPT") + spec.input_namespace('qe.dos', + help="Inputs for DOS calculation which is needed for the Fermi level workchain") + spec.input_namespace('qe.dfpt', required=False, + help="Inputs for DFPT calculation for calculating the relative permittivity of the host material") + spec.input_namespace('qe.pp', + help="Inputs for postprocessing calculations") + + # spec.input('nbands', valid_type=orm.Int, + # help="The number of bands used in pw calculation for the unitcell. Need to specify it because we want it to be larger than the default value so that we can get the band gap which is need for the FermiLevelWorkchain.") + spec.input('k_points_distance', valid_type=orm.Float, required=False, default=lambda: orm.Float(0.2), + help='distance (in 1/Angstrom) between adjacent kpoints') + + # DFT inputs (PW.x) + spec.input("qe.dft.supercell.code", valid_type=orm.Code, + help="The pw.x code to use for the calculations") + spec.input("qe.dft.supercell.relaxation_scheme", valid_type=orm.Str, required=False, + default=lambda: orm.Str('relax'), + help="Option to relax the cell. Possible options are : ['fixed', 'relax', 'vc-relax']") + #spec.input("qe.dft.supercell.kpoints", valid_type=orm.KpointsData, + # help="The k-point grid to use for the calculations") + spec.input("qe.dft.supercell.parameters", valid_type=orm.Dict, + help="Parameters for the PWSCF calcuations. Some will be set automatically") + spec.input("qe.dft.supercell.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the PW.x calculations") + spec.input("qe.dft.supercell.settings", valid_type=orm.Dict, + help="Settings for the PW.x calculations") +# spec.input_namespace("qe.dft.supercell.pseudopotentials", valid_type=orm.UpfData, dynamic=True, +# help="The pseudopotential family for use with the code, if required") + spec.input("qe.dft.supercell.pseudopotential_family", valid_type=orm.Str, + help="The pseudopotential family for use with the code") + + # DFT inputs (PW.x) for the unitcell calculation for the dielectric constant + spec.input("qe.dft.unitcell.code", valid_type=orm.Code, + help="The pw.x code to use for the calculations") + spec.input("qe.dft.unitcell.relaxation_scheme", valid_type=orm.Str, required=False, + default=lambda: orm.Str('relax'), + help="Option to relax the cell. Possible options are : ['fixed', 'relax', 'vc-relax']") + #spec.input("qe.dft.unitcell.kpoints", valid_type=orm.KpointsData, + # help="The k-point grid to use for the calculations") + spec.input("qe.dft.unitcell.parameters", valid_type=orm.Dict, + help="Parameters for the PWSCF calcuations. Some will be set automatically") + spec.input("qe.dft.unitcell.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the PW.x calculations") + spec.input("qe.dft.unitcell.settings", valid_type=orm.Dict, + help="Settings for the PW.x calculations") +# spec.input_namespace("qe.dft.unitcell.pseudopotentials",valid_type=orm.UpfData, dynamic=True, +# help="The pseudopotential family for use with the code, if required") + spec.input("qe.dft.unitcell.pseudopotential_family", valid_type=orm.Str, + help="The pseudopotential family for use with the code") + + # DOS inputs (DOS.x) + spec.input("qe.dos.code", valid_type=orm.Code, + help="The dos.x code to use for the calculations") + spec.input("qe.dos.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the dos.x calculations") + + # Postprocessing inputs (PP.x) + spec.input("qe.pp.code", valid_type=orm.Code, + help="The pp.x code to use for the calculations") + spec.input("qe.pp.scheduler_options", valid_type=orm.Dict, + help="Scheduler options for the PP.x calculations") + + # DFPT inputs (PH.x) + spec.input("qe.dfpt.code", valid_type=orm.Code, required=False, + help="The ph.x code to use for the calculations") + spec.input("qe.dfpt.scheduler_options", valid_type=orm.Dict, required=False, + help="Scheduler options for the PH.x calculations") + + spec.outline( + cls.setup, + if_(cls.if_restart_wc)( + cls.retrieve_previous_results + ), + cls.run_chemical_potential_workchain, + cls.check_chemical_potential_workchain, + if_(cls.if_rerun_calc_unitcell)( + cls.prep_unitcell_dft_calculation, + cls.check_unitcell_dft_calculation, + ), + if_(cls.if_rerun_calc_dos)( + cls.prep_dos_calculation, + cls.check_dos_calculation, + ), + if_(cls.if_run_dfpt)( + cls.prep_dfpt_calculation + ), + cls.check_dfpt_calculation, + cls.prep_dft_calculations, + cls.check_dft_calculations, + cls.prep_dft_potentials_calculations, + cls.check_dft_potentials_calculations, + cls.prep_charge_density_calculations, + cls.check_charge_density_calculations, + cls.run_gaussian_correction_workchain, + cls.check_correction_workchain, + cls.create_defect_data, + cls.run_fermi_level_workchain, + cls.check_fermi_level_workchain, + cls.compute_defect_formation_energy + ) + + def retrieve_previous_results(self): + """ + Retrieve all the converged calculations from the previous run + """ + + self.report('Retrieving results from previous calculations...') + Node = orm.load_node(self.inputs.restart_node.value) + + # Merging and retreiving data from previous run with the that of the additional dopants + if Node.is_finished_ok: + self.ctx.chemical_potential = Node.outputs.chemical_potential.get_dict() + self.ctx.fermi_level = Node.outputs.fermi_level.get_dict() + self.ctx.total_correction = Node.outputs.total_correction.get_dict() + self.ctx.electrostatic_correction = Node.outputs.electrostatic_correction.get_dict() + self.ctx.potential_alignment = Node.outputs.potential_alignment.get_dict() + # self.ctx.defect_data = Node.outputs.defect_data.get_dict() + + self.ctx.sc_fermi_dopants = list(set(self.ctx.fermi_level.keys()).union(set(self.inputs.formation_energy_dict.get_dict().keys()))) + + for defect, properties in self.ctx.all_defects.items(): + # In case we want to add new charge states to the same defects from previous calculations + # if defect not in self.ctx.defect_data.keys(): + self.ctx.total_correction[defect] = {} + self.ctx.electrostatic_correction[defect] = {} + self.ctx.potential_alignment[defect] = {} + # self.ctx.defect_data[defect] = {'N_site': properties['N_site'], 'species': properties['species'], 'charges': {}} + if 0.0 not in properties['charges']: + self.ctx.all_defects[defect]['charges'].append(0.0) + # for chg in self.ctx.all_defects[defect]['charges']: + # self.ctx.defect_data[defect]['charges'][str(chg)] = {} + + for entry in Node.get_outgoing(): + try: + process_label = entry.node.attributes['process_label'] + #self.report('{}'.format(process_label)) + except KeyError: + continue + + #if process_label == 'PwBaseWorkChain': + # calc_label = entry.node.label + # if 'host' in calc_label: + # calc_name = 'calc_'+calc_label + # self.report('{}'.format(calc_name)) + # pw_host_dopants.remove(calc_label[5:]) + # self.ctx[calc_name] = entry.node + + if process_label == 'FermiLevelWorkchain': + self.ctx.dos = entry.node.inputs.DOS + vbm = entry.node.inputs.valence_band_maximum.value + N_electrons = entry.node.inputs.number_of_electrons.value + band_gap = entry.node.inputs.band_gap.value + self.ctx['output_unitcell'] = {'number_of_electrons': N_electrons, 'vbm': vbm, 'band_gap': band_gap} + + else: + for dopant, Ef in Node.inputs.formation_energy_dict.get_dict().items(): + if dopant not in self.ctx.all_dopants.keys(): + self.ctx.all_dopants[dopant] = Ef + chempot_dopants = copy.deepcopy(self.ctx.all_dopants) + sc_fermi_dopants = list(self.ctx.all_dopants.keys()) #copy.deepcopy(self.ctx.all_dopants) + pw_host_dopants = list(self.ctx.all_dopants.keys()) + + for defect, info in Node.inputs.defect_info.get_dict().items(): + if defect not in self.ctx.all_defects.keys(): + self.ctx.all_defects[defect] = info + if 0.0 not in self.ctx.all_defects[defect]['charges']: + self.ctx.all_defects[defect]['charges'].append(0.0) + pw_defects = copy.deepcopy(self.ctx.all_defects) + phi_defects = copy.deepcopy(self.ctx.all_defects) + rho_defects = copy.deepcopy(self.ctx.all_defects) + gc_correction_defects = copy.deepcopy(self.ctx.all_defects) + + for entry in Node.get_outgoing(): + try: + process_label = entry.node.attributes['process_label'] + #self.report('{}'.format(process_label)) + except KeyError: + continue + + if process_label == 'PwBaseWorkChain': + calc_label = entry.node.label + if calc_label == 'unitcell': + #calc_name = 'calc_unitcell' + #self.ctx['calc_unitcell'] = entry.node + vbm = get_vbm(entry.node) + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(entry.node.outputs.output_band) + N_electrons = entry.node.outputs.output_parameters.get_dict()['number_of_electrons'] + self.ctx['output_unitcell'] = {'number_of_electrons': N_electrons, 'vbm': vbm, 'band_gap': band_gap} + elif 'host' in calc_label: + calc_name = 'calc_'+calc_label + self.report('{}'.format(calc_name)) + if entry.node.is_finished_ok: + pw_host_dopants.remove(calc_label[5:]) + self.ctx[calc_name] = entry.node + else: + calc_name = 'calc_defect_'+calc_label + if entry.node.is_finished_ok: + #self.report('{}'.format(calc_name)) + self.ctx[calc_name] = entry.node + defect, chg = get_defect_and_charge_from_label(calc_label) + pw_defects[defect]['charges'].remove(chg) + if not pw_defects[defect]['charges']: + pw_defects.pop(defect) + + elif process_label == 'PpCalculation': + calc_label = entry.node.label + if entry.node.is_finished_ok: + self.ctx[calc_label] = entry.node + if 'host' not in calc_label: + defect, chg = get_defect_and_charge_from_label(calc_label[14:]) + self.report('{}, {}, {}'.format(calc_label, defect, chg)) + if 'phi' in calc_label: + # self.report('{}'.format(phi_defects)) + phi_defects[defect]['charges'].remove(chg) + if not phi_defects[defect]['charges']: + phi_defects.pop(defect) + if 'rho' in calc_label: + #self.report('{}'.format(phi_defects)) + rho_defects[defect]['charges'].remove(chg) + if not rho_defects[defect]['charges']: + rho_defects.pop(defect) + + elif process_label == 'DosCalculation': + #self.ctx['calc_dos'] = entry.node + self.ctx.dos = entry.node.outputs.output_dos + + elif process_label == 'GaussianCounterChargeWorkchain': + calc_label = entry.node.label + if entry.node.is_finished_ok: + self.ctx[calc_label] = entry.node + defect, chg = get_defect_and_charge_from_label(calc_label.replace('correction_wc_', '')) + gc_correction_defects[defect]['charges'].remove(chg) + #if not gc_correction_defects[defect]['charges']: + if gc_correction_defects[defect]['charges'] == [0.0]: + gc_correction_defects.pop(defect) + + elif process_label == 'ChemicalPotentialWorkchain': + dopant = entry.node.label + if entry.node.is_finished_ok: + self.ctx["chem_potential_wc_{}".format(dopant)] = entry.node + chempot_dopants.pop(dopant) + +# elif process_label == 'FermiLevelWorkchain': +# dopant = entry.node.label +# if entry.node.is_finished_ok: +# self.ctx["fermi_level_wc_{}".format(dopant)] = entry.node +# sc_fermi_dopants.pop(dopant) + + else: + pass + + self.ctx.chempot_dopants = chempot_dopants + self.ctx.sc_fermi_dopants = sc_fermi_dopants + self.ctx.pw_host_dopants = pw_host_dopants + self.ctx.pw_defects = pw_defects + self.ctx.phi_defects = phi_defects + self.ctx.rho_defects = rho_defects + self.ctx.gc_correction_defects = gc_correction_defects + + self.report('chempot dopant: {}'.format(self.ctx.chempot_dopants.keys())) + self.report('pw host dopant: {}'.format(self.ctx.pw_host_dopants)) + self.report('sc fermi dopants: {}'.format(self.ctx.sc_fermi_dopants)) + self.report('pw defects: {}'.format(self.ctx.pw_defects.keys())) + self.report('phi defects: {}'.format(self.ctx.phi_defects.keys())) + self.report('rho defects: {}'.format(self.ctx.rho_defects.keys())) + self.report('phi defects: {}'.format(self.ctx.phi_defects.keys())) + self.report('rho defects: {}'.format(self.ctx.rho_defects.keys())) + self.report('gc correction defects: {}'.format(self.ctx.gc_correction_defects.keys())) + + def prep_unitcell_dft_calculation(self): + """ + Run a DFT calculation on the structure to be used for the computation of the + DOS and/or dielectric constant + """ + self.report("DFT calculation for the unitcell has been requested") + + # Another code may be desirable - N.B. in AiiDA a code refers to a specific + # executable on a specific computer. As the PH calculation may have to be run on + # an HPC cluster, the PW calculation must be run on the same machine and so this + # may necessitate that a different code is used than that for the supercell calculations. + + relax_type = {'fixed': RelaxType.NONE, 'relax': RelaxType.POSITIONS, 'vc-relax': RelaxType.POSITIONS_CELL} + overrides = { + 'base':{ + # 'pseudo_family': self.inputs.qe.dft.unitcell.pseudopotential_family.value, + 'pw': {} + }, + 'base_final_scf':{ + # 'pseudo_family': self.inputs.qe.dft.unitcell.pseudopotential_family.value, + 'pw': {} + }, + 'clean_workdir' : orm.Bool(False), + } + + if 'pseudopotential_family' in self.inputs.qe.dft.unitcell: + overrides['base']['pseudo_family'] = self.inputs.qe.dft.unitcell.pseudopotential_family.value + overrides['base_final_scf']['pseudo_family'] = self.inputs.qe.dft.unitcell.pseudopotential_family.value + if 'parameters' in self.inputs.qe.dft.unitcell: + overrides['base']['pw']['parameters'] = self.inputs.qe.dft.unitcell.parameters.get_dict() + overrides['base_final_scf']['pw']['parameters'] = self.inputs.qe.dft.unitcell.parameters.get_dict() + if 'scheduler_options' in self.inputs.qe.dft.unitcell: + overrides['base']['pw']['metadata'] = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() + overrides['base_final_scf']['pw']['metadata'] = self.inputs.qe.dft.unitcell.scheduler_options.get_dict() + if 'settings' in self.inputs.qe.dft.unitcell: + overrides['base']['pw']['settings'] = self.inputs.qe.dft.unitcell.settings.get_dict() + overrides['base_final_scf']['pw']['settings'] = self.inputs.qe.dft.unitcell.settings.get_dict() + + inputs = PwRelaxWorkChain.get_builder_from_protocol( + code = self.inputs.qe.dft.unitcell.code, + structure = self.inputs.unitcell, + overrides = overrides, + relax_type = relax_type[self.inputs.qe.dft.unitcell.relaxation_scheme.value] + ) + + future = self.submit(inputs) + self.report( + 'Launching PWSCF for the unitcell structure (PK={}) at node PK={}'.format(self.inputs.unitcell.pk, future.pk)) + future.label = 'unitcell' + self.to_context(**{'calc_unitcell': future}) + + def check_unitcell_dft_calculation(self): + """ + Check if the DFT calculation of the unitcell has completed successfully. + """ + + # self.ctx['calc_unitcell'] = orm.load_node(230976) + + unitcell_calc = self.ctx['calc_unitcell'] + if not unitcell_calc.is_finished_ok: + self.report( + 'PWSCF for the unitcell structure has failed with status {}'. + format(unitcell_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(unitcell_calc.outputs.output_band) + if not is_insulator: + self.report('WARNING! Metallic ground state!') + self.ctx.vbm = orm.Float(get_vbm(unitcell_calc)) + #self.ctx.number_of_electrons = unitcell_calc.res.number_of_electrons + self.ctx.number_of_electrons = unitcell_calc.outputs.output_parameters.get_dict()['number_of_electrons'] + self.ctx.band_gap = band_gap + self.report("The band gap of the material is: {} eV".format(band_gap)) + self.report("The number of electron is: {}".format(self.ctx.number_of_electrons)) + self.report("The bottom of the valence band is: {} eV".format(self.ctx.vbm.value)) + + + def prep_dos_calculation(self): + ''' + Run a calculation to extract the DOS of the unitcell. + ''' + dos_inputs = DosCalculation.get_builder() + dos_inputs.code = self.inputs.qe.dos.code + dos_inputs.parent_folder = self.ctx['calc_unitcell'].outputs.remote_folder + + parameters = orm.Dict(dict={'DOS':{ + 'Emin': -180.0, 'Emax': 40.0, 'degauss':0.0005, 'DeltaE': 0.005} + }) + dos_inputs.parameters = parameters + + dos_inputs.metadata = self.inputs.qe.dos.scheduler_options.get_dict() + + future = self.submit(DosCalculation, **dos_inputs) + self.report('Launching DOS for unitcell structure (PK={}) at node PK={}'.format(self.inputs.unitcell.pk, future.pk)) + self.to_context(**{'calc_dos': future}) + + def check_dos_calculation(self): + ''' + Retrieving the DOS of the unitcell + ''' + + # self.ctx['calc_dos'] = orm.load_node(230991) + + dos_calc = self.ctx['calc_dos'] + if dos_calc.is_finished_ok: + Dos = dos_calc.outputs.output_dos + x = Dos.get_x() + y = Dos.get_y() + DOS = np.vstack((x[1]-self.ctx.vbm.value, y[1][1])).T + mask = (DOS[:,0] <= 0.05) + N_electron = np.trapz(DOS[:,1][mask], DOS[:,0][mask]) + if np.absolute(N_electron - self.ctx.number_of_electrons) > 5e-3: + self.report('The number of electrons obtained from the integration of DOS is: {}'.format(N_electron)) + self.report('The number of electrons obtained from the integration of DOS is different from the expected number of electrons in the input') + return self.exit_codes.ERROR_DOS_INTEGRATION_FAILED + else: + self.ctx.dos = dos_calc.outputs.output_dos + else: + self.report('DOS calculation for the unitcell has failed with status {}'.format(dos_calc.exit_status)) + return self.exit_codes.ERROR_DOS_CALCULATION_FAILED + + def prep_dfpt_calculation(self): + """ + Run a DFPT calculation to compute the dielectric constant for the pristine material + """ + + ph_inputs = PhCalculation.get_builder() + ph_inputs.code = self.inputs.qe.dfpt.code + + # Setting up the calculation depends on whether the parent SCF calculation is either + # the host supercell or an alternative host unitcell + if self.inputs.unitcell: + ph_inputs.parent_folder = self.ctx['calc_unitcell'].outputs.remote_folder + else: + ph_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder + + parameters = orm.Dict(dict={ + 'INPUTPH': { + "tr2_ph" : 1e-16, + 'epsil': True, + 'trans': False + } + }) + ph_inputs.parameters = parameters + + # Set the q-points for a Gamma-point calculation + # N.B. Setting a 1x1x1 mesh is not equivalent as this will trigger a full phonon dispersion calculation + qpoints = orm.KpointsData() + if self.inputs.host_unitcell: + qpoints.set_cell_from_structure(structuredata=self.ctx['calc_unitcell'].inputs.structure) + else: + qpoints.set_cell_from_structure(structuredata=self.ctx['calc_host'].inputs.structure) + qpoints.set_kpoints([[0.,0.,0.]]) + qpoints.get_kpoints(cartesian=True) + ph_inputs.qpoints = qpoints + + ph_inputs.metadata = self.inputs.qe.dfpt.scheduler_options.get_dict() + + future = self.submit(PhCalculation, **ph_inputs) + self.report('Launching PH for host structure at node PK={}'.format(self.inputs.host_structure.pk, future.pk)) + self.to_context(**{'calc_dfpt': future}) + + def check_dfpt_calculation(self): + """ + Compute the dielectric constant to be used in the correction + """ + if self.inputs.epsilon == 0.0: + dfpt_calc = self.ctx['calc_dfpt'] + if dfpt_calc.is_finished_ok: + epsilion_tensor = np.array(dfpt_calc.outputs.output_parameters.get_dict()['dielectric_constant']) + self.ctx.epsilon = orm.Float(np.trace(epsilion_tensor/3.)) + self.report('The computed relative permittivity is {}'.format(self.ctx.epsilon.value)) + else: + self.report( + 'PH for the host structure has failed with status {}'.format(dfpt_calc.exit_status)) + return self.exit_codes.ERROR_DFPT_CALCULATION_FAILED + else: + self.ctx.epsilon = self.inputs.epsilon + + def prep_dft_calculations(self): + """ + Run DFT calculation of the perfect host lattice as well as all the possible defects considered in the material. + """ + + relax_type = {'fixed': RelaxType.NONE, 'relax': RelaxType.POSITIONS, 'vc-relax': RelaxType.POSITIONS_CELL} + overrides = { + 'base':{ + # 'pseudo_family': self.inputs.qe.dft.unitcell.pseudopotential_family.value, + 'pw': {} + }, + 'base_final_scf':{ + # 'pseudo_family': self.inputs.qe.dft.unitcell.pseudopotential_family.value, + 'pw': {} + }, + 'clean_workdir' : orm.Bool(False), + } + + if 'pseudopotential_family' in self.inputs.qe.dft.supercell: + overrides['base']['pseudo_family'] = self.inputs.qe.dft.supercell.pseudopotential_family.value + overrides['base_final_scf']['pseudo_family'] = self.inputs.qe.dft.supercell.pseudopotential_family.value + if 'parameters' in self.inputs.qe.dft.supercell: + overrides['base']['pw']['parameters'] = self.inputs.qe.dft.supercell.parameters.get_dict() + overrides['base_final_scf']['pw']['parameters'] = self.inputs.qe.dft.supercell.parameters.get_dict() + if 'scheduler_options' in self.inputs.qe.dft.supercell: + overrides['base']['pw']['metadata'] = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + overrides['base_final_scf']['pw']['metadata'] = self.inputs.qe.dft.supercell.scheduler_options.get_dict() + if 'settings' in self.inputs.qe.dft.supercell: + overrides['base']['pw']['settings'] = self.inputs.qe.dft.supercell.settings.get_dict() + overrides['base_final_scf']['pw']['settings'] = self.inputs.qe.dft.supercell.settings.get_dict() + + for dopant in self.ctx.pw_host_dopants: + #for dopant in self.ctx.pw_host_dopants[:1]: + #overrides['base']['pw']['metadata']['label'] = 'host_{}'.format(dopant) + inputs = PwRelaxWorkChain.get_builder_from_protocol( + code = self.inputs.qe.dft.supercell.code, + structure = self.inputs.host_structure, + overrides = overrides, + relax_type = relax_type[self.inputs.qe.dft.supercell.relaxation_scheme.value] + ) + future = self.submit(inputs) + self.report( + 'Launching PWSCF for host structure (PK={}) for {} dopant at node PK={}'.format(self.inputs.host_structure.pk, dopant, future.pk)) + future.label = 'host_{}'.format(dopant) + self.to_context(**{'calc_host_{}'.format(dopant): future}) + + + for defect, properties in self.ctx.pw_defects.items(): + defect_structure = generate_defect_structure(self.inputs.host_structure, properties['defect_position'], properties['species']) + for chg in properties['charges']: + overrides['base']['pw']['parameters'] = recursive_merge(overrides['base']['pw']['parameters'], {'SYSTEM':{'tot_charge': chg}}) + overrides['base_final_scf']['pw']['parameters'] = recursive_merge(overrides['base_final_scf']['pw']['parameters'], {'SYSTEM':{'tot_charge': chg}}) + + inputs = PwRelaxWorkChain.get_builder_from_protocol( + code = self.inputs.qe.dft.supercell.code, + structure = defect_structure, + overrides = overrides, + relax_type = relax_type[self.inputs.qe.dft.supercell.relaxation_scheme.value] + ) + + future = self.submit(inputs) + self.report('Launching PWSCF for {} defect structure with charge {} at node PK={}' + .format(defect, chg, future.pk)) + future.label = '{}[{}]'.format(defect, chg) + self.to_context(**{'calc_defect_{}[{}]'.format(defect, chg): future}) + +# def prep_dft_calculations(self): +# """ +# Run DFT calculation of the perfect host lattice as well as all the possible defects considered in the material. +# """ +# +## pw_inputs = PwCalculation.get_builder() +## pw_inputs.code = self.inputs.qe.dft.supercell.code +# +# kpoints = orm.KpointsData() +# kpoints.set_cell_from_structure(self.inputs.host_structure) +# kpoints.set_kpoints_mesh_from_density(self.inputs.k_points_distance.value) +## pw_inputs.kpoints = kpoints +# +## pw_inputs.metadata = self.inputs.qe.dft.supercell.scheduler_options.get_dict() +## pw_inputs.settings = self.inputs.qe.dft.supercell.settings +# scheduler_options = self.inputs.qe.dft.supercell.scheduler_options.get_dict() +# parameters = self.inputs.qe.dft.supercell.parameters.get_dict() +# +# # We set 'tot_charge' later so throw an error if the user tries to set it to avoid +# # any ambiguity or unseen modification of user input +# if 'tot_charge' in parameters['SYSTEM']: +# self.report('You cannot set the "tot_charge" PW.x parameter explicitly') +# return self.exit_codes.ERROR_PARAMETER_OVERRIDE +# +## pw_inputs.structure = self.inputs.host_structure +# parameters['SYSTEM']['tot_charge'] = orm.Float(0.) +## pw_inputs.parameters = orm.Dict(dict=parameters) +# +# inputs = { +# 'pw':{ +# 'code' : self.inputs.qe.dft.supercell.code, +# 'structure' : self.inputs.host_structure, +# 'parameters' : orm.Dict(dict=parameters), +# 'settings': self.inputs.qe.dft.supercell.settings, +# }, +# 'kpoints': kpoints, +# } +# +# for dopant in self.ctx.pw_host_dopants[:1]: +# pseudos = get_pseudos_from_structure(self.inputs.host_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) +# scheduler_options['label'] = 'host_{}'.format(dopant) +## pw_inputs.metadata = scheduler_options +# +# inputs['pw']['pseudos'] = pseudos +# inputs['pw']['metadata'] = scheduler_options +# +# future = self.submit(PwBaseWorkChain, **inputs) +# self.report('Launching PWSCF for host structure (PK={}) at node PK={}' +# .format(self.inputs.host_structure.pk, future.pk)) +# future.label = 'host_{}'.format(dopant) +# self.to_context(**{'calc_host_{}'.format(dopant): future}) +# +# #defect_info = self.inputs.defect_info.get_dict() +# for defect, properties in self.ctx.pw_defects.items(): +# defect_structure = generate_defect_structure(self.inputs.host_structure, properties['defect_position'], properties['species']) +## temp_structure = pymatgen.Structure.from_file('/home/sokseiham/Documents/Defect_calculations/LiK2AlF6/Structures/Ba-K.cif') +## defect_structure = orm.StructureData(pymatgen=temp_structure) +# pseudos = get_pseudos_from_structure(defect_structure, self.inputs.qe.dft.supercell.pseudopotential_family.value) +# +# inputs['pw']['structure'] = defect_structure +# inputs['pw']['pseudos'] = pseudos +# +# parameters['SYSTEM']['nspin'] = 2 +# parameters['SYSTEM']['tot_magnetization'] = 0.0 +# +# for chg in properties['charges']: +# parameters['SYSTEM']['tot_charge'] = orm.Float(chg) +## pw_inputs.parameters = orm.Dict(dict=parameters) +# scheduler_options['label'] = '{}[{}]'.format(defect, chg) +## pw_inputs.metadata = scheduler_options +# +# inputs['pw']['metadata'] = scheduler_options +# inputs['pw']['parameters'] = orm.Dict(dict=parameters) +# +# future = self.submit(PwBaseWorkChain, **inputs) +# self.report('Launching PWSCF for {} defect structure with charge {} at node PK={}' +# .format(defect, chg, future.pk)) +# future.label = '{}[{}]'.format(defect, chg) +# self.to_context(**{'calc_defect_{}[{}]'.format(defect, chg): future}) + + def check_dft_calculations(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # self.ctx['calc_host_intrinsic'] = orm.load_node(231011) + # self.ctx['calc_defect_N-O[-1.0]'] = orm.load_node(231028) + # self.ctx['calc_defect_N-O[0.0]'] = orm.load_node(231044) + # self.ctx['calc_defect_V_Cl[1.0]'] = orm.load_node(231061) + # self.ctx['calc_defect_V_Cl[0.0]'] = orm.load_node(231077) + + # Host + for dopant in self.ctx.pw_host_dopants[:1]: + host_calc = self.ctx['calc_host_{}'.format(dopant)] +# if host_calc.is_finished_ok: +# self.ctx.host_energy = orm.Float(host_calc.outputs.output_parameters.get_dict()['energy']) # eV +# self.report('The energy of the host is: {} eV'.format(self.ctx.host_energy.value)) +# self.ctx.host_vbm = orm.Float(get_vbm(host_calc)) +# self.report('The top of valence band is: {} eV'.format(self.ctx.host_vbm.value)) + if not host_calc.is_finished_ok: + self.report( + 'PWSCF for the host structure has failed with status {}'.format(host_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + + # Defects + #defect_info = self.inputs.defect_info.get_dict() + defect_info = self.ctx.all_defects + for defect, properties in defect_info.items(): + dopant = get_dopant(properties['species'], self.inputs.compound.value) + #self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_{}'.format(dopant)]) + #self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_{}'.format(dopant)].outputs.output_parameters.get_dict()['energy'] + # if self.ctx.pw_host_dopants == []: + # self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_intrinsic']) + # self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_intrinsic'].outputs.output_parameters.get_dict()['energy'] + # else: + # self.ctx.defect_data[defect]['vbm'] = get_vbm(self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])]) + # self.ctx.defect_data[defect]['E_host'] = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.output_parameters.get_dict()['energy'] + for chg in properties['charges']: + defect_calc = self.ctx['calc_defect_{}[{}]'.format(defect, chg)] + if not defect_calc.is_finished_ok: + self.report('PWSCF for the {} defect structure with charge {} has failed with status {}' + .format(defect, chg, defect_calc.exit_status)) + return self.exit_codes.ERROR_DFT_CALCULATION_FAILED + else: + is_insulator, band_gap = orm.nodes.data.array.bands.find_bandgap(defect_calc.outputs.output_band) + if not is_insulator: + self.report('WARNING! The ground state of {} defect structure with charge {} is metallic!'.format(defect, chg)) + # self.ctx.defect_data[defect]['charges'][str(chg)]['E'] = defect_calc.outputs.output_parameters.get_dict()['energy'] # eV + self.report('The energy of {} defect structure with charge {} is: {} eV' + .format(defect, chg, defect_calc.outputs.output_parameters.get_dict()['energy'])) +# self.report('The defect data is :{}'.format(self.ctx.defect_data)) + + def prep_dft_potentials_calculations(self): + """ + Obtain the electrostatic potentials from the PWSCF calculations. + """ + # User inputs + pp_inputs = PpCalculation.get_builder() + pp_inputs.code = self.inputs.qe.pp.code + + scheduler_options = self.inputs.qe.pp.scheduler_options.get_dict() + scheduler_options['label'] = 'pp_phi_host' + pp_inputs.metadata = scheduler_options + + # Fixed settings + #pp_inputs.plot_number = orm.Int(11) # Electrostatic potential + #pp_inputs.plot_dimension = orm.Int(3) # 3D + + parameters = orm.Dict(dict={ + 'INPUTPP': { + "plot_num" : 11, + }, + 'PLOT': { + "iflag" : 3 + } + }) + pp_inputs.parameters = parameters + + # Host + # assuming that the electrostatic potential doesnt vary much with the cutoff + # pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder + self.report('pw_host_dopants: {}'.format(self.ctx.pw_host_dopants)) + if self.ctx.pw_host_dopants == []: + pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder + else: + pp_inputs.parent_folder = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for electrostatic potential for the host structure at node PK={}' + .format(future.pk)) + self.to_context(**{'pp_phi_host': future}) + + #Defects + for defect, properties in self.ctx.phi_defects.items(): + for chg in properties['charges']: + scheduler_options['label'] = 'pp_phi_defect_{}[{}]'.format(defect, chg) + pp_inputs.metadata = scheduler_options + pp_inputs.parent_folder = self.ctx['calc_defect_{}[{}]'.format(defect, chg)].outputs.remote_folder + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for electrostatic potential for {} defect structure with charge {} at node PK={}' + .format(defect, chg, future.pk)) + self.to_context(**{'pp_phi_defect_{}[{}]'.format(defect, chg): future}) + + def check_dft_potentials_calculations(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # self.ctx['pp_phi_host'] = orm.load_node(231144) + # self.ctx['pp_phi_defect_N-O[-1.0]'] = orm.load_node(231145) + # self.ctx['pp_phi_defect_N-O[0.0]'] = orm.load_node(231146) + # self.ctx['pp_phi_defect_V_Cl[1.0]'] = orm.load_node(231147) + # self.ctx['pp_phi_defect_V_Cl[0.0]'] = orm.load_node(231148) + + # Host + host_pp = self.ctx['pp_phi_host'] + if host_pp.is_finished_ok: + #data_array = host_pp.outputs.output_data.get_array('data') + #v_data = orm.ArrayData() + #v_data.set_array('data', data_array) + #self.ctx.phi_host = v_data + self.ctx.phi_host = get_data_array(host_pp.outputs.output_data) + else: + self.report( + 'Post processing for electrostatic potential the host structure has failed with status {}'.format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defects + defect_info = self.ctx.all_defects + for defect, properties in defect_info.items(): + for chg in properties['charges']: + defect_pp = self.ctx['pp_phi_defect_{}[{}]'.format(defect, chg)] + if defect_pp.is_finished_ok: + #data_array = defect_pp.outputs.output_data.get_array('data') + #v_data = orm.ArrayData() + #v_data.set_array('data', data_array) + #self.ctx['phi_defect_{}[{}]'.format(defect, chg)] = v_data + self.ctx['phi_defect_{}[{}]'.format(defect, chg)] = get_data_array(defect_pp.outputs.output_data) + else: + self.report('Post processing for electrostatic potential for {} defect structure with charge {} has failed with status {}' + .format(defect, chg, defect_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + def prep_charge_density_calculations(self): + """ + Obtain electronic charge density from the PWSCF calculations. + """ + # User inputs + pp_inputs = PpCalculation.get_builder() + pp_inputs.code = self.inputs.qe.pp.code + scheduler_options = self.inputs.qe.pp.scheduler_options.get_dict() + scheduler_options['label'] = 'pp_rho_host' + pp_inputs.metadata = scheduler_options + + # Fixed settings + #pp_inputs.plot_number = orm.Int(0) # Charge density + #pp_inputs.plot_dimension = orm.Int(3) # 3D + + parameters = orm.Dict(dict={ + 'INPUTPP': { + "plot_num" : 0, + }, + 'PLOT': { + "iflag" : 3 + } + }) + pp_inputs.parameters = parameters + + # Host + # assuming that the charge density doesn't vary much with the cutoff + pp_inputs.parent_folder = self.ctx['calc_host_{}'.format(self.ctx.pw_host_dopants[0])].outputs.remote_folder + #pp_inputs.parent_folder = self.ctx['calc_host_intrinsic'].outputs.remote_folder + + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for charge density for host structure at node PK={}' + .format(future.pk)) + self.to_context(**{'pp_rho_host': future}) + + #Defects + for defect, properties in self.ctx.rho_defects.items(): + for chg in properties['charges']: + pp_inputs.parent_folder = self.ctx['calc_defect_{}[{}]'.format(defect, chg)].outputs.remote_folder + scheduler_options['label'] = 'pp_rho_defect_{}[{}]'.format(defect, chg) + pp_inputs.metadata = scheduler_options + future = self.submit(PpCalculation, **pp_inputs) + self.report('Launching PP.x for charge density for {} defect structure with charge {} at node PK={}' + .format(defect, chg, future.pk)) + self.to_context(**{'pp_rho_defect_{}[{}]'.format(defect, chg): future}) + + def check_charge_density_calculations(self): + """ + Check if the required calculations for the Gaussian Countercharge correction workchain + have finished correctly. + """ + + # self.ctx['pp_rho_host'] = orm.load_node(231180) + # self.ctx['pp_rho_defect_N-O[-1.0]'] = orm.load_node(231181) + # self.ctx['pp_rho_defect_N-O[0.0]'] = orm.load_node(231182) + # self.ctx['pp_rho_defect_V_Cl[1.0]'] = orm.load_node(231183) + # self.ctx['pp_rho_defect_V_Cl[0.0]'] = orm.load_node(231184) + + # Host + host_pp = self.ctx['pp_rho_host'] + if host_pp.is_finished_ok: + #data_array = host_pp.outputs.output_data.get_array('data') + #v_data = orm.ArrayData() + #v_data.set_array('data', data_array) + #self.ctx.rho_host = v_data + self.ctx.rho_host = get_data_array(host_pp.outputs.output_data) + else: + self.report( + 'Post processing for charge density for the host structure has failed with status {}'.format(host_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + + # Defects + defect_info = self.ctx.all_defects + for defect, properties in defect_info.items(): + for chg in properties['charges']: + defect_pp = self.ctx['pp_rho_defect_{}[{}]'.format(defect, chg)] + if defect_pp.is_finished_ok: + #data_array = defect_pp.outputs.output_data.get_array('data') + #v_data = orm.ArrayData() + #v_data.set_array('data', data_array) + #self.ctx['rho_defect_{}[{}]'.format(defect, chg)] = v_data + self.ctx['rho_defect_{}[{}]'.format(defect, chg)] = get_data_array(defect_pp.outputs.output_data) + else: + self.report('Post processing for charge density for {} defect structure with charge {} has failed with status {}' + .format(defect, chg, defect_pp.exit_status)) + return self.exit_codes.ERROR_PP_CALCULATION_FAILED + diff --git a/aiida_defects/formation_energy/fermi_level/fermi_level.py b/aiida_defects/formation_energy/fermi_level/fermi_level.py index 2c26ea5..2fa2c87 100644 --- a/aiida_defects/formation_energy/fermi_level/fermi_level.py +++ b/aiida_defects/formation_energy/fermi_level/fermi_level.py @@ -55,14 +55,15 @@ def setup(self): Setup the calculation """ chempot_dict = self.inputs.chem_potentials.get_dict() - for key in chempot_dict: - data_array = np.ones_like(chempot_dict[key]) - v_data = ArrayData() - v_data.set_array('data', data_array) - self.ctx.input_chem_shape = v_data +# for key, value in chempot_dict.items(): +# data_array = np.ones_like(value) +# #print(data_array) +# v_data = ArrayData() +# v_data.set_array('data', data_array) +# self.ctx.input_chem_shape = v_data # extracting the DOS of the unitcell, assuming that the calculation is non-spin polarized. - dos_x = self.inputs.DOS.get_x()[1] - self.inputs.valence_band_maximum.value + dos_x = self.inputs.DOS.get_x()[1] - self.inputs.valence_band_maximum.value # Shift the top of valence band to zero v_data = ArrayData() v_data.set_array('data', dos_x) self.ctx.dos_x = v_data @@ -88,7 +89,7 @@ def compute_sc_fermi_level(self): try: E_Fermi = solve_for_sc_fermi(self.inputs.defect_data, self.inputs.chem_potentials, - self.ctx.input_chem_shape, + #self.ctx.input_chem_shape, self.inputs.temperature, self.inputs.unitcell, self.inputs.band_gap, diff --git a/aiida_defects/formation_energy/fermi_level/utils.py b/aiida_defects/formation_energy/fermi_level/utils.py index f5043d3..4afe035 100644 --- a/aiida_defects/formation_energy/fermi_level/utils.py +++ b/aiida_defects/formation_energy/fermi_level/utils.py @@ -9,36 +9,25 @@ from aiida.engine import calcfunction import numpy as np +import random from pymatgen.core.composition import Composition from aiida.orm import ArrayData, Float -from pymatgen import Element from scipy.optimize import broyden1 from scipy.optimize.nonlin import NoConvergence +from scipy.special import expit -def _get_first_element(x): - ''' - This is needed in the electron_concentration and hole_concentration methods because we want to accept - the chemical potential (and fermi level) of any shape as input to vectorize the numpy operations but - the two methods accept only a scalar. - ''' - if x.ndim == 0: - return x - elif x.ndim == 1: - return x[0] - else: - return x[0,0] -def compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant): +def compute_net_charge(defect_data, chem_potentials, temperature, unitcell, band_gap, dos_x, dos_y, dopant): ''' This is a nested function that return a function (with E_Fermi as variable) to be use in the non-linear solver to obtain the self-consistent Fermi level. arguments: defect_data : dictionary containing information required to compute the formation energy of each defect - chem_potentials : dictionary containing the chemical potential of all elements constituting the compound. Can be a float or numpy array - input_chem_shape : the shape of values of chem_potentials. this is needed because we want the code to work both for float or numpy array - for ex. when computing the concentration of a particular defect in the stability region. We can of course do that one - value at a time but it is much slower than vectorization using numpy + chem_potentials : dictionary containing the chemical potential of all elements constituting the compound. Each value can be a float or 1d numpy array + #input_chem_shape : the shape of values of 'chem_potentials' dictionnary. This is needed because we want the code to work both for float or numpy array + # for ex. when computing the concentration of a particular defect in the stability region. We can of course do that one + # value at a time but it is much slower than vectorization using numpy dopant : aliovalent dopants specified by its charge and concentration with the format {'X_1': {'c':, 'q':}, 'X_2': {'c':, 'q':}, ...}. Used to compute the change in the defect concentrations with 'frozen defect' approach uniticell : is the structure used to compute the Dos, NOT the host supercell used to compute the formation energy @@ -60,75 +49,74 @@ def defect_formation_energy(E_Fermi): for chg in temp['charges'].keys(): E_formation = temp['charges'][chg]['E']-temp['E_host']+float(chg)*(E_Fermi+temp['vbm'])+temp['charges'][chg]['E_corr'] for spc in temp['species'].keys(): - E_formation -= temp['species'][spc]*input_chem_shape*chem_potentials[spc] + E_formation -= temp['species'][spc]*np.array(chem_potentials[spc]) # We convert chem_potentials[spc] to np array because it was converted to list in the calcfunction Ef[chg] = E_formation E_defect_formation[defect] = Ef - print(E_defect_formation) return E_defect_formation def electron_concentration(E_Fermi): ''' Compute electron concentration ''' - upper_dos = dos_y[dos_x>=band_gap] - E_upper = dos_x[dos_x>=band_gap] - - ndim = E_Fermi.ndim - E_Fermi = np.expand_dims(E_Fermi, axis=ndim) # To broadcast with E_upper - mask_n = ((E_upper-E_Fermi)/(k_B*temperature) < 700.0) # To avoid overflow in the exp - for i in range(ndim): - upper_dos = np.repeat(np.expand_dims(upper_dos, axis=0), E_Fermi.shape[ndim-i-1], axis=0) - upper_dos[~mask_n] = 0 - temp = E_upper-E_Fermi - temp[~mask_n] = 0 - temp_n = upper_dos/(np.exp(temp/(k_B*temperature))+1.0) - - return convert*np.sum(temp_n, axis=ndim)*dE/unitcell.volume +# if input_chem_shape.ndim != 0: + upper_dos = np.reshape(dos_y[dos_x>=band_gap], (-1,1)) # For broadcasting + E_upper = np.reshape(dos_x[dos_x>=band_gap], (-1,1)) # For broadcasting +# else: +# upper_dos = dos_y[dos_x>=band_gap] +# E_upper = dos_x[dos_x>=band_gap] + temp_n = upper_dos*expit(-(E_upper-E_Fermi)/(k_B*temperature)) # Use expit (expit(x)=1/(1+exp(-x))) to directly compute Fermi-Dirac distribution + return convert*np.sum(temp_n, axis=0)*dE/unitcell.volume def hole_concentration(E_Fermi): ''' Compute hole concentration ''' - lower_dos = dos_y[dos_x<=0.0] - E_lower = dos_x[dos_x<=0.0] - - ndim = E_Fermi.ndim - E_Fermi = np.expand_dims(E_Fermi, axis=ndim) # To broadcast with E_lower - mask_p = ((E_Fermi-E_lower)/(k_B*temperature) < 700.0) # To avoid overflow in the exp - for i in range(ndim): - lower_dos = np.repeat(np.expand_dims(lower_dos, axis=0), E_Fermi.shape[ndim-i-1], axis=0) - lower_dos[~mask_p] = 0 - temp = E_Fermi-E_lower - temp[~mask_p] = 0 - temp_p = lower_dos/(np.exp(temp/(k_B*temperature))+1.0) - - return convert*np.sum(temp_p, axis=ndim)*dE/unitcell.volume +# if input_chem_shape.ndim != 0: + lower_dos = np.reshape(dos_y[dos_x<=0.0], (-1,1)) #For broadcasting + E_lower = np.reshape(dos_x[dos_x<=0.0], (-1,1)) #For broadcasting +# else: +# lower_dos = dos_y[dos_x<=0.0] +# E_lower = dos_x[dos_x<=0.0] + temp_p = lower_dos*expit(-(E_Fermi-E_lower)/(k_B*temperature)) # Use expit to directly compute Fermi-Dirac distribution + return convert*np.sum(temp_p, axis=0)*dE/unitcell.volume # def electron_concentration(E_Fermi): # ''' -# compute the concentration of electrons +# Compute electron concentration # ''' -# -# E_Fermi = _get_first_element(E_Fermi) # upper_dos = dos_y[dos_x>=band_gap] # E_upper = dos_x[dos_x>=band_gap] -# # plt.plot(E_upper, upper_dos) +# +# ndim = E_Fermi.ndim +# E_Fermi = np.expand_dims(E_Fermi, axis=ndim) # To broadcast with E_upper # mask_n = ((E_upper-E_Fermi)/(k_B*temperature) < 700.0) # To avoid overflow in the exp -# temp_n = upper_dos[mask_n]/(np.exp((E_upper[mask_n]-E_Fermi)/(k_B*temperature))+1.0) -# return input_chem_shape*convert*np.sum(temp_n)*dE/unitcell.volume - +# for i in range(ndim): +# upper_dos = np.repeat(np.expand_dims(upper_dos, axis=0), E_Fermi.shape[ndim-i-1], axis=0) +# upper_dos[~mask_n] = 0 +# temp = E_upper-E_Fermi +# temp[~mask_n] = 0 +# temp_n = upper_dos/(np.exp(temp/(k_B*temperature))+1.0) +# +# return convert*np.sum(temp_n, axis=ndim)*dE/unitcell.volume +# # def hole_concentration(E_Fermi): # ''' -# compute the concentration of holes +# Compute hole concentration # ''' -# -# E_Fermi = _get_first_element(E_Fermi) # lower_dos = dos_y[dos_x<=0.0] # E_lower = dos_x[dos_x<=0.0] -# # plt.plot(E_lower, lower_dos) +# +# ndim = E_Fermi.ndim +# E_Fermi = np.expand_dims(E_Fermi, axis=ndim) # To broadcast with E_lower # mask_p = ((E_Fermi-E_lower)/(k_B*temperature) < 700.0) # To avoid overflow in the exp -# temp_p = lower_dos[mask_p]/(np.exp((E_Fermi-E_lower[mask_p])/(k_B*temperature))+1.0) -# return input_chem_shape*convert*np.sum(temp_p)*dE/unitcell.volume +# for i in range(ndim): +# lower_dos = np.repeat(np.expand_dims(lower_dos, axis=0), E_Fermi.shape[ndim-i-1], axis=0) +# lower_dos[~mask_p] = 0 +# temp = E_Fermi-E_lower +# temp[~mask_p] = 0 +# temp_p = lower_dos/(np.exp(temp/(k_B*temperature))+1.0) +# +# return convert*np.sum(temp_p, axis=ndim)*dE/unitcell.volume def c_defect(N_site, Ef): ''' @@ -138,7 +126,7 @@ def c_defect(N_site, Ef): def Net_charge(E_Fermi): ''' - compute the total charge of the system. The self-consistent Fermi level is the one for with this net (or total) charge is zero. + compute the total charge of the system. The self-consistent Fermi level is the one for which this net (or total) charge is zero. ''' n = electron_concentration(E_Fermi) p = hole_concentration(E_Fermi) @@ -166,7 +154,7 @@ def Net_charge(E_Fermi): return Net_charge @calcfunction -def solve_for_sc_fermi(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant, f_tol): +def solve_for_sc_fermi(defect_data, chem_potentials, temperature, unitcell, band_gap, dos_x, dos_y, dopant, f_tol): ''' solve the non-linear equation with E_fermi as variable to obtain the self-consistent Fermi level. The non-linear solver broyden1 in scipy is used. @@ -174,15 +162,18 @@ def solve_for_sc_fermi(defect_data, chem_potentials, input_chem_shape, temperatu defect_data = defect_data.get_dict() chem_potentials = chem_potentials.get_dict() - input_chem_shape = input_chem_shape.get_array('data') + #input_chem_shape = input_chem_shape.get_array('data') temperature = temperature.value unitcell = unitcell.get_pymatgen_structure() + band_gap = band_gap.value dos_x = dos_x.get_array('data') dos_y = dos_y.get_array('data') - band_gap = band_gap.value + dopant = dopant.get_dict() tolerance = f_tol.value - net_charge = compute_net_charge(defect_data, chem_potentials, input_chem_shape, temperature, unitcell, band_gap, dos_x, dos_y, dopant) + net_charge = compute_net_charge(defect_data, chem_potentials, temperature, unitcell, band_gap, dos_x, dos_y, dopant) + #sc_fermi = broyden1(net_charge, input_chem_shape*band_gap/2, f_tol=tolerance) + input_chem_shape = np.ones_like(random.choice(list(chem_potentials.values()))) sc_fermi = broyden1(net_charge, input_chem_shape*band_gap/2, f_tol=tolerance) v_data = ArrayData() v_data.set_array('data', sc_fermi) diff --git a/aiida_defects/formation_energy/formation_energy_base.py b/aiida_defects/formation_energy/formation_energy_base.py index 23a77ee..8b4f28a 100644 --- a/aiida_defects/formation_energy/formation_energy_base.py +++ b/aiida_defects/formation_energy/formation_energy_base.py @@ -97,11 +97,11 @@ def define(cls, spec): # Fixed spec.input_namespace('charge_model.fixed', required=False, populate_defaults=False, help="Inputs for a fixed charge model using a user-specified multivariate gaussian") - spec.input("charge_model.fixed.gaussian_params", - valid_type=orm.List, - help="A length 9 list of parameters needed to construct the " - "gaussian charge distribution. The format required is " - "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") + spec.input("charge_model.fixed.covariance_matrix", + valid_type=orm.ArrayData, + help="The covariance matrix used to construct the gaussian charge distribution.") + # "gaussian charge distribution. The format required is " + # "[x0, y0, z0, sigma_x, sigma_y, sigma_z, cov_xy, cov_xz, cov_yz]") # Fitted spec.input_namespace('charge_model.fitted', required=False, populate_defaults=False, help="Inputs for a fitted charge model using a multivariate anisotropic gaussian.") @@ -239,7 +239,7 @@ def run_gaussian_correction_workchain(self): } if self.inputs.charge_model.model_type.value == 'fixed': - inputs['charge_model']['fixed'] = {'gaussian_params': self.inputs.charge_model.fixed.gaussian_params} + inputs['charge_model']['fixed'] = {'covariance_matrix': self.inputs.charge_model.fixed.covariance_matrix} else: inputs['charge_model']['fitted'] = {'tolerance': self.inputs.charge_model.fitted.tolerance, 'strict_fit': self.inputs.charge_model.fitted.strict_fit} @@ -293,7 +293,7 @@ def check_correction_workchain(self): self.ctx.electrostatic_correction = ( correction_wc.outputs.electrostatic_correction ) - self.ctx.total_alignment = correction_wc.outputs.total_alignment + self.ctx.potential_alignment = correction_wc.outputs.potential_alignment def run_chemical_potential_workchain(self): from .chemical_potential.chemical_potential import ( @@ -367,7 +367,7 @@ def compute_formation_energy(self): # Corrected formation energy with potential alignment self.ctx.e_f_corrected_aligned = get_corrected_aligned_formation_energy( - self.ctx.e_f_corrected, self.ctx.total_alignment + self.ctx.e_f_corrected, self.inputs.defect_charge, self.ctx.potential_alignment ) self.report( "The computed corrected formation energy, including potential alignments, is {} eV".format( diff --git a/aiida_defects/formation_energy/formation_energy_qe.py b/aiida_defects/formation_energy/formation_energy_qe.py index a60a19f..0335c6c 100644 --- a/aiida_defects/formation_energy/formation_energy_qe.py +++ b/aiida_defects/formation_energy/formation_energy_qe.py @@ -19,7 +19,7 @@ from aiida_defects.formation_energy.formation_energy_base import FormationEnergyWorkchainBase from aiida_defects.formation_energy.utils import run_pw_calculation -from .utils import get_vbm, get_raw_formation_energy, get_corrected_formation_energy, get_corrected_aligned_formation_energy +from .utils import get_vbm, get_raw_formation_energy, get_data_array, get_corrected_formation_energy, get_corrected_aligned_formation_energy PpCalculation = CalculationFactory('quantumespresso.pp') @@ -409,10 +409,12 @@ def check_dft_potentials_gaussian_correction(self): # Host host_pp = self.ctx['calc_v_host'] if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_host = v_data + # data_array = host_pp.outputs.output_data.get_array('data') + # v_data = orm.ArrayData() + # v_data.set_array('data', data_array) + # self.ctx.v_host = v_data + # self.ctx.v_host = host_pp.outputs.output_data + self.ctx.v_host = get_data_array(host_pp.outputs.output_data) else: self.report( 'Post processing for the host structure has failed with status {}'.format(host_pp.exit_status)) @@ -421,10 +423,12 @@ def check_dft_potentials_gaussian_correction(self): # Defect (q=0) defect_q0_pp = self.ctx['calc_v_defect_q0'] if defect_q0_pp.is_finished_ok: - data_array = defect_q0_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q0 = v_data + # data_array = defect_q0_pp.outputs.output_data.get_array('data') + # v_data = orm.ArrayData() + # v_data.set_array('data', data_array) + # self.ctx.v_defect_q0 = v_data + # self.ctx.v_defect_q0 = defect_q0_pp.outputs.output_data + self.ctx.v_defect_q0 = get_data_array(defect_q0_pp.outputs.output_data) else: self.report( 'Post processing for the defect structure (with charge 0) has failed with status {}' @@ -434,52 +438,18 @@ def check_dft_potentials_gaussian_correction(self): # Defect (q=q) defect_q_pp = self.ctx['calc_v_defect_q'] if defect_q_pp.is_finished_ok: - data_array = defect_q_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.v_defect_q = v_data + # data_array = defect_q_pp.outputs.output_data.get_array('data') + # v_data = orm.ArrayData() + # v_data.set_array('data', data_array) + # self.ctx.v_defect_q = v_data + # self.ctx.v_defect_q = defect_q_pp.outputs.output_data + self.ctx.v_defect_q = get_data_array(defect_q_pp.outputs.output_data) else: self.report( 'Post processing for the defect structure (with charge {}) has failed with status {}' .format(self.inputs.defect_charge.value,defect_q_pp.exit_status)) return self.exit_codes.ERROR_PP_CALCULATION_FAILED - - def get_kohn_sham_potentials(self): - """ - Obtain the electrostatic potentials from the PWSCF calculations. - """ - # User inputs - pp_inputs = self.inputs.qe.pp.code.get_builder() - pp_inputs.metadata = self.inputs.qe.pp.scheduler_options.get_dict() - - # Fixed settings - pp_inputs.plot_number = orm.Int(1) # Kohn-Sham potential - pp_inputs.plot_dimension = orm.Int(3) # 3D - - # Host - if self.inputs.run_pw_host: - pp_inputs.parent_folder = self.ctx['calc_host'].outputs.remote_folder - else: - HostNode = orm.load_node(self.inputs.host_node.value) - pp_inputs.parent_folder = HostNode.outputs.remote_folder - - future = self.submit(pp_inputs) - self.report('Extracting Kohn-Sham potential of host structure (PK={}) with charge {} (PK={})'. - format(self.inputs.host_structure.pk, "0.0", future.pk)) - self.to_context(**{'V_KS_host': future}) - - # Defect (q=q) - if self.inputs.run_pw_defect_q: - pp_inputs.parent_folder = self.ctx['calc_defect_q'].outputs.remote_folder - else: - Defect_qNode = orm.load_node(self.inputs.defect_q_node.value) - pp_inputs.parent_folder = Defect_qNode.outputs.remote_folder - future = self.submit(pp_inputs) - self.report('Extracting Kohn-Sham potential of defect structure (PK={}) with charge {} (PK={})' - .format(self.inputs.defect_structure.pk, self.inputs.defect_charge.value, future.pk)) - self.to_context(**{'V_KS_defect_q': future}) - def get_charge_density(self): """ Obtain the electrostatic potentials from the PWSCF calculations. @@ -555,10 +525,12 @@ def check_charge_density_calculations(self): # Host host_pp = self.ctx['calc_rho_host'] if host_pp.is_finished_ok: - data_array = host_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.rho_host = v_data + # data_array = host_pp.outputs.output_data.get_array('data') + # v_data = orm.ArrayData() + # v_data.set_array('data', data_array) + # self.ctx.rho_host = v_data + # self.ctx.rho_host = host_pp.outputs.output_data + self.ctx.rho_host = get_data_array(host_pp.outputs.output_data) else: self.report( 'Post processing for the host structure has failed with status {}'.format(host_pp.exit_status)) @@ -567,10 +539,12 @@ def check_charge_density_calculations(self): # Defect (q=0) defect_q0_pp = self.ctx['calc_rho_defect_q0'] if defect_q0_pp.is_finished_ok: - data_array = defect_q0_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.rho_defect_q0 = v_data + # data_array = defect_q0_pp.outputs.output_data.get_array('data') + # v_data = orm.ArrayData() + # v_data.set_array('data', data_array) + # self.ctx.rho_defect_q0 = v_data + # self.ctx.rho_defect_q0 = defect_q0_pp.outputs.output_data + self.ctx.rho_defect_q0 = get_data_array(defect_q0_pp.outputs.output_data) else: self.report( 'Post processing for the defect structure (with charge 0) has failed with status {}' @@ -580,10 +554,12 @@ def check_charge_density_calculations(self): # Defect (q=q) defect_q_pp = self.ctx['calc_rho_defect_q'] if defect_q_pp.is_finished_ok: - data_array = defect_q_pp.outputs.output_data.get_array('data') - v_data = orm.ArrayData() - v_data.set_array('data', data_array) - self.ctx.rho_defect_q = v_data + # data_array = defect_q_pp.outputs.output_data.get_array('data') + # v_data = orm.ArrayData() + # v_data.set_array('data', data_array) + # self.ctx.rho_defect_q = v_data + # self.ctx.rho_defect_q = defect_q_pp.outputs.output_data + self.ctx.rho_defect_q = get_data_array(defect_q_pp.outputs.output_data) else: self.report( 'Post processing for the defect structure (with charge 0) has failed with status {}' diff --git a/aiida_defects/formation_energy/potential_alignment/mae/mae.py b/aiida_defects/formation_energy/potential_alignment/mae/mae.py index 1a6866a..10d8055 100644 --- a/aiida_defects/formation_energy/potential_alignment/mae/mae.py +++ b/aiida_defects/formation_energy/potential_alignment/mae/mae.py @@ -11,7 +11,7 @@ from aiida.engine import WorkChain, calcfunction from aiida_defects.formation_energy.potential_alignment.utils import get_potential_difference -from .utils import get_alignment, AllValuesMaskedError +from .utils import get_alignment, AllValuesMaskedError, convert_Hat_to_Ryd class MaeAlignmentWorkchain(WorkChain): @@ -72,9 +72,20 @@ def compute_difference(self): """ Compute the difference of the two potentials """ + + ### Temporary solution to convert potential to the same unit, has to be redone properly. + ### The potentials generate by pp.x are in Rydberg while the model potential is in Hartree + if len(self.inputs.second_potential.get_arraynames()) == 1: + #v_model = orm.ArrayData() + #v_model.set_array('data',self.inputs.second_potential.get_array(self.inputs.second_potential.get_arraynames()[0])*-2.0) # Hartree to Ry unit of potential - This is dirty - need to harmonise units + v_model = convert_Hat_to_Ryd(self.inputs.second_potential) + else: + v_model = self.inputs.second_potential + self.ctx.potential_difference = get_potential_difference( first_potential = self.inputs.first_potential, - second_potential = self.inputs.second_potential + # second_potential = self.inputs.second_potential + second_potential = v_model ) @@ -96,4 +107,4 @@ def results(self): Pack the results """ self.out('alignment_required', self.ctx.alignment) - self.out('potential_difference', self.ctx.potential_difference) \ No newline at end of file + self.out('potential_difference', self.ctx.potential_difference) diff --git a/aiida_defects/formation_energy/potential_alignment/mae/utils.py b/aiida_defects/formation_energy/potential_alignment/mae/utils.py index 0b25aac..a5a3b49 100644 --- a/aiida_defects/formation_energy/potential_alignment/mae/utils.py +++ b/aiida_defects/formation_energy/potential_alignment/mae/utils.py @@ -28,6 +28,13 @@ class AllValuesMaskedError(ValueError): """ pass +@calcfunction +def convert_Hat_to_Ryd(potential): + v_model = orm.ArrayData() + v_model.set_array('data', potential.get_array(potential.get_arraynames()[0])*-2.0) + + return v_model + @calcfunction def get_alignment(potential_difference, defect_site, cutoff_radius=lambda: orm.Float(0.5)): """ @@ -51,7 +58,7 @@ def get_alignment(potential_difference, defect_site, cutoff_radius=lambda: orm.F # Generate a crystal grid of the same dimension as the data ijk_array = get_grid(v_diff.shape, endpoint=False) # Compute the distance from the defect site to every other. - distance_vectors = np.array(defect_site).reshape(3,1) - ijk_array + distance_vectors = np.array(defect_site.get_list()).reshape(3,1) - ijk_array # Apply minimum image min_image_vectors = (distance_vectors - np.rint(distance_vectors)) # Compute distances and reshape to match input data @@ -71,7 +78,7 @@ def get_alignment(potential_difference, defect_site, cutoff_radius=lambda: orm.F raise AllValuesMaskedError fit_result = fit_potential(v_diff_masked) - alignment = fit_result.x*CONSTANTS.ry_to_ev + alignment = -1.*fit_result.x*CONSTANTS.ry_to_ev return orm.Float(alignment) diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index d21cdbb..297389b 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -101,19 +101,24 @@ def setup(self): namespace=self.ctx.alignment_scheme)) self.ctx.inputs = inputs + # Array should have the same shape - if not they should be interpolated to have the same shape # Collect the arrays + # arrays = { + # 'first_potential': inputs.first_potential, + # 'second_potential': inputs.second_potential + # } arrays = { - 'first_potential': inputs.first_potential, - 'second_potential': inputs.second_potential + 'first_potential': self.inputs[self.ctx.alignment_scheme]['first_potential'], + 'second_potential': self.inputs[self.ctx.alignment_scheme]['second_potential'] } if 'charge_density' in inputs: # density-weighted case arrays['charge_density'] = inputs.charge_density - # Check if ArrayData objects have more than one array packed in them - for array in arrays.values(): - if len(array.get_arraynames()) != 1: - return self.exit_codes.ERROR_INPUT_EXTRA_ARRAYS + # # Check if ArrayData objects have more than one array packed in them + # for array in arrays.values(): + # if len(array.get_arraynames()) != 1: + # return self.exit_codes.ERROR_INPUT_EXTRA_ARRAYS # Unpack and obtain the shapes array_shapes = {} @@ -175,13 +180,23 @@ def do_interpolation(self): self.report('Doing interpolation') interpolated_arrays = {} - for array_name, array in self.ctx.arrays.items(): - interpolated_arrays[array_name] = get_interpolation( - input_array=array, + # for array_name, array in self.ctx.arrays.items(): + # interpolated_arrays[array_name] = get_interpolation( + # input_array=array, + # target_shape=target_shape) + # # Replace input arrays with interpolated versions + # for array_name, array in interpolated_arrays.items(): + # self.ctx.inputs[array_name] = array + + interpolated_arrays['first_potential'] = get_interpolation( + input_array=self.inputs[self.ctx.alignment_scheme]['first_potential'], + target_shape=target_shape) + interpolated_arrays['second_potential'] = get_interpolation( + input_array=self.inputs[self.ctx.alignment_scheme]['second_potential'], target_shape=target_shape) # Replace input arrays with interpolated versions for array_name, array in interpolated_arrays.items(): - self.ctx.inputs[array_name] = array + self.ctx.inputs[array_name] = array return diff --git a/aiida_defects/formation_energy/potential_alignment/utils.py b/aiida_defects/formation_energy/potential_alignment/utils.py index 0c6cdcf..24de95e 100644 --- a/aiida_defects/formation_energy/potential_alignment/utils.py +++ b/aiida_defects/formation_energy/potential_alignment/utils.py @@ -38,6 +38,11 @@ def get_potential_difference(first_potential, second_potential): first_potential.get_arraynames()[0]) second_array = second_potential.get_array( second_potential.get_arraynames()[0]) + +# if first_array.shape != second_array.shape: +# target_shape = orm.List(list=np.max(np.vstack((first_array.shape, second_array.shape)), axis=0).tolist()) +# first_array = get_interpolation(first_potential, target_shape).get_array('interpolated_array') +# second_array = get_interpolation(second_potential, target_shape).get_array('interpolated_array') difference_array = first_array - second_array difference_potential = orm.ArrayData() @@ -84,4 +89,4 @@ def get_interpolation(input_array, target_shape): interpolated_array = orm.ArrayData() interpolated_array.set_array('interpolated_array', interp_array) - return interpolated_array \ No newline at end of file + return interpolated_array diff --git a/aiida_defects/formation_energy/utils.py b/aiida_defects/formation_energy/utils.py index b9d82ee..8e30733 100644 --- a/aiida_defects/formation_energy/utils.py +++ b/aiida_defects/formation_energy/utils.py @@ -79,15 +79,23 @@ def get_defect_and_charge_from_label(calc_label): chg = float(spl[1].split(']')[0]) return defect, chg -def defect_formation_energy(defect_data, E_Fermi, chem_potentials, pot_alignments): +@calcfunction +def get_data_array(array): + data_array = array.get_array('data') + v_data = orm.ArrayData() + v_data.set_array('data', data_array) + return v_data + +@calcfunction +def get_defect_formation_energy(defect_data, E_Fermi, chem_potentials, pot_alignments): ''' - Computing the defec tformation energy with and without electrostatic and potential alignment corrections - Note: 'E_corr' in the defect_data contains the total correction, i.e electrostatic and potential alignment + Computing the defect formation energy with and without electrostatic and potential alignment corrections + Note: 'E_corr' in the defect_data corresponds to the total correction, i.e electrostatic and potential alignment ''' - # defect_data = defect_data.get_dict() - # E_Fermi = E_Fermi.get_array('data') - # chem_potentials = chem_potentials.get_dict() - # pot_alignments = pot_alignments.get_dict() + defect_data = defect_data.get_dict() + E_Fermi = E_Fermi.get_array('data') + chem_potentials = chem_potentials.get_dict() + pot_alignments = pot_alignments.get_dict() E_defect_formation = {'uncorrected':{}, 'electrostatic': {}, 'electrostatic and alignment': {}} for defect, properties in defect_data.items(): @@ -97,63 +105,104 @@ def defect_formation_energy(defect_data, E_Fermi, chem_potentials, pot_alignment for chg in properties['charges'].keys(): Ef_raw = properties['charges'][chg]['E']-properties['E_host']+float(chg)*(E_Fermi+properties['vbm']) - # for spc in properties['species'].keys(): - # Ef_raw -= properties['species'][spc]*chem_potentials[spc] for spc, sign in properties['species'].items(): - Ef_raw -= sign*chem_potentials[spc] + Ef_raw -= sign*chem_potentials[spc][0] Ef_corrected = Ef_raw + properties['charges'][chg]['E_corr'] E_defect_formation['uncorrected'][defect][str(chg)] = Ef_raw - E_defect_formation['electrostatic'][defect][str(chg)] = Ef_corrected - pot_alignments[defect][str(chg)] + E_defect_formation['electrostatic'][defect][str(chg)] = Ef_corrected + float(chg)*pot_alignments[defect][str(chg)] E_defect_formation['electrostatic and alignment'][defect][str(chg)] = Ef_corrected - # return orm.Dict(dict=E_defect_formation) - return E_defect_formation - -@calcfunction -def get_defect_formation_energy(defect_data, E_Fermi, pot_alignments, chem_potentials, compound): - - defect_data = defect_data.get_dict() - #formation_energy_dict = formation_energy_dict.get_dict() - E_Fermi = E_Fermi.get_dict() - chem_potentials = chem_potentials.get_dict() - pot_alignments = pot_alignments.get_dict() - compound = compound.value - - intrinsic_defects = {} - for defect, properties in defect_data.items(): - if is_intrinsic_defect(properties['species'], compound): - intrinsic_defects[defect] = properties - - defect_Ef = {} - for dopant, e_fermi in E_Fermi.items(): - defect_temp = intrinsic_defects.copy() - if dopant != 'intrinsic': - for defect, properties in defect_data.items(): - if dopant in properties['species'].keys(): - defect_temp[defect] = properties - - defect_Ef[dopant] = defect_formation_energy( - defect_temp, - e_fermi, - chem_potentials[dopant], - pot_alignments - ) + return orm.Dict(dict=E_defect_formation) + +# @calcfunction +# def get_defect_formation_energy(defect_data, E_Fermi, pot_alignments, chem_potentials, compound): + +# defect_data = defect_data.get_dict() +# #formation_energy_dict = formation_energy_dict.get_dict() +# E_Fermi = E_Fermi.get_dict() +# chem_potentials = chem_potentials.get_dict() +# pot_alignments = pot_alignments.get_dict() +# compound = compound.value + +# intrinsic_defects = {} +# for defect, properties in defect_data.items(): +# if is_intrinsic_defect(properties['species'], compound): +# intrinsic_defects[defect] = properties + +# defect_Ef = {} +# for dopant, e_fermi in E_Fermi.items(): +# defect_temp = intrinsic_defects.copy() +# if dopant != 'intrinsic': +# for defect, properties in defect_data.items(): +# if dopant in properties['species'].keys(): +# defect_temp[defect] = properties + +# defect_Ef[dopant] = defect_formation_energy( +# defect_temp, +# e_fermi, +# chem_potentials[dopant], +# pot_alignments +# ) - return orm.Dict(dict=defect_Ef) +# return orm.Dict(dict=defect_Ef) + +def has_numbers(inputString): + return any(char.isdigit() for char in inputString) + +def convert_key(key): + new_key = key.replace('-', 'q') + if has_numbers(key): + new_key = 'A'+new_key + return new_key.replace('.', '_') + else: + return new_key + +def revert_key(key): + new_key = key.replace('q', '-') + if has_numbers(key): + return new_key[1:]#.replace('_', '.') + else: + return new_key @calcfunction -def store_dict(data_dict): +def store_dict(**kwargs): new_dict = {} - for k, v in data_dict.get_dict().items(): - new_dict[k] = v + for k, v in kwargs.items(): + new_k = revert_key(k) + if isinstance(v, orm.Dict): + # new_dict[k.replace('q', '-')] = v.get_dict() + d = {key.replace('_', '.'): item for key, item in v.get_dict().items()} + new_dict[new_k] = d + if isinstance(v, orm.Float): + new_dict[new_k] = v.value + if isinstance(v, orm.ArrayData): + new_dict[new_k] = v.get_array(v.get_arraynames()[0]).item() # get the value from 0-d numpy array return orm.Dict(dict=new_dict) + @calcfunction -def store_dos(DOS): - dos_x = DOS.get_x()[1] - dos_y = DOS.get_y()[1][1] - return DOS +def get_defect_data(dopant, compound, defect_info, vbm, E_host_outputs_params, total_correction, **kwargs): + + dopant = dopant.value + compound = compound.value + vbm = vbm.value + E_host = E_host_outputs_params.get_dict()['energy'] + defect_info = defect_info.get_dict() + total_correction = total_correction.get_dict() + + defect_data = {} + for defect, properties in defect_info.items(): + if is_intrinsic_defect(properties['species'], compound) or dopant in properties['species'].keys(): + defect_data[defect] = {'N_site': properties['N_site'], 'species': properties['species'], 'charges': {}, + 'vbm': vbm, 'E_host': E_host} + for chg in properties['charges']: + defect_data[defect]['charges'][str(chg)] = {'E_corr': total_correction[defect][str(chg)], + 'E': kwargs[convert_key(defect)+'_'+convert_key(str(chg))].get_dict()['energy'] + } + + return orm.Dict(dict=defect_data) + def run_pw_calculation(pw_inputs, structure, charge): """ @@ -212,13 +261,12 @@ def get_corrected_formation_energy(e_f_uncorrected, correction): e_f_corrected = e_f_uncorrected + correction return e_f_corrected - @calcfunction -def get_corrected_aligned_formation_energy(e_f_corrected, alignment): +def get_corrected_aligned_formation_energy(e_f_corrected, defect_charge, alignment): """ Compute the formation energy with correction and aligned """ - e_f_corrected_aligned = e_f_corrected + alignment + e_f_corrected_aligned = e_f_corrected - defect_charge * alignment return e_f_corrected_aligned From abe19f57110fb4e90174f32487b60030d5380d8c Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 27 Mar 2023 15:06:13 +0200 Subject: [PATCH 57/60] Adding examples for various workchains --- examples/ChemicalPotential.ipynb | 125 ++++++++++++ examples/DefectChemistry.ipynb | 282 +++++++++++++++++++++++++++ examples/FormationEnergyQE.ipynb | 250 ++++++++++++------------ examples/GaussianCountercharge.ipynb | 26 +-- examples/Structures/Li3ClO_1x1x1.cif | 37 ++++ 5 files changed, 576 insertions(+), 144 deletions(-) create mode 100644 examples/ChemicalPotential.ipynb create mode 100644 examples/DefectChemistry.ipynb create mode 100644 examples/Structures/Li3ClO_1x1x1.cif diff --git a/examples/ChemicalPotential.ipynb b/examples/ChemicalPotential.ipynb new file mode 100644 index 0000000..ee3d292 --- /dev/null +++ b/examples/ChemicalPotential.ipynb @@ -0,0 +1,125 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "25dabefe", + "metadata": {}, + "source": [ + "# How to use the ChemicalPotential Workchain\n", + "To compute the formation energy of a defect, one needs to know the chemical potential of the element that is added or removed to create that defect. That chemical potential has to be chosen in such a way that it is compatible with the stability of the host structure with respect to the other phases in the phase diagram. In the example below, we show you how to compute the stability region of a compound Li$_3$PO$_4$ using the `ChemicalPotential` workchain that is part of the `AiiDA-defects` package. Once the stability region is determined, the chemical potential can be chosen from this region and use in the calculation of the defect formation energy. By default, the chemical potential of the centroid of the stability region is chosen." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "b6cfda92", + "metadata": {}, + "outputs": [], + "source": [ + "# Get your normal profile\n", + "%load_ext aiida" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fceca655", + "metadata": {}, + "outputs": [], + "source": [ + "%aiida" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "691a2e4c", + "metadata": {}, + "outputs": [], + "source": [ + "#Import the workchain and common aiida functionalities\n", + "from aiida import orm, engine\n", + "from aiida_defects.formation_energy.chemical_potential.chemical_potential import ChemicalPotentialWorkchain" + ] + }, + { + "cell_type": "markdown", + "id": "f356b1bd", + "metadata": {}, + "source": [ + "**Explanation of inputs parameters**\n", + "\n", + "'formation_energy_dict': formation energies of all stable compounds in the given phase diagram. The keys are the name of the compounds and the values are their formation energy (per formula unit). These numbers can be taken from your favorite material databases or computed on your own. In anycase, you have to make sure that they are computed using the same DFT setup (k-point mesh, xcf functionals, planewave cutoff,...) as the one you used for calculation of the supercell energy (with and without defects)\n", + "'compound': the name of the host compound you are studying.\n", + "'dependent_element': Element whose chemical potential is determined once the chemical potentials of the elements are fixed. In our case, we chose P as the dependent element but it can also be Li or O.\n", + "'ref_energy': Energy of the element in its standar state. \n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f781c1b4", + "metadata": {}, + "outputs": [], + "source": [ + "Ef_dict = {'Li3PO4': -22.0891, 'LiP': -1.0465, 'LiP7': -1.2718, 'Li3P7': -3.5958, 'Li3P': -2.7859, 'LiO8': -3.6499, 'Li2O2': -6.6031,\n", + " 'Li2O': -6.2001, 'P2O5': -17.1485, 'Li4P2O7': -35.7771, 'LiPO3': -13.5973}" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9eca0a27", + "metadata": {}, + "outputs": [], + "source": [ + "inputs = {\n", + " 'formation_energy_dict' : orm.Dict(dict=Ef_dict),\n", + " 'compound' : orm.Str('Li3PO4'),\n", + " 'dependent_element' : orm.Str('P'),\n", + " 'ref_energy' : orm.Dict(dict={'Li':-195.5141, 'P':-191.0388, 'O':-557.4985})\n", + " }\n", + "workchain_future, pk = engine.run_get_pk(ChemicalPotentialWorkchain, **inputs)" + ] + }, + { + "cell_type": "markdown", + "id": "2e812e74", + "metadata": {}, + "source": [ + "**Optional parameters**\n", + "\n", + "If you want to study the effect of dopant concentration in the so-called 'frozen-defect' approach, you have to specify that frozen defect in the inputs for ex., 'dopant_elements' : orm.List(list=['O'])" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0343d3bf", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/DefectChemistry.ipynb b/examples/DefectChemistry.ipynb new file mode 100644 index 0000000..c59b5f1 --- /dev/null +++ b/examples/DefectChemistry.ipynb @@ -0,0 +1,282 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "3ea5e76f", + "metadata": {}, + "source": [ + "# How to use the DefectChemistry Workchain\n", + "\n", + "This notebook will explain the use of the `DefectChemistry` workchain.\n", + "\n", + "In other to select suitable dopants for a materials, one has to consider several dopants possibly in various charge states. `DefectChemistry` workchain is the top most workchain in `AiiDA-defects` package that was designed to make this calculation seamless and easily reproducible. \n", + "Once all the necessary inputs are provided, the workchain will compute all the necessary terms including the chemical potential and the Fermi level in a consistent way without the need for human intervention.\n", + "An example of the input file is shown below:\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8e46c870", + "metadata": {}, + "outputs": [], + "source": [ + "# Get your normal profile\n", + "%load_ext aiida" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "be681a85", + "metadata": {}, + "outputs": [], + "source": [ + "%aiida" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "fd8deee5", + "metadata": {}, + "outputs": [], + "source": [ + "import numpy as np\n", + "from aiida import orm, engine, common\n", + "\n", + "#Import the workchain \n", + "from aiida_defects.formation_energy.defect_chemistry_qe import DefectChemistryWorkchainQE" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "679c104a", + "metadata": {}, + "outputs": [], + "source": [ + "# Set up structures\n", + "from pymatgen.core.structure import Structure\n", + "\n", + "pymatgen_structure = Structure.from_file(\"./Structures/Li3ClO_1x1x1.cif\")\n", + "\n", + "# Unitcell\n", + "unitcell_structure = orm.StructureData(pymatgen=pymatgen_structure)\n", + "\n", + "# Host 2x2x2 supercell\n", + "pymatgen_structure.make_supercell([2,2,2])\n", + "host_structure = orm.StructureData(pymatgen=pymatgen_structure)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "613f53e4", + "metadata": {}, + "outputs": [], + "source": [ + "# List all possible defects you want to consider when determining the defect chemistry of your material\n", + "defect_dict = {\n", + " 'V_Li': {'N_site': 3, 'species': {'Li':-1}, 'defect_position': [0.25, 0.0, 0.0], 'charges': [-1.0]},\n", + " 'V_O': {'N_site': 1, 'species': {'O':-1}, 'defect_position': [0.0, 0.0, 0.0], 'charges': [2.0]},\n", + " 'V_Cl': {'N_site': 1,'species': {'Cl':-1}, 'defect_position': np.array([0.25, 0.25, 0.25]), 'charges': np.array([2.0])},\n", + " 'N-O': {'N_site': 1,'species': {'N':1, 'O':-1}, 'defect_position': [0.0, 0.0, 0.0], 'charges': [-1.0]},\n", + " 'Mg-Li': {'N_site': 3, 'species': {'Mg':1, 'Li':-1}, 'defect_position': [0.25, 0.0, 0.0], 'charges': [1.0]},\n", + " }\n", + "\n", + "# Formation energies required by the ChemicalPotential workchain\n", + "Ef_dict = {\n", + " 'intrinsic': {'Li3ClO': -11.075, 'LiClO4': -6.7039, 'LiCl': -4.2545, 'ClO2': -1.6839, 'Cl2O7': -4.0196, 'ClO3': -1.9974, 'Cl2O': -1.1942, \n", + " 'LiO8': -3.6499, 'Li2O': -6.2001, 'Li2O2': -6.6031},\n", + " 'N': {'Li3ClO': -11.075, 'LiClO4': -6.7039, 'LiCl': -4.2545, 'Li4NCl': -6.1485, 'NCl3': -0.2089, 'NClO3': -3.6343, 'NClO6': -4.5814, \n", + " 'NClO': -1.5903, 'ClO2': -1.6839, 'Cl2O7': -4.0196, 'ClO3': -1.9974, 'Cl2O': -1.1942, 'LiN3': -1.6777, 'Li3N': -1.8502, 'LiNO3': -7.3655,\n", + " 'LiO8': -3.6499, 'Li2O': -6.2001, 'Li2O2': -6.6031, 'N2O5': -5.1059, 'N2O': -1.3466, 'NO2': -2.4734},\n", + " }" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "339296f4", + "metadata": {}, + "outputs": [], + "source": [ + "# Codes\n", + "pw_code = orm.Code.get_from_string(\"pw-7.0-qe-eiger\")\n", + "\n", + "# Pseudos\n", + "pseudo_family = orm.Str('SSSP/1.2/PBEsol/efficiency') # This is the label that was used when installing the pseudos" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "16a7e0db", + "metadata": {}, + "outputs": [], + "source": [ + "# If known, the dielctric constant can be directly provided as below. If not, it can be computed within the workchain by specifying the ph code\n", + "dielectric = orm.ArrayData()\n", + "dielectric.set_array('epsilon', np.array([[3.12, 0., 0.,], [0., 3.12, 0.], [0., 0., 3.12]]))\n", + "\n", + "# Covariance matrix is needed to construct the gaussian charge model for the correction workchain.\n", + "cov_matrix = orm.ArrayData()\n", + "cov_matrix.set_array('sigma', np.eye(3))\n", + "\n", + "inputs = {\n", + " 'restart_wc' : orm.Bool(False),\n", + " # 'restart_node' : orm.Int(29729), \n", + " # Structures\n", + " 'unitcell' : unitcell_structure,\n", + " 'host_structure' : host_structure,\n", + " 'defect_info' : orm.Dict(dict=defect_dict),\n", + " # Chemical potential\n", + " 'formation_energy_dict' : orm.Dict(dict=Ef_dict),\n", + " 'compound' : orm.Str('Li3ClO'),\n", + " 'dependent_element' : orm.Str('Li'),\n", + " 'ref_energy' : orm.Dict(dict={'Li':-195.51408,'O':-557.49850,'Cl':-451.66500, 'N':-274.00734, 'Mg':-445.18254}),\n", + " 'temperature' : orm.Float(300.0), # in Kelvin\n", + " # Correction scheme\n", + " 'correction_scheme' : orm.Str('gaussian'),\n", + " 'epsilon' : dielectric, # epsilon_inf = 3.2\n", + " 'cutoff' : orm.Float(100.0),\n", + " 'charge_model': {\n", + " 'model_type': orm.Str('fixed'),\n", + " 'fixed':{\n", + " 'covariance_matrix': cov_matrix}\n", + " # 'fitted': {\n", + " # 'tolerance': orm.Float(1.0e-3),\n", + " # 'strict_fit': orm.Bool(True),\n", + " # }\n", + " },\n", + " }\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "cbaf384a", + "metadata": {}, + "outputs": [], + "source": [ + "# Scheduler options\n", + "pw_metadata = orm.Dict(dict={ \n", + " 'options': {\n", + " 'max_wallclock_seconds': 1*60*60, \n", + " 'resources': {\n", + " 'num_machines': 1,\n", + " 'num_mpiprocs_per_machine': 64, \n", + " 'num_cores_per_mpiproc': 1, \n", + " }\n", + " }\n", + " })\n", + "pw_settings = orm.Dict(dict={'cmdline': ['-nk', '4']})\n", + "\n", + "pw_metadata_unitcell = orm.Dict(dict={\n", + " 'options': {\n", + " 'max_wallclock_seconds': 1*60*60, \n", + " 'resources': {\n", + " 'num_machines': 1,\n", + " 'num_mpiprocs_per_machine': 16,\n", + " 'num_cores_per_mpiproc': 1,\n", + " }\n", + " }\n", + " })\n", + "pw_settings_unitcell = orm.Dict(dict={'cmdline': ['-nk', '2']})\n", + "\n", + "dos_code = orm.Code.get_from_string('dos-7.0-qe-eiger')\n", + "dos_metadata = orm.Dict( dict={\n", + " 'options': {\n", + " 'max_wallclock_seconds': 10*60,\n", + " 'resources': {\n", + " 'num_machines': 1,\n", + " 'num_mpiprocs_per_machine': 16,\n", + " 'num_cores_per_mpiproc': 1,\n", + " }\n", + " },\n", + "})\n", + "\n", + "pp_code = orm.Code.get_from_string('pp-7.0-qe-eiger')\n", + "pp_metadata = orm.Dict( dict={\n", + "# 'description': 'Li3ClO',\n", + " 'options': {\n", + " 'max_wallclock_seconds': 10*60,\n", + " 'resources': {\n", + " 'num_machines': 1,\n", + " 'num_mpiprocs_per_machine': 64,\n", + " 'num_cores_per_mpiproc': 1, \n", + " }\n", + " },\n", + "})\n", + "\n", + "# Computational (chosen code is QE)\n", + "inputs['qe'] = {\n", + " 'dft': {\n", + " 'supercell' : {\n", + " 'relaxation_scheme': orm.Str('fixed'),\n", + " 'code' : pw_code,\n", + " #'kpoints': kpoints,\n", + " 'pseudopotential_family': pseudo_family,\n", + " 'parameters' : pw_parameters,\n", + " 'scheduler_options' : pw_metadata,\n", + " 'settings' : pw_settings,\n", + " },\n", + " 'unitcell' : {\n", + " 'code' : pw_code,\n", + " #'kpoints': kpoints_unitcell,\n", + " 'pseudopotential_family': pseudo_family,\n", + " 'parameters' : pw_parameters,\n", + " 'scheduler_options' : pw_metadata_unitcell,\n", + " 'settings' : pw_settings_unitcell,\n", + " }\n", + " },\n", + " 'dos' : {\n", + " 'code' : dos_code,\n", + " 'scheduler_options' : dos_metadata,\n", + " },\n", + "# 'dfpt' : {\n", + "# 'code' : ph_code,\n", + "# 'scheduler_options' : ph_metadata,\n", + "# },\n", + " 'pp' : {\n", + " 'code' : pp_code,\n", + " 'scheduler_options' : pp_metadata,\n", + " }\n", + " }\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8fb6db75", + "metadata": {}, + "outputs": [], + "source": [ + "workchain_future = engine.submit(DefectChemistryWorkchainQE, **inputs)\n", + "print('Submitted workchain with PK=' + str(workchain_future.pk))" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/examples/FormationEnergyQE.ipynb b/examples/FormationEnergyQE.ipynb index 246ded9..c375e78 100644 --- a/examples/FormationEnergyQE.ipynb +++ b/examples/FormationEnergyQE.ipynb @@ -15,20 +15,9 @@ "1. Run self-consistent DFT energy calculations for the host, neutral defect and charged defect supercells.\n", "2. Run PP.x to obtain the electrostatic potentials.\n", "3. Run a further DFT calculation on a unitcell (optionally).\n", - "4. Run DFPT to obtain the relative permitivitty.\n", + "4. Run DFPT to obtain the relative permitivitty (optionally).\n", "5. Run the `GaussianCountercharge` workchain to obtain the correction.\n", - "6. Compute the formation energy, with and without corrections.\n", - "\n", - "**NOTE!**\n", - "In this alpha version of `AiiDA-Defects` there are a number of features which are either not yet implemented or not well tested. These are listed below, with no guarentee of this being an exhaustive list.\n", - "Please bear these considerations in mind when testing the workchain.\n", - "\n", - "* The PP.x plugin used must be from [my AiiDA-QuantumESPRESSO fork](https://github.com/ConradJohnston/aiida-quantumespresso/tree/pp-parser) until this is merged into the official release\n", - "* Alignment of the electrostatic potentials is not yet automatic. Placeholder code will return 0.0 eV for these steps. The alignment should be done 'by hand'. A typical option is to take a planar average of the electrostatic potential along some axis, and then to align far from the defect. For cubic cells, a convenient option is to place point defects in the center of the box, and then take the alignment at the edge. \n", - "* In principle, only cubic cells are currently supported, although for a large-enough supercell, it shouldn't matter. This would be interesting to prove/disprove. A change to any shape of supercell is on the TODO list.\n", - "* The width of the model gaussian is fixed currently, with a TODO for a routine to fit this. If one wants to play with this for testing, I can expose it as an input.\n", - "\n", - "\n" + "6. Compute the formation energy, with and without corrections." ] }, { @@ -46,13 +35,27 @@ "outputs": [], "source": [ "# Get your normal profile\n", - "from aiida import load_profile\n", - "load_profile()\n", - "\n", + "%load_ext aiida" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "%aiida" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ "# Import commonly used functionality\n", "import numpy as np\n", - "from aiida import orm, engine, common\n", - "from aiida.plugins import WorkflowFactory" + "from aiida import orm, engine, common" ] }, { @@ -68,7 +71,8 @@ "metadata": {}, "outputs": [], "source": [ - "from aiida_defects.formation_energy.formation_energy_qe import FormationEnergyWorkchainQE" + "from aiida_defects.formation_energy.formation_energy_qe import FormationEnergyWorkchainQE\n", + "from aiida_defects.formation_energy.utils import generate_defect_structure" ] }, { @@ -85,9 +89,9 @@ "outputs": [], "source": [ "# Set up structures\n", - "import pymatgen\n", + "from pymatgen.core.structure import Structure\n", "\n", - "pymatgen_structure = pymatgen.Structure.from_file(\"./Structures/Diamond_1x1x1.cif\")\n", + "pymatgen_structure = Structure.from_file(\"./Structures/Li3ClO_1x1x1.cif\")\n", "\n", "# Unitcell\n", "unitcell_structure = orm.StructureData(pymatgen=pymatgen_structure)\n", @@ -96,9 +100,9 @@ "pymatgen_structure.make_supercell([2,2,2])\n", "host_structure = orm.StructureData(pymatgen=pymatgen_structure)\n", "\n", - "# Defect (Carbon vacancy) 2x2x2 supercell\n", - "pymatgen_structure.remove_sites(indices=[0])\n", - "defect_structure = orm.StructureData(pymatgen=pymatgen_structure)" + "# Defect (Lithium vacancy) 2x2x2 supercell\n", + "defect_position = [0.0, 0.0, 0.0]\n", + "defect_structure = generate_defect_structure(host_structure, defect_position, {'Li': -1}) # the value -1 means removing (to create vacancy) while +1 mean adding (to create interstitial)" ] }, { @@ -112,7 +116,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "4a. Set up the supercell calculations" + "4a. Set up the supercell calculations. Most of the parameters needed for the pw calculations are taken from the aiida-quantum espresso protocol but the users can also overwrite these default parameters by their owns." ] }, { @@ -121,70 +125,34 @@ "metadata": {}, "outputs": [], "source": [ - "# Set up a PW calculation\n", - "\n", - "# PW code\n", "pw_code = orm.Code.get_from_string('pw@localhost')\n", "\n", - "# Add the minimum parameters needed, plus any additional needed for the system of interest\n", - "pw_parameters = orm.Dict(dict={\n", - " 'CONTROL': {\n", - " 'calculation': 'scf',\n", - " 'restart_mode': 'from_scratch',\n", - " 'wf_collect': True,\n", - " },\n", - " 'SYSTEM': {\n", - " 'ecutwfc': 45,\n", - " 'ecutrho': 360.,\n", - " },\n", - " 'ELECTRONS': {\n", - " 'conv_thr': 1.e-7,\n", - " }})\n", + "# set this parameters to True if you start the calculations from scratch\n", + "run_pw = True\n", + "run_v = True\n", + "run_rho = True\n", "\n", - "# Setup k-points\n", - "kpoints = orm.KpointsData()\n", - "kpoints.set_kpoints_mesh([1,1,1]) # Definately not converged, but we want the example to run quickly\n", - "\n", - "# Psuedos \n", - "pseudo_family = 'SSSP' # This is the label that was used when installing the pseudos\n", - "pseudos = orm.nodes.data.upf.get_pseudos_from_structure(host_structure,pseudo_family)\n", + "# Pseudos \n", + "pseudo_family = orm.Str('SSSP/1.2/PBEsol/efficiency') # This is the label that was used when installing the pseudos\n", "\n", "# Scheduler options\n", "pw_metadata = orm.Dict( dict={\n", - " 'description': 'Diamond test', \n", + " 'description': 'Li3ClO test', \n", " 'options': {\n", " 'max_wallclock_seconds': 1800, \n", " 'resources': {\n", " 'num_machines': 1\n", " }\n", " }, \n", - " 'label': 'Diamond test'\n", - "})\n" - ] - }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "4b. Set up the unitcell calculation. This is optional, but likely to be necessary to converge the relative permitivitty. Using a unitcell, but with a much denser k-mesh is the expected usage." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "# Set up the unitcell PW calculation \n", - "kpoints_unitcell = orm.KpointsData()\n", - "kpoints_unitcell.set_kpoints_mesh([20,20,20])" + " 'label': 'Li3ClO test'\n", + "})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "4c. Set up the post-processing calculations. These are used to obtain the electrostatic potentials from the supercell calculations." + "4b. Set up the post-processing calculations. These are used to obtain the electrostatic potentials from the supercell calculations." ] }, { @@ -197,46 +165,17 @@ "\n", "# Scheduler options\n", "pp_metadata = orm.Dict( dict={\n", - " 'description': 'Diamond test', \n", + " 'description': 'Li3ClO test', \n", " 'options': {\n", " 'max_wallclock_seconds': 1800, \n", " 'resources': {\n", " 'num_machines': 1\n", " }\n", " }, \n", - " 'label': 'Diamond test'\n", + " 'label': 'Li3ClO test'\n", "})\n" ] }, - { - "cell_type": "markdown", - "metadata": {}, - "source": [ - "4d. Set up the post-processing calculations. These are used to obtain the electrostatic potentials from the supercell calculations." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "ph_code = orm.Code.get_from_string('ph@localhost')\n", - "\n", - "\n", - "ph_metadata = orm.Dict( dict={\n", - " 'description': 'Diamond test', \n", - " 'options': {\n", - " 'max_wallclock_seconds': 1800, \n", - " 'resources': {\n", - " 'num_machines': 28\n", - " },\n", - " 'queue_name' : 'debug'\n", - " }, \n", - " 'label': 'Diamond test'\n", - "})" - ] - }, { "cell_type": "markdown", "metadata": {}, @@ -250,48 +189,81 @@ "metadata": {}, "outputs": [], "source": [ + "# If known, the dielctric constant can be directly provided as below. If not, it can be computed within the workchain by specifying the ph code\n", + "dielectric = orm.ArrayData()\n", + "dielectric.set_array('epsilon', np.array([[3.12, 0., 0.,], [0., 3.12, 0.], [0., 0., 3.12]]))\n", + "\n", + "# Covariance matrix is needed to construct the gaussian charge model for the correction workchain.\n", + "cov_matrix = orm.ArrayData()\n", + "cov_matrix.set_array('sigma', np.eye(3))\n", "inputs = {\n", + " 'relaxation_scheme': orm.Str('fixed'), # Run only scf calculation without relaxation\n", " # Structures\n", " 'host_structure': host_structure,\n", " 'defect_structure': defect_structure,\n", " 'host_unitcell' : unitcell_structure,\n", " # Defect information \n", - " 'defect_charge' : orm.Float(-2.), \n", - " 'defect_site' : orm.List(list=[0.,0.,0.]), # Position of the defect in crystal coordinates\n", - " 'fermi_level' : orm.Float(0.0), # Position of the Fermi level, with respect to the valence band maximum \n", - " 'chemical_potential' : orm.Float(250.709), # eV, the chemical potentical of a C atom\n", + " 'defect_charge' : orm.Float(-3.0),\n", + " 'defect_site' : orm.List(list=defect_position), # Position of the defect in crystal coordinates\n", + " 'chempot_sign': orm.Dict(dict={'Al':-1}), \n", + " 'run_chem_pot_wc' : orm.Bool(False),\n", + " 'chemical_potential' : orm.Dict(dict={'Al':-524.03435, 'P':-191.03878}),\n", + " 'fermi_level' : orm.Float(0.0), # Fermi level is set to zero by default\n", + " # Setup\n", + " 'run_pw_host' : orm.Bool(run_pw),\n", + " 'run_pw_defect_q0' : orm.Bool(run_pw),\n", + " 'run_pw_defect_q' : orm.Bool(run_pw),\n", + " 'run_v_host' : orm.Bool(run_v),\n", + " 'run_v_defect_q0' : orm.Bool(run_v),\n", + " 'run_v_defect_q' : orm.Bool(run_v),\n", + " 'run_rho_host' : orm.Bool(run_rho),\n", + " 'run_rho_defect_q0' : orm.Bool(run_rho),\n", + " 'run_rho_defect_q' : orm.Bool(run_rho), \n", + " 'run_dfpt' : orm.Bool(False),\n", " # Method\n", " 'correction_scheme' : orm.Str('gaussian'),\n", + " 'epsilon' : dielectric, # epsilon_inf = 3.2\n", + " 'cutoff' : orm.Float(400.0),\n", + " 'charge_model': {\n", + " 'model_type': orm.Str('fixed'),\n", + " 'fixed':{\n", + " 'covariance_matrix': cov_matrix }\n", + " # 'fitted': {\n", + " # 'tolerance': orm.Float(1.0e-3),\n", + " # 'strict_fit': orm.Bool(True),\n", + " # }\n", + " },\n", " # Computational (chosen code is QE)\n", " 'qe' : {\n", " 'dft': {\n", " 'supercell' : {\n", " 'code' : pw_code,\n", - " 'kpoints': kpoints, \n", - " 'pseudopotentials': pseudos, \n", - " 'parameters' : pw_parameters,\n", + " #'kpoints': kpoints, \n", + " 'pseudopotential_family': pseudo_family, \n", + " # 'parameters' : pw_host_parameters,\n", " 'scheduler_options' : pw_metadata,\n", + " 'settings' : pw_settings,\n", "\n", " },\n", " 'unitcell' : {\n", " 'code' : pw_code,\n", - " 'kpoints': kpoints_unitcell, \n", - " 'pseudopotentials': pseudos, \n", - " 'parameters' : pw_parameters,\n", + " #'kpoints': kpoints_unitcell, \n", + " 'pseudopotential_family': pseudo_family, \n", + " #'parameters' : pw_parameters,\n", " 'scheduler_options' : pw_metadata,\n", + " 'settings' : pw_settings,\n", " } \n", " },\n", - " 'dfpt' : {\n", - " 'code' : ph_code,\n", - " 'scheduler_options' : ph_metadata,\n", - " \n", - " },\n", + "# 'dfpt' : {\n", + "# 'code' : ph_code,\n", + "# 'scheduler_options' : ph_metadata,\n", + "# },\n", " 'pp' : {\n", " 'code' : pp_code,\n", - " 'scheduler_options' : pw_metadata,\n", + " 'scheduler_options' : pp_metadata,\n", " }\n", " }\n", - "}" + "}\n" ] }, { @@ -349,25 +321,55 @@ " else:\n", " print('Not yet finished')\n" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Optional**\n", + "If the dielectric constant of the host materials is not know and you wish to compute it as part of the workchain, you have to specify the ph code as you did with pw and pp codes.\n", + "\n", + "ph_code = orm.Code.get_from_string('ph@localhost')\n", + "\n", + "\n", + "ph_metadata = orm.Dict( dict={\n", + " 'description': 'Li3ClO test', \n", + " 'options': {\n", + " 'max_wallclock_seconds': 1800, \n", + " 'resources': {\n", + " 'num_machines': 12\n", + " },\n", + " 'queue_name' : 'debug'\n", + " }, \n", + " 'label': 'Li3ClO test'\n", + "})" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python 2", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "python2" + "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", - "version": 2 + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", - "pygments_lexer": "ipython2", - "version": "2.7.10" + "pygments_lexer": "ipython3", + "version": "3.8.10" } }, "nbformat": 4, diff --git a/examples/GaussianCountercharge.ipynb b/examples/GaussianCountercharge.ipynb index 90d47bc..4d6637b 100644 --- a/examples/GaussianCountercharge.ipynb +++ b/examples/GaussianCountercharge.ipynb @@ -8,18 +8,7 @@ "\n", "This notebook will explain the use of the `GaussianCountercharge` Workchain. \n", "\n", - "Ths workchain implements a correction to the supercell energy based on an equivalent electrostatic model. Normally, this lower-level workchain need not be used directly as the higher-level `FormationEnergy` workchain will abstract the detail away and automate the generation of the necessary inputs. For completeness, and to give the option to use the correction directly, the use of the workchain is demonstrated below.\n", - "\n", - "**NOTE!**\n", - "In this alpha version of `AiiDA-Defects` there are a number of features which are either not yet implemented or not well tested. These are listed below, with no guarantee of this being an exhaustive list.\n", - "Please bear these considerations in mind when testing the workchain.\n", - "\n", - "* `epsilon`, the dielctric constant of the bulk host material, must be specified 'by hand' when using the GaussianCountercharge workchain directly.\n", - "* Alignment of the electrostatic potentials is not yet automatic. Placeholder code will return 0.0 eV for these steps. The alignment should be done 'by hand'. A typical option is to take a planar average of the electrostatic potential along some axis, and then to align far from the defect. For cubic cells, a convenient option is to place point defects in the center of the box, and then take the alignment at the edge. \n", - "* In principle, only cubic cells are currently supported, although for a large-enough supercell, it shouldn't matter. This would be interesting to prove/disprove. A change to any shape of supercell is on the TODO list.\n", - "* The width of the model gaussian is fixed currently, with a TODO for a routine to fit this. If one wants to play with this for testing, I can expose it as an input.\n", - "\n", - "\n" + "Ths workchain implements a correction to the supercell energy based on an equivalent electrostatic model. Normally, this lower-level workchain need not be used directly as the higher-level `FormationEnergy` workchain will abstract the detail away and automate the generation of the necessary inputs. For completeness, and to give the option to use the correction directly, the use of the workchain is demonstrated below." ] }, { @@ -98,11 +87,8 @@ "builder.rho_defect_q = placeholder_array\n", "\n", "builder.charge_model.model_type = orm.Str('fixed')\n", - "builder.charge_model.fixed.gaussian_params = orm.List(list=[\n", - " 0.5, 0.5, 0.5, \n", - " 1.0, 1.0, 1.0,\n", - " 0.0, 0.0, 0.0\n", - "])\n", + "builder.epsilon = placeholder_array # Dielectric constant of the host material\n", + "builder.charge_model.fixed.covariance_matrix = placeholder_array \n", "\n", "# Prepare a structre. Only the host structure is required as the user sets the defect location explicitly.\n", "# Here, a dummy strucute data with no atoms is used, but any valid StructureData object can passed in. \n", @@ -207,9 +193,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3.7.4 64-bit ('aiidapy': virtualenv)", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "python37464bitaiidapyvirtualenv941d830aa424405eb828f69d9163a2ed" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -221,7 +207,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.9" + "version": "3.8.10" } }, "nbformat": 4, diff --git a/examples/Structures/Li3ClO_1x1x1.cif b/examples/Structures/Li3ClO_1x1x1.cif new file mode 100644 index 0000000..07181fa --- /dev/null +++ b/examples/Structures/Li3ClO_1x1x1.cif @@ -0,0 +1,37 @@ +#====================================================================== + +# CRYSTAL DATA + +#---------------------------------------------------------------------- + +data_VESTA_phase_1 + + +_chemical_name_common 'Li3 Cl1 O1' +_cell_length_a 3.90834 +_cell_length_b 3.90834 +_cell_length_c 3.90834 +_cell_angle_alpha 90 +_cell_angle_beta 90 +_cell_angle_gamma 90 +_space_group_name_H-M_alt 'P 1' +_space_group_IT_number 1 + +loop_ +_space_group_symop_operation_xyz + 'x, y, z' + +loop_ + _atom_site_label + _atom_site_occupancy + _atom_site_fract_x + _atom_site_fract_y + _atom_site_fract_z + _atom_site_adp_type + _atom_site_B_iso_or_equiv + _atom_site_type_symbol + Li0 1.0 0.500000 0.000000 0.500000 Biso 1.000000 Li + Li1 1.0 0.000000 0.500000 0.500000 Biso 1.000000 Li + Li2 1.0 0.000000 0.000000 0.000000 Biso 1.000000 Li + Cl3 1.0 0.500000 0.500000 0.000000 Biso 1.000000 Cl + O4 1.0 0.000000 0.000000 0.500000 Biso 1.000000 O From 8f542a96eb63e6392b2f93948e7a59e811e2e6d6 Mon Sep 17 00:00:00 2001 From: Sokseiha Date: Mon, 27 Mar 2023 15:20:15 +0200 Subject: [PATCH 58/60] switching the reference potential to host --- .../chemical_potential/chemical_potential.py | 20 +++++++++---------- .../chemical_potential/utils.py | 10 +++++----- .../gaussian_countercharge.py | 7 +++++-- .../potential_alignment.py | 1 + 4 files changed, 21 insertions(+), 17 deletions(-) diff --git a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py index 93aebfb..2bedb51 100644 --- a/aiida_defects/formation_energy/chemical_potential/chemical_potential.py +++ b/aiida_defects/formation_energy/chemical_potential/chemical_potential.py @@ -53,7 +53,7 @@ def define(cls, spec): spec.output('stability_vertices', valid_type=Dict) spec.output('matrix_of_constraints', valid_type=Dict) spec.output('chemical_potential', valid_type=Dict) - spec.output('stability_region', valid_type=StabilityData) + #spec.output('stability_region', valid_type=StabilityData) spec.exit_code(601, "ERROR_CHEMICAL_POTENTIAL_FAILED", message="The stability region can't be determined. The compound is probably unstable" @@ -100,7 +100,7 @@ def setup(self): self.report('WARNING! The compound {} is predicted to be unstable. For the purpose of determining the stability region, we shift its formation energy down so that it is on the convex hull. Use with care!'.format(self.inputs.compound.value)) formation_energy_dict[self.inputs.compound.value] -= composition.num_atoms*(E_hull+0.005) # the factor 0.005 is added for numerical reason - self.ctx.formation_energy_dict = Dict(dict=formation_energy_dict) + self.ctx.formation_energy_dict = Dict(formation_energy_dict) def generate_matrix_of_constraints(self): @@ -178,7 +178,7 @@ def get_stability_region_data(self): sub_vertices = self.ctx.stability_vertices else: centroid = self.ctx.centroid.get_dict() - fixed_chempot = Dict(dict={k: np.array(centroid['data'])[:,i] for i, k in enumerate(centroid['column'][:-3])}) # Keep the last 3 columns + fixed_chempot = Dict({k: np.array(centroid['data'])[:,i] for i, k in enumerate(centroid['column'][:-3])}) # Keep the last 3 columns sub_master_eqn = substitute_chemical_potential(self.ctx.master_eqn, fixed_chempot) sub_matrix_eqns = substitute_chemical_potential(self.ctx.matrix_eqns, fixed_chempot) # print(Dict_to_pandas_df(sub_matrix_eqns)) @@ -190,10 +190,10 @@ def get_stability_region_data(self): self.inputs.tolerance ) - stability_region = get_StabilityData( - sub_matrix_eqns, - sub_vertices, - self.inputs.compound, - self.inputs.dependent_element, - ) - self.out('stability_region', stability_region) + #stability_region = get_StabilityData( + # sub_matrix_eqns, + # sub_vertices, + # self.inputs.compound, + # self.inputs.dependent_element, + # ) + #self.out('stability_region', stability_region) diff --git a/aiida_defects/formation_energy/chemical_potential/utils.py b/aiida_defects/formation_energy/chemical_potential/utils.py index 3ab37c9..ef25767 100644 --- a/aiida_defects/formation_energy/chemical_potential/utils.py +++ b/aiida_defects/formation_energy/chemical_potential/utils.py @@ -23,9 +23,9 @@ def pandas_df_to_Dict(df, index=False): If index=False, the index of df won't be converted to (keys, values) pair in the Dict ''' if index: - return Dict(dict={'column': df.columns, 'index': df.index, 'data': df.to_numpy()}) + return Dict({'column': df.columns, 'index': df.index, 'data': df.to_numpy()}) else: - return Dict(dict={'column': df.columns, 'data': df.to_numpy()}) + return Dict({'column': df.columns, 'data': df.to_numpy()}) def Dict_to_pandas_df(py_dict): ''' @@ -204,7 +204,7 @@ def get_stability_vertices(master_eqn, matrix_eqns, compound, dependent_element, # get the chemical potentials of the dependent element dependent_chempot = get_dependent_chempot(master_eqn, stability_corners.to_dict(orient='list'), compound, dependent_element) stability_corners = np.append(stability_corners, np.reshape(dependent_chempot, (-1,1)), axis =1) - stability_vertices = Dict(dict={'column': matrix_eqns['column'][:-1]+[dependent_element], 'data': stability_corners}) + stability_vertices = Dict({'column': matrix_eqns['column'][:-1]+[dependent_element], 'data': stability_corners}) return stability_vertices @@ -245,7 +245,7 @@ def get_centroid_of_stability_region(stability_corners, master_eqn, matrix_eqns, # Add the corresponding chemical potential of the dependent element dependent_chempot = get_dependent_chempot(master_eqn, ctr_stability.to_dict(orient='list'), compound, dependent_element) ctr_stability = np.append(ctr_stability, np.reshape(dependent_chempot, (-1,1)), axis=1) - ctr_stability = Dict(dict={'column': matrix_eqns['column'][:-1]+[dependent_element], 'data': ctr_stability}) + ctr_stability = Dict({'column': matrix_eqns['column'][:-1]+[dependent_element], 'data': ctr_stability}) return ctr_stability @@ -394,7 +394,7 @@ def get_absolute_chemical_potential(relative_chemical_potential, ref_energy): for element in relative_chempot.columns: absolute_chemical_potential[element] = ref_energy[element] + np.array(relative_chempot[element]) - return Dict(dict=absolute_chemical_potential) + return Dict(absolute_chemical_potential) @calcfunction def get_StabilityData(matrix_eqns, stability_vertices, compound, dependent_element): diff --git a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py index d5ef3c4..cbbecbd 100644 --- a/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py +++ b/aiida_defects/formation_energy/corrections/gaussian_countercharge/gaussian_countercharge.py @@ -334,14 +334,18 @@ def compute_dft_difference_potential(self): first_array_shape = self.inputs.v_defect_q.get_array('data').shape second_array_shape = self.inputs.v_host.get_array('data').shape + # second_array_shape = self.inputs.v_defect_q0.get_array('data').shape if first_array_shape != second_array_shape: target_shape = orm.List(list=np.max(np.vstack((first_array_shape, second_array_shape)), axis=0).tolist()) first_array = get_interpolation(self.inputs.v_defect_q, target_shape)#.get_array('interpolated_array') second_array = get_interpolation(self.inputs.v_host, target_shape)#.get_array('interpolated_array') + # second_array = get_interpolation(self.inputs.v_defect_q0, target_shape) self.ctx.v_defect_q_host = get_potential_difference(first_array, second_array) else: self.ctx.v_defect_q_host = get_potential_difference( - self.inputs.v_defect_q, self.inputs.v_host) + self.inputs.v_defect_q, self.inputs.v_host) + # self.ctx.v_defect_q_host = get_potential_difference( + # self.inputs.v_defect_q, self.inputs.v_defect_q0) #self.out('v_dft_difference', self.ctx.v_defect_q_q0) @@ -395,7 +399,6 @@ def submit_alignment_workchains(self): "allow_interpolation": orm.Bool(True), "mae":{ "first_potential": self.ctx.v_defect_q_host, - # "second_potential": v_model, "second_potential": self.ctx.v_model, "defect_site": self.inputs.defect_site }, diff --git a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py index 297389b..88fd9dd 100644 --- a/aiida_defects/formation_energy/potential_alignment/potential_alignment.py +++ b/aiida_defects/formation_energy/potential_alignment/potential_alignment.py @@ -141,6 +141,7 @@ def setup(self): # all other axis keep the correct ordering. # If the reasoning was compelling, this could be relaxed later to the product type # situation where having a (3,1) and a (1,3) would result in a target grid of (3,3) + sorted_shapes = sorted(list(array_shapes.values())) for index, shape in enumerate(sorted_shapes): for axis in [1,2]: # Sorting is correct for axis 0, now check if the others are okay From 1ca231d2b6341cd704e40ecf061cf5b5e92d2406 Mon Sep 17 00:00:00 2001 From: ConradJohnston <40352432+ConradJohnston@users.noreply.github.com> Date: Wed, 29 Mar 2023 11:34:53 -0700 Subject: [PATCH 59/60] Update and rename README.rst to README.md Refreshed readme --- README.md | 35 +++++++++++++++++++++++++++++++++++ README.rst | 50 -------------------------------------------------- 2 files changed, 35 insertions(+), 50 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 0000000..a3ed65d --- /dev/null +++ b/README.md @@ -0,0 +1,35 @@ +Welcome to AiiDA-Defects +======================== + +AiiDA-Defects is a plugin for the [AiiDA](http://www.aiida.net/) computational materials science framework, and provides tools and automated workflows for the study of defects in materials. + +The package is available for download from [GitHub](http://github.com/aiida-defects). + +If you use AiiDA-Defects in your work, please cite: + +*AiiDA-defects: An automated and fully reproducible workflow for the complete characterization of defect chemistry in functional materials* +[doi.org/10.48550/arXiv.2303.12465](https://doi.org/10.48550/arXiv.2303.12465) + +Please also remember to cite the [AiiDA paper](https://doi.org/10.1038/s41597-020-00638-4). + + +Quick Setup +=========== + +Install this package by running the following in your shell: + + $ pip install . + +This will install all of the prerequisites automatically (including for the optional docs) +in your environment, including AiiDA core, if it not already installed. + + +Getting Started +=============== + +Expample usage of the workchains is documented in the collection of Jupyter notebooks in the ``examples`` directory. + + +Acknowledgements +================ +This work is supported by the MARVEL National Centre of Competence in Research (NCCR) funded by the Swiss National Science Foundation (grant agreement ID 51NF40-182892) and by the European Union’s Horizon 2020 research and innovation program under Grant Agreement No. 824143 (European MaX Centre of Excellence “Materials design at the Exascale”) and Grant Agreement No. 814487 (INTERSECT project). We thank Chiara Ricca and Ulrich Aschauer for discussions and prototype implementation ideas. The authors also would like to thank the Swiss National Supercomputing Centre CSCS (project s1073) for providing the computational ressources and Solvay for funding this project. We thank Arsalan Akhtar, Lorenzo Bastonero, Luca Bursi, Francesco Libbi, Riccardo De Gennaro and Daniele Tomerini for useful discussions and feedback. diff --git a/README.rst b/README.rst deleted file mode 100644 index 24c7a3b..0000000 --- a/README.rst +++ /dev/null @@ -1,50 +0,0 @@ -Welcome to AiiDA-Defects -++++++++++++++++++++++++ - -AiiDA-Defects is a plugin for the `AiiDA `_ computational -materials science framework, and provides tools and automated workflows for the -study of defects in materials. - -The package is available for download from `GitHub `_. - -If you use AiiDA-Defects in your work, please cite: - - *paper reference (doi)* - -Please also remember to cite the `AiiDA paper `_. - - -Quick Setup -=========== - -Install this package by running the following in your shell: - - .. code-block:: bash - - $ pip install .[docs] - -This will install all of the prerequisites automatically (including for the optional docs) -in your environment, including AiiDA core, if it not already installed. -Ideally however, you should install AiiDA-Defects after installing and setting -up AiiDA core. - -To build the local docs, run: - - .. code-block:: bash - - $ cd docs/ - $ make html - -Note: You will need to have ``make`` installed on your operating system to compile the documentation - - -Getting Started -=============== - -Expample usage of the workchains is documented in the collection of Jupyter notebooks in the ``examples`` directory. - - - -Acknowledgements -================ -This work is funded by... From ced42b2fbde33dc4fb67d99063a9dc9388d5d4b8 Mon Sep 17 00:00:00 2001 From: ConradJohnston <40352432+ConradJohnston@users.noreply.github.com> Date: Wed, 29 Mar 2023 11:36:18 -0700 Subject: [PATCH 60/60] Update README.md Add preprint tag to arxiv link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a3ed65d..ad23e30 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,8 @@ The package is available for download from [GitHub](http://github.com/aiida-defe If you use AiiDA-Defects in your work, please cite: -*AiiDA-defects: An automated and fully reproducible workflow for the complete characterization of defect chemistry in functional materials* -[doi.org/10.48550/arXiv.2303.12465](https://doi.org/10.48550/arXiv.2303.12465) +*AiiDA-defects: An automated and fully reproducible workflow for the complete characterization of defect chemistry in functional materials* +[doi.org/10.48550/arXiv.2303.12465 (preprint)](https://doi.org/10.48550/arXiv.2303.12465) Please also remember to cite the [AiiDA paper](https://doi.org/10.1038/s41597-020-00638-4).