# Path: smact/properties.py
# def band_gap_Harrison(anion, cation, verbose=False,
#                       distance=None):
# 
#     """
#     Estimates the band gap from elemental data.
# 
#     The band gap is estimated using the principles outlined in
#     Harrison's 1980 work "Electronic Structure and the Properties of
#     Solids: The Physics of the Chemical Bond".
# 
#     Args:
#         Anion (str): Element symbol of the dominant anion in the system
# 
#         Cation (str): Element symbol of the the dominant cation in the system
#         Distance (float or str): Nuclear separation between anion and cation
#                 i.e. sum of ionic radii
#         verbose (bool) : An optional True/False flag. If True, additional
#         information is printed to the standard output. [Defult: False]
# 
#     Returns :
#         Band_gap (float): Band gap in eV
# 
#     """
# 
#     # Set constants
#     hbarsq_over_m = 7.62
# 
#     # Get anion and cation
#     An = anion
#     Cat = cation
#     d = float(distance)
# 
#     # Get elemental data:
#     elements_dict = smact.element_dictionary((An, Cat))
#     An, Cat = elements_dict[An], elements_dict[Cat]
# 
#     # Calculate values of equation components
#     V1_Cat = (Cat.eig - Cat.eig_s)/4
#     V1_An = (An.eig - An.eig_s)/4
#     V1_bar = (V1_An + V1_Cat)/2
#     V2 = 2.16 * hbarsq_over_m / (d**2)
#     V3 = (Cat.eig - An.eig)/2
#     alpha_m = (1.11*V1_bar)/sqrt(V2**2 + V3**2)
# 
#     # Calculate Band gap [(3-43) Harrison 1980 ]
#     Band_gap = (3.60/3.)*(sqrt(V2**2 + V3**2))*(1-alpha_m)
#     if verbose:
#         print("V1_bar = ", V1_bar)
#         print("V2 = ", V2)
#         print("alpha_m = ", alpha_m)
#         print("V3 = ", V3)
# 
#     return Band_gap


from smact.properties import band_gap_Harrison
    import argparse

#!/usr/bin/env python

###############################################################################
# Copyright Daniel Davies, Adam J. Jackson (2013)                             #
#                                                                             #
# This file is part of SMACT: Band_gap_simple.py is free software: you can    #
# redistribute it and/or modify it under the terms of the GNU General Public  #
# License as published by the Free Software Foundation, either version 3 of   #
# the License, or (at your option) any later version.                         #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       #
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for   #
# more details.                                                               #
# You should have received a copy of the GNU General Public License along with#
# this program.  If not, see <http://www.gnu.org/licenses/>.                  #
#                                                                             #
###############################################################################


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Compound band gap estimates from elemental data.")

# Path: smact/properties.py
# def band_gap_Harrison(anion, cation, verbose=False,
#                       distance=None):
# 
#     """
#     Estimates the band gap from elemental data.
# 
#     The band gap is estimated using the principles outlined in
#     Harrison's 1980 work "Electronic Structure and the Properties of
#     Solids: The Physics of the Chemical Bond".
# 
#     Args:
#         Anion (str): Element symbol of the dominant anion in the system
# 
#         Cation (str): Element symbol of the the dominant cation in the system
#         Distance (float or str): Nuclear separation between anion and cation
#                 i.e. sum of ionic radii
#         verbose (bool) : An optional True/False flag. If True, additional
#         information is printed to the standard output. [Defult: False]
# 
#     Returns :
#         Band_gap (float): Band gap in eV
# 
#     """
# 
#     # Set constants
#     hbarsq_over_m = 7.62
# 
#     # Get anion and cation
#     An = anion
#     Cat = cation
#     d = float(distance)
# 
#     # Get elemental data:
#     elements_dict = smact.element_dictionary((An, Cat))
#     An, Cat = elements_dict[An], elements_dict[Cat]
# 
#     # Calculate values of equation components
#     V1_Cat = (Cat.eig - Cat.eig_s)/4
#     V1_An = (An.eig - An.eig_s)/4
#     V1_bar = (V1_An + V1_Cat)/2
#     V2 = 2.16 * hbarsq_over_m / (d**2)
#     V3 = (Cat.eig - An.eig)/2
#     alpha_m = (1.11*V1_bar)/sqrt(V2**2 + V3**2)
# 
#     # Calculate Band gap [(3-43) Harrison 1980 ]
#     Band_gap = (3.60/3.)*(sqrt(V2**2 + V3**2))*(1-alpha_m)
#     if verbose:
#         print("V1_bar = ", V1_bar)
#         print("V2 = ", V2)
#         print("alpha_m = ", alpha_m)
#         print("V3 = ", V3)
# 
#     return Band_gap


# Path: examples/Simple_wrappers/band_gap_simple.py
from smact.properties import band_gap_Harrison
    import argparse

#!/usr/bin/env python

###############################################################################
# Copyright Daniel Davies, Adam J. Jackson (2013)                             #
#                                                                             #
# This file is part of SMACT: Band_gap_simple.py is free software: you can    #
# redistribute it and/or modify it under the terms of the GNU General Public  #
# License as published by the Free Software Foundation, either version 3 of   #
# the License, or (at your option) any later version.                         #
# This program is distributed in the hope that it will be useful, but WITHOUT #
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or       #
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for   #
# more details.                                                               #
# You should have received a copy of the GNU General Public License along with#
# this program.  If not, see <http://www.gnu.org/licenses/>.                  #
#                                                                             #
###############################################################################


if __name__ == "__main__":
    parser = argparse.ArgumentParser(
        description="Compound band gap estimates from elemental data.")

    parser.add_argument("-a", "--anion", type=str,
