pyqmmm.qm.charge_spin_extractor

Extract charge and spin data for a given subset of atoms for graphing.

Module Contents

Functions

get_files(file_pattern)

Find all examples of a file type in the current directory.

get_selection(file)

Get the user's atom set.

get_atoms()

get_spins(atoms, file, selection)

Gets the charges for the atoms specified by the user and sums them.

get_charges(atoms, file, selection)

Gets the charge for the atoms specified by the user and sums them.

write_data(file, net_data)

Writes out the data for either the charge or spin.

charge_spin_extractor()

pyqmmm.qm.charge_spin_extractor.get_files(file_pattern)[source]

Find all examples of a file type in the current directory.

Parameters:

file_pattern (str) – The type of file the for which the user would like to search the current directory.

Returns:

xyz_filename_list – A list of files found matching the user’s pattern.

Return type:

list

pyqmmm.qm.charge_spin_extractor.get_selection(file)[source]

Get the user’s atom set. :returns: atoms – The index of the atom for which the user would like the spin and charge. :rtype: selection

pyqmmm.qm.charge_spin_extractor.get_atoms()[source]
pyqmmm.qm.charge_spin_extractor.get_spins(atoms, file, selection)[source]

Gets the charges for the atoms specified by the user and sums them.

Parameters:
  • atoms (list) – List of atoms indices.

  • file (str) – The name of the file that you would like to analyze.

  • selection (list) – The indices of the atoms for which the user would like the charge and spin.

Returns:

net_spins – List fo spins corresponding to each image in the scan.

Return type:

list

pyqmmm.qm.charge_spin_extractor.get_charges(atoms, file, selection)[source]

Gets the charge for the atoms specified by the user and sums them.

Parameters:
  • atoms (list) – List of atoms indices.

  • file (str) – The name of the file that you would like to analyze.

  • selection (list) – The atom indices for which the user would like the charge and spin.

Returns:

net_spins – List fo spins corresponding to each image in the scan.

Return type:

list

pyqmmm.qm.charge_spin_extractor.write_data(file, net_data)[source]

Writes out the data for either the charge or spin.

Parameters:
  • file (str) – The name of the file where we are going to write out the data.

  • net_data (list) – List of data extracted from either the spin or charge files.

pyqmmm.qm.charge_spin_extractor.charge_spin_extractor()[source]