pymolresponse.tests package

Submodules

pymolresponse.tests.test_ao2mo module

Test two-electron integral MO transformation interfaces.

pymolresponse.tests.test_ao2mo.test_ao2mo_hand_against_pyscf_rhf_full() None[source]

Compare the unoptimized MO transformation with PySCF.

All orbitals are present in the transformation (“full”).

pymolresponse.tests.test_ao2mo.test_ao2mo_hand_against_pyscf_rhf_partial() None[source]

Compare the unoptimized MO transformation with PySCF.

Only those orbitals needed for the response calculation are present (“partial”).

pymolresponse.tests.test_calculators module

Response term calculators using reference data from disk.

pymolresponse.tests.test_calculators.calculate_disk_rhf(testcasedir: Path, hamiltonian: str, spin: str, frequency: str, label_1: str, label_2: str) float[source]

Calculate a single linear response term from a test case directory.

pymolresponse.tests.test_calculators.calculate_disk_uhf(testcasedir: Path, hamiltonian: str, spin: str, frequency: str, label_1: str, label_2: str) float[source]

Calculate a single linear response term from a test case directory.

pymolresponse.tests.test_calculators.calculate_rhf(dalton_tmpdir: Path, hamiltonian: str, spin: str, operator_label: str, operator: str, source_moenergies: str, source_mocoeffs: str, source_operator: str) float[source]

Calculate a single linear response term from a DALTON scratch directory.

This uses PySCF to compute two-electron integrals.

pymolresponse.tests.test_calculators.calculate_uhf(dalton_tmpdir: Path, hamiltonian: str, spin: str, operator_label: str, operator: str, source_moenergies: str, source_mocoeffs: str, source_operator: str) float[source]

Calculate a single linear response term from a DALTON scratch directory.

This uses PySCF to compute two-electron integrals.

pymolresponse.tests.test_final_result module

Tests against reference values using inputs from disk..

pymolresponse.tests.test_final_result.test_as_many_as_possible_rhf_disk() None[source]

Test correctness of the final result for closed-shell molecules against DALTON references.

pymolresponse.tests.test_final_result.test_as_many_as_possible_uhf_disk() None[source]

Test correctness of the final result for open-shell (UHF) molecules against DALTON (ROHF) references.

pymolresponse.tests.test_final_result.test_final_result_rhf_h2o_sto3g_rpa_singlet() None[source]

Test correctness of the final result for water/STO-3G with full RPA for singlet response induced by the dipole length operator (the electric polarizability) computed with quantities from disk.

pymolresponse.tests.test_final_result.test_final_result_rhf_h2o_sto3g_rpa_triplet() None[source]

Test correctness of the final result for water/STO-3G with full RPA for triplet response induced by the dipole length operator computed with quantities from disk.

pymolresponse.tests.test_final_result.test_final_result_rhf_h2o_sto3g_tda_singlet() None[source]

Test correctness of the final result for water/STO-3G with the TDA approximation/CIS for singlet response induced by the dipole length operator computed with quantities from disk.

pymolresponse.tests.test_final_result.test_final_result_rhf_h2o_sto3g_tda_triplet() None[source]

Test correctness of the final result for water/STO-3G with the TDA approximation/CIS for triplet response induced by the dipole length operator computed with quantities from disk.

pymolresponse.tests.test_hydrogen module

pymolresponse.tests.test_molecular_property module

pymolresponse.tests.test_operators module

Basic tests for Operators.

pymolresponse.tests.test_operators.test_dalton_label_to_operator() None[source]

Test that Operator metadata is generated from DALTON labels.

pymolresponse.tests.test_rhf module

Hard-coded response equations for restricted wavefunctions.

Tests here are a complete implementation of the linear response equations from molecular orbital coefficients and energies and property integrals computed on the fly. The only reused functionality from the production implementations is

  1. forming the two-electron integrals in the MO basis and

  2. forming the blocks of the orbital Hessian

pymolresponse.tests.test_rhf.test_explicit_rhf_outside_solver_off_diagonal_blocks() None[source]

Run hard-coded response equations for an RHF reference.

pymolresponse.tests.test_runners module

Run response term calculators over all references for a test case.

pymolresponse.tests.test_runners.run_as_many_tests_as_possible_rhf_disk(testcase: Path | str) None[source]

Execute all comparisons against DALTON disk references for a test case.

pymolresponse.tests.test_runners.run_as_many_tests_as_possible_uhf_disk(testcase: Path | str) None[source]

Execute all comparisons against DALTON disk references for a test case.

pymolresponse.tests.test_runners.run_dalton_label_to_operator(dalton_label: str, operator_label: str, slice_idx: int, is_imaginary: bool, is_spin_dependent: bool) Operator[source]

Convert a DALTON integral label to an Operator.

pymolresponse.tests.test_solvers module

Tests for solvers, used by drivers to compute orbital Hessian eigenvectors or response vectors.

pymolresponse.tests.test_solvers.test_final_result_rhf_h2o_sto3g_rpa_singlet_iter() None[source]

Test that an iterative solver gives the same results as performing exact inversion.

pymolresponse.tests.test_solvers.test_inversion() None[source]

Test that each kind of inversion function gives identical results.

pymolresponse.tests.test_td module

Core tests for excitation energies.

pymolresponse.tests.test_td.test_HF_both_singlet_HF_STO3G() None[source]

Compare singlet TDA and RPA excitation energies for RHF.

pymolresponse.tests.test_uhf module

Hard-coded response equations for unrestricted wavefunctions.

Tests here are a complete implementation of the linear response equations from molecular orbital coefficients and energies and property integrals computed on the fly. The only reused functionality from the production implementations is

  1. forming the two-electron integrals in the MO basis and

  2. forming the blocks of the orbital Hessian

pymolresponse.tests.test_uhf.test_api_uhf() None[source]

Run linear response (static polarizability) through for a UHF reference.

The only difference between this and a production calculation is that it doesn’t use the Polarizability wrapper.

pymolresponse.tests.test_uhf.test_explicit_uhf_from_rhf_outside_solver() None[source]

Run hard-coded response equations for an RHF reference using the UHF equations.

pymolresponse.tests.test_uhf.test_explicit_uhf_outside_solver() None[source]

Run hard-coded response equations for a UHF reference.

pymolresponse.tests.test_uhf_partial_mo_trafo module

Hard-coded response equations for unrestricted wavefunctions.

The difference between this file and test_uhf.py is here only the necessary subspaces of the MO-basis two-electron integrals are formed, and in test_uhf.py the entire orbital space is formed.

pymolresponse.tests.test_uhf_partial_mo_trafo.test_api_uhf() None[source]

Run linear response (static polarizability) for a UHF reference.

The only differences between this and a production calculation are that it doesn’t use the Polarizability wrapper and the two-electron integral MO transformations are done manually.

pymolresponse.tests.test_uhf_partial_mo_trafo.test_explicit_uhf_outside_solver() None[source]

Run hard-coded response equations for a UHF reference.

pymolresponse.tests.test_uncoupled module

Tests for uncoupled (initial guess) results.

The module also has tests against coupled (full) results, which were convenient to generate calculations for.

pymolresponse.tests.test_uncoupled.mol_atom(symbol: str = 'He', charge: int = 0, spin: int = 0, basis: str = 'sto-3g', verbose: int = 0) Mole[source]

Create a pyscf.gto.Mole instance for a single atom.

pymolresponse.tests.test_uncoupled.test_uncoupled_rhf() None[source]

Test uncoupled results from a restricted wavefunction against references.

pymolresponse.tests.test_uncoupled.test_uncoupled_uhf() None[source]

Test uncoupled results from an unrestricted wavefunction against references.

pymolresponse.tests.test_utils module

Tests for functions in pymolresponse.utils.

pymolresponse.tests.test_utils.test_splitter_default() None[source]

Does the splitter remove empty fields by default properly?

pymolresponse.tests.test_utils.test_splitter_no_truncation() None[source]

Does the splitter return even the empty fields when asked?

Module contents