ramannoodle

Facilitates calculation of Raman spectra from first principles calculations.

Subpackages

Submodules

ramannoodle.abstract module

Abstract classes.

class ramannoodle.abstract.Dynamics

Bases: ABC

Abstract class for atomic dynamics.

abstract get_raman_spectrum(polarizability_model)

Calculate a raman spectrum using a polarizability model.

Parameters:

polarizability_model (PolarizabilityModel) – Must be compatible with the dynamics.

Return type:

RamanSpectrum

class ramannoodle.abstract.PolarizabilityModel

Bases: ABC

Abstract polarizability model.

abstract calc_polarizabilities(positions_batch)

Return estimated polarizabilities for a batch of fractional positions.

Parameters:

positions_batch (ndarray[Any, dtype[float64]]) – (fractional) Array with shape (S,N,3) where S is the number of samples and N is the number of atoms.

Return type:

ndarray[Any, dtype[float64]]

Returns:

Array with shape (S,3,3).

class ramannoodle.abstract.RamanSpectrum

Bases: ABC

Abstract class for Raman spectra.

abstract measure(orientation='polycrystalline', laser_correction=False, laser_wavelength=522, bose_einstein_correction=False, temperature=300)

Calculate and return a raw Raman spectrum.

Parameters:
  • orientation (str | ndarray[Any, dtype[float64]]) – Supports "polycrystalline". Future versions will support arbitrary orientations.

  • laser_correction (bool) – If True, applies laser-wavelength-dependent intensity correction.

  • laser_wavelength (float) – (nm) Ignored if laser_correction == False.

  • bose_einstein_correction (bool) – If True, applies temperature-dependent Bose Einstein correction.

  • temperature (float) –

    1. Ignored if bose_einstein_correction == False.

Return type:

tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]

Returns:

  1. wavenumbers – (cm-1) Array with shape (M,).

  2. intensities – (arbitrary units) Array with shape (M,).

ramannoodle.constants module

Useful globals.

ramannoodle.exceptions module

Exceptions, warnings, and related functions.

exception ramannoodle.exceptions.DOFWarning

Bases: UserWarning

A degree of freedom may not have been specified as intended.

exception ramannoodle.exceptions.IncompatibleStructureException

Bases: Exception

File contains structure that is incompatible with the current operation.

exception ramannoodle.exceptions.InvalidDOFException

Bases: Exception

A supplied degree of freedom is invalid.

exception ramannoodle.exceptions.InvalidFileException

Bases: Exception

File cannot not be read, likely due to due to invalid or unexpected format.

exception ramannoodle.exceptions.NoMatchingLineFoundException

Bases: Exception

No matching line can be found in file.

exception ramannoodle.exceptions.SymmetryException

Bases: Exception

Symmetry operation failed.

exception ramannoodle.exceptions.UserError

Bases: Exception

The user has done something they shouldn’t.

This exception is used sparingly, as (ideally) the structure of the API should dictate what the user should and shouldn’t do.

ramannoodle.exceptions.get_pymatgen_missing_error()

Get error indicating that pymatgen is not installed.

Return type:

UserError

ramannoodle.exceptions.get_torch_missing_error()

Get error indicating that torch is not installed.

Return type:

UserError