17.1.1.15. pysisyphus.marcus_dim package

17.1.1.15.1. Submodules

17.1.1.15.2. pysisyphus.marcus_dim.config module

17.1.1.15.3. pysisyphus.marcus_dim.fit module

pysisyphus.marcus_dim.fit.calculate_property(i, coords, geom, calc_getter, pal, fragments, prop_eq, property_func)[source]
pysisyphus.marcus_dim.fit.create_correlation_plots(qs, nus, corrs, depos, drop_first, batch, out_dir='.', corr_thresh=0.1)[source]
pysisyphus.marcus_dim.fit.create_marcus_coefficient_plot(nqs, coeffs, batch=None, ncalcs=None)[source]
pysisyphus.marcus_dim.fit.dump_marcus_dim_xyz_trj(atoms, coords3d_eq, marcus_dim, out_path)[source]
pysisyphus.marcus_dim.fit.en_exc_property(geom, fragments)[source]
pysisyphus.marcus_dim.fit.epos_from_wf(wf, fragments, pop_kind=PopulationKind.IAO)[source]

Fragment mulliken charges using intrinsic atomic orbital.

pysisyphus.marcus_dim.fit.epos_property(geom, fragments, pop_kind)[source]
pysisyphus.marcus_dim.fit.epos_property_iao(geom, fragments)[source]
pysisyphus.marcus_dim.fit.epos_property_mulliken(geom, fragments)[source]
pysisyphus.marcus_dim.fit.fit_marcus_dim(geom, calc_kwargs=None, batch_kwargs=None, batch_calc_func=None, out_dir='.')[source]
pysisyphus.marcus_dim.fit.fit_marcus_dim_batched(atoms, coords3d_eq, masses, batch_calc_func, nus, cart_displs, to_save, batch_size=25, max_batches=20, rms_thresh=0.005, correlations=False, corr_thresh=0.1, out_dir='.')[source]
pysisyphus.marcus_dim.fit.get_batch_calc_func(geom, calc_getter, property, fragments, scheduler, cart_displs, temperature, seed=None, out_dir=PosixPath('.'))[source]
pysisyphus.marcus_dim.fit.get_batch_calc_func_from_npz(npz_fn)[source]
pysisyphus.marcus_dim.fit.get_displaced_coordinates(wigner_sampler, cart_displs, coords_eq)[source]

Displaced (normal) coordinates from Wigner sampling.

pysisyphus.marcus_dim.fit.get_marcus_dim(cart_displs, qs, properties)[source]

Determine Marcus dimension from normal coordinates and properties.

Parameters:
  • cart_displs -- 2d array with shape (3N, nmodes) holding normal modes, with N being the number of atoms.

  • masses -- 1d array with shape (N, ) holding atomic masses.

  • qs -- 2d array with shape (nsamples, nmodes) holding the normal coordinates for each sample.

  • properties -- 1d array with shape (nsamples, ) holding the calculated properties, e.g,. electron position (centroid of spin density) or exciation energy.

Returns:

  • corrs -- Pearson correlation coefficients.

  • coeffs -- Normal mode expansion coefficients.

  • marcus_dim -- Normalized Marcus dimension in unweighted Cartesiand coordinates of shape (3*natoms, ).

pysisyphus.marcus_dim.fit.get_mass(marcus_dim, masses)[source]

Mass of fictious particle moving along Marcus dimension.

Eq. (2) in SI of [2].

Parameters:
  • marcus_dim (ndarray) -- Array of shape (3N, ) or (N, 3) with N being the number of atoms.

  • masses (ndarray) -- Array of shape (N, ) containing the atom masses in atomic mass units.

Returns:

Mass of fictious particle moving along Marcus dimension.

Return type:

mass

pysisyphus.marcus_dim.fit.get_wavenumber(marcus_dim, nus, eigvecs, masses)[source]

Wavenumber of Marcus dimension.

Eq. (3) in SI of [2].

The angular frequency is obtained from the square root of the quotient between force constants and reduced mass.

ω = sqrt(k/μ)

The 'normal' frequency ν is obtained as

ω_i = 2π ν_i = sqrt(k_i/μ_i) ν_i = 1/2π * sqrt(k_i/μ_i) ν_i = sqrt(k_i/(4π²μ_i)) (1)

Force constant k_i is

k_i = 4π²ν_i²μ_i (2)

The general ideo of Eq. (3) in the SI of [2] seems to be to calculate the force constants of all normal modes in the numerator (Ω² C^T M C; compare to ν² μ in (2)), then contract these values with the Marcus dimension in normal coordinates. This number is then divided by the mass of the Marcus dimension. The square root of this fraction yields a frequency with unit 1/s!

Parameters:
  • marcus_dim (ndarray) -- Array of shape (3N, ) or (N, 3) with N being the number of atoms.

  • nus (ndarray) -- Array of wavenumbers of shape (N, ).

  • eigvecs (ndarray) -- Array of eigenvectors of the projected mass-weighted Hessian with shape (3N, 3N).

  • masses (ndarray) -- Array of shape (N, ) containing the atom masses in atomic mass units.

Returns:

Wavenumber along Marcus dimension in cm⁻¹.

Return type:

nu_marcus

pysisyphus.marcus_dim.fit.get_wavenumber_from_coeffs(coeffs, nus)[source]

Wavenumber in cm⁻¹ of Marcus dimension from fit coefficients.

Return type:

float

pysisyphus.marcus_dim.fit.report_correlations(nus, corrs, drop_first, corr_thresh=0.1)[source]
pysisyphus.marcus_dim.fit.report_marcus_coefficients(coeffs, nus, drop_first, nhighest=10)[source]
pysisyphus.marcus_dim.fit.run_batch_calcs(batch_size, start_ind, sampler, client, calc_func)[source]
pysisyphus.marcus_dim.fit.setup_calc_client(geom, scheduler)[source]

17.1.1.15.4. pysisyphus.marcus_dim.param module

pysisyphus.marcus_dim.param.find_minima(arr)[source]
pysisyphus.marcus_dim.param.param_marcus(coordinate, energies)[source]

Parametrize Marcus model with results from scan along Marcus dimension.

pysisyphus.marcus_dim.param.solve_marcus(R, Vab, dG=None, en_exc_min=None)[source]

Fit Marcus-Hush model to given parameters R, Vab, dG and en_exc_min. Either dG or en_exc_min is mandatory.

All argument should be given in atomic units (Hartree and Bohr).

Quartic extension is described here:

https://www.science.org/doi/epdf/10.1126/science.278.5339.846

This is not yet implemented!

pysisyphus.marcus_dim.param.solve_marcus_wavenums_and_ang(R, Vab, dG=None, en_exc_min=None)[source]

Wrapper for solve_marcus that accepts wavenumbers and Ångstrom.

17.1.1.15.5. pysisyphus.marcus_dim.run module

pysisyphus.marcus_dim.run.dump_scan_result(geom, scan_result, dummy_scan, out_dir='.')[source]
pysisyphus.marcus_dim.run.run_marcus_dim(geom, calc_getter, calc_kwargs, rd_class, batch_kwargs=None, scan_kwargs=None, cluster=True, force=False, dummy_scan=False, out_dir='.')[source]

Fit Marucs dimension, scan along it and try to parametrize the Marcus model

Parameters:
  • geom (Geometry) -- Equilibrium geometry with N atoms and 3N Cartesian coordinates.

  • calc_getter -- Callable that returns a new calculator. Takes optional kwargs, that are passed to the underlying Calculator class.

  • fragments -- List of lists of integers, containing the different fragment indices. Order is important, as the prefactors for weighting the alpha-electron spin density depend on the order.

  • rd_class (RobinDay) -- RobinDay enum, denoting the Robin-Day class.

  • fit_kwargs -- Optional dict, containing additional arguments for fitting the Marcus dimension.

  • scan_kwargs (Optional[dict], default: None) -- Optional dict, containing additional arguments for scanning along the Marcus dimension.

  • T -- Temperature in Kelvin used for Wigner sampling.

  • cluster (bool, default: True) -- Boolean; controls wheter all calculations are done in serial or in parallel using dask.distributed.

  • force (bool, default: False) -- Boolean; when True fit & scan are done, even when the results are already present.

  • dummy_scan (bool, default: False) -- Optional; see docstring of run_scan()/run_scan_parallel().

  • out_dir (Union[PathLike, str], default: '.') -- String or Path object that controls the directory, where various files are written.

Return type:

dict[str, MarcusModel]

pysisyphus.marcus_dim.run.run_param(scan_factors, scan_energies, mult, out_dir='.')[source]

Try to parametrize quadratic Marcus model from scan data (factors & energies).

Parameters:
  • scan_factors (ndarray) -- 1d-array of shape (n, ) containing the multiplicative factors, describing the displacment along the Marcus dimension.

  • scan_energies (ndarray) -- 2d-array of shape(n, 2) containing the energies of the ground and first excited state.

  • mult (int) -- Integer representing the multiplicity of the system under study. Used to create meaningful labels in the plots.

  • out_dir (Union[PathLike, str], default: '.') -- String or Path object that controls the directory, where various files are written.

Returns:

Dictionary with two str keys ("a", "b") containing the (possibly) parametrized Marcus models. Parametrization is only possible for class II systems.

Return type:

models

pysisyphus.marcus_dim.run.run_scan(geom, marcus_dim, calc_getter, fragments, dummy_scan=False, out_dir='.', **kwargs)[source]

Scan along Marcus dimension using serial calculations in two directions.

Parameters:
  • geom (Geometry) -- Equilibrium geometry with N atoms and 3N Cartesian coordinates.

  • marucs_dim -- 1d array of shape (3N, ) containing the Marcus dimension in unweighted Cartesian coordinates.

  • calc_getter (Callable) -- Callable that returns a new calculator. Takes optional kwargs, that are passed to the underlying Calculator class.

  • fragments (list[list[int]]) -- List of lists of integers, containing the different fragment indices. Order is important, as the prefactors for weighting the alpha-electron spin density depend on the order.

  • dummy_scan (bool, default: False) -- Optional; when True the scan can be carried out using a calculator that supports only GS calculations, e.g. xTB. In such a case, a dummy value for the first ES is used (GS + 2 eV).

  • out_dir (Union[PathLike, str], default: '.') -- String or Path object that controls the directory, where various files are written.

Returns:

MarcusDimScanResult, carrying the factors, Cartesian coordinates, calculated energies and properties along the scan.

Return type:

scan_result

pysisyphus.marcus_dim.run.run_scan_parallel(geom, marcus_dim_data, calc_getter, fragments, rd_class, dummy_scan=False, out_dir='.', scheduler=None, **scan_kwargs)[source]

Scan along Marcus dimension using parallel calculations.

Parameters:
  • geom (Geometry) -- Equilibrium geometry with N atoms and 3N Cartesian coordinates.

  • marucs_dim_data -- Dictionary, as returned by fit_marcus_dim.

  • calc_getter (Callable) -- Callable that returns a new calculator. Takes optional kwargs, that are passed to the underlying Calculator class.

  • fragments (list[list[int]]) -- List of lists of integers, containing the different fragment indices. Order is important, as the prefactors for weighting the alpha-electron spin density depend on the order.

  • rd_class (RobinDay) -- RobinDay enum, denoting the Robin-Day class.

  • dummy_scan (bool, default: False) -- Optional; when True the scan can be carried out using a calculator that supports only GS calculations, e.g. xTB. In such a case, a dummy value for the first ES is used (GS + 2 eV).

  • out_dir (Union[PathLike, str], default: '.') -- String or Path object that controls the directory, where various files are written.

  • scheduler (Optional[LocalCluster], default: None) -- Dask.distributed LocalCluster object.

Returns:

MarcusDimScanResult, carrying the factors, Cartesian coordinates, calculated energies and properties along the scan.

Return type:

scan_result

17.1.1.15.6. pysisyphus.marcus_dim.scan module

pysisyphus.marcus_dim.scan.get_classII_scan_info(marcus_dim, normal_coords, properties, eigvecs, masses, max_bond_change=0.4)[source]

Determe directions & lengths for Robin-Day class II systems.

In class II systems we start at one of two minima and the scan along the Marcus dimension will be asymmetric. One direction of the scan will pass a barrier, towards the second minimum. This (sub)-scan will be longer. The scan in the opposite direction can be shorter and no big changes regarding electron position are expected.

pysisyphus.marcus_dim.scan.get_scan_factors_and_steps(B, normal_coords, properties, eigvecs, masses, marcus_dim, rd_class, max_bond_change=0.4, step_length=0.01)[source]
pysisyphus.marcus_dim.scan.plot_scan(factors, energies, properties, dummy_scan=False)[source]
pysisyphus.marcus_dim.scan.scan(coords_init, direction, get_properties, pos_min_steps=None, neg_min_steps=None, out_dir='.', **kwargs)[source]
pysisyphus.marcus_dim.scan.scan_coords_for_max_bond_change(B, cart_displs, max_bond_change=0.4, step_length=0.01)[source]
pysisyphus.marcus_dim.scan.scan_dir(x0, direction, prefact, get_property, step_size=0.05, add_steps=10, max_steps=500, min_steps=10, grad_thresh=0.01)[source]
pysisyphus.marcus_dim.scan.scan_parallel(coords_init, get_properties, marcus_dim, normal_coords, properties, eigvecs, masses, B, rd_class, max_bond_change=0.4, step_length=0.01, scheduler=None, out_dir='.')[source]

17.1.1.15.7. pysisyphus.marcus_dim.types module

class pysisyphus.marcus_dim.types.MarcusDimScanResult(factors, coords, energies, properties)[source]

Bases: object

coords: ndarray
energies: ndarray
factors: ndarray
properties: ndarray
class pysisyphus.marcus_dim.types.MarcusModel(reorg_en, dG, coupling, R, f, d)[source]

Bases: object

G_adiabatic(x, shift=True)[source]
G_diabatic(x)[source]
R: float
as_wavenums_and_ang_tuple()[source]
coupling: float
d: float
dG: float
f: float
plot(x, adiabatic=True, diabatic=False, show=False)[source]
pretty()[source]
reorg_en: float
pysisyphus.marcus_dim.types.PopKind

alias of PopulationKind

class pysisyphus.marcus_dim.types.Property(value)

Bases: Enum

An enumeration.

EEXC = 3
EPOS_IAO = 1
EPOS_MULLIKEN = 2
class pysisyphus.marcus_dim.types.RobinDay(value)

Bases: Enum

An enumeration.

CLASS1 = 1
CLASS2 = 2
CLASS3 = 3
pysisyphus.marcus_dim.types.get_rd_class(rd_class)[source]
Return type:

RobinDay

17.1.1.15.8. Module contents