qrunch.chemistry.calculators.pair_configuration_interaction_calculator

Ground state energy calculator using Pair Full CI.

The Pair Full Configuration Interaction (pFCI) is a version of the full configuration interaction (FCI) where only pair excitations are included in the calculation. The Orbital Optimized Pair Full Configuration Interaction (oo-pFCI) is the orbital optimized version.

Module Attributes

DEFAULT_CI_BASIN_HOPPING_OPTIONS

The default options for basin hopping (inactive by default).

DEFAULT_OPTIONS

The default options for the Orbital Optimizer minimizer.

Functions

build_pair_bit_string_integers(...)

Generate all pair excitation bitstrings from the electronic configuration.

generate_pair_excitations(reference, ...)

Generate all pair excitation bitstrings.

log_scipy_result(result)

Log details from scipy OptimizeResult in a readable format.

Classes

ConfigurationInteractionBasinHoppingOptions

Options for SciPy basinhopping global optimization.

OrbitalOptimizedPairConfigurationInteractionGroundStateCalculator

Class for performing orbital-optimized pair full configuration interaction calculations.

OrbitalOptimizerOptions

The default options for SciPy minimizer.

PairConfigurationInteractionGroundStateCalculator

Class for performing pair full configuration interaction calculations.

class ConfigurationInteractionBasinHoppingOptions

Bases: DataclassPublicAPI

Options for SciPy basinhopping global optimization.

All fields are immutable (frozen=True) so an instance can be safely reused.

Parameters:
  • number_of_macro_iterations – How many basin hopping steps to perform. (default=3)

  • temperature – Controls accept probability for worse solutions. (default=0.01)

  • stepsize – Size of random displacement. (default=0.05)

  • number_of_successive_failures – Stop if no improvement after this many steps. (default=4)

  • seed – RNG seed for reproducibility. (default=None)

  • display – Verbosity. (default=True)

  • active – Activate Basin Hopping. (default=True)

__init__(*, number_of_macro_iterations: int = 3, temperature: float = 0.01, stepsize: float = 0.05, number_of_successive_failures: int = 4, seed: int | None = None, display: bool = True, active: bool = True) None
Parameters:
  • number_of_macro_iterations (int)

  • temperature (float)

  • stepsize (float)

  • number_of_successive_failures (int)

  • seed (int | None)

  • display (bool)

  • active (bool)

Return type:

None

active: bool = True
display: bool = True
number_of_macro_iterations: int = 3
number_of_successive_failures: int = 4
seed: int | None = None
stepsize: float = 0.05
temperature: float = 0.01
DEFAULT_CI_BASIN_HOPPING_OPTIONS = ConfigurationInteractionBasinHoppingOptions(number_of_macro_iterations=3, temperature=0.01, stepsize=0.05, number_of_successive_failures=4, seed=None, display=True, active=True)

The default options for basin hopping (inactive by default).

DEFAULT_OPTIONS = OrbitalOptimizerOptions(relative_error_tolerance=1e-06, max_iterations_per_parameter=20000, jacobian_step_size=1e-08, display=True)

The default options for the Orbital Optimizer minimizer.

class OrbitalOptimizedPairConfigurationInteractionGroundStateCalculator

Bases: object

Class for performing orbital-optimized pair full configuration interaction calculations.

__init__(options: OrbitalOptimizerOptions | None = None, basin_hopping_options: ConfigurationInteractionBasinHoppingOptions | None = None) None

Initialize an instance of OrbitalOptimizedPairConfigurationInteractionGroundStateCalculator.

Parameters:
Return type:

None

calculate(problem: GeneralRestrictedGroundStateProblem) GroundStateProblemCalculatorResult
calculate(problem: RestrictedReactionPathProblem) ReactionPathProblemCalculatorResult

Solve the orbital-optimized pair configuration interaction (pCI) calculation.

Only pair excitations are included in the calculation. Note that the problem may restrict the orbital space, in which case this is a paired CASCI calculation in the provided orbital space, whose inactive energy contribution is included in the problem.

The Hamiltonian for all geometries is assumed to be real.

Parameters:

problem (RestrictedGroundStateProblem | LazyRestrictedGroundStateProblem | RestrictedReactionPathProblem) – The problem to calculate the ground state energy / energies for.

Return type:

GroundStateProblemCalculatorResult | ReactionPathProblemCalculatorResult

class OrbitalOptimizerOptions

Bases: DataclassPublicAPI

The default options for SciPy minimizer.

All fields are immutable (frozen=True) so an instance can be safely reused.

Parameters:
  • relative_error_tolerance – Convergence tolerance. (default=1.0e-6)

  • max_iterations_per_parameter – Maximum number of iterations per parameter. (default=20000)

  • jacobian_step_size – Jacobian step size. (default=1e-8)

  • display – Whether to display optimization progress. (default=True)

__init__(*, relative_error_tolerance: float = 1e-06, max_iterations_per_parameter: int = 20000, jacobian_step_size: float = 1e-08, display: bool = True) None
Parameters:
  • relative_error_tolerance (float)

  • max_iterations_per_parameter (int)

  • jacobian_step_size (float)

  • display (bool)

Return type:

None

display: bool = True
jacobian_step_size: float = 1e-08
max_iterations_per_parameter: int = 20000
relative_error_tolerance: float = 1e-06
class PairConfigurationInteractionGroundStateCalculator

Bases: object

Class for performing pair full configuration interaction calculations.

__init__() None

Initialize an instance of PairConfigurationInteractionGroundStateCalculator.

Return type:

None

calculate(problem: GeneralRestrictedGroundStateProblem) GroundStateProblemCalculatorResult
calculate(problem: RestrictedReactionPathProblem) ReactionPathProblemCalculatorResult

Solve the pair full configuration interaction (pFCI) calculation.

Only pair excitations are included in the calculation. Note that the problem may restrict the orbital space, in which case this is a paired CASCI calculation in the provided orbital space, whose inactive energy contribution is included in the problem.

The Hamiltonian for all geometries is assumed to be real.

Parameters:

problem (RestrictedGroundStateProblem | LazyRestrictedGroundStateProblem | RestrictedReactionPathProblem) – The problem to calculate the ground state energy / energies for.

Return type:

GroundStateProblemCalculatorResult | ReactionPathProblemCalculatorResult

build_pair_bit_string_integers(electronic_configuration: MolecularElectronConfiguration) list[int]

Generate all pair excitation bitstrings from the electronic configuration.

Parameters:

electronic_configuration (MolecularElectronConfiguration) – The electronic configuration.

Return type:

list[int]

generate_pair_excitations(reference: int, total_length: int) list[int]

Generate all pair excitation bitstrings.

The pair excitation bitstrings are generated as integers from the reference integer provided. It should represent a binary string composed of two identical halves.

Parameters:
  • reference (int) – Reference bitstring as integer.

  • total_length (int) – Total bit length of the binary string; must be even.

Return type:

list[int]

log_scipy_result(result: OptimizeResult) None

Log details from scipy OptimizeResult in a readable format.

Parameters:

result (OptimizeResult) – The scipy OptimizeResult.

Return type:

None