BE Kernel
Molecular BE kernel
- class molbe.mbe.BE(mf, fobj, eri_file='eri_file.h5', lo_method='lowdin', pop_method=None, compute_hf=True, restart=False, save=False, restart_file='storebe.pk', mo_energy=None, save_file='storebe.pk', hci_pt=False, nproc=1, ompnum=4, scratch_dir=None, hci_cutoff=0.001, ci_coeff_cutoff=None, select_cutoff=None, integral_direct_DF=False, auxbasis=None)
Class for handling bootstrap embedding (BE) calculations.
This class encapsulates the functionalities required for performing bootstrap embedding calculations, including setting up the BE environment, initializing fragments, performing SCF calculations, and evaluating energies.
- mf
PySCF mean-field object.
- Type:
pyscf.scf.SCF
- fobj
Fragment object containing sites, centers, edges, and indices.
- Type:
molbe.fragpart
- eri_file
Path to the file storing two-electron integrals.
- Type:
str
- lo_method
Method for orbital localization, default is ‘lowdin’.
- Type:
str
- __init__(mf, fobj, eri_file='eri_file.h5', lo_method='lowdin', pop_method=None, compute_hf=True, restart=False, save=False, restart_file='storebe.pk', mo_energy=None, save_file='storebe.pk', hci_pt=False, nproc=1, ompnum=4, scratch_dir=None, hci_cutoff=0.001, ci_coeff_cutoff=None, select_cutoff=None, integral_direct_DF=False, auxbasis=None)
Constructor for BE object.
- Parameters:
mf (pyscf.scf.SCF) – PySCF mean-field object.
fobj (molbe.fragpart) – Fragment object containing sites, centers, edges, and indices.
eri_file (str, optional) – Path to the file storing two-electron integrals, by default ‘eri_file.h5’.
lo_method (str, optional) – Method for orbital localization, by default ‘lowdin’.
compute_hf (bool, optional) – Whether to compute Hartree-Fock energy, by default True.
restart (bool, optional) – Whether to restart from a previous calculation, by default False.
save (bool, optional) – Whether to save intermediate objects for restart, by default False.
restart_file (str, optional) – Path to the file storing restart information, by default ‘storebe.pk’.
mo_energy (numpy.ndarray, optional) – Molecular orbital energies, by default None.
save_file (str, optional) – Path to the file storing save information, by default ‘storebe.pk’.
nproc (int, optional) – Number of processors for parallel calculations, by default 1. If set to >1, threaded parallel computation is invoked.
ompnum (int, optional) – Number of OpenMP threads, by default 4.
integral_direct_DF (bool, optional) – If mf._eri is None (i.e. ERIs are not saved in memory using incore_anyway), this flag is used to determine if the ERIs are computed integral-directly using density fitting; by default False.
auxbasis (str, optional) – Auxiliary basis for density fitting, by default None (uses default auxiliary basis defined in PySCF).
- compute_energy_full(approx_cumulant=False, use_full_rdm=False, return_rdm=True)
Compute the total energy using rdms in the full basis.
- Parameters:
approx_cumulant (bool, optional) – If True, use an approximate cumulant for the energy computation. Default is False.
use_full_rdm (bool, optional) – If True, use the full two-particle RDM for energy computation. Default is False.
return_rdm (bool, optional) – If True, return the computed reduced density matrices (RDMs). Default is True.
- Returns:
If return_rdm is True, returns a tuple containing the one-particle and two-particle reduced density matrices (RDM1 and RDM2). Otherwise, returns None.
- Return type:
tuple of numpy.ndarray or None
Notes
This function computes the total energy in the full basis, with options to use approximate or true cumulants, and to return the reduced density matrices (RDMs). The energy components are printed as part of the function’s output.
- initialize(eri_, compute_hf, restart=False)
Initialize the Bootstrap Embedding calculation.
- Parameters:
eri (numpy.ndarray) – Electron repulsion integrals.
compute_hf (bool) – Whether to compute Hartree-Fock energy.
restart (bool, optional) – Whether to restart from a previous calculation, by default False.
- localize(lo_method, mol=None, valence_basis='sto-3g', hstack=False, pop_method=None, init_guess=None, valence_only=False, nosave=False)
Molecular orbital localization
Performs molecular orbital localization computations. For large basis, IAO is recommended augmented with PAO orbitals.
- Parameters:
lo_method (str) – Localization method in quantum chemistry. ‘lowdin’, ‘boys’, and ‘iao’ are supported.
mol (pyscf.gto.Molecule) – pyscf.gto.Molecule object.
valence_basis (str) – Name of minimal basis set for IAO scheme. ‘sto-3g’ suffice for most cases.
valence_only (bool) – If this option is set to True, all calculation will be performed in the valence basis in the IAO partitioning. This is an experimental feature.
- oneshot(solver='MP2', nproc=1, ompnum=4, calc_frag_energy=False, clean_eri=False, scratch_dir=None, **solver_kwargs)
Perform a one-shot bootstrap embedding calculation.
- Parameters:
solver (str, optional) – High-level quantum chemistry method, by default ‘MP2’. ‘CCSD’, ‘FCI’, and variants of selected CI are supported.
nproc (int, optional) – Number of processors for parallel calculations, by default 1. If set to >1, threaded parallel computation is invoked.
ompnum (int, optional) – Number of OpenMP threads, by default 4.
calc_frag_energy (bool, optional) – Whether to calculate fragment energies, by default False.
clean_eri (bool, optional) – Whether to clean up ERI files after calculation, by default False.
- optimize(solver='MP2', method='QN', only_chem=False, conv_tol=1e-06, relax_density=False, use_cumulant=True, J0=None, nproc=1, ompnum=4, max_iter=500, scratch_dir=None, trust_region=False, **solver_kwargs)
BE optimization function
Interfaces BEOPT to perform bootstrap embedding optimization.
- Parameters:
solver (str, optional) – High-level solver for the fragment, by default ‘MP2’
method (str, optional) – Optimization method, by default ‘QN’
only_chem (bool, optional) – If true, density matching is not performed – only global chemical potential is optimized, by default False
conv_tol (_type_, optional) – Convergence tolerance, by default 1.e-6
relax_density (bool, optional) – Whether to use relaxed or unrelaxed densities, by default False This option is for using CCSD as solver. Relaxed density here uses Lambda amplitudes, whereas unrelaxed density only uses T amplitudes. c.f. See http://classic.chem.msu.su/cgi-bin/ceilidh.exe/gran/gamess/forum/?C34df668afbHW-7216-1405+00.htm for the distinction between the two
use_cumulant (bool, optional) – Use cumulant-based energy expression, by default True
max_iter (int, optional) – Maximum number of optimization steps, by default 500
nproc (int) – Total number of processors assigned for the optimization. Defaults to 1. When nproc > 1, Python multithreading is invoked.
ompnum (int) – If nproc > 1, ompnum sets the number of cores for OpenMP parallelization. Defaults to 4
J0 (list of list of float) – Initial Jacobian.
trust_region (bool, optional) – Use trust-region based QN optimization, by default False
- print_ini()
Print initialization banner for the MOLBE calculation.
- rdm1_fullbasis(return_ao=True, only_rdm1=False, only_rdm2=False, return_lo=False, return_RDM2=True, print_energy=False)
Compute the one-particle and two-particle reduced density matrices (RDM1 and RDM2).
Parameters:
- return_aobool, optional
Whether to return the RDMs in the AO basis. Default is True.
- only_rdm1bool, optional
Whether to compute only the RDM1. Default is False.
- only_rdm2bool, optional
Whether to compute only the RDM2. Default is False.
- return_lobool, optional
Whether to return the RDMs in the localized orbital (LO) basis. Default is False.
- return_RDM2bool, optional
Whether to return the two-particle RDM (RDM2). Default is True.
- print_energybool, optional
Whether to print the energy contributions. Default is False.
Returns:
- rdm1AOnumpy.ndarray
The one-particle RDM in the AO basis.
- rdm2AOnumpy.ndarray
The two-particle RDM in the AO basis (if return_RDM2 is True).
- rdm1LOnumpy.ndarray
The one-particle RDM in the LO basis (if return_lo is True).
- rdm2LOnumpy.ndarray
The two-particle RDM in the LO basis (if return_lo and return_RDM2 are True).
- rdm1MOnumpy.ndarray
The one-particle RDM in the molecular orbital (MO) basis (if return_ao is False).
- rdm2MOnumpy.ndarray
The two-particle RDM in the MO basis (if return_ao is False and return_RDM2 is True).
- read_heff(heff_file='bepotfile.h5')
Read the effective Hamiltonian from a file.
- Parameters:
heff_file (str, optional) – Path to the file storing effective Hamiltonian, by default ‘bepotfile.h5’.
- update_fock(heff=None)
Update the Fock matrix for each fragment with the effective Hamiltonian.
- Parameters:
heff (list of numpy.ndarray, optional) – List of effective Hamiltonian matrices for each fragment, by default None.
- write_heff(heff_file='bepotfile.h5')
Write the effective Hamiltonian to a file.
- Parameters:
heff_file (str, optional) – Path to the file to store effective Hamiltonian, by default ‘bepotfile.h5’.
- molbe.mbe.initialize_pot(Nfrag, edge_idx)
Initialize the potential array for bootstrap embedding.
This function initializes a potential array for a given number of fragments (Nfrag) and their corresponding edge indices (edge_idx). The potential array is initialized with zeros for each pair of edge site indices within each fragment, followed by an additional zero for the global chemical potential.
- Parameters:
Nfrag (int) – Number of fragments.
edge_idx (list of list of list of int) – List of edge indices for each fragment. Each element is a list of lists, where each sublist contains the indices of edge sites for a particular fragment.
- Returns:
Initialized potential array with zeros.
- Return type:
list of float
Periodic BE kernel
- class kbe.pbe.BE(mf, fobj, eri_file='eri_file.h5', lo_method='lowdin', compute_hf=True, restart=False, save=False, restart_file='storebe.pk', mo_energy=None, save_file='storebe.pk', hci_pt=False, nproc=1, ompnum=4, hci_cutoff=0.001, ci_coeff_cutoff=None, select_cutoff=None, iao_val_core=True, exxdiv='ewald', kpts=None, cderi=None, iao_wannier=False)
Class for handling periodic bootstrap embedding (BE) calculations.
This class encapsulates the functionalities required for performing periodic bootstrap embedding calculations, including setting up the BE environment, initializing fragments, performing SCF calculations, and evaluating energies.
- mf
PySCF mean-field object.
- Type:
pyscf.scf.SCF
- fobj
Fragment object containing sites, centers, edges, and indices.
- Type:
molbe.fragpart
- eri_file
Path to the file storing two-electron integrals.
- Type:
str
- lo_method
Method for orbital localization, default is ‘lowdin’.
- Type:
str
- __init__(mf, fobj, eri_file='eri_file.h5', lo_method='lowdin', compute_hf=True, restart=False, save=False, restart_file='storebe.pk', mo_energy=None, save_file='storebe.pk', hci_pt=False, nproc=1, ompnum=4, hci_cutoff=0.001, ci_coeff_cutoff=None, select_cutoff=None, iao_val_core=True, exxdiv='ewald', kpts=None, cderi=None, iao_wannier=False)
Constructor for BE object.
- Parameters:
mf (pyscf.pbc.scf.SCF) – PySCF periodic mean-field object.
fobj (kbe.fragpart) – Fragment object containing sites, centers, edges, and indices.
kpts (list of list of float) – k-points in the reciprocal space for periodic computation
eri_file (str, optional) – Path to the file storing two-electron integrals, by default ‘eri_file.h5’.
lo_method (str, optional) – Method for orbital localization, by default ‘lowdin’.
iao_wannier (bool, optional) – Whether to perform Wannier localization on the IAO space, by default False.
compute_hf (bool, optional) – Whether to compute Hartree-Fock energy, by default True.
restart (bool, optional) – Whether to restart from a previous calculation, by default False.
save (bool, optional) – Whether to save intermediate objects for restart, by default False.
restart_file (str, optional) – Path to the file storing restart information, by default ‘storebe.pk’.
mo_energy (numpy.ndarray, optional) – Molecular orbital energies, by default None.
save_file (str, optional) – Path to the file storing save information, by default ‘storebe.pk’.
nproc (int, optional) – Number of processors for parallel calculations, by default 1. If set to >1, threaded parallel computation is invoked.
ompnum (int, optional) – Number of OpenMP threads, by default 4.
- initialize(eri_, compute_hf, restart=False)
Initialize the Bootstrap Embedding calculation.
- Parameters:
eri (numpy.ndarray) – Electron repulsion integrals.
compute_hf (bool) – Whether to compute Hartree-Fock energy.
restart (bool, optional) – Whether to restart from a previous calculation, by default False.
- localize(lo_method, mol=None, valence_basis='sto-3g', iao_wannier=True, valence_only=False, iao_val_core=True)
Orbital localization
Performs orbital localization computations for periodic systems. For large basis, IAO is recommended augmented with PAO orbitals.
- Parameters:
lo_method (str) – Localization method in quantum chemistry. ‘lowdin’, ‘boys’,’iao’, and ‘wannier’ are supported.
mol (pyscf.gto.Molecule) – pyscf.gto.Molecule object.
valence_basis (str) – Name of minimal basis set for IAO scheme. ‘sto-3g’ suffice for most cases.
valence_only (bool) – If this option is set to True, all calculation will be performed in the valence basis in the IAO partitioning. This is an experimental feature.
iao_wannier (bool) – Whether to perform Wannier localization in the IAO space
- oneshot(solver='MP2', nproc=1, ompnum=4, calc_frag_energy=False, clean_eri=False)
Perform a one-shot bootstrap embedding calculation.
- Parameters:
solver (str, optional) – High-level quantum chemistry method, by default ‘MP2’. ‘CCSD’, ‘FCI’, and variants of selected CI are supported.
nproc (int, optional) – Number of processors for parallel calculations, by default 1. If set to >1, threaded parallel computation is invoked.
ompnum (int, optional) – Number of OpenMP threads, by default 4.
calc_frag_energy (bool, optional) – Whether to calculate fragment energies, by default False.
clean_eri (bool, optional) – Whether to clean up ERI files after calculation, by default False.
- optimize(solver='MP2', method='QN', only_chem=False, conv_tol=1e-06, relax_density=False, use_cumulant=True, J0=None, nproc=1, ompnum=4, max_iter=500)
BE optimization function
Interfaces BEOPT to perform bootstrap embedding optimization.
- Parameters:
solver (str, optional) – High-level solver for the fragment, by default ‘MP2’
method (str, optional) – Optimization method, by default ‘QN’
only_chem (bool, optional) – If true, density matching is not performed – only global chemical potential is optimized, by default False
conv_tol (_type_, optional) – Convergence tolerance, by default 1.e-6
relax_density (bool, optional) – Whether to use relaxed or unrelaxed densities, by default False This option is for using CCSD as solver. Relaxed density here uses Lambda amplitudes, whereas unrelaxed density only uses T amplitudes. c.f. See http://classic.chem.msu.su/cgi-bin/ceilidh.exe/gran/gamess/forum/?C34df668afbHW-7216-1405+00.htm for the distinction between the two
use_cumulant (bool, optional) – Use cumulant-based energy expression, by default True
max_iter (int, optional) – Maximum number of optimization steps, by default 500
nproc (int) – Total number of processors assigned for the optimization. Defaults to 1. When nproc > 1, Python multithreading is invoked.
ompnum (int) – If nproc > 1, ompnum sets the number of cores for OpenMP parallelization. Defaults to 4
J0 (list of list of float) – Initial Jacobian.
- print_ini()
Print initialization banner for the kBE calculation.
- read_heff(heff_file='bepotfile.h5')
Read the effective Hamiltonian from a file.
- Parameters:
heff_file (str, optional) – Path to the file storing effective Hamiltonian, by default ‘bepotfile.h5’.
- update_fock(heff=None)
Update the Fock matrix for each fragment with the effective Hamiltonian.
- Parameters:
heff (list of numpy.ndarray, optional) – List of effective Hamiltonian matrices for each fragment, by default None.
- write_heff(heff_file='bepotfile.h5')
Write the effective Hamiltonian to a file.
- Parameters:
heff_file (str, optional) – Path to the file to store effective Hamiltonian, by default ‘bepotfile.h5’.
- kbe.pbe.eritransform_parallel(a, atom, basis, kpts, C_ao_emb, cderi)
Wrapper for parallel eri transformation
- kbe.pbe.initialize_pot(Nfrag, edge_idx)
Initialize the potential array for bootstrap embedding.
This function initializes a potential array for a given number of fragments (Nfrag) and their corresponding edge indices (edge_idx). The potential array is initialized with zeros for each pair of edge site indices within each fragment, followed by an additional zero for the global chemical potential.
- Parameters:
Nfrag (int) – Number of fragments.
edge_idx (list of list of list of int) – List of edge indices for each fragment. Each element is a list of lists, where each sublist contains the indices of edge sites for a particular fragment.
- Returns:
Initialized potential array with zeros.
- Return type:
list of float
- kbe.pbe.parallel_fock_wrapper(dname, nao, dm, S, TA, hf_veff, eri_file)
Wrapper for parallel Fock transformation
- kbe.pbe.parallel_scf_wrapper(dname, nao, nocc, h1, dm_init, eri_file)
Wrapper for performing fragment scf calculation
Parallel BE Solver
- molbe.be_parallel.be_func_parallel(pot, Fobjs, Nocc, solver, enuc, hf_veff=None, nproc=1, ompnum=4, only_chem=False, relax_density=False, use_cumulant=True, eeval=False, ereturn=False, frag_energy=False, hci_cutoff=0.001, ci_coeff_cutoff=None, select_cutoff=None, return_vec=False, ecore=0.0, ebe_hf=0.0, be_iter=None, writeh1=False)
Embarrassingly Parallel High-Level Computation
Performs high-level bootstrap embedding (BE) computation for each fragment. Computes 1-RDMs and 2-RDMs for each fragment. It also computes error vectors in BE density match. For selected CI solvers, this function exposes thresholds used in selected CI calculations (hci_cutoff, ci_coeff_cutoff, select_cutoff).
- Parameters:
pot (list of float) – Potentials (local & global) that are added to the 1-electron Hamiltonian component. The last element in the list is the chemical potential.
Fobjs (list of MolBE.fragpart) – Fragment definitions.
Nocc (int) – Number of occupied orbitals for the full system.
solver (str) – High-level solver in bootstrap embedding. Supported values are ‘MP2’, ‘CCSD’, ‘FCI’, ‘HCI’, ‘SHCI’, and ‘SCI’.
enuc (float) – Nuclear component of the energy.
hf_veff (numpy.ndarray, optional) – Hartree-Fock effective potential.
nproc (int, optional) – Total number of processors assigned for the optimization. Defaults to 1. When nproc > 1, Python multithreading is invoked.
ompnum (int, optional) – If nproc > 1, sets the number of cores for OpenMP parallelization. Defaults to 4.
only_chem (bool, optional) – Whether to perform chemical potential optimization only. Refer to bootstrap embedding literature. Defaults to False.
eeval (bool, optional) – Whether to evaluate energies. Defaults to False.
ereturn (bool, optional) – Whether to return the computed energy. Defaults to False.
frag_energy (bool, optional) – Whether to compute fragment energy. Defaults to False.
return_vec (bool, optional) – Whether to return the error vector. Defaults to False.
ecore (float, optional) – Core energy. Defaults to 0.
ebe_hf (float, optional) – Hartree-Fock energy. Defaults to 0.
be_iter (int or None, optional) – Iteration number for bootstrap embedding. Defaults to None.
writeh1 (bool, optional) – Whether to write the one-electron integrals. Defaults to False.
- Returns:
Depending on the parameters, returns the error norm or a tuple containing the error norm, error vector, and the computed energy.
- Return type:
float or tuple
- molbe.be_parallel.be_func_parallel_u(pot, Fobjs, solver, enuc, hf_veff=None, nproc=1, ompnum=4, relax_density=False, use_cumulant=True, eeval=False, ereturn=False, frag_energy=False, ecore=0.0, ebe_hf=0.0, frozen=False)
Embarrassingly Parallel High-Level Computation
Performs high-level unrestricted bootstrap embedding (UBE) computation for each fragment. Computes 1-RDMs and 2-RDMs for each fragment to return the energy. As such, this currently is equipped for one-shot U-CCSD BE.
- Parameters:
pot (list of float) – Potentials (local & global) that are added to the 1-electron Hamiltonian component. The last element in the list is the chemical potential. Should always be 0, as this is still a one-shot only implementation
Fobjs (list of tuples of MolBE.fragpart) – Fragment definitions, alpha and beta components.
solver (str) – High-level solver in bootstrap embedding. Supported value is ‘UCCSD’.
enuc (float) – Nuclear component of the energy.
hf_veff (tuple of numpy.ndarray, optional) – Alpha and beta Hartree-Fock effective potential.
nproc (int, optional) – Total number of processors assigned for the optimization. Defaults to 1. When nproc > 1, Python multithreading is invoked.
ompnum (int, optional) – If nproc > 1, sets the number of cores for OpenMP parallelization. Defaults to 4.
eeval (bool, optional) – Whether to evaluate energies. Defaults to False.
ereturn (bool, optional) – Whether to return the computed energy. Defaults to False.
frag_energy (bool, optional) – Whether to compute fragment energy. Defaults to False.
ecore (float, optional) – Core energy. Defaults to 0.
ebe_hf (float, optional) – Hartree-Fock energy. Defaults to 0.
frozen (bool, optional) – Frozen core. Defaults to False
- Returns:
Returns the computed energy
- Return type:
float
- molbe.be_parallel.run_solver(h1, dm0, dname, nao, nocc, nfsites, efac, TA, hf_veff, h1_e, solver='MP2', eri_file='eri_file.h5', veff0=None, hci_cutoff=0.001, ci_coeff_cutoff=None, select_cutoff=None, ompnum=4, writeh1=False, eeval=True, return_rdm_ao=True, use_cumulant=True, relax_density=False, frag_energy=False)
Run a quantum chemistry solver to compute the reduced density matrices.
- Parameters:
h1 (numpy.ndarray) – One-electron Hamiltonian matrix.
dm0 (numpy.ndarray) – Initial guess for the density matrix.
dname (str) – Directory name for storing intermediate files.
nao (int) – Number of atomic orbitals.
nocc (int) – Number of occupied orbitals.
nfsites (int) – Number of fragment sites.
efac (float) – Scaling factor for the electronic energy.
TA (numpy.ndarray) – Transformation matrix for embedding orbitals.
hf_veff (numpy.ndarray) – Hartree-Fock effective potential matrix.
h1_e (numpy.ndarray) – One-electron integral matrix.
solver (str, optional) – Solver to use for the calculation (‘MP2’, ‘CCSD’, ‘FCI’, ‘HCI’, ‘SHCI’, ‘SCI’). Default is ‘MP2’.
eri_file (str, optional) – Filename for the electron repulsion integrals. Default is ‘eri_file.h5’.
ompnum (int, optional) – Number of OpenMP threads. Default is 4.
writeh1 (bool, optional) – If True, write the one-electron integrals to a file. Default is False.
eeval (bool, optional) – If True, evaluate the electronic energy. Default is True.
return_rdm_ao (bool, optional) – If True, return the reduced density matrices in the atomic orbital basis. Default is True.
use_cumulant (bool, optional) – If True, use the cumulant approximation for RDM2. Default is True.
frag_energy (bool, optional) – If True, compute the fragment energy. Default is False.
relax_density (bool, optional) – If True, use CCSD relaxed density. Default is False
- Returns:
Depending on the input parameters, returns the molecular orbital coefficients, one-particle and two-particle reduced density matrices, and optionally the fragment energy.
- Return type:
tuple
- molbe.be_parallel.run_solver_u(fobj_a, fobj_b, solver, enuc, hf_veff, frag_energy=True, relax_density=False, frozen=False, eri_file='eri_file.h5', use_cumulant=True, ereturn=True)
Run a quantum chemistry solver to compute the reduced density matrices.
- Parameters:
fobj_a – Alpha spin molbe.pfrag.Frags object
fobj_b – Beta spin molbe.pfrag.Frags object
solver (str) – High-level solver in bootstrap embedding. Supported value is “UCCSD”
enuc (float) – Nuclear component of the energy
hf_veff (tuple of numpy.ndarray, optional) – Alpha and beta spin Hartree-Fock effective potentials.
frag_energy (bool, optional) – If True, calculates and returns fragment energies, defaults to True.
relax_density (bool, optional) – If True, uses relaxed density matrix for UCCSD, defaults to False.
frozen (bool, optional) – If True, uses frozen core, defaults to False
eri_file (str, optional) – Filename for the electron repulsion integrals. Default is ‘eri_file.h5’.
use_cumulant (bool, optional) – If True, uses the cumulant approximation for RDM2. Default is True.
ereturn (bool, optional) – If True, return the computed energy. Defaults to False.
- Return type:
As implemented, only returns the UCCSD fragment energy
Serial BE Solver
- molbe.solver.be_func(pot, Fobjs, Nocc, solver, enuc, hf_veff=None, only_chem=False, nproc=4, hci_pt=False, hci_cutoff=0.001, ci_coeff_cutoff=None, select_cutoff=None, eeval=False, ereturn=False, frag_energy=False, relax_density=False, return_vec=False, ecore=0.0, ebe_hf=0.0, be_iter=None, use_cumulant=True, scratch_dir=None, **solver_kwargs)
Perform bootstrap embedding calculations for each fragment.
This function computes the energy and/or error for each fragment in a molecular system using various quantum chemistry solvers.
- Parameters:
pot (list) – List of potentials.
Fobjs (list of MolBE.fragpart) – List of fragment objects.
Nocc (int) – Number of occupied orbitals.
solver (str) – Quantum chemistry solver to use (‘MP2’, ‘CCSD’, ‘FCI’, ‘HCI’, ‘SHCI’, ‘SCI’).
enuc (float) – Nuclear energy.
hf_veff (numpy.ndarray, optional) – Hartree-Fock effective potential. Defaults to None.
only_chem (bool, optional) – Whether to only optimize the chemical potential. Defaults to False.
nproc (int, optional) – Number of processors. Defaults to 4. This is only neccessary for ‘SHCI’ solver
eeval (bool, optional) – Whether to evaluate the energy. Defaults to False.
ereturn (bool, optional) – Whether to return the energy. Defaults to False.
frag_energy (bool, optional) – Whether to calculate fragment energy. Defaults to False.
relax_density (bool, optional) – Whether to relax the density. Defaults to False.
return_vec (bool, optional) – Whether to return the error vector. Defaults to False.
ecore (float, optional) – Core energy. Defaults to 0.
ebe_hf (float, optional) – Hartree-Fock energy. Defaults to 0.
be_iter (int or None, optional) – Iteration number. Defaults to None.
use_cumulant (bool, optional) – Whether to use the cumulant-based energy expression. Defaults to True.
- Returns:
Depending on the options, it returns the norm of the error vector, the energy, or a combination of these values.
- Return type:
float or tuple