Writers

Density writer

class rhodent.writers.density.DensityWriter(collector)[source]

Calculate density contributions

Parameters:

collector (ResultsCollector) – ResultsCollector object

property common_arrays: dict[str, ndarray[tuple[int, ...], dtype[float64]] | int | float]

Dictionary of eigenvalues and limits

fill_ulm(writer, work, result)[source]

Fill one entry of the ULM file

Parameters:
  • writer – Open ULM writer object

  • work (WorkMetadata) – Metadata to current piece of data

  • result (Result) – Result containing the current observables

write_empty_arrays_ulm(writer)[source]

Add empty arrays in to the ULM file

Parameters:

writer – Open ULM writer object

Energy writer

class rhodent.writers.energy.EnergyWriter(collector, only_one_pulse)[source]

Calculate energy contributions

Parameters:

collector (ResultsCollector) – ResultsCollector object

property common_arrays: dict[str, ndarray[tuple[int, ...], dtype[float64]] | int | float]

Dictionary of eigenvalues and limits

fill_ulm(writer, work, result)[source]

Fill one entry of the ULM file

Parameters:
  • writer – Open ULM writer object

  • work (ConvolutionDensityMatrixMetadata) – Metadata to current piece of data

  • result (Result) – Result containing the current observables

write_empty_arrays_ulm(writer)[source]

Add empty arrays in to the ULM file

Parameters:

writer – Open ULM writer object

Hot-carriers writer

class rhodent.writers.hcdist.HotCarriersWriter(collector, only_one_pulse)[source]

Calculate hot-carrier totals, and optionally broadened hot-carrier energy distributions

Parameters:
  • collector (ResultsCollector) – ResultsCollector object

  • only_one_pulse (bool) – False if the resulting outputs should have one dimension corresponding to different pulses. True if there should be no such dimension. If True, then the calculator must only hold one pulse.

property common_arrays: dict[str, ndarray[tuple[int, ...], dtype[float64]] | int | float]

Dictionary of eigenvalues and limits

Transition contribution map writer

class rhodent.writers.tcm.DipoleWriter(collector)[source]

Calculate dipole moment contributions, optionally broadened onto an energy grid as a transition contribution map

Parameters:

collector (ResultsCollector) – ResultsCollector object

property common_arrays: dict[str, ndarray[tuple[int, ...], dtype[float64]] | int | float]

Dictionary of eigenvalues and limits

fill_ulm(writer, work, result)[source]

Fill one entry of the ULM file

Parameters:
  • writer – Open ULM writer object

  • work (WorkMetadata) – Metadata to current piece of data

  • result (Result) – Result containing the current observables

write_empty_arrays_ulm(writer)[source]

Add empty arrays in to the ULM file

Parameters:

writer – Open ULM writer object

Pulse convolution writer

rhodent.writers.pulserho.calculate_pulserho_and_save(pulserho_fmt, density_matrices)[source]

Read density matrices in frequency space from disk, convolve with Gaussian laser pulse, and inverse Fourier transform to get a time domain response.

Save the pulse density matrces for selected times in the simulation Read density matrices in frequency space from disk

Parameters:
  • pulserho_fmt (str) –

    Formatting string for the density matrices saved to disk.

    Example:

    • pulserho_fmt = ‘pulserho/t{time:09.1f}{tag}.npy’

    Accepts variables

    • {time} - Time in as

    • {tag} - Derivative tag, ‘’, ‘-Iomega’, or ‘-omega2’

    • {pulsefreq} - Pulse frequency in eV

    • {pulsefwhm} - Pulse FWHM in fs

  • density_matrices (ConvolutionDensityMatrices) – Object that gives the density matrix in the time domain

DOS Writer

rhodent.writers.dos.calculate_and_save_dat(out_fname, gpw_file, energies, sigma, zerofermi=False)[source]

Read eigenvalues from ground state and calculate broadened DOS

Save the broadened DOS in a text file

Parameters:
  • out_fname (str) – Filename of data file where data is to be saved

  • gpw_file (str) – Filename of GPAW ground state file

  • energies (list[float] | ndarray[tuple[int, ...], dtype[float64]]) – Array of energies (in eV) for which the broadened DOS is computed

  • sigma (float) – Gaussian broadening width in eV

  • zerofermi (bool) – True if energies are to be relative to Fermi level, False if relative to vacuum

PDOS Writer

rhodent.writers.pdos.calculate_and_save_by_filename(out_fname, **kwargs)[source]

Read eigenvalues and wave functions from ground state and calculate broadened PDOS

The PDOS is projected on each group of atoms in atom_projections

The file format of the resulting data file is inferred from the file name

Parameters:
  • out_fname (str) – File name of data file where data is to be saved

  • voronoi – Voronoi weights calculator/reader

  • energies – Array of energies (in eV) for which the broadened DOS is computed

  • sigma – Gaussian broadening width in eV

  • gpw_file – Filename of GPAW ground state file

  • zerofermi – Eigenvalues relative to Fermi level if true, else relative to vacuum

rhodent.writers.pdos.calculate_and_save_dat(out_fname, voronoi, energies, sigma, gpw_file, zerofermi=False)[source]

Read eigenvalues and wave functions from ground state and calculate broadened PDOS

The PDOS is projected on each group of atoms in atom_projections

Save the broadened PDOS in a text file

Parameters:
  • out_fname (str) – File name of data file where data is to be saved

  • voronoi (VoronoiWeights) – Voronoi weights calculator/reader

  • energies (list[float] | ndarray[tuple[int, ...], dtype[float64]]) – Array of energies (in eV) for which the broadened DOS is computed

  • sigma (float) – Gaussian broadening width in eV

  • gpw_file (str) – Filename of GPAW ground state file

  • zerofermi (bool) – Eigenvalues relative to Fermi level if true, else relative to vacuum

rhodent.writers.pdos.calculate_and_save_npz(out_fname, voronoi, energies, sigma, gpw_file, zerofermi=False, write_extra={}, write_extra_from_voronoi=False)[source]

Read eigenvalues and wave functions from ground state and calculate broadened PDOS

The PDOS is projected on each group of atoms in atom_projections

Save the broadened PDOS in a compressed numpy .npz archive

Parameters:
  • out_fname (str) – File name of data file where data is to be saved

  • voronoi (VoronoiWeights) – Voronoi weights calculator/reader

  • energies (list[float] | ndarray[tuple[int, ...], dtype[float64]]) – Array of energies (in eV) for which the broadened DOS is computed

  • sigma (float) – Gaussian broadening width in eV

  • gpw_file (str) – Filename of GPAW ground state file

  • zerofermi (bool) – Eigenvalues relative to Fermi level if true, else relative to vacuum

  • write_extra (dict[str, Any]) – Dictionary of extra key-value pairs to write to the .npz file

  • write_extra_from_voronoi (bool) – If true, and voronoi is a ULM reader, extra key-value pairs are read from voronoi and written to the .npz file

Voronoi Writer

rhodent.writers.voronoi.calculate_and_save_LCAO_only_by_filename(out_fname, **kwargs)[source]

Save Voronoi weights in LCAO basis to file

The file format of the resulting file is inferred from the file name

Parameters:
  • out_fname (str) – File name of the voronoi weigths file

  • voronoi_lcao – Voronoi weights in LCAO basis object

  • write_extra – Dictionary of extra key-value pairs to write to the data file

rhodent.writers.voronoi.calculate_and_save_by_filename(out_fname, **kwargs)[source]

Save Voronoi weights to file

The file format of the resulting file is inferred from the file name

Parameters:
  • out_fname (str) – File name of the voronoi weigths file

  • voronoi – Voronoi weights object

  • write_extra – Dictionary of extra key-value pairs to write to the data file

rhodent.writers.voronoi.calculate_and_save_npz(out_fname, voronoi, write_extra={})[source]

Save Voronoi weights to numpy archive

Parameters:
  • out_fname (str) – File name of the voronoi weigths file

  • voronoi (VoronoiWeights) – Voronoi weights object

  • write_extra (dict[str, Any]) – Dictionary of extra key-value pairs to write to the data file

rhodent.writers.voronoi.calculate_and_save_npz_LCAO_only(out_fname, voronoi_lcao, write_extra={})[source]

Save Voronoi weights in LCAO basis to numpy archive

Parameters:
  • out_fname (str) – File name of the voronoi weigths file

  • voronoi_lcao (VoronoiLCAOWeightCalculator) – Voronoi weights in LCAO basis object

  • write_extra (dict[str, Any]) – Dictionary of extra key-value pairs to write to the data file

rhodent.writers.voronoi.calculate_and_save_ulm(out_fname, voronoi, write_extra={})[source]

Save Voronoi weights to ULM file

Parameters:
  • out_fname (str) – File name of the voronoi weigths file

  • voronoi (VoronoiWeights) – Voronoi weights object

  • write_extra (dict[str, Any]) – Dictionary of extra key-value pairs to write to the data file

rhodent.writers.voronoi.calculate_and_save_ulm_LCAO_only(out_fname, voronoi_lcao, write_extra={})[source]

Save Voronoi weights in LCAO basis to ULM file

Parameters:
  • out_fname (str) – File name of the voronoi weigths file

  • voronoi_lcao (VoronoiLCAOWeightCalculator) – Voronoi weights in LCAO basis object

  • write_extra (dict[str, Any]) – Dictionary of extra key-value pairs to write to the data file