Crystal Orbital Guided Iteration To atomic-Orbitals - Quantum chemistry from plane wave DFT
Bases: object
Initializes the :param directory: The path for the input files :param verbose: How much will be printed (0 is least) :param file_suffix: The suffix to the TBparams and overlaps files :param orbs_orth: Whether the orbitals are orthogonal, if from COGITO this is always False
This function reads in the orbitals as coefficents for a gaussian expansion. The information in ‘orbitals.npy’ is combined with the orbital data in ‘tb_input.txt’. :param file: Orbital file
Change a TB parameter :param value: The new parameter :param orb1: The first orbital index of the parameter :param orb2: The second orbital index of the parameter :param trans: The tuple of translation indices :returns:
Generates self.use_tbparams, self.use_overlaps, and self.use_vecs_to_orbs which are used in the gen_ham() funciton With this, the calculation of hamiltonians by gen_ham() is both sparse and vectorized :param maximum_dist: The maximmum distance between hopping parameters which should be included :param minimum_value: The minimum magnitude of hopping parameter which should be included
similar to from pymatgen.io.vasp.outputs.Wavecar but is vectorized :param kpt: The k-point in reduced coordinates :returns: The gpoints
This function generates the hamiltonian and overlap matrices for a given kpt. Then it solves the generalized eigenvalue problem to return the eigvalues and vectors :param self: An object with the attributes of the COGITO_TB_Model class :param kpt: The kpoint to regenerate at in reduced coordinates :param return_overlap: If True, the function will also return the overlap matrix at the kpt; default is False :param return_truevec: If True, the function will return the eigenvectors in the original nonorthogonal basis
Default if True
- Parameters: spin – The spin of the parameters for a spin-polarized calculation; default is 0–for non spin-polarized
- Returns: returns a list of the eigenvalues and eigenvectors (and overlap if return_overlap=True)
This sorts the matrix of TB parameters into terms which are 1NN, 2NN, etc.
Plots the crystal field splitting diagram for the orbitals and atom given :param atomnum: Which atom to plot for :param orbitals: Which orbitals to plot, “d” is most common :param ylim: The limits of the y-axis in the plot, will default to good value if left (-10,0)
This function reads the EIGENVAL from a DFT run, generates the energies from the TB model for the kpt grid, And plots and compares the error between the TB model energies and DFT energies :param self: An object of the class COGITO_TB_Model (can not be the BAND or UNIFORM classes!) :param directory: The directory where the EIGENVAL file is :returns: Returns a list of the (averaged over the valance bands) band distance (as defined by Marzari),
average maximum error, and average band error
Calculates the COHP for the given orbitals and nearest neighbors :param self: An object of the class COGITO_BAND or COGITO_UNIFORM :param orbs: either a list of two dictionaries giving elements as keys and orbital types as items (eg [{“Pb”:[“s”,”d”],”O”:[“s”,”p”]},{“Pb”:[“s”]”O”:[“p”]}]) or give list of orb numbers [[1,2,3,5,6,7],[1,2,3,4,5,6,7,8]] :param NN: An integer for which nearest neighbor number to include (eg 1 for 1NN) or None or “All” for all nearest neighbors :param include_onsite: Includes atomic orbital energy terms (H_ab(R) where R=0 and a=b) instead of just bonding terms :param spin: The spin of the tight binding parameters; default is 0 works for nonspin-polarized :returns: returns COHP values in a [kpt,band] dimension
Calculates the COOP for the given orbitals and nearest neighbors :param self: An object of the class COGITO_BAND or COGITO_UNIFORM :param orbs: either a list of two dictionaries giving elements as keys and orbital types as items (eg [{“Pb”:[“s”,”d”],”O”:[“s”,”p”]},{“Pb”:[“s”]”O”:[“p”]}]) or give list of orb numbers [[1,2,3,5,6,7],[1,2,3,4,5,6,7,8]] :param NN: An integer for which nearest neighbor number to include (eg 1 for 1NN) or None or “All” for all nearest neighbors :param include_onsite: Includes atomic overlap terms (S_ab(R) where R=0 and a=b) instead of just bonding terms, this can be used with NN=0 to give a projected bandstructure :param spin: The spin of the tight binding parameters; default is 0 works for nonspin-polarized :returns: returns COOP values in a [kpt,band] dimension
Bases: object
This class deals with all post-processing band structure analysis :param TB_model: requires an object of the class COGITO_TB_Model
The function automatically generates a kpath using pymatgen and kpathseek Then calculates the band energies and vectors for the kpath :param num_kpts: The number of kpoints between EACH kpath :returns: Nothing
Plots bandstructure (or projected bandstructure) using plotly graph_objects :param ylim: Limits on the y-axis of plot :param color_label: When being plotted from another function, this passes “COHP” or “COOP” :param colors: Magnitude for each point to use in color plotting, passed by get_COHP() function :param colorhalf: Sets scale of color bar :returns: plotly figure with bandstructure plotted
Calculates and plots the projected COHP values for each band and k-point on band structure :param orbs: either a list of two dictionaries giving elements as keys and orbital types as items (eg [{“Pb”:[“s”,”d”],”O”:[“s”,”p”]},{“Pb”:[“s”]”O”:[“p”]}]) or give list of orb numbers [[1,2,3,5,6,7],[1,2,3,4,5,6,7,8]] :param NN: An integer for which nearest neighbor number to include (eg 1 for 1NN) or None or “All” for all nearest neighbors :param ylim: The limits of the y-axis (energy) of the band structure plot :param colorhalf: Set the magnitude for the color bar; For default value of 10, it is set automatically to average(COHP)*3 :param include_onsite: Includes atomic orbital energy terms (H_ab(R) where R=0 and a=b) instead of just bonding terms :param from_dash: Flag to set when calling from the dash app, sets plotting backend to plotly and returns the axis :returns: Nothing
Calculates and plots the projected COOP values for each band and k-point on band structure :param orbs: either a list of two dictionaries giving elements as keys and orbital types as items (eg [{“Pb”:[“s”,”d”],”O”:[“s”,”p”]},{“Pb”:[“s”]”O”:[“p”]}]) or give list of orb numbers [[1,2,3,5,6,7],[1,2,3,4,5,6,7,8]] :param NN: An integer for which nearest neighbor number to include (eg 1 for 1NN) or None or “All” for all nearest neighbors :param ylim: The limits of the y-axis (energy) of the band structure plot :param colorhalf: Set the magnitude for the color bar; For default value of 10, it is set automatically to average(COOP)*3 :param include_onsite: Includes atomic overlap terms (S_ab(R) where R=0 and a=b) instead of just bonding terms, this can be used with NN=0 to give a projected bandstructure :param from_dash: Flag to set when calling from the dash app, sets plotting backend to plotly and returns the axis :returns: Nothing
This function generate a dash app which allows the user to interactively select orbitals and nearest neighbors to examine their project COHP band structure quickly :param pathname: Name appended to the default pathname for the html :returns: Nothing
Bases: object
This class deals with all post-processing uniform grid analysis :param TB_model: requires an object of the class COGITO_TB_Model
This is a function which will generate populate the cartXYZ grid with values for the bond density between the atoms given using the orbCOOP provided. :param atmind1: The atom number for the first atom :param atmind2: The atom number for the second atom :param center1: The center of the first atom (not using self.primATOMs) :param center2: The center of the second atom (not using self.primATOMs) :param orbCOOP: The orbCOOP which reveals how much of each orbital combo that is included in the bond.
Dimension nxm where n is the # of orbitals for atom 1 and m is # of orbitals for atom 2.
- Parameters: cartXYZ – The 3D flattened grid that the bond density is calculated on
- Returns: A 1D array (3D flattened) of the bond density
this will plot the crystal structure atoms with line weighted by iCOHP each line should also be hoverable to reveal the number and amounts that are s-s,s-p, and p-p :param energy_cutoff: This is the minimum bond magnitude that will be plotted :param offset: The offset in the colors, set different values to try out different colors :param plot_atom: Set with one_atom=True, plots only one atom and it’s bonds, this passes the atom number to plot :param one_atom: Whether only the atom defined in plot_atom should be plotted; default is False :param bond_max: The maximum bond distance that will be plotted outside the primitive cell :returns: Nothing
this will plot the crystal structure atoms with line weighted by iCOHP each line should also be hoverable to reveal the number and amounts that are s-s,s-p, and p-p :param energy_cutoff: This is the minimum bond magnitude that will be plotted :param bond_max: The maximum bond distance that will be plotted outside the primitive cell :param elem_colors: Colors for the elements based on order in tb_input. Length of list should be the number of
unique elements. Can either be integer list to reference the default colors or list of plotly compatable colors.
- Parameters:
- atom_colors – Colors for the atoms based on order in tb_input. Length of list should be the number of atoms in the primitive cell. Can either be integer list to reference the default colors or list of plotly compatable colors. If not set defaults to elem_colors.
- atom_labels – List of atom labels as a string.
- plot_atom – Set with one_atom=True, plots only one atom and it’s bonds, this passes the atom number to plot
- one_atom – Whether only the atom defined in plot_atom should be plotted; default is False
- fovy – field of view in the vertical direction. Use this tag to adjust depth perception in crystal. Set between 3 (for close to orthographic) and 30 (for good perspective depth).
- return_fig – If False, this function saves figure to crystal_bonds.html. If True, this function will return the plotly figure object
- only_prim_atoms – If True, only the atoms within the primitive cell are plotted. If False, atoms are added outside the primitive cell if the atom has a bond to an atom inside the primtive cell that meets energy_cutoff and bond_max criteria. Default is set in code False if self.numAtoms < 30, otherwise set to True
- Returns: Nothing
Plots the crystal structure atoms with bonds plotted based on iCOHP Each line should also be hoverable to reveal the number and amounts that are s-s,s-p, and p-p The charge and magnetic moment will also be plotted acording to auto_label :param energy_cutoff: This is the minimum bond magnitude that will be plotted :param bond_max: The maximum bond distance that will be plotted outside the primitive cell :param elem_colors: Colors for the elements based on order in tb_input. Length of list should be the number of
unique elements. Can either be integer list to reference the default colors or list of plotly compatable colors.
- Parameters:
- atom_colors – Colors for the atoms based on order in tb_input. Length of list should be the number of atoms in the primitive cell. Can either be integer list to reference the default colors or list of plotly compatable colors. If not set defaults to elem_colors.
- atom_labels – List of atom labels as a string.
- auto_label – Different options for plotting includes: (can include multiple in the string) “mulliken” - plots the onsite charge and mag (if spin_polar) on atoms by mulliken population (overrides atom_labels) “full” - plots the charge and magnetics moments (if spin_polar) on atoms and bonds (overrides atom_labels) “color” - colors the atoms and bonds based on their charge (overrides atom_colors or elem_colors) “color mag” - colors the atoms and bonds based on their magnetic moments (overrides atom_colors or elem_colors) NOTE: Only use “mulliken” OR “full”, NOT both
- plot_atom – Set with one_atom=True, plots only one atom and it’s bonds, this passes the atom number to plot
- one_atom – Whether only the atom defined in plot_atom should be plotted; default is False
- fovy – field of view in the vertical direction. Use this tag to adjust depth perception in crystal. Set between 3 (for close to orthographic) and 30 (for good perspective depth).
- return_fig – If False, this function saves figure to crystal_bonds.html. If True, this function will return the plotly figure object
- only_prim_atoms – If True, only the atoms within the primitive cell are plotted. If False, atoms are added outside the primitive cell if the atom has a bond to an atom inside the primtive cell that meets energy_cutoff and bond_max criteria. Default is set in code False if self.numAtoms < 30, otherwise set to True
- Returns: Depend on return_fig parameter.
Plots the crystal structure atoms with bonds plotted based on iCOHP Each line should also be hoverable to reveal the number and amounts that are s-s,s-p, and p-p The charge and magnetic moment will also be plotted acording to auto_label :param energy_cutoff: This is the minimum bond magnitude that will be plotted :param iso_max: The positive isosurface for plotting the bonds. :param iso_min: The negative isosurface for plotting the bonds. :param elem_colors: Colors for the elements based on order in tb_input. Length of list should be the number of
unique elements. Can either be integer list to reference the default colors or list of plotly compatable colors.
- Parameters:
- atom_colors – Colors for the atoms based on order in tb_input. Length of list should be the number of atoms in the primitive cell. Can either be integer list to reference the default colors or list of plotly compatable colors. If not set defaults to elem_colors.
- atom_labels – List of atom labels as a string.
- auto_label – Different options for plotting includes: (can include multiple in the string) “mulliken” - plots the onsite charge and mag (if spin_polar) on atoms by mulliken population (overrides atom_labels) “full” - plots the charge and magnetics moments (if spin_polar) on atoms and bonds (overrides atom_labels) “color” - colors the atoms and bonds based on their charge (overrides atom_colors or elem_colors) “color mag” - colors the atoms and bonds based on their magnetic moments (overrides atom_colors or elem_colors) NOTE: Only use “mulliken” OR “full”, NOT both
- plot_atom – Set with one_atom=True, plots only one atom and it’s bonds, this passes the atom number to plot
- one_atom – Whether only the atom defined in plot_atom should be plotted; default is False
- bond_max – The maximum bond distance that will be plotted outside the primitive cell
- fovy – field of view in the vertical direction. Use this tag to adjust depth perception in crystal. Set between 3 (for close to orthographic) and 30 (for good perspective depth).
- Returns: Nothing, but saves plotly figure to ‘crystal_bonds.html’
The will plot the crystal bond plot on the left with interactivity to a COHP DOS plot on the right :param energy_cutoff: This is the minimum bond magnitude that will be plotted :param bond_max: The maximum bond distance that will be plotted outside the primitive cell :param auto_label: Different options for plotting includes: (can include multiple in the string)
“mulliken” - plots the onsite charge and mag (if spin_polar) on atoms by mulliken population (overrides atom_labels) “full” - plots the charge and magnetics moments (if spin_polar) on atoms and bonds (overrides atom_labels) “color” - colors the atoms and bonds based on their charge (overrides atom_colors or elem_colors) “color mag” - colors the atoms and bonds based on their magnetic moments (overrides atom_colors or elem_colors) NOTE: Only use “mulliken” OR “full”, NOT both
- Parameters: fovy – field of view in the vertical direction. Use this tag to adjust depth perception in crystal.
- Returns: Nothing, but saved to ‘bond_cohp_plot.html’
Bases: object
This class deals with all post-processing band structure analysis :param TB_model: requires an object of the class COGITO_TB_Model
The function automatically generates a kpath using pymatgen and kpathseek Then calculates the band energies and vectors for the kpath :param num_kpts: The number of kpoints between EACH kpath :returns: Nothing
Plots bandstructure (or projected bandstructure) using plotly graph_objects :param ylim: Limits on the y-axis of plot :returns: plotly figure with bandstructure plotted
To change tight-binding parameter, need to know two orbitals and three translations