carmm.analyse package¶
Subpackages¶
Submodules¶
carmm.analyse.angles module¶
- carmm.analyse.angles.analyse_all_angles(model, verbose=True)¶
Returns a table of bond angle analysis for the supplied model.
Parameters:
- model: Atoms object
The structure that needs to be interrogated
- verbose: Boolean
Whether to print information to screen
- Returns:
list of all elemental combinations
list of indices for each elemental combination
list of all angle values for each combination of indices
- carmm.analyse.angles.analyse_angles(model, A, B, C, verbose=True, multirow=False)¶
Check A-B-C angles present in the model.
Parameters: model: Atoms object
The ASE atoms object that needs to be considered
A: string, chemical symbol, e.g. “O” B: string, chemical symbol, e.g. “C” C: string, chemical symbol, e.g. “O” verbose: Boolean
Whether to print information to screen
- multirow: Boolean
Whether we are returning multiple sets of results in a Table
- carmm.analyse.angles.print_angles_table_header()¶
carmm.analyse.bonds module¶
- carmm.analyse.bonds.analyse_all_bonds(model, verbose=True, abnormal=True)¶
Analyse bonds and return all abnormal bond types and list of these TODO: Make this more bullet proof - what happens if abnormal bonds aren’t requested. A table of bond distance analysis for the supplied model is also possible
Parameters:
- model: Atoms object
Structure for which the analysis is to be conducted
- verbose: Boolean
Determines whether the output should be printed to screen
- abnormal: Boolean
Collect information about rogue looking bond lengths. (Does enabling this by default add a large time overhead?)
- carmm.analyse.bonds.analyse_bonds(model, A, B, verbose=True, multirow=False)¶
Check A-B distances present in the model.
Parameters: model: Atoms object
XXX
A: string, chemical symbol, e.g. “H” B: string, chemical symbol, e.g. “H” verbose: Boolean
Whether to print information to screen
- multirow: Boolean
Whether we are working with analyse_all_bonds, so the output is multirow, or just one specific analysis of a bond, in which case the table header is needed.
- carmm.analyse.bonds.analyse_chelation(atoms, metal, ligand_atoms, mult=1)¶
Returns information on the ligands in a mononuclear complex and their chelation type. TODO: rework so script can account for multiple separate metal atoms (ie: polynuclear complexes)
Parameters: atoms: Atoms object
Input structure from which to calculate molecular information
- Mult: float value
Multiplier for the bond cutoffs. Set to 1 as default but can be adjusted depending on application
- metal: String
Metal cation to characterise the coordination environment around
- ligand_atom: list
Element symbol of the atom coordinating with the metal cation
- carmm.analyse.bonds.compare_structures(atoms1, atoms2, label=None)¶
Comparison of two input structures to identify equivalent atoms but incorrect index ordering
Parameters:
- atoms1: Atoms object or trajectory of individual atoms
An atoms object
- atoms2: Atoms object or trajectory of individual atoms
Another atoms object
- label: String of elemental character
Only necessary to limit search to specific atomic species
- carmm.analyse.bonds.comparing_bonds_lengths(atoms1, atoms2)¶
description: this function allows to compare difference in bonds lengths between two structures, :type atoms1: :param atoms1: Atoms object or trajectory of individual atoms :type atoms2: :param atoms2: a second atom object
- carmm.analyse.bonds.get_indices_of_elements(list_of_symbols, symbol)¶
Check an atoms object for occurences of symbols given and return indices
Parameters:
- list_of_symbols: List of strings
Symbols from an atoms object in structural order
- symbol:
Symbol to search for
- carmm.analyse.bonds.get_sorted_distances(model, atoms_to_include=None)¶
Returns a sorted list of atomic distances in the model, selecting only those atoms of interest Current usage is for molecules and periodic solids (through mic).
Parameters:
- model: Atoms objects
The model from which the RDF is to be plotted
- atoms_to_include: Integer or List of Integers
Atoms that you want included in the RDF
Returns:
- individual_lengths: List of floats
An sorted list of all lengths of bonds between all atoms in the model
- carmm.analyse.bonds.print_bond_table_header()¶
- carmm.analyse.bonds.search_abnormal_bonds(model, verbose=True)¶
Check all bond lengths in the model for abnormally short ones.
Parameters: model: Atoms object or string. If string it will read a file
in the same folder, e.g. “name.traj”
carmm.analyse.colormaps module¶
- carmm.analyse.colormaps.color_bar(width, height, bottom, vmin, vmax, orientation, label, cmapcolour, resolution)¶
Basic Colour Bar figsize= y axis how tallbottom = <0.8 - size of bar (cannot be bigger than top)vmin/vmax = x axis valuesorientation = horizontal,verticallabel = units
- cmapcolour = [(‘Perceptually Uniform Sequential’, [
‘viridis’, ‘plasma’, ‘inferno’, ‘magma’, ‘cividis’]),
- (‘Sequential’, [
‘Greys’, ‘Purples’, ‘Blues’, ‘Greens’, ‘Oranges’, ‘Reds’, ‘YlOrBr’, ‘YlOrRd’, ‘OrRd’, ‘PuRd’, ‘RdPu’, ‘BuPu’, ‘GnBu’, ‘PuBu’, ‘YlGnBu’, ‘PuBuGn’, ‘BuGn’, ‘YlGn’]),
- (‘Sequential (2)’, [
‘binary’, ‘gist_yarg’, ‘gist_gray’, ‘gray’, ‘bone’, ‘pink’, ‘spring’, ‘summer’, ‘autumn’, ‘winter’, ‘cool’, ‘Wistia’, ‘hot’, ‘afmhot’, ‘gist_heat’, ‘copper’]),
- (‘Diverging’, [
‘PiYG’, ‘PRGn’, ‘BrBG’, ‘PuOr’, ‘RdGy’, ‘RdBu’, ‘RdYlBu’, ‘RdYlGn’, ‘Spectral’, ‘coolwarm’, ‘bwr’, ‘seismic’]),
(‘Cyclic’, [‘twilight’, ‘twilight_shifted’, ‘hsv’]), (‘Qualitative’, [
‘Pastel1’, ‘Pastel2’, ‘Paired’, ‘Accent’, ‘Dark2’, ‘Set1’, ‘Set2’, ‘Set3’, ‘tab10’, ‘tab20’, ‘tab20b’, ‘tab20c’]),
- (‘Miscellaneous’, [
‘flag’, ‘prism’, ‘ocean’, ‘gist_earth’, ‘terrain’, ‘gist_stern’, ‘gnuplot’, ‘gnuplot2’, ‘CMRmap’, ‘cubehelix’, ‘brg’, ‘gist_rainbow’, ‘rainbow’, ‘jet’, ‘turbo’, ‘nipy_spectral’, ‘gist_ncar’])]
resolution = the level of segmentation on the map
carmm.analyse.counterpoise_onepot module¶
- carmm.analyse.counterpoise_onepot.calculate_energy_ghost_compatible(calc, atoms=None, properties=['energy'], system_changes=['positions', 'numbers', 'cell', 'pbc', 'initial_charges', 'initial_magmoms'], ghosts=None, dry_run=False)¶
This is a modified version of ase.calculators.calculator.FileIOCalculator.calculate to make ghost atoms work Do the calculation and read the results.
This is a workaround. The same could be done easily if we were using the same version of ASE on Gitlab. The Aims calculator were rewritten where ghosts can be specified while constructing the calculator (not available in current release)
- Parameters:
calc – fhi_aims calculator constructed by ASE
atoms – ASE atoms object
properties – list of str. properties to be calculated, default is energy. See original function
system_changes – list of str. See original function.
ghosts – bool list. Ghost is Ture and Atom is False. The length is the same as atoms.
dry_run – flag for CI-test.
- carmm.analyse.counterpoise_onepot.check_and_convert_id(complex_struc, a_id, b_id)¶
This function checks if a_id and b_id are supplied correctly (lists of indices or lists of strings), and convert symbols to indices. :type complex_struc: :param complex_struc: see counterpoise_calc :type a_id: :param a_id: see counterpoise_calc :type b_id: :param b_id: see counterpoise_calc
- Returns:
a_id, b_id. Two lists of indices for A and B, respectively.
- carmm.analyse.counterpoise_onepot.counterpoise_calc(complex_struc, a_id, b_id, fhi_calc=None, a_name=None, b_name=None, verbose=False, dry_run=False)¶
This function does counterpoise (CP) correction for basis set super position error (BSSE) in one go, assuming a binding complex AB.
CP correction = A_only + B_only - A_plus_ghost - B_plus_ghost A_only has A in the geometry of the binding complex with its own basis A_plus_ghost has A in the same geometry as in the complex with B replaced by ghost atoms This value should be positive by this definition and should be added to the energy change of interest, such as adsorption energy.
Some references: 1. Szalewicz, K., & Jeziorski, B. (1998). The Journal of Chemical Physics, 109(3), 1198–1200. https://doi.org/10.1063/1.476667
2. Galano, A., & Alvarez-Idaboy, J. R. (2006). Journal of Computational Chemistry, 27(11), 1203–1210. https://doi.org/10.1002/JCC.20438 (See the second paragraph in the introduction for a good explanation of why BSSE arises)
- Parameters:
complex_struc – ASE Atoms This is the Atoms object which stores the optimized structure of the binding complex
a_id – list of atom symbols or atom indices for species A
b_id – list of atom symbols or atom indices for species B Please use both symbols or both indices for a_id and b_id.
fhi_calc – ase.calculators.aims.Aims object A FHI_aims calculator constructed with ase Aims
a_name – string. optional.
b_name – string. optional. The name of the two species for your counterpoise correction, which has symbol (or index) a_id and b_id.
verbose – Flag for printing output.
dry_run – bool Flag for test run (CI-test)
Returns: float. counterpoise correction value for basis set superposition error
- carmm.analyse.counterpoise_onepot.gather_info_for_write_input(complex_struc, a_id, b_id)¶
This function collects info for writing input files for A_only, A_plus_ghost, B_only, and B_plus_ghost The geometry.in files are written with ase.io.aims.write_aims. For species with ghost atoms, write_aims needs a bool list for the keyword argument “ghosts”, where a ghost atom is True and a normal atom is False. :type complex_struc: :param complex_struc: The complex. See counterpoise_calc. :type a_id: :param a_id: indices for A :type b_id: :param b_id: indices for B
- Returns:
A list of four bool lists (Ghost atom is True; Real atom is False) A list of atoms objects Both in the order of A_only, A_plus_ghost, B_only, B_plus_ghost.
- carmm.analyse.counterpoise_onepot.get_energy_dryrun(dir, outputname)¶
Parse the energy from the aims.out file
carmm.analyse.distribution_functions module¶
- carmm.analyse.distribution_functions.average_distribution_function(trajectory, samples=10)¶
Plots the average distribution function of the last N steps of an MD trajectory TODO: -This is distance based - can we adapt it to also allow radial?
Seems like constraints are removed below but this causes error
when no constraints are present in the system. Need to make this a condition.
Parameters:
- trajectory: List of Atoms objects
The pathway from which the ensemble RDF is to be plotted
- samples: Integer
The number of samples to include in the ensemble, starting from the final image of the trajectory.
Returns:
- all_data: List of floats
A list containing _all_ of the distances encountered in the sampled trajectories
- snapshots: List of list of floats
A list containing the list of floats for distances measured in each specific snapshot analysed
- carmm.analyse.distribution_functions.element_radial_distribution_function(model, radius, element, position=None, verbose=False)¶
Returns a plot of the distribution of the distance between atoms of a specific element up to given radius Plot is currently a frequency vs distance. Current usage is for periodic solids
Parameters:
- model: Atoms objects
The model from which the RDF is to be plotted
- radius: float
The distance around the atom of interest to plot the RDF
- position: integer
The atom index of interest (i.e. centre of RDF). Default is 0
Returns:
- distances: List of floats
An sorted list of all lengths of bonds between the central atom and others in the desired radius
- carmm.analyse.distribution_functions.plot_distribution_function(data, bins=None, bin_sampling=0.1, title=None, density=False, **kwargs)¶
Generic plotter
Parameters:
- data: List of floats
The values to be plotted on the histogram
- bins: Int
Number of separate bins on the histogram
- bin_sampling: Float
The separation between bin boundaries
- title: String
Name to place at the top of the plot
- **kwargs: Additional arguments
These are passed straight through to the plotting function
TODO: We should edit the axes object, not the plot itself (see graphs.py, specifically mulliken related)
- carmm.analyse.distribution_functions.radial_distribution_function(model, radius, position, verbose=False)¶
Returns a plot of the distribution of the distance between atoms up to given radius Plot is currently a frequency vs distance. Current usage is for periodic solids
Parameters:
- model: Atoms objects
The model from which the RDF is to be plotted
- radius: float
The distance around the atom of interest to plot the RDF
- position: integer
The atom index of interest (i.e. centre of RDF)
Returns:
- distances: List of floats
An sorted list of all lengths of bonds between the central atom and others in the desired radius
- carmm.analyse.distribution_functions.radius_of_gyration(model)¶
creates a radius of gyration for input file of a molecule. A radius of gyration is a measurement of the distribution of atoms in a molecular structure with respect to it’s centre of mass:
radius_of_gyration^2 = SUM(mass_atom(atom_position - centre_mass_position)) / mass_of_molecule
TODO: - further tidying up
carmm.analyse.forces module¶
- carmm.analyse.forces.is_converged(atoms, fmax=0.01)¶
This function takes an atoms object and a force convergence criterion and returns True if stored forces are below fmax convergence criterion or False if forces are above fmax or there is no stored calculator. Useful for multiple geometry optimisations and automated restarts from .traj files to avoid unnecessary calculations.
atoms: Atoms object fmax: float
Convergence criterion in eV/Angstrom, usually 0.01
carmm.analyse.graphs module¶
- carmm.analyse.graphs.get_graph_colour(choice=0)¶
Return some nice graph colours
Parameters:
- choice: Integer
The colour choice to return from the colours array
- carmm.analyse.graphs.get_graph_linetype(choice=0)¶
Return linetypes that match the matplotlib options
Parameters:
- choice: Integer
The linetype choice to return from the array of options
- carmm.analyse.graphs.load_xyz_data_from_csv(fname)¶
Read in x, y and z-axis data from a CSV file for plotting (3D)
Parameters:
- fname: String
filename for the CSV that is to be read in
- carmm.analyse.graphs.plot_energy_profile(data, x_labels, **kwargs)¶
This function is used for plotting solid+dashed line style reaction energy profiles, which often require manual tweaking using other software.
- Parameters:
data – dict A dictionary of key-value pairs, where the keys are used as the title of the data series, and the values are lists of floats to be plotted on the y-axis.
x_labels – list A list of strings containing x-axis labels - intermediates, reaction steps etc.
**kwargs – dict %% These variables should be optional in the function call. Then the defaults are clear. This is passthrough for all other variables. The following are pulled from if they exist (otherwise defaults are used): font_size; figsize; colours; linestyles; linestyle; x_labels_rotation; x_axis_title; y_axis_title; legend_xy_offset
- Returns:
matplotlib.pyplot
- carmm.analyse.graphs.set_graph_axes_heatmap(plt, x, y)¶
Construct a suitable axes for displating a 3D heatmap
Parameters:
- plt: Matplotlib structure
Incoming plot containing data and for which the axes need adjustment
- x: List of Floats
X-axis data
- y: List of Floats
Y-axis data
- carmm.analyse.graphs.set_graph_axes_mulliken(axis, x, y, homo, xlabel='$\\epsilon$ (eV)', ylabel='Density of States (1/eV)')¶
Function to automate setting up the plot axes for a DOS
Parameters:
- plt: Matplotlib plot object or Axes
This has data predrawn from the x- and y-axis data also provided
- x: list of Floats
The x-axis data object (i.e. range of x-axis values)
- y: list of Floats
The y-axis data objects, corresponding to the plotted data
- homo: Float
Reference level for the HOMO, which is the middle point of the x-axis
- xlabel: String
Label for x-axis
- ylabel: String
Label for y-axis
carmm.analyse.hirshfeld module¶
- carmm.analyse.hirshfeld.extract_hirshfeld(fname, natoms, data, write=True, outname='hirshfeld.txt')¶
- Parameters:
fname – Input file name, usually aims.out. str
natoms – number of atoms to extract charge from. int
data – type of output requested. str Can be ‘charge’, ‘volume’, ‘volume f’, ‘dipole vector’, ‘dipole moment’ or ‘second’
write – bool of whether to write the hirshfeld data to a new file called hirshfeld.txt
Returns: hirsh. List of requested data
- carmm.analyse.hirshfeld.get_hirshfeld_line(text)¶
- carmm.analyse.hirshfeld.read_hirshfeld(fname, identifier)¶
- Parameters:
fname – Input filename. str
identifier – regex to pull data from file. str
Returns: label. list of data
- carmm.analyse.hirshfeld.vmd_out(array, fname='vmd_chrgs.txt')¶
- carmm.analyse.hirshfeld.write_hirshfeld(text, natoms, start, outname)¶
carmm.analyse.images module¶
- carmm.analyse.images.write_to_povray()¶
Saves the incoming atoms object to a povray file
TODO: As the povray file generation and rendering have been reworked in recent ASE version this function is no longer necessary. A jupyter notebook would be more suitable to explain write_pov().render() syntax.
carmm.analyse.molecules module¶
- carmm.analyse.molecules.calculate_formula(atoms, mult=1)¶
What it does Determines the chemical formula for each molecule in the system.
Parameters: atoms: Atoms object
Input structure from which to calculate molecular information.
Returns: molecule_formula: List of strings.
TO DO: Molecules such as CO2 are returned as C1O2. Preferable to make consistent with Hill’s notation (CO2).
- carmm.analyse.molecules.calculate_molecules(atoms, mult=1, print_output=False)¶
Returns information on the molecules in the system. Needs refinement!
Parameters: atoms: Atoms object
Input structure from which to calculate molecular information
- Mult: a multiplier for the cutoffs
Set to 1 as default, but can be adjusted depending on application
- print_output: Boolean
Whether to print any information whilst working out molecules
Returns: molecules: List of list of integers
Indices of atoms involved in each molecule can view individual molecules via atoms[molecules[0]] ect
carmm.analyse.mulliken module¶
- class carmm.analyse.mulliken.Atom(nspin, nkpts, nstates)¶
Bases:
object
Description # TODO: Needs changing the name of the class as it might interfere with the ‘Atom’ class of ASE Class to represent data for a each atom. Data includes the number of spin-channel, k-points and eigenstates for each atom
- class carmm.analyse.mulliken.Kpt(nstates)¶
Bases:
object
Description Class to represent data for a particular k-point. Data includes the number eigenstates for a given k-point, spin channel and atom.
- class carmm.analyse.mulliken.MullikenData(natoms, nspin, nkpts, nstates)¶
Bases:
object
Description Class representing the Mulliken data and store information pertinent to eigenvalues, occupation numbers, and angular momentas for each atom, spin-channel, k-point and eigenstate
- Parameters:
natoms – Integer Number of atoms in the Mulliken data object
nspin – Integer Number of spin channels in the data object
nkpts – Integer Number of k-points in the model
nstates – Integer Number of electronic states to be stored in the data object
- get_all_plot_data()¶
Description Obtains the arrays of data (x –> energy and y –> density) for plotting the total density of states (dos). Basically uses the get_plot_data() function with angular=’all’.
- Returns:
1D array of x (energy) and 2D array of y (density). The density data is 2D to account for both spin-up and spin-down channels
- get_data_integrity()¶
Description
- get_graph_xlabel()¶
Return label for the x-axis depending on whether the model is periodic or not
- get_homo()¶
Description
- get_natoms()¶
Description Computes the number of atoms
- get_nkpts()¶
Description Computes the number of k-points
- get_nspin()¶
Description Computes the number of spin channels. For spin paired the value is 1 whereas for spin polarised the value is 2
- get_nstates()¶
Description Computes the number of eigenstates
- get_orbital_plot_data(orbital, atoms=None, spin=None, kpts=None)¶
Description Obtains the arrays of data (x –> energy and y –> density) for plotting the individual density of states (dos) for a desired orbital Basically uses the get_plot_data() function with orbital (‘s’,’p’,’d’,’f’) of user’s choice.
- Returns:
1D array of x (energy) and 2D array of y (density). The density data is 2D to account for both spin-up and spin-down channels
Parameters:
- orbital: String
Choices are ‘s’,’p’,’d’,’f’,’g’ for obtaining the corresponding plots for a desired orbital.
- atoms: List of Integers
Indices of atoms that are to be included in the data acquisition
- spin: List of Integers
Indices of spins that are to be included - either [0] or [0,1] for none or collinear
- kpts: List of Integers
Indices of kpts to be included
- get_plot_data(atom_ind, spin, kpts, angular, xmin=-20, xmax=20, npoints=1000, variance=0.02)¶
Description Obtains the arrays of data (x –> energy and y –> density) for plotting the density of states (dos). Can obtain data for total and individual contribution from the ‘s’, ‘p’, ‘d’, and ‘f’ orbitals using the ‘angular’ keyword.
Parameters:
- atom_ind: List of Integers
Indices of atoms that are to be included in the data acquisition
- spin: List of Integers
Indices of spins that are to be included - either [0] or [0,1] for none or collinear
- kpts: List of Integers
Indices of kpts to be included
- angular: String
Letters for angular momenta to be returned (any combination from spdfg) or ‘all’ for everything
- xmin: Float
Minimum on the x-axis for the energy range
- xmax: Float
Maximum on the x-axis for the energy range
- npoints: Integer
Number of ‘bins’ on the x-axis when expanding Gaussians on the eigenvalues
- variance: Float
Variance for the Gaussian when added to each eigenfunction
- Returns:
1D array of x (energy) and 2D array of y (density). The density data is 2D to account for both spin-up and spin-down channels
- class carmm.analyse.mulliken.Spin(nkpts, nstates)¶
Bases:
object
Description Class to represent data for a spin channel. Data includes the number of k-points and eigenstates for a given spin channel and atom.
- carmm.analyse.mulliken.extract_mulliken_charge(fn, natoms)¶
Function to extract and return the Mulliken charges from an FHI-aims output. A list of relative charges is returned, with +q meaning charge depletion and -q meaning charge accummulation
Parameters:
- fn: string
Filename from which the Mulliken data should be extracted
- natoms: int
Number of atoms in the calculation
- Returns:
List of charges.
- carmm.analyse.mulliken.extract_mulliken_spin(fn, natoms)¶
Function to extract and return the Mulliken spin from an FHI-aims output. A list of spin moments on is returned. The value at each index corresponds to the spin moment of each the atom at that particular index
Parameters:
- fn: string
Filename from which the Mulliken data should be extracted
- natoms: int
Number of atoms in the calculation
- Returns:
List of spin moments.
- carmm.analyse.mulliken.parse_mulliken_file(fname)¶
Description Extracting data from a Mulliken.out file. Iterates through each atom, spin-channel, k-points and eigenstates to extract the values of eigenvalues (energies), occupancies (occupation number), total angular momenta.
Parameters:
- fname: String
Filename of the Mulliken.out file we are reading in and parsing.
- Returns:
A MullikenData object containing the values of eigenvalues (energies), occupancies (occupation number), total angular momenta for each atom, spin-channel, k-point and eigenstate.
- carmm.analyse.mulliken.write_dos_to_csv(fname, x, y)¶
Description Function to write the density of states (dos) data to a csv file. In case of spin-unpolarised calculations, there will be only two columns in the csv file corresponding to the x and y values whereas in case of a spin-polarised calculation, we will have 3 columns viz x, y(spin-up) and y(spin-down).
Parameters: fname: String
Filename to save the CSV data in too.
- x: 1D array of floats
Array of x-axis values
- y: 2D array of floats
2D array of y-axis values, possibly spin-paired or spin-polarised
carmm.analyse.neighbours module¶
- carmm.analyse.neighbours.neighbour_cutout_sphere(atoms, centre, distance_cutoff=5.0)¶
Returns a spherical cutout of a structure TODO: This doesn’t work with periodic boundary conditions. TODO:Could probably integrate this with the neighbor function bellow
Parameters:
- atoms: Atoms object
Input structure to cutout from
- centre: Integer
Index of central atom in cutout
- distance_cutoff: Float
Distance which inside atoms are counted as neighbours
- carmm.analyse.neighbours.neighbours(atoms, centre, shell, cutoff=None, verbose=False)¶
Returns a list of indices of atomic neighbors from a central atom
Parameters: atoms : Atoms object
Input structure to count neighbours
- centrelist of integers
Indices of atom(s) to start counting from
- shellInteger
Size of the nearest neighbour shell, 1st neighbours, 2nd neighbours ….
- cutoff: list of floats or None
Bond length cutoff distance in Angstrom can be set for each atom individually The list must contain exactly len(atoms) floats. If None, natural_cutoffs are used by default.
- verbose: boolean
If True, information about the cutoffs and selected neighbors is printed
- Returns:
List of all atoms within specified neighbour distances List of lists containing indices of atoms that make 0th, 1st (…) shell
- carmm.analyse.neighbours.surface_coordination(atoms, cutoff=None, verbose=True)¶
This function allows to extract the following data from the supplied Atoms object in the form of a dictionary: Per atom: - number of neighbouring atoms of specific chemical symbol
Per atomic layer (based on tag): - average coordination number for all M-M combinations of all chemical species,
- e.g. for CuAu alloy slab an average number of Cu-Cu, Cu-Au, Au-Cu and Au-Au
bonds with surrounding atoms i.e. Cu-Cu_neighbors_per_layer etc.
concentration of atoms per layer
- Parameters:
atoms – Atoms object Surface slab containing tagged atomic layers e.g. using carmm.build.neb.symmetry.sort_z
cutoff – list of floats or None Bond length cutoff distance in Angstrom can be set for each atom individually The list must contain exactly len(atoms) floats. If None, natural_cutoffs are used by default.
verbose – boolean If True, analysed data that is contained in the dictionary will be printed as a table TODO: make table neater
- Returns:
- dict_CN, dict_surf_CN
TODO: proper description of dictionary structure, writing csv files
carmm.analyse.pickle_dos module¶
- carmm.analyse.pickle_dos.read_dos_from_old_pickle(filename)¶
Method to read in DOS data from pickle files (GPAW, outdated)
Parameters:
- filename: String
Name of the pickle file we are reading
carmm.analyse.planes module¶
- carmm.analyse.planes.distance_between_centers_of_mass(A_mol, B_mol)¶
TODO: @Jack Warren :type A_mol: :param A_mol: molecule A :type B_mol: :param B_mol: molecule B :return: distance between 2 centers of mass
- carmm.analyse.planes.establish_planes(Atom1, Atom2, Atom3)¶
Using 3 points to calculate 3 vectors and establish a plane…
@Jack Warren: Please complete :type Atom1: :param Atom1: (x,y,z coordinates of Atom1) :type Atom2: :param Atom2: :type Atom3: :param Atom3:
#TODO: This should just return the plot, not show it. :return: Graphical Representation of planes
- carmm.analyse.planes.get_close_contacts(A_mol, B_mol)¶
Uses molecules.py to separate fn into molecules then measures the shortest distances between. Indented for Periodic systems
Parameters: A_mol: Atoms object created by molecules the one you want to measure from B_mol: Same as A_mol, however its the molecule you’re measuring to
Returns: The closest contact for each atom on A_mol to their closest contact on B_mol
Still very much a work in progress so go easy on it
- carmm.analyse.planes.get_interplane_distances(atoms)¶
A function that combines the molecules script and get_lowest distances to separate molecules out in a system and measure the distances inbetween.
Returns: interplane distance
- carmm.analyse.planes.plane_of_best_fit(model)¶
Using the xyz coordinates of a molecule or atoms object to calculate the plane of best fit and plot it for visualizing model: Atoms object
The atoms object that has been previously loaded (note the IO is not done here)
# TODO: @Jack Warren what are these variables? xs = all x coordinates ys = all y zs = all z
Returns - plt of the plane and the atoms as well as the equation of plane and the errors from atoms that vary from the plane
carmm.analyse.surface_area module¶
- carmm.analyse.surface_area.surface_area(atoms)¶
A function to calculate the surface of a slab (based on cell vectors)
Parameters:
atoms: ASE Atoms object holding slab information
Returns: Surface area, in same units as cell vector lengths (^2)