17.1.1.25. pysisyphus.wavefunction package

17.1.1.25.1. Subpackages

17.1.1.25.2. Submodules

17.1.1.25.3. pysisyphus.wavefunction.Basis module

class pysisyphus.wavefunction.Basis.Basis[source]

Bases: object

Read basis sets from files. Bring them in a suitable order. 1s2s2p3s3p4s3d etc.

NOT YET USED

pysisyphus.wavefunction.Basis.basis_from_json(name)[source]
pysisyphus.wavefunction.Basis.basis_from_orca_str(basis_str)[source]
%basis

newgto 1 s 2 1 0.7 0.5 1 0.8 0.6 p 2 1 0.7 0.5 1 0.8 0.6 d 2 1 0.7 0.5 1 0.8 0.6 d 3 1 0.7 0.5 1 0.8 0.6 1 0.6 0.4 end

end

pysisyphus.wavefunction.Basis.basis_from_pyscf_str(basis_str)[source]

# Comment1 He S

13.6267000 0.1752300

1.9993500 0.8934830 0.3829930 0.0000000

He S
13.6267000 0.0000000

1.9993500 0.0000000 0.3829930 1.0000000

pysisyphus.wavefunction.Basis.shells_with_basis(atoms, coords, basis=None, name=None, shells_cls=None, min_coeff=1e-08, **kwargs)[source]

17.1.1.25.4. pysisyphus.wavefunction.DIIS module

class pysisyphus.wavefunction.DIIS.DIIS(arr_specs)[source]

Bases: object

__init__(arr_specs)[source]

DIIS container.

Parameters:

arr_specs (Dict[str, ndarray]) -- Dict with string-keys and array-values. The key 'err_vecs' must always be present. Additional keys can be provided, depending on what must be stored next to the error vectors. The arrays should be at least 2d, with the first dimension having size 'nvecs'.

can_get_coeffs()[source]
Return type:

bool

get(key)[source]
Return type:

ndarray

get_coeffs()[source]

Try to calculate DIIS coefficients from the error matrix.

Return type:

Optional[ndarray]

reset()[source]

Reset DIIS container.

store(arrs)[source]

Store arrays.

Returns the index, where the arrays were stored in their respective arrays.

Return type:

int

17.1.1.25.5. pysisyphus.wavefunction.backend_numba module

class pysisyphus.wavefunction.backend_numba.NumbaShell(*args, **kwargs)[source]

Bases: NumbaShell

class_type = jitclass.NumbaShell#7fdb36ab5fa0<L:int64,center:array(float64, 1d, A),coeffs:array(float64, 1d, A),exps:array(float64, 1d, A),index:int64,size:int64>
class pysisyphus.wavefunction.backend_numba.ShellStruct(L, center, center_ind, coeffs, exps, index, size)[source]

Bases: StructRefProxy

class pysisyphus.wavefunction.backend_numba.ShellStructType(*args, **kwargs)[source]

Bases: StructRef

preprocess_fields(fields)[source]

Subclasses can override this to do additional clean up on fields.

The default is an identity function.

17.1.1.25. Parameters:

fields : Sequence[Tuple[str, Type]]

pysisyphus.wavefunction.backend_numba.get_1el_ints_cart(shells_a, func_dict, components, shells_b=None, R=array([0., 0., 0.]), **kwargs)[source]
pysisyphus.wavefunction.backend_numba.get_2c_ints_cart(shells_a, shells_b, func_dict, components, symmetric=True, R=array([0., 0., 0.]))[source]
pysisyphus.wavefunction.backend_numba.get_func_data(key)[source]

Get func_dict and component.

_func_data dict is laziliy populated, as there is still a ~ 2 s compile time per import :/

pysisyphus.wavefunction.backend_numba.ol_as_tuple(self)[source]
pysisyphus.wavefunction.backend_numba.ol_cart_size(self)[source]
pysisyphus.wavefunction.backend_numba.ol_sph_size(self)[source]
pysisyphus.wavefunction.backend_numba.to_numba_shells(shells)[source]
pysisyphus.wavefunction.backend_numba.to_numba_shellstructs(shells)[source]

17.1.1.25.6. pysisyphus.wavefunction.backend_numba_multipole module

pysisyphus.wavefunction.backend_numba_multipole.canonical_order(L)[source]
Return type:

ndarray

pysisyphus.wavefunction.backend_numba_multipole.factorial2(n)[source]

Double factorial for positive integer arguments and 0 and -1.

Return type:

int

pysisyphus.wavefunction.backend_numba_multipole.get_1el_ints_cart(shells, func_dict, components, shells_b, **kwargs)[source]
pysisyphus.wavefunction.backend_numba_multipole.get_func_data(key)[source]
pysisyphus.wavefunction.backend_numba_multipole.get_multipole_ints_cart(Le, R, shellstructs_a, shellstructs_b=None)[source]
pysisyphus.wavefunction.backend_numba_multipole.get_multipole_ints_cart_numba(Le, R, shells_a, shells_b, symmetric)[source]
pysisyphus.wavefunction.backend_numba_multipole.get_multipole_ints_sph(Le, R, shells_a, shells_b=None)[source]

This function expects pysisyphus.Shells not Shellstructs

pysisyphus.wavefunction.backend_numba_multipole.lmn_factors(l, m, n)[source]
Return type:

float

pysisyphus.wavefunction.backend_numba_multipole.multipole1d(i, j, e, px, pa, pb, pr, base)[source]

1d-multipole integral.

pysisyphus.wavefunction.backend_numba_multipole.multipole1d_(i, j, e, px, pa, pb, pr, base)[source]

1d-multipole integral.

pysisyphus.wavefunction.backend_numba_multipole.multipole3d(La, Lb, Le, axs, das, A, bxs, dbs, B, R, exp_thresh=-36.0)[source]

3d-multipole integral.

17.1.1.25.7. pysisyphus.wavefunction.backend_python module

pysisyphus.wavefunction.backend_python.get_1el_ints_cart(shells_a, func_dict, components, shells_b=None, screen=False, screen_func=None, **kwargs)[source]
pysisyphus.wavefunction.backend_python.get_3c2el_ints_cart(shells_a, shells_aux)[source]

Cartesian 3-center-2-electron integrals.

DO NOT USE THESE INTEGRALS AS THEY ARE RETURNED FROM THIS METHOD. These integrals utilize recurrence relations that are only valid, when the resulting Cartesian integrals are transformed into spherical integrals.

Contrary to the general function 'get_1el_ints_cart', that supports different 'func_dict' arguments and cross-integrals between two different shells this function is less general. This function is restricted to '_3center2el_sph' and always uses only 1 set of shells and 1 set of auxiliary shells.

pysisyphus.wavefunction.backend_python.get_func_data(key)[source]

17.1.1.25.8. pysisyphus.wavefunction.bond_order module

pysisyphus.wavefunction.bond_order.improved_mayer_bond_order(Pa, Pb, S, ao_centers, natoms)[source]

Improved Mayer bond-order.

Implements algorithm described in [1].

Parameters:
  • Pa (ndarray) -- Density matrix of alpha electrons of shape (nao, nao).

  • Pb (ndarray) -- Density matrix of beta electrons of shape (nao, nao).

  • S (ndarray) -- AO-overlap matrix of shape (nao, nao).

  • ao_centers (list) -- List of of length nao, denoting the atom center of each AO.

  • natoms (int) -- Number of atoms.

Returns:

Bond-order matrix.

Return type:

BOs

pysisyphus.wavefunction.bond_order.report_bond_orders(BOs, thresh=0.1)[source]

17.1.1.25.9. pysisyphus.wavefunction.cart2sph module

pysisyphus.wavefunction.cart2sph.cart2sph_coeff(lx, ly, lz, m)[source]

Coefficient to convert Cartesian to spherical harmonics.

Eq. (15) in [1].

17.1.1.25. Paramters

lx

Cartesian quantum number.

ly

Cartesian quantum number.

lz

Cartesian quantum number.

m

Magnetic quantum number.

returns:

Contribution of the given Cartesian basis function to the spherical harmonic Y^(lx + ly + lz)_m.

rtype:

coeff

pysisyphus.wavefunction.cart2sph.cart2sph_coeffs(l_max, **kwargs)[source]
Return type:

Dict[int, ndarray]

pysisyphus.wavefunction.cart2sph.cart2sph_coeffs_for(l, real=True, zero_small=True, zero_thresh=1e-14, use_mp=False)[source]
Return type:

ndarray

pysisyphus.wavefunction.cart2sph.cart2sph_nlms(l_max)[source]
Return type:

Dict[int, Tuple[Tuple[int, int, int]]]

pysisyphus.wavefunction.cart2sph.expand_sph_quantum_numbers(Lm, zero_thresh=1e-14, with_lmn_factors=False)[source]

Factors and Cart. angular momentum vectors for given sph. quantum numbers.

Return type:

Tuple[ndarray, List[Tuple[int, int, int]]]

pysisyphus.wavefunction.cart2sph.mp_cart2sph_coeff(lx, ly, lz, m)[source]

Higher precision Cartesian to Spherical transformation coefficients.

Eq. (15) in [1].

17.1.1.25. Paramters

lx

Cartesian quantum number.

ly

Cartesian quantum number.

lz

Cartesian quantum number.

m

Magnetic quantum number.

returns:

Contribution of the given Cartesian basis function to the spherical harmonic Y^(lx + ly + lz)_m.

rtype:

coeff

pysisyphus.wavefunction.cart2sph.parse_args(args)[source]
pysisyphus.wavefunction.cart2sph.print_coeffs(l, C)[source]
pysisyphus.wavefunction.cart2sph.run()[source]

17.1.1.25.10. pysisyphus.wavefunction.density_numba module

pysisyphus.wavefunction.density_numba.cart_gto3d_rel(La, axs, das, RA, RA2, result, cutoff=-36)[source]
pysisyphus.wavefunction.density_numba.cart_size(L)[source]
pysisyphus.wavefunction.density_numba.eval_density(shells, coords3d, P, precontr, rho, blk_size=100, thresh=1e-08, accumulate=False)[source]

Density evaluation on a grid using numba.

As (briefly) outlined in Section III C in [1].

pysisyphus.wavefunction.density_numba.eval_prim_density(Ls_inds, primdata, coords3d, P, switch, rho, cutoff=-36)[source]
pysisyphus.wavefunction.density_numba.prefacts(La, RA, result)[source]

17.1.1.25.11. pysisyphus.wavefunction.dma module

pysisyphus.wavefunction.dma.accumulate_multipoles(dx, dy, dz, prefact, multipoles)[source]
pysisyphus.wavefunction.dma.closest_sites_and_weights(org_coords, sites, site_radii, thresh=1e-06)[source]

Determine closest expansion sites and associated weights.

Implements Stone's closest-neigbours-take-it-all-strategy. Alternatively, Vigne-Maeder could be implemented (eq. (78) in [4]).

pysisyphus.wavefunction.dma.dma(wavefunction, sites, site_radii, exp_cutoff=-36.0, dens_thresh=1e-09, switch=4.0, addons=True)[source]
pysisyphus.wavefunction.dma.get_C(lmax=4)[source]

Factors for complex->real transformation of multipoles.

Defined below A9 in [3].

Return type:

dict[tuple[int, int], complex]

pysisyphus.wavefunction.dma.get_W(xyz, lmkq, L_max=2)[source]

Multipole-shift matrix W.

See eq. (A11) in [3].

Return type:

ndarray

pysisyphus.wavefunction.dma.get_binom_lmkq(L_max=2)[source]

Bionmial-coefficient prefactor required for translating multipoles.

See eq. (2.7) in [1] and eq. (11) in [2]. Returns sqrt of the product of two binomial coefficients.

Return type:

ndarray

pysisyphus.wavefunction.dma.get_index_maps(L_max=2)[source]

Map between (l, m) keys and 1d indices in the multipole arrays.

The ordering here must match the ordering in the integral functions.

Return type:

dict[tuple[int, int], int]

pysisyphus.wavefunction.dma.get_radii(atoms)[source]

Default site radii from DMA. 0.325 Å for Hydrogen, 0.65 Å else.

Return type:

ndarray

pysisyphus.wavefunction.dma.get_redistribution_func(sites, site_radii, distributed_multipoles)[source]
pysisyphus.wavefunction.dma.move_multipoles(L_max, lmkq, multipoles, P, S)[source]

Move multipoles from P to S using matrix multiplication.

Follows the approach outlined in [3].

Return type:

ndarray

pysisyphus.wavefunction.dma.move_multipoles_gen(L_max, lmkq, Q, P, S)[source]

Move multipoles from P to S using matrix multiplication.

Follows the approach outlined in [3]. The code below is generated with 'gen_m2m.py' in the 'scripts' subdirectory. It is basically the unrolled matrix multiplication.

The code below works up to quadrupoles.

Return type:

ndarray

pysisyphus.wavefunction.dma.run_dma(wf, sites=None, site_labels=None, site_radii=None, **kwargs)[source]
pysisyphus.wavefunction.dma.to_orient(atoms, coords3d, multipoles, rank=2, molecule_name='Molecule1', title='Orient input from pysisyphus', eV_lim=0.5)[source]

17.1.1.25.12. pysisyphus.wavefunction.excited_states module

pysisyphus.wavefunction.excited_states.ct_numbers(C, occ, Ts, nfrags, frag_ao_map)[source]

Charge-transfer numbers.

This function is based on [1]; a different implementation is described in the SI of [3].

Return type:

ndarray[Any, dtype[float]]

pysisyphus.wavefunction.excited_states.ct_numbers_for_states(wf, frags, Ta, Tb=None)[source]

Charge-Transfer number for a given wavefunction and fragments.

Parameters:
  • wf (Wavefunction) -- Wavefunction object.

  • frags (List[List[int]]) -- List of lists of integers, containing the atom indices of the respective fragments.

  • Ta (ndarray[Any, dtype[float]]) -- Alpha-spin transition density matrices of shape (nstates, occ_a, virt_a).

  • Tb (Optional[ndarray[Any, dtype[float]]], default: None) -- Beta-spin transition density matrices of shape (nstates, occ_b, virt_b).

Returns:

Array of shape (nstates, nfrags, nfrags), containing the charge-transfer numbers of every state.

Return type:

omegas

pysisyphus.wavefunction.excited_states.detachment_attachment_density(diff_dens, atol=1e-12, verbose=False)[source]

Calculation of detachment and attachment densities in the MO-basis.

Based on [4]. As described in the paper, both density-matrices are positive semidefinite.

Parameters:
  • diff_dens (ndarray) -- 2d array containing a difference density in the MO basis w/ shape (nmos, nmos).

  • atol (default: 1e-12) -- Positive float; absolute tolerance used in the checks.

Returns:

  • detach_dens -- 2d array containing the detachment density in the MO basis w/ shape (nmos, nmos).

  • attach_dens -- 2d array containing the attachment density in the MO basis w/ shape (nmos, nmos).

pysisyphus.wavefunction.excited_states.get_state_to_state_transition_density(T_a, T_b)[source]

State-to-state transition density.

See eq. (17) in [5], which is a simplification of eq. (15) in [5]. For TD-DFT with a potentially non-vanishing Y vector this function can be called two times. First with X[a] and X[b], and then Y[a] and Y[b]. Finally both matrices can be added to yield the matrix on the RHS of eq. (17) in [5].

Parameters:
  • T_a (ndarray[Any, dtype[float]]) -- Transition density matrix for state A of shape (occ, virt).

  • T_b (ndarray[Any, dtype[float]]) -- Transition density matrix for state B of shape (occ, virt).

Returns:

State-to-state transition density of shape (occ+virt, occ+virt).

Return type:

T_ab

pysisyphus.wavefunction.excited_states.make_density_matrices_for_root(rootm1, restricted, Xa, Ya, Xb, Yb, ov_corr_a=None, ov_corr_b=None, Ca=None, Cb=None, renorm=True)[source]

Create relaxed/unrelaxed alpha and beta density matrices for an ES.

pysisyphus.wavefunction.excited_states.make_mo_density_matrix_for_root(X, Y, restricted, ov_corr=None)[source]

Construct (relaxed) density matrix from X, Y (and occ-virt. correction).

Parameters:
  • X (ndarray) -- 2d-array containing excitation CI-coefficients w/ shape (nocc, nvirt).

  • Y (ndarray) -- 2d-array containing deexcitation CI-coefficients w/ shape (nocc, nvirt).

  • restricted (bool) -- Whether the X and Y vectors were produced from a restricted calculation.

  • ov_corr (Optional[ndarray], default: None) -- occ-virt/virt-occ correction, as obtained from ES gradient calculations.

Returns:

(Relaxed) density matrix in MO basis.

Return type:

P

pysisyphus.wavefunction.excited_states.mo_inds_from_tden(T, ci_thresh)[source]

Indices (from, to) for CI-coefficients above a threshold.

Return type:

Tuple[ndarray[Any, dtype[int]], ndarray[Any, dtype[int]], ndarray[Any, dtype[float]]]

pysisyphus.wavefunction.excited_states.norm_ci_coeffs(Xa, Ya, Xb=None, Yb=None, restricted_norm=0.5, unrestricted_norm=1.0)[source]

Normalize transition density matrices.

Return type:

Tuple[ndarray[Any, dtype[float]], ndarray[Any, dtype[float]]]

target_norm = (N*X)**2 - (N*Y)**2

= N**2 * (X**2 - Y**2)

N**2 = target_norm / (X**2 - Y**2) N = sqrt(target_norm / (X**2 - Y**2))

pysisyphus.wavefunction.excited_states.nto_overlaps(ntos_1, lambdas_1, ntos_2, lambdas_2, ao_ovlp)[source]

NTOS are expected to be given in columns.

pysisyphus.wavefunction.excited_states.ovlp(from_A, to_A, vecA, from_B, to_B, vecB, S_MO)[source]

Overlap between two transition orbital pairs.

According to Eq. (9)

Return type:

ndarray[Any, dtype[float]]

pysisyphus.wavefunction.excited_states.parse_tden(T, thresh)[source]
Return type:

Tuple[List[frozenset], ndarray[Any, dtype[int]], ndarray[Any, dtype[int]], ndarray[Any, dtype[float]]]

pysisyphus.wavefunction.excited_states.rAB(TXA, TYA, TXB, TYB, S_MO, exc_thresh=0.05, deexc_thresh=0.02)[source]

Transition-orbital-pair overlaps.

See 'Transition orbital projection approach for excited state tracking' in J. Chem. Phys. 156, 214104 (2022); https://doi.org/10.1063/5.0081207

Parameters:
  • TXA (ndarray[Any, dtype[float]]) -- Excitation coefficient (X) vector for 1 state at geometry A.

  • TYA (ndarray[Any, dtype[float]]) -- Deexcitation coefficient (Y) vector for 1 state at geometry A.

  • TXB (ndarray[Any, dtype[float]]) -- Excitation coefficient (X) vector for 1 state at geometry B.

  • TYB (ndarray[Any, dtype[float]]) -- Deexcitation coefficient (Y) vector for 1 state at geometry B.

  • S_MO (ndarray[Any, dtype[float]]) -- Matrix containing overlaps between the MOs at geometry A and B.

  • exc_thresh (float, default: 0.05) -- Coefficient threshold up to which CI-coefficients from TXA and TXA are still considered.

  • deexc_thresh (float, default: 0.02) -- Coefficient threshold up to which CI-coefficients from TYA and TYA are still considered.

Return type:

float

pysisyphus.wavefunction.excited_states.r_diff(vecP_from, vec_to, t_to)[source]
Return type:

float

pysisyphus.wavefunction.excited_states.tden_overlaps(C_1, ci_coeffs1, C_2, ci_coeffs2, S_AO)[source]

Transition density overlaps.

Parameters:
  • mo_coeffs1 (ndarray, shape (MOs, AOs)) -- MO coefficient matrix. MOs are expected to be in columns.

  • mo_coeffs2 (ndarray) -- See mo_coeffs1.

  • ci_coeffs1 (ndarray, shape(occ. MOs, MOs)) -- CI-coefficient matrix.

  • ci_coeffs2 (ndarray, shape(occ. MOs, MOs)) -- See ci_coeffs1.

  • S_AO (ndarray, shape(AOs1, AOs2)) -- Double molcule AO overlaps.

pysisyphus.wavefunction.excited_states.to_pairs(arr_a, arr_b)[source]

Zip two iterables to a list of frozensets.

Return type:

List[frozenset]

pysisyphus.wavefunction.excited_states.to_same_basis(pairs1, vals1, pairs2, vals2)[source]
Return type:

Tuple[List[int], List[int], ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]], ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]]

pysisyphus.wavefunction.excited_states.top_differences(XA, YA, XB, YB, S_MO)[source]

17.1.1.25.13. pysisyphus.wavefunction.gdma_int module

pysisyphus.wavefunction.gdma_int.get_diffuse_density_numba(wf, mol_grid, switch)[source]
Return type:

ndarray

pysisyphus.wavefunction.gdma_int.get_prim_data(shells)[source]
Return type:

Tuple[ndarray, ndarray]

17.1.1.25.14. pysisyphus.wavefunction.gen_ints module

class pysisyphus.wavefunction.gen_ints.CartGTO3d(i, j, k, a, Xa, Ya, Za)[source]

Bases: Function

3D Cartesian Gaussian function; not normalized.

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(i, j, k, a, Xa, Ya, Za)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.CartGTOShell(La_tot, a, Xa, Ya, Za)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, a, Xa, Ya, Za)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.Coulomb(a, A, b, B, C=None)[source]

Bases: TwoCenter1d

Nucleus at C.

default_assumptions: ClassVar[StdFactKB] = {}
eval(i, k, m, j, l, n, N)[source]
class pysisyphus.wavefunction.gen_ints.CoulombShell(La_tot, Lb_tot, a, b, A, B, C=(0.0, 0.0, 0.0))[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, a, b, A, B, C=(0.0, 0.0, 0.0))[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.DiagQuadrupole3dShell(La_tot, Lb_tot, a, b, A, B, C=(0.0, 0.0, 0.0))[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, a, b, A, B, C=(0.0, 0.0, 0.0))[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.ERI(ia, ja, ka, ib, jb, kb, ic, jc, kc, id_, jd, kd, N, a, b, c, d, A, B, C, D)[source]

Bases: Function

Variables named according to libreta paper [3].

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(ia, ja, ka, ib, jb, kb, ic, jc, kc, id_, jd, kd, N, a, b, c, d, A, B, C, D)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.ERIShell(La_tot, Lb_tot, Lc_tot, Ld_tot, a, b, c, d, A, B, C, D)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, Lc_tot, Ld_tot, a, b, c, d, A, B, C, D)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.Kinetic1d(a, A, b, B, C=None)[source]

Bases: TwoCenter1d

default_assumptions: ClassVar[StdFactKB] = {}
eval(i, j)[source]
class pysisyphus.wavefunction.gen_ints.Kinetic3d(La, Lb, a, b, A, B)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La, Lb, a, b, A, B)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.Kinetic3dShell(La_tot, Lb_tot, a, b, A, B)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, a, b, A, B)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.Multipole1d(a, A, b, B, C=None)[source]

Bases: TwoCenter1d

1d multipole-moment integral of order 'e', between primitive 1d Gaussians Ga = G_i(a, r, A) and Gb = G_j(b, r, B) with Cartesian quantum number i and j, exponents a and b, centered at A (B). The origin of the multipole expansion is at C.

default_assumptions: ClassVar[StdFactKB] = {}
eval(i, j, e)[source]
class pysisyphus.wavefunction.gen_ints.Multipole3d(La, Lb, a, b, A, B, Le, C)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La, Lb, a, b, A, B, Le, C)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.Multipole3dShell(La_tot, Lb_tot, a, b, A, B, Le_tot=0, C=(0.0, 0.0, 0.0))[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, a, b, A, B, Le_tot=0, C=(0.0, 0.0, 0.0))[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.Overlap1d(a, A, b, B, C=None)[source]

Bases: TwoCenter1d

default_assumptions: ClassVar[StdFactKB] = {}
eval(i, j)[source]
class pysisyphus.wavefunction.gen_ints.Overlap3dShell(La_tot, Lb_tot, a, b, A, B)[source]

Bases: Function

Whole shell of 3d overlap integrals for a given L pair over primitive gaussians.

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, a, b, A, B)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.SpinOrbit(i, k, m, j, l, n, N, mu, a, b, A, B, C)[source]

Bases: Function

1-electron spin-orbit interaction integral for Cartesian direction μ.

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(i, k, m, j, l, n, N, mu, a, b, A, B, C)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.SpinOrbitShell(La_tot, Lb_tot, a, b, A, B, C=(0.0, 0.0, 0.0))[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, a, b, A, B, C=(0.0, 0.0, 0.0))[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.ThreeCenterTwoElectron(ia, ja, ka, ib, jb, kb, ic, jc, kc, N, a, b, c, A, B, C)[source]

Bases: ThreeCenterTwoElectronBase

aux_vrr = 'cart'
default_assumptions: ClassVar[StdFactKB] = {}
class pysisyphus.wavefunction.gen_ints.ThreeCenterTwoElectronBase(ia, ja, ka, ib, jb, kb, ic, jc, kc, N, a, b, c, A, B, C)[source]

Bases: Function

https://pubs.rsc.org/en/content/articlelanding/2004/CP/b413539c

There is an error in the base case (00|0). One must divide by sqrt(eta + gamma), not multiply.

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(ia, ja, ka, ib, jb, kb, ic, jc, kc, N, a, b, c, A, B, C)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.ThreeCenterTwoElectronShell(La_tot, Lb_tot, Lc_tot, a, b, c, A, B, C)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, Lc_tot, a, b, c, A, B, C)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.ThreeCenterTwoElectronSph(ia, ja, ka, ib, jb, kb, ic, jc, kc, N, a, b, c, A, B, C)[source]

Bases: ThreeCenterTwoElectronBase

aux_vrr = 'sph'
default_assumptions: ClassVar[StdFactKB] = {}
class pysisyphus.wavefunction.gen_ints.ThreeCenterTwoElectronSphShell(La_tot, Lb_tot, Lc_tot, a, b, c, A, B, C)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, Lc_tot, a, b, c, A, B, C)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.TwoCenter1d(a, A, b, B, C=None)[source]

Bases: Expr

property AB

Relative coordinate/Gaussian separation X_AB.

property K
property P

Center-of-charge coordinate.

property PA

Relative coordinate/Gaussian separation X_PA.

property PB

Relative coordinate/Gaussian separation X_PB.

property PC

Relative coordinate/Gaussian separation X_PC.

default_assumptions: ClassVar[StdFactKB] = {}
property mu

Reduced exponent mu.

property p

Total exponent p.

class pysisyphus.wavefunction.gen_ints.TwoCenterTwoElectron(ia, ja, ka, ib, jb, kb, N, a, b, A, B)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(ia, ja, ka, ib, jb, kb, N, a, b, A, B)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.TwoCenterTwoElectronShell(La_tot, Lb_tot, a, b, A, B)[source]

Bases: Function

default_assumptions: ClassVar[StdFactKB] = {}
classmethod eval(La_tot, Lb_tot, a, b, A, B)[source]

Returns a canonical form of cls applied to arguments args.

17.1.1.25. Explanation

The eval() method is called when the class cls is about to be instantiated and it should return either some simplified instance (possible of some other class), or if the class cls should be unmodified, return None.

Examples of eval() for the function "sign"

@classmethod
def eval(cls, arg):
    if arg is S.NaN:
        return S.NaN
    if arg.is_zero: return S.Zero
    if arg.is_positive: return S.One
    if arg.is_negative: return S.NegativeOne
    if isinstance(arg, Mul):
        coeff, terms = arg.as_coeff_Mul(rational=True)
        if coeff is not S.One:
            return cls(coeff) * cls(terms)
class pysisyphus.wavefunction.gen_ints.boys(*args)

Bases: AppliedUndef

default_assumptions: ClassVar[StdFactKB] = {}
name: str = 'boys'
pysisyphus.wavefunction.gen_ints.canonical_order(L)[source]
pysisyphus.wavefunction.gen_ints.cart2spherical(L_tots, exprs)[source]
pysisyphus.wavefunction.gen_ints.gen_integral_exprs(int_func, L_maxs, kind, maps=None, sph=False)[source]
pysisyphus.wavefunction.gen_ints.get_center(i)[source]
pysisyphus.wavefunction.gen_ints.get_centers(i)[source]
pysisyphus.wavefunction.gen_ints.get_map(i, center_i)[source]
pysisyphus.wavefunction.gen_ints.make_c_func(repls, reduced, args=None, name=None, doc_str='')[source]
pysisyphus.wavefunction.gen_ints.make_py_func(repls, reduced, args=None, name=None, doc_str='', return_array=True)[source]
pysisyphus.wavefunction.gen_ints.parse_args(args)[source]
pysisyphus.wavefunction.gen_ints.render_c_funcs(exprs_Ls, args, base_name, doc_func, add_imports=None, comment='')[source]
pysisyphus.wavefunction.gen_ints.render_py_funcs(exprs_Ls, args, base_name, doc_func, add_imports=None, comment='')[source]
pysisyphus.wavefunction.gen_ints.run()[source]
pysisyphus.wavefunction.gen_ints.shell_iter(Ls)[source]

Iterator over cartesian product of L values in Ls.

pysisyphus.wavefunction.gen_ints.write_file(out_dir, name, rendered)[source]
pysisyphus.wavefunction.gen_ints.write_render(ints_Ls, args, name, doc_func, out_dir, comment='', py_kwargs=None, c=True, c_kwargs=None)[source]

17.1.1.25.15. pysisyphus.wavefunction.helpers module

class pysisyphus.wavefunction.helpers.BFType(value)[source]

Bases: IntEnum

An enumeration.

CARTESIAN = 1
PURE_SPHERICAL = 2
pysisyphus.wavefunction.helpers.canonical_order(L)[source]
pysisyphus.wavefunction.helpers.cart2ang_moms(cart)[source]

Translate 'xxx' to (3, 0, 0) etc.

pysisyphus.wavefunction.helpers.cart_size(L)[source]
Return type:

int

pysisyphus.wavefunction.helpers.cca_order(l)[source]

Same as canonical_order().

pysisyphus.wavefunction.helpers.get_l(l_inp)[source]

Convert shell label to angular moment quantum number l.

Return type:

int

pysisyphus.wavefunction.helpers.lm_iter(L_max)[source]
pysisyphus.wavefunction.helpers.permut_for_order(cart_orders, pysis_order_func=<function cca_order>)[source]

Create permutation matrices to reorder Cartesian integrals.

pysisyphus.wavefunction.helpers.sph_size(L)[source]
Return type:

int

pysisyphus.wavefunction.helpers.symmetric_orthogonalization(mat, S, thresh=1e-06)[source]

17.1.1.25.16. pysisyphus.wavefunction.localization module

class pysisyphus.wavefunction.localization.JacobiSweepResult(is_converged, cur_cycle, C, P)[source]

Bases: object

C: ndarray[Any, dtype[float]]
P: float
cur_cycle: int
is_converged: bool
pysisyphus.wavefunction.localization.cholesky(C)[source]

Localization via pivoted Cholesky factorization.

See [2].

Parameters:

C (ndarray[Any, dtype[float]]) -- Matrix of molecular orbital coefficients to be localized. Shape is (naos, nmos).

Returns:

Localized molecular orbital coefficient matrix of shape (naos, nmos).

Return type:

C_loc

pysisyphus.wavefunction.localization.edmiston_ruedenberg(C, Lao, Sao, diis_cycles=5, max_cycles=100)[source]

Edmiston-Ruedenberg localization using DF integrals and DIIS.

This implementation follows [7].

The parameters given below are described for the case of MO localization, but this function can also be used for diabatization of electronic states. As the states obtained from TD-DFT and related methods are usually orthogonal, the overlap matrix 'Sao' must be the unit matrix. The tensor Lao should then be the contraction of the original density-fitting tensor w/ the densities of the different states or their transition densities. The shape will be (naux, nstates, nates). C has the shape (nstates, nstates) and can/should be chosen as a random rotation matrix, e.g.,

via scipy.stats.special_ortho_group.rvs(nstates)

Multiple runs may be required when a random matrix used to initiate the diabatization.

Parameters:
  • C -- MO-coefficients of shape (naos, nmos); this means MOs must be organized in columns.

  • Lao -- Density fitting tensor obtained from contracting the 2e3c-matrix with 2c2e**-0.5 in the AO basis. Must have shape (naux, nao, nao).

  • Sao -- Overlap matrix of shape (nao, nao) in the AO basis.

  • diis_cycles (default: 5) -- Integer >= 0. If > 0, DIIS is employed to accelerate convergence.

  • max_cycles (default: 100) -- Positive integer; maximum number of localization cycles.

Returns:

Edmiston-Ruedenberg localized orbitals.

Return type:

Crot

pysisyphus.wavefunction.localization.edmiston_ruedenberg_cost_func(L)[source]

Edmiston-Ruedenberg cost function.

Eq. (2) in [7].

pysisyphus.wavefunction.localization.edmiston_ruedenberg_grad(L)[source]

Edmiston-Ruedenberg gradient.

Eq. (5) in [7].

pysisyphus.wavefunction.localization.foster_boys(C, dip_ints, **kwargs)[source]

Foster-Boys localization.

nMO nMO ___ ___ ╲ ╲ 2

╲ ╲ | | ╱ ╱ | <i|R|i> - <j|R|j> |

╱ ╱ | | ‾‾‾ ‾‾‾

i = 1 j = 1

or similarily (see eq. (6) in [4] or the appendix of [5])

╲ 2

╲ | | ╱ | <i|R|i> |

╱ | | ‾‾‾

i = 1

Parameters:
  • dip_ints (ndarray[Any, dtype[float]]) -- Dipole moment integral matrices with shape (3, naos, naos).

  • C (ndarray[Any, dtype[float]]) -- Matrix of molecular orbital coefficients to be localized. Shape is (naos, nmos).

  • kwargs -- Additional keyword arguments that are passed jacobi_sweeps.

Returns:

Localized molecular orbital coefficient matrix of shape (naos, nmos).

Return type:

C_loc

pysisyphus.wavefunction.localization.get_fb_ab_func(moments_ints)[source]
pysisyphus.wavefunction.localization.get_fb_contract(moments_ints)[source]
pysisyphus.wavefunction.localization.get_fb_cost_func(moments_ints)[source]
pysisyphus.wavefunction.localization.jacobi_sweeps(C, cost_func, ab_func, gamma_func=None, callback=None, max_cycles=100, dP_thresh=1e-08)[source]

Wrapper for 2x2 Jacobi-sweeps as used in localization/diabatization.

Parameters:
  • C (ndarray[Any, dtype[float]]) -- MO coefficient matrix (shape naos x nmos) or rotation matrix (nstates x nstates).

  • cost_func (Callable) -- Function to be maximized/minimized.

  • ab_func (Callable) -- Function that returns A & B values, used to calculate the angle for the 2x2 rotation.

  • gamma_func (Optional[Callable], default: None) -- Function that returns rotation angle in radius for given real numbers A and B.

  • callback (Optional[Callable], default: None) -- Function that is called after the 2x2 rotation took place. It takes three arguments: (gamma, j, k).

  • max_cycles (int, default: 100) -- Maximum number of macro cycles.

  • dP_thresh (float, default: 1e-08) -- Indicate convergence when change in cost function is equal or below this threshold.

Returns:

Localized molecular orbital coefficient matrix of shape (naos, nmos).

Return type:

C_loc

pysisyphus.wavefunction.localization.pipek_mezey(C, S, ao_center_map, **kwargs)[source]

Pipek-Mezey localization using Mulliken population analysis.

Python adaption of code found in orbloc.f90 of Multiwfn 3.8. For now, only Mulliken population and localization exponent 2 is supported.

Parameters:
  • C -- Matrix of molecular orbital coefficients to be localized. Shape is (naos, nmos).

  • S -- Overlap matrix of shape (naos x naos).

  • ao_center_map -- Mapping between atom indices and AOs, centered at the respective atom.

Returns:

Localized molecular orbital coefficient matrix of shape (naos, nmos).

Return type:

C_loc

pysisyphus.wavefunction.localization.rot_inplace(mat, rad, i, j)[source]

2x2 inplace rotation of matrix columns mat[:, i] and mat[:, j] by 'rad' radians.

17.1.1.25.17. pysisyphus.wavefunction.multipole module

pysisyphus.wavefunction.multipole.get_multipole_moment(order, coords3d, origin, multipole_ints, nuc_charges, P)[source]
Return type:

ndarray[Any, dtype[float]]

order

Kind of requested multipoles: (1, dipole moment), (2, quadrupole moment).

coords3d

Cartesian coordinates of shape (natoms, 3).

origin

Origin of the multipole expansion. The supplied integrales must be calculated w.r.t. this origin.

multipole_ints

Linear or quadratic multipole moment integrals.

nuc_charges

Nuclear charges.

P

Density matrix in the AO basis.

pysisyphus.wavefunction.multipole.get_transition_multipole_moment(multipole_ints, C_a, C_b, T_a, T_b=None, occ_a=None, occ_b=None, full=False)[source]

Transition multipole moments from transition density matrices.

This functions relies on the following normalization

closed shell: 0.5 = norm(X_a)**2 - norm(Y_a)**2

open shell: 1.0 = norm(X_a,X_b)**2 - norm(Y_a,Y_b)**2

with X_a,X_b indicating a vector formed by concatenating the elements of X_a and X_b for every state. See also Eq. (33) in [1].

Parameters:
  • multipole_integrals -- Multipole integrals in the AO basis of the desired ordered, e.g., linear moment for transition dipole moments or quadratic moments for quadrupole transition moments.

  • C_a (ndarray[Any, dtype[float]]) -- MO-coefficients for α-electrons.

  • C_b (ndarray[Any, dtype[float]]) -- MO-coefficients for β-electrons.

  • T_a (ndarray[Any, dtype[float]]) -- Numpy array containing transition density matrices of shape (nstates, occ, virt) or (occ, virt) in the α-electron space. The transition density must be given in the MO-basis!

  • T_b (Optional[ndarray[Any, dtype[float]]], default: None) -- See P_a. Optional. If not provided, P_b is derived from P_a.

  • occ_a (Optional[int], default: None) -- Number of α-electrons.

  • occ_b (Optional[int], default: None) -- Number of β-electrons.

  • full (bool, default: False) -- Use all MOs to transform multipole integrals. Needed for state-to-state transition denstiy matrices of shape (occ+virt, occ+virt).

Returns:

Transition moments of the respective order for all provided states.

Return type:

trans_moments

17.1.1.25.18. pysisyphus.wavefunction.normalization module

pysisyphus.wavefunction.normalization.factorial2(n)[source]

Scipy 1.11 decided that (-1)!! is not 1 anymore!

Please see https://github.com/scipy/scipy/issues/18813.

pysisyphus.wavefunction.normalization.get_lmn_factors(L)[source]
pysisyphus.wavefunction.normalization.norm_cgto_lmn(coeffs, exps, L)[source]
pysisyphus.wavefunction.normalization.norm_pgto(exponent, L)[source]
Return type:

ndarray

17.1.1.25.19. pysisyphus.wavefunction.pop_analysis module

class pysisyphus.wavefunction.pop_analysis.PopAnalysis(pop_a, pop_b, nuc_charges)[source]

Bases: object

property alpha_spin_pop
property beta_spin_pop
property charges
nuc_charges: ndarray
pop_a: ndarray
pop_b: ndarray
property spin_pop
property tot_charge
pysisyphus.wavefunction.pop_analysis.iao_charges(P, nuc_charges, ao_centers)[source]
Return type:

PopAnalysis

pysisyphus.wavefunction.pop_analysis.make_iaos(C_occ, S_org, S_minao, S_cross)[source]

Intrinsic atomic orbitals.

[1] https://doi.org/10.1021/ct400687b

Return type:

ndarray

pysisyphus.wavefunction.pop_analysis.mulliken_charges(P, S, nuc_charges, ao_centers)[source]
Return type:

PopAnalysis

17.1.1.25.20. pysisyphus.wavefunction.shells module

class pysisyphus.wavefunction.shells.AOMixShells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: Shells

cart_order = (('',), ('x', 'y', 'z'), ('xx', 'yy', 'zz', 'xy', 'xz', 'yz'), ('xxx', 'yyy', 'zzz', 'xyy', 'xxy', 'xxz', 'xzz', 'yzz', 'yyz', 'xyz'), ('zzzz', 'yzzz', 'yyzz', 'yyyz', 'yyyy', 'xzzz', 'xyzz', 'xyyz', 'xyyy', 'xxzz', 'xxyz', 'xxyy', 'xxxz', 'xxxy', 'xxxx'))
class pysisyphus.wavefunction.shells.FCHKShells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: Shells

cart_order = (('',), ('x', 'y', 'z'), ('xx', 'yy', 'zz', 'xy', 'xz', 'yz'), ('xxx', 'yyy', 'zzz', 'xyy', 'xxy', 'xxz', 'xzz', 'yzz', 'yyz', 'xyz'), ('zzzz', 'yzzz', 'yyzz', 'yyyz', 'yyyy', 'xzzz', 'xyzz', 'xyyz', 'xyyy', 'xxzz', 'xxyz', 'xxyy', 'xxxz', 'xxxy', 'xxxx'))
sph_Ps = {0: [[1]], 1: [[1, 0, 0], [0, 0, 1], [0, 1, 0]], 2: [[0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 1, 0], [1, 0, 0, 0, 0], [0, 0, 0, 0, 1]], 3: [[0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1]], 4: [[0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1]]}
class pysisyphus.wavefunction.shells.IntegralBackend(value)

Bases: Enum

An enumeration.

NUMBA = 2
NUMBA_MULTIPOLE = 3
PYTHON = 1
class pysisyphus.wavefunction.shells.MoldenShells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: Shells

cart_order = (('',), ('x', 'y', 'z'), ('xx', 'yy', 'zz', 'xy', 'xz', 'yz'), ('xxx', 'yyy', 'zzz', 'xyy', 'xxy', 'xxz', 'xzz', 'yzz', 'yyz', 'xyz'), ('xxxx', 'yyyy', 'zzzz', 'xxxy', 'xxxz', 'yyyx', 'yyyz', 'zzzx', 'zzzy', 'xxyy', 'xxzz', 'yyzz', 'xxyz', 'yyxz', 'zzxy'))
sph_Ps = {0: [[1]], 1: [[1, 0, 0], [0, 0, 1], [0, 1, 0]], 2: [[0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 1, 0], [1, 0, 0, 0, 0], [0, 0, 0, 0, 1]], 3: [[0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1]], 4: [[0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1]]}
class pysisyphus.wavefunction.shells.ORCAMoldenShells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: Shells

sph_Ps = {0: [[1]], 1: [[1, 0, 0], [0, 0, 1], [0, 1, 0]], 2: [[0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 1, 0], [1, 0, 0, 0, 0], [0, 0, 0, 0, 1]], 3: [[0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0], [-1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -1]], 4: [[0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1]]}
class pysisyphus.wavefunction.shells.ORCAShells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: Shells

sph_Ps = {0: [[1]], 1: [[0, 1, 0], [1, 0, 0], [0, 0, 1]], 2: [[0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [0, 0, 0, 1, 0], [1, 0, 0, 0, 0], [0, 0, 0, 0, 1]], 3: [[0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0], [-1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -1]], 4: [[0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1]]}
class pysisyphus.wavefunction.shells.Shell(L, center, coeffs, exps, center_ind, atomic_num=None, shell_index=None, index=None, sph_index=None)[source]

Bases: object

as_tuple()[source]
property cart_powers
property cart_size

Number of cartesian basis functions in the shell.

property contr_depth
exps_coeffs_iter()[source]
property index: int
property shell_index: int
property size

Number of cartesian basis functions in the shell.

property sph_size

Number of cartesian basis functions in the shell.

property sph_slice
to_pyscf_shell()[source]
to_sap_shell()[source]

Fix contraction coefficients, for use in SAP-initial guess calculation.

See [1].

class pysisyphus.wavefunction.shells.Shells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: object

property P_cart

Permutation matrix for Cartesian basis functions.

property P_cart_native
property P_sph

Permutation matrix for spherical basis functions.

property P_sph_native
property S_cart
property S_sph
property T_cart
property T_sph
property V_cart
property V_sph
as_arrays(fortran=False)[source]

Similar to the approach in libcint.

as_gau_gbs()[source]
Return type:

str

as_numba_shells()[source]
as_numba_shellstructs()[source]
as_tuple()[source]
property atoms_coords3d
backend_module

'native' refers to the original ordering, as used in the QC program. The ordering will be reflected in the MO coefficient ordering. With 'native' the integrals calculated by pysisyphus must be reorderd, to match the native ordering of the MO coefficients.

property cart2sph_coeffs
property cart_ao_centers
property cart_bf_num
property cart_size

Number of cartesian basis functions.

center_shell_iter()[source]
dump_to_h5_group(h5_handle, group_name)[source]
eval(xyz, spherical=True)[source]

Evaluate all basis functions at points xyz using generated code.

A possibly more efficient approach is discussed in III C of https://doi.org/10.1063/1.469408.

fragment_ao_map(fragments)[source]
static from_aomix(inp, *args, **kwargs)
from_basis(name, shells_cls=None, **kwargs)[source]
static from_fchk(inp, *args, **kwargs)
static from_orca_json(inp, *args, **kwargs)
static from_pyscf_mol(mol, **kwargs)[source]
classmethod from_shells(other, **kwargs)[source]
static from_sympleints_arrays(shell_data, centers, coefficients, exponents, **kwargs)[source]
static from_sympleints_h5(h5_fn, group_name='shells', **kwargs)[source]
get_1el_ints_cart(key, other=None, can_reorder=True, screen_func=None, **kwargs)[source]
get_1el_ints_sph(key=None, int_matrix=None, other=None, **kwargs)[source]
Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

get_2c2el_ints_cart()[source]
get_2c2el_ints_sph()[source]
get_3c2el_ints_cart(shells_aux)[source]
get_3c2el_ints_sph(shells_aux)[source]
get_S_cart(other=None)[source]
Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

get_S_sph(other=None)[source]
Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

get_T_cart()[source]
Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

get_T_sph()[source]
Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

get_V_cart(coords3d=None, charges=None, **kwargs)[source]

Nuclear attraction integrals.

Coordinates and charges must be either be omitted or given together. Alternatively, this function could also take one array that combines coords3c and charges (not yet implemented).

get_V_sph(coords3d=None, charges=None)[source]
Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

get_diag_quadrupole_ints_cart(origin)[source]
get_diag_quadrupole_ints_sph(origin)[source]
get_dipole_ints_cart(origin)[source]
get_dipole_ints_sph(origin)[source]
Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

get_quadrupole_ints_cart(origin)[source]
get_quadrupole_ints_sph(origin)[source]
Return type:

ndarray[Any, dtype[TypeVar(_ScalarType_co, bound= generic, covariant=True)]]

property l_max
property nprims
property numba_shells
property numba_shellstructs
print_shells()[source]
static screen_S(a, b, R, k=10)[source]

Returns False when distance R is below calculated threshold. Derived from the sympy code below.

from sympy import *

a, b, S, R = symbols("a b S R", real=True, positive=True) k = symbols("k", integer=True, positive=True) apb = a + b # 0 = S - 10**(-k) ovlp = (pi / apb)**Rational(3,2) * exp(-a*b / apb * R**2) - 10**(-k) print("ss-overlap:", ovlp) # Distance R, when ss-overlaps drops below 10**(-k) R = solve(ovlp, R)[0] print("R:", R)

Parameters:
  • a -- Minimum exponent in shell a.

  • b -- Minimum exponent in shell b.

  • R -- Real space distance of shells a and b.

sph_Ps = {0: array([[1.]]), 1: array([[1., 0., 0.],        [0., 1., 0.],        [0., 0., 1.]]), 2: array([[1., 0., 0., 0., 0.],        [0., 1., 0., 0., 0.],        [0., 0., 1., 0., 0.],        [0., 0., 0., 1., 0.],        [0., 0., 0., 0., 1.]]), 3: array([[1., 0., 0., 0., 0., 0., 0.],        [0., 1., 0., 0., 0., 0., 0.],        [0., 0., 1., 0., 0., 0., 0.],        [0., 0., 0., 1., 0., 0., 0.],        [0., 0., 0., 0., 1., 0., 0.],        [0., 0., 0., 0., 0., 1., 0.],        [0., 0., 0., 0., 0., 0., 1.]]), 4: array([[1., 0., 0., 0., 0., 0., 0., 0., 0.],        [0., 1., 0., 0., 0., 0., 0., 0., 0.],        [0., 0., 1., 0., 0., 0., 0., 0., 0.],        [0., 0., 0., 1., 0., 0., 0., 0., 0.],        [0., 0., 0., 0., 1., 0., 0., 0., 0.],        [0., 0., 0., 0., 0., 1., 0., 0., 0.],        [0., 0., 0., 0., 0., 0., 1., 0., 0.],        [0., 0., 0., 0., 0., 0., 0., 1., 0.],        [0., 0., 0., 0., 0., 0., 0., 0., 1.]]), 5: array([[1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.],        [0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.],        [0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0.],        [0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0.],        [0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.],        [0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.],        [0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.],        [0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0.],        [0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0.],        [0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0.],        [0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.]])}
property sph_ao_centers
property sph_size

Number of spherical basis.

to_pyscf_mol(charge=0, mult=1)[source]
to_ris_shells(theta=0.2)[source]
to_sap_shells()[source]
to_sympleints_arrays()[source]

17.1.1.25.21. pysisyphus.wavefunction.shells_molcas module

class pysisyphus.wavefunction.shells_molcas.MolcasShells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: Shells

Override some properties to accomodate the insane basis function ordering in OpenMolcas.

property P_sph

Permutation matrix for mixed spherical/Cartesian basis functions.

Cartesian p-functions are assumed! Molcas stores the basis functions not per shell, but (more or less) per center and angular momentum. So for a given center the order would be something like this 1s, 2s, 3s, 1px, 2px, 1py, 2py, 1pz, 2pz, etc.

property cart2sph_coeffs

Cartesian-to-spherical coefficients w/ Cartesian p-Orbitals.

pysisyphus.wavefunction.shells_molcas.bf_ind_key(bf_ind)[source]

Key function to sort OpenMolcas basis functions.

pysisyphus.wavefunction.shells_molcas.get_molcas_P_sph(shells, nbfs)[source]

17.1.1.25.22. pysisyphus.wavefunction.shells_pyscf module

class pysisyphus.wavefunction.shells_pyscf.PySCFShells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: Shells

Cartesian bfs >= d angular momentum are not normalized! S_ref = mol.intor("int1e_ovlp_cart") N = 1 / np.diag(S_ref)**0.5 ao *= N

property P_cart

Permutation matrix for Cartesian basis functions.

property P_sph

Permutation matrix for Spherical basis functions.

cart_Ps = {0: array([[1]]), 1: array([[1, 0, 0],        [0, 1, 0],        [0, 0, 1]]), 2: array([[1, 0, 0, 0, 0, 0],        [0, 1, 0, 0, 0, 0],        [0, 0, 1, 0, 0, 0],        [0, 0, 0, 1, 0, 0],        [0, 0, 0, 0, 1, 0],        [0, 0, 0, 0, 0, 1]]), 3: array([[1, 0, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 1, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 1, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 1, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 1, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 1, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 1, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 1, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 1, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 0, 1]]), 4: array([[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0],        [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]])}
sph_Ps = {0: [[1]], 1: [[1, 0, 0], [0, 0, 1], [0, 1, 0]], 2: [[0, 0, 0, 0, 1], [0, 0, 0, 1, 0], [0, 0, 1, 0, 0], [0, 1, 0, 0, 0], [1, 0, 0, 0, 0]], 3: [[0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 1, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0]], 4: [[0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0]]}
pysisyphus.wavefunction.shells_pyscf.get_pyscf_P(shells, cartesian=True)[source]

Get Cartesian/spherical Pyscf-permutation matrix P.

--- PySCF ---> | |

pysis P

v

Parameters:

shells (Shells) -- Pysisyphus Shells object.

Returns:

Permutation matrix. PySCF-order will be along columns, pysisyphus-order along the rows.

Return type:

P.T

pysisyphus.wavefunction.shells_pyscf.pyscf_cart_order(l)[source]

17.1.1.25.23. pysisyphus.wavefunction.shells_trexio module

class pysisyphus.wavefunction.shells_trexio.TrexIOShells(shells, screen=False, ordering='native', backend=IntegralBackend.NUMBA_MULTIPOLE)[source]

Bases: Shells

cart_order = (('',), ('x', 'y', 'z'), ('xx', 'xy', 'xz', 'yy', 'yz', 'zz'), ('xxx', 'xxy', 'xxz', 'xyy', 'xyz', 'xzz', 'yyy', 'yyz', 'yzz', 'zzz'), ('xxxx', 'xxxy', 'xxxz', 'xxyy', 'xxyz', 'xxzz', 'xyyy', 'xyyz', 'xyzz', 'xzzz', 'yyyy', 'yyyz', 'yyzz', 'yzzz', 'zzzz'))
sph_Ps = {0: [[1]], 1: [[1, 0, 0], [0, 0, 1], [0, 1, 0]], 2: [[0, 0, 1, 0, 0], [0, 0, 0, 1, 0], [0, 1, 0, 0, 0], [0, 0, 0, 0, 1], [1, 0, 0, 0, 0]], 3: [[0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0]], 4: [[0, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 0, 0, 0, 0, 0, 0, 0]]}

17.1.1.25.24. pysisyphus.wavefunction.so_coupling module

pysisyphus.wavefunction.so_coupling.Q(l)[source]

Maximum number of accumulated electrons for given angular momentum.

See A006331 in the On-Line Encyclopedia of Integer Sequences.

Return type:

int

pysisyphus.wavefunction.so_coupling.boettger_factors2d(Ls, Zs, bf_type)[source]

Boettger-factors to scale 1-electron SOC-integrals.

See eq. (18) in [4].

Return type:

ndarray

pysisyphus.wavefunction.so_coupling.get_cart_norms(mol)[source]

Get normalization matrix to ensure self-overlaps of 1.0.

In PySCF not all Cartesian basis functions have a self-overlap of 1.0. This can be fixed by this matrix.

Parameters:

mol (gto.Mole) -- pyscf.gto.Mole object.

Returns:

2d matrix of shape (nao, nao) containing normalization factors for 2-center integrals over Cartesian basis functions.

Return type:

NN

pysisyphus.wavefunction.so_coupling.get_effective_charge(atomic_num)[source]

Effective charge for SOC calculations as described in [1].

3d and 4d effective charges are disabled until I figure they are only useful for calculation w/ ECPs or w/o them ... this should be described in [2].

17.1.1.25. Parameter

atomic_num

Atomic number, positive integer.

returns:

Effective charge.

rtype:

Zeff

pysisyphus.wavefunction.so_coupling.get_original_charge(atomic_num)[source]
Return type:

float

pysisyphus.wavefunction.so_coupling.get_soc_oscs(exc_ens, soc_tdms)[source]
pysisyphus.wavefunction.so_coupling.get_soc_states(socs, sing_ens, trip_ens)[source]
pysisyphus.wavefunction.so_coupling.get_soc_tdms(wf, v, socs, XpYs)[source]
pysisyphus.wavefunction.so_coupling.report_singlet_trans_moms(w, sing_oscs, sing_tdms)[source]
pysisyphus.wavefunction.so_coupling.report_so_couplings(socs)[source]
pysisyphus.wavefunction.so_coupling.report_so_states(w, v, nsings, thresh=0.01)[source]
pysisyphus.wavefunction.so_coupling.report_so_trans_moms(w, soc_oscs, soc_tdms)[source]
pysisyphus.wavefunction.so_coupling.root_spin_ms_from_row(row, nsings)[source]
pysisyphus.wavefunction.so_coupling.run(wf, Xas, Yas, Xat, Yat, sing_ens, trip_ens, pysoc_norm=True, **kwargs)[source]
pysisyphus.wavefunction.so_coupling.singlet_triplet_so_couplings(C, ints_ao, XpYs, XpYt)[source]

Singlet-triplet spin-orbit couplings from LR-TDDFT.

As described in [3].

Parameters:
  • C (ndarray) -- MO-coefficients, 2d array with shape (nao, nmo).

  • ints_ao (ndarray) -- Spin-orbit integrals in AO basis with shape (3, nao, nao).

  • XpYs (ndarray) -- X and Y vectors for singlet-singlet exictations from TD-DFT. 3d array with shape (nsings, nocc, nvirt).

  • XpYs -- X and Y vectors for singlet-triplet exictations from TD-DFT. 3d array with shape (ntrips, nocc, nvirt).

Returns:

2d array with shape ((nsings + 1) * ntrips, 3) containing the spin-orbit couplings in atomic units.

Return type:

socs

17.1.1.25.25. pysisyphus.wavefunction.solid_harmonics module

pysisyphus.wavefunction.solid_harmonics.Am(m, x, y)[source]
pysisyphus.wavefunction.solid_harmonics.Bm(m, x, y)[source]
pysisyphus.wavefunction.solid_harmonics.C(l, m, x, y, z)[source]
pysisyphus.wavefunction.solid_harmonics.Rlm(l, m, x, y, z)[source]

Real regular solid harmonics w/ Cartesian arguments.

pysisyphus.wavefunction.solid_harmonics.S(l, m, x, y, z)[source]
pysisyphus.wavefunction.solid_harmonics.gamma(l, m, k)[source]
pysisyphus.wavefunction.solid_harmonics.zpart(l, m, x, y, z)[source]

17.1.1.25.26. pysisyphus.wavefunction.wavefunction module

class pysisyphus.wavefunction.wavefunction.DensityType(value)

Bases: Enum

An enumeration.

RELAXED = 2
UNRELAXED = 1
class pysisyphus.wavefunction.wavefunction.Wavefunction(atoms, coords, charge, mult, unrestricted, occ, C, bf_type, shells=None, ecp_electrons=None, mo_ens=None, strict=True, warn_charge=4)[source]

Bases: object

property C_occ
property C_virt
property P
P_exc(trans_dens, transform_ao=True)[source]

Eqs. (2.25) and (2.26) in [1].

property P_tot
property S
S_MO_with(other)[source]
property S_from_C

Reconstructed overlap-matrix from 1 = C.T @ S @ C.

It will have the same BFType as the underlying orbitals!

S_with(other)[source]
S_with_shells(other_shells)[source]
property ao_center_map: Dict[int, List[int]]
property ao_centers: List[int]
property atom_num
check_sanity()[source]
property coords3d
current_density(key)[source]
property densities
dipole_ints(origin=None, kind='coc')[source]
Return type:

ndarray[Any, dtype[float]]

property dipole_moment: ndarray[Any, dtype[float]]
eval_density(coords3d, P=None)[source]
eval_esp(coords3d, with_nuc=True)[source]
static from_aomix(inp, *args, **kwargs)
static from_fchk(inp, *args, **kwargs)
static from_file(fn, **kwargs)[source]
static from_molden(inp, *args, **kwargs)
static from_orca_bson(inp, *args, **kwargs)
static from_orca_json(inp, *args, **kwargs)
static from_orca_molden(inp, *args, **kwargs)
static from_trexio(fn, **kwargs)[source]
get_V(coords3d, charges)[source]
get_current_density()[source]
get_current_total_density()[source]
get_dipole_moment(P=None, origin=None, kind='coc')[source]
Return type:

ndarray[Any, dtype[float]]

get_origin(kind='coc')[source]
get_permut_matrix()[source]
get_permut_matrix_native()[source]
get_quadrupole_moment(P=None, origin=None, kind='coc')[source]
Return type:

ndarray[Any, dtype[float]]

get_relaxed_density(root)[source]
get_total_relaxed_density(root)[source]
get_transition_dipole_moment(*args, **kwargs)[source]
get_transition_multipole_moment(order, T_a, T_b=None, origin=None, kind='coc', full=False)[source]
Return type:

ndarray[Any, dtype[float]]

get_transition_quadrupole_moment(*args, **kwargs)[source]
property has_shells
property is_cartesian: bool
property masses
property mo_num
property nuc_charges
oscillator_strength(exc_ens, trans_moms)[source]

Oscillator strength from TDMs and excitation energies.

Return type:

ndarray[Any, dtype[float]]

quadrupole_ints(origin=None, kind='coc')[source]
Return type:

ndarray[Any, dtype[float]]

property quadrupole_moment: ndarray[Any, dtype[float]]
set_current_density(key)[source]
set_relaxed_density(root, density)[source]
to_trexio(fn, **kwargs)[source]

17.1.1.25.27. Module contents