pyscf.pbc.cc package#
Submodules#
pyscf.pbc.cc.ccsd module#
pyscf.pbc.cc.eom_kccsd_ghf module#
- class pyscf.pbc.cc.eom_kccsd_ghf.EOMEA(cc)[source]#
Bases:
EOMEA
- ccsd_star_contract(eaccsd_evals, eaccsd_evecs, leaccsd_evecs, kshift, imds=None)#
- Returns:
- e_star (list of float):
The EA-CCSD* energy.
- Notes:
The user should check to make sure the right and left eigenvalues before running the perturbative correction.
- Reference:
Saeh, Stanton “…energy surfaces of radicals” JCP 111, 8275 (1999); DOI:10.1063/1.480171
- eaccsd(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)#
See ipccsd() for a description of arguments.
- eaccsd_star(nroots=1, koopmans=False, right_guess=None, left_guess=None, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)#
See kernel() for a description of arguments.
- get_diag(kshift, imds=None)#
- get_padding_k_idx(cc)#
- kernel(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)#
See ipccsd() for a description of arguments.
- l_matvec(vector, kshift, imds=None, diag=None)#
2hp operators are of the form s_{ j}^{ab}, i.e. ‘jb’ indices are coupled.
See also eaccsd_matvec
- mask_frozen(vector, kshift, const=100000000000000.0)#
Replaces all frozen orbital indices of vector with the value const.
- matvec(vector, kshift, imds=None, diag=None)#
2hp operators are of the form s_{ j}^{ab}, i.e. ‘jb’ indices are coupled.
- property nkpts#
- class pyscf.pbc.cc.eom_kccsd_ghf.EOMEA_Ta(cc)[source]#
Bases:
EOMEA
Class for EOM EACCSD(T)*(a) method by Matthews and Stanton.
- class pyscf.pbc.cc.eom_kccsd_ghf.EOMEE(cc)[source]#
Bases:
EOM
- eeccsd(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)#
See kernel_ee() for a description of arguments.
- get_diag(kshift, imds=None)#
Diagonal elements of similarity-transformed Hamiltonian
- get_init_guess(kshift, nroots=1, koopmans=False, diag=None, **kwargs)[source]#
Initial guess vectors of R coefficients
- get_kconserv_ee_r1(kshift=0)[source]#
Get the momentum conservation array for a set of k-points.
Given k-point index m the array kconserv_r1[m] returns the index n that satisfies momentum conservation,
(k(m) - k(n) - kshift) dot a = 2npi
This is used for symmetry of 1p-1h excitation operator vector R_{m k_m}^{n k_n} is zero unless n satisfies the above.
Note that this method is adapted from kpts_helper.get_kconserv().
- get_kconserv_ee_r2(kshift=0)[source]#
Get the momentum conservation array for a set of k-points.
Given k-point indices (k, l, m) the array kconserv_r2[k,l,m] returns the index n that satisfies momentum conservation,
(k(k) - k(l) + k(m) - k(n) - kshift) dot a = 2npi
This is used for symmetry of 2p-2h excitation operator vector R_{k k_k, m k_m}^{l k_l n k_n} is zero unless n satisfies the above.
Note that this method is adapted from kpts_helper.get_kconserv().
- kernel(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)#
See kernel_ee() for a description of arguments.
- matvec(vector, kshift, imds=None, diag=None)#
Spin-orbital EOM-EE-CCSD equations with k points.
- property nkpts#
- class pyscf.pbc.cc.eom_kccsd_ghf.EOMIP(cc)[source]#
Bases:
EOMIP
- ccsd_star_contract(ipccsd_evals, ipccsd_evecs, lipccsd_evecs, kshift, imds=None)#
- Returns:
- e_star (list of float):
The IP-CCSD* energy.
- Notes:
The user should check to make sure the right and left eigenvalues before running the perturbative correction.
The 2hp right amplitudes are assumed to be of the form s^{a }_{ij}, i.e. the (ia) indices are coupled.
- Reference:
Saeh, Stanton “…energy surfaces of radicals” JCP 111, 8275 (1999); DOI:10.1063/1.480171
- get_diag(kshift, imds=None)#
- get_padding_k_idx(cc)#
- ipccsd(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)#
See kernel() for a description of arguments.
- ipccsd_star(nroots=1, koopmans=False, right_guess=None, left_guess=None, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)#
See kernel() for a description of arguments.
- kernel(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)#
See kernel() for a description of arguments.
- l_matvec(vector, kshift, imds=None, diag=None)#
2ph operators are of the form s_{ij}^{ b}, i.e. ‘jb’ indices are coupled.
See also ipccsd_matvec
- mask_frozen(vector, kshift, const=100000000000000.0)#
Replaces all frozen orbital indices of vector with the value const.
- matvec(vector, kshift, imds=None, diag=None)#
2ph operators are of the form s_{ij}^{a }, i.e. ‘ia’ indices are coupled. This differs from the restricted case that uses s_{ij}^{ b}.
- property nkpts#
- class pyscf.pbc.cc.eom_kccsd_ghf.EOMIP_Ta(cc)[source]#
Bases:
EOMIP
Class for EOM IPCCSD(T)*(a) method by Matthews and Stanton.
- pyscf.pbc.cc.eom_kccsd_ghf.amplitudes_to_vector_ee(r1, r2, kshift, kconserv)[source]#
Transform 3- and 7-dimensional arrays, r1 and r2, to a 1-dimensional array with unique indices.
- For example:
r1: t_{i k_i}^{a k_a} r2: t_{i k_i, j k_j}^{a k_a, b k_b} return: a vector with all r1 elements, and r2 elements whose indices
satisfy (i k_i) > (j k_j) and (a k_a) > (b k_b)
- pyscf.pbc.cc.eom_kccsd_ghf.eaccsd(eom, nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)[source]#
See ipccsd() for a description of arguments.
- pyscf.pbc.cc.eom_kccsd_ghf.eaccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2hp operators are of the form s_{ j}^{ab}, i.e. ‘jb’ indices are coupled.
- pyscf.pbc.cc.eom_kccsd_ghf.eaccsd_star(eom, nroots=1, koopmans=False, right_guess=None, left_guess=None, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)[source]#
See kernel() for a description of arguments.
- pyscf.pbc.cc.eom_kccsd_ghf.eaccsd_star_contract(eom, eaccsd_evals, eaccsd_evecs, leaccsd_evecs, kshift, imds=None)[source]#
- Returns:
- e_star (list of float):
The EA-CCSD* energy.
- Notes:
The user should check to make sure the right and left eigenvalues before running the perturbative correction.
- Reference:
Saeh, Stanton “…energy surfaces of radicals” JCP 111, 8275 (1999); DOI:10.1063/1.480171
- pyscf.pbc.cc.eom_kccsd_ghf.eeccsd(eom, nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)[source]#
See kernel_ee() for a description of arguments.
- pyscf.pbc.cc.eom_kccsd_ghf.eeccsd_diag(eom, kshift, imds=None)[source]#
Diagonal elements of similarity-transformed Hamiltonian
- pyscf.pbc.cc.eom_kccsd_ghf.eeccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
Spin-orbital EOM-EE-CCSD equations with k points.
- pyscf.pbc.cc.eom_kccsd_ghf.enforce_2p_spin_doublet(r2, kconserv, kshift, orbspin, excitation)[source]#
Enforces condition that net spin can only change by +/- 1/2
- pyscf.pbc.cc.eom_kccsd_ghf.ipccsd(eom, nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)[source]#
See kernel() for a description of arguments.
- pyscf.pbc.cc.eom_kccsd_ghf.ipccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2ph operators are of the form s_{ij}^{a }, i.e. ‘ia’ indices are coupled. This differs from the restricted case that uses s_{ij}^{ b}.
- pyscf.pbc.cc.eom_kccsd_ghf.ipccsd_star(eom, nroots=1, koopmans=False, right_guess=None, left_guess=None, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)[source]#
See kernel() for a description of arguments.
- pyscf.pbc.cc.eom_kccsd_ghf.ipccsd_star_contract(eom, ipccsd_evals, ipccsd_evecs, lipccsd_evecs, kshift, imds=None)[source]#
- Returns:
- e_star (list of float):
The IP-CCSD* energy.
- Notes:
The user should check to make sure the right and left eigenvalues before running the perturbative correction.
The 2hp right amplitudes are assumed to be of the form s^{a }_{ij}, i.e. the (ia) indices are coupled.
- Reference:
Saeh, Stanton “…energy surfaces of radicals” JCP 111, 8275 (1999); DOI:10.1063/1.480171
- pyscf.pbc.cc.eom_kccsd_ghf.kernel(eom, nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)[source]#
Calculate excitation energy via eigenvalue solver
- Kwargs:
- nrootsint
Number of roots (eigenvalues) requested per k-point
- koopmansbool
Calculate Koopmans’-like (quasiparticle) excitations only, targeting via overlap.
- guesslist of ndarray
List of guess vectors to use for targeting via overlap.
- leftbool
If True, calculates left eigenvectors rather than right eigenvectors.
- erisobject(uccsd._ChemistsERIs)
Holds uccsd electron repulsion integrals in chemist notation.
- imdsobject(_IMDS)
Holds eom intermediates in chemist notation.
- partitionbool or str
Use a matrix-partitioning for the doubles-doubles block. Can be None, ‘mp’ (Moller-Plesset, i.e. orbital energies on the diagonal), or ‘full’ (full diagonal elements).
- kptlistlist
List of k-point indices for which eigenvalues are requested.
- dtypetype
Type for eigenvectors.
- pyscf.pbc.cc.eom_kccsd_ghf.kernel_ee(eom, nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None, **kwargs)[source]#
See kernel() for a description of arguments.
This method is merely a simplified version of kernel() with a few parts removed, such as those involving eom.mask_frozen(). Slowly they will be added back for the completion of program.
- pyscf.pbc.cc.eom_kccsd_ghf.leaccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2hp operators are of the form s_{ j}^{ab}, i.e. ‘jb’ indices are coupled.
See also eaccsd_matvec
- pyscf.pbc.cc.eom_kccsd_ghf.lipccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2ph operators are of the form s_{ij}^{ b}, i.e. ‘jb’ indices are coupled.
See also ipccsd_matvec
- pyscf.pbc.cc.eom_kccsd_ghf.mask_frozen_ea(eom, vector, kshift, const=100000000000000.0)[source]#
Replaces all frozen orbital indices of vector with the value const.
- pyscf.pbc.cc.eom_kccsd_ghf.mask_frozen_ip(eom, vector, kshift, const=100000000000000.0)[source]#
Replaces all frozen orbital indices of vector with the value const.
- pyscf.pbc.cc.eom_kccsd_ghf.perturbed_ccsd_kernel(eom, nroots=1, koopmans=False, right_guess=None, left_guess=None, eris=None, imds=None, partition=None, kptlist=None, dtype=None)[source]#
Wrapper for running perturbative excited-states that require both left and right amplitudes.
- pyscf.pbc.cc.eom_kccsd_ghf.spatial2spin_ea_doublet(r1, r2, kconserv, kshift, orbspin=None)[source]#
Convert R1/R2 of spatial orbital representation to R1/R2 of spin orbital representation
- pyscf.pbc.cc.eom_kccsd_ghf.spatial2spin_ip_doublet(r1, r2, kconserv, kshift, orbspin=None)[source]#
Convert R1/R2 of spatial orbital representation to R1/R2 of spin orbital representation
- pyscf.pbc.cc.eom_kccsd_ghf.spin2spatial_ea_doublet(r1, r2, kconserv, kshift, orbspin)[source]#
Convert R1/R2 of spin orbital representation to R1/R2 of spatial orbital representation
- pyscf.pbc.cc.eom_kccsd_ghf.spin2spatial_ip_doublet(r1, r2, kconserv, kshift, orbspin)[source]#
Convert R1/R2 of spin orbital representation to R1/R2 of spatial orbital representation
- pyscf.pbc.cc.eom_kccsd_ghf.vector_to_amplitudes_ea(vector, kshift, nkpts, nmo, nocc, kconserv)[source]#
- pyscf.pbc.cc.eom_kccsd_ghf.vector_to_amplitudes_ee(vector, kshift, nkpts, nmo, nocc, kconserv)[source]#
Transform 1-dimensional array to 3- and 7-dimensional arrays, r1 and r2.
- For example:
vector: a 1-d array with all r1 elements, and r2 elements whose indices
- satisfy (i k_i) > (j k_j) and (a k_a) > (b k_b)
return: [r1, r2], where r1 = r_{i k_i}^{a k_a} is a 3-d array whose elements can be accessed via
r1[k_i, i, a].
r2 = r_{i k_i, j k_j}^{a k_a, b k_b} is a 7-d array whose elements can
be accessed via
r2[k_i, k_j, k_a, i, j, a, b]
pyscf.pbc.cc.eom_kccsd_rhf module#
- class pyscf.pbc.cc.eom_kccsd_rhf.EOMEA(cc)[source]#
Bases:
EOMEA
- ccsd_star_contract(eaccsd_evals, eaccsd_evecs, leaccsd_evecs, kshift, imds=None)#
For descreation of arguments, see eaccsd_star_contract in kccsd_ghf.py.
- ea_amplitudes_to_vector(t1, t2, kshift=None, kconserv=None)[source]#
Ground state amplitudes to a vector.
- property ea_vector_desc#
Description of the EA vector.
- get_diag(kshift, imds=None, diag=None)#
- l_matvec(vector, kshift, imds=None, diag=None)#
2hp operators are of the form s_{ l}^{cd}, i.e. ‘ld’ indices are coupled.
- mask_frozen(vector, kshift, const=100000000000000.0)#
Replaces all frozen orbital indices of vector with the value const.
- matvec(vector, kshift, imds=None, diag=None)#
2hp operators are of the form s_{ j}^{ab}, i.e. ‘jb’ indices are coupled.
- property nkpts#
- class pyscf.pbc.cc.eom_kccsd_rhf.EOMEA_Ta(cc)[source]#
Bases:
EOMEA
Class for EOM EACCSD(T)*(a) method by Matthews and Stanton.
- class pyscf.pbc.cc.eom_kccsd_rhf.EOMEE(cc)[source]#
Bases:
EOMEE
- eeccsd(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)#
See kernel_ee() for a description of arguments.
- get_diag(kshift=0, imds=None)#
Diagonal elements of similarity-transformed Hamiltonian
- kernel(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)#
See kernel_ee() for a description of arguments.
- matvec(vector, kshift, imds=None, diag=None)#
Spin-orbital EOM-EE-CCSD equations with k points.
- property nkpts#
- class pyscf.pbc.cc.eom_kccsd_rhf.EOMEESinglet(cc)[source]#
Bases:
EOMEE
- cis(nroots=1, kptlist=None, imds=None, **kwargs)#
An easy implementation of k-point CIS based on EOMCC infrastructure.
- eomee_ccsd_singlet(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, diag=None, partition=None, kptlist=None, dtype=None)#
See eom_kgccsd.kernel() for a description of arguments.
- get_init_guess(kshift, nroots=1, imds=None, **kwargs)#
Build initial R vector through diagonalization of <r1|Hbar|r1>
Check eeccsd_cis_approx_slow() for details.
- kernel(nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, diag=None, partition=None, kptlist=None, dtype=None)#
See eom_kgccsd.kernel() for a description of arguments.
- matvec(vector, kshift, imds=None, diag=None)#
Spin-restricted, k-point EOM-EE-CCSD equations for singlet excitation only.
This implementation can be checked against the spin-orbital version in eom_kccsd_ghf.eeccsd_matvec().
- class pyscf.pbc.cc.eom_kccsd_rhf.EOMIP(cc)[source]#
Bases:
EOMIP
- ccsd_star_contract(ipccsd_evals, ipccsd_evecs, lipccsd_evecs, kshift, imds=None)#
For description of arguments, see ipccsd_star_contract in kccsd_ghf.py.
- get_diag(kshift, imds=None, diag=None)#
- property ip_vector_desc#
Description of the IP vector.
- l_matvec(vector, kshift, imds=None, diag=None)#
2hp operators are of the form s_{kl}^{ d}, i.e. ‘ld’ indices are coupled.
- mask_frozen(vector, kshift, const=100000000000000.0)#
Replaces all frozen orbital indices of vector with the value const.
- matvec(vector, kshift, imds=None, diag=None)#
2ph operators are of the form s_{ij}^{ b}, i.e. ‘jb’ indices are coupled.
- property nkpts#
- class pyscf.pbc.cc.eom_kccsd_rhf.EOMIP_Ta(cc)[source]#
Bases:
EOMIP
Class for EOM IPCCSD(T)*(a) method by Matthews and Stanton.
- pyscf.pbc.cc.eom_kccsd_rhf.amplitudes_to_vector_singlet(r1, r2, kconserv)[source]#
Transform 3- and 7-dimensional arrays, r1 and r2, to a 1-dimensional array with unique indices.
- For example:
r1: t_{i k_i}^{a k_a} r2: t_{i k_i, j k_j}^{a k_a, b k_b} return: a vector with all r1 elements, and r2 elements whose indices
satisfy (i k_i a k_a) >= (j k_j b k_b)
- pyscf.pbc.cc.eom_kccsd_rhf.cis_easy(eom, nroots=1, kptlist=None, imds=None, **kwargs)[source]#
An easy implementation of k-point CIS based on EOMCC infrastructure.
- pyscf.pbc.cc.eom_kccsd_rhf.eaccsd_star_contract(eom, eaccsd_evals, eaccsd_evecs, leaccsd_evecs, kshift, imds=None)[source]#
For descreation of arguments, see eaccsd_star_contract in kccsd_ghf.py.
- pyscf.pbc.cc.eom_kccsd_rhf.eeccsd(eom, nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, partition=None, kptlist=None, dtype=None)[source]#
See kernel_ee() for a description of arguments.
- pyscf.pbc.cc.eom_kccsd_rhf.eeccsd_cis_approx_slow(eom, kshift, nroots=1, imds=None, **kwargs)[source]#
Build initial R vector through diagonalization of <r1|Hbar|r1>
This method evaluates the matrix elements of Hbar in r1 space in the following way: - 1st col of Hbar = matvec(r1_col1) where r1_col1 = [1, 0, 0, 0, …] - 2nd col of Hbar = matvec(r1_col2) where r1_col2 = [0, 1, 0, 0, …] - and so on
Note that such evaluation has N^3 cost, but error free (because matvec() has been proven correct).
- pyscf.pbc.cc.eom_kccsd_rhf.eeccsd_diag(eom, kshift=0, imds=None)[source]#
Diagonal elements of similarity-transformed Hamiltonian
- pyscf.pbc.cc.eom_kccsd_rhf.eeccsd_matvec_singlet(eom, vector, kshift, imds=None, diag=None)[source]#
Spin-restricted, k-point EOM-EE-CCSD equations for singlet excitation only.
This implementation can be checked against the spin-orbital version in eom_kccsd_ghf.eeccsd_matvec().
- pyscf.pbc.cc.eom_kccsd_rhf.eeccsd_matvec_singlet_Hr1(eom, vector, kshift, imds=None)[source]#
A mini version of eeccsd_matvec_singlet(), in the sense that only Hbar.r1 is performed.
- pyscf.pbc.cc.eom_kccsd_rhf.eomee_ccsd_singlet(eom, nroots=1, koopmans=False, guess=None, left=False, eris=None, imds=None, diag=None, partition=None, kptlist=None, dtype=None)[source]#
See eom_kgccsd.kernel() for a description of arguments.
- pyscf.pbc.cc.eom_kccsd_rhf.get_init_guess_cis(eom, kshift, nroots=1, imds=None, **kwargs)[source]#
Build initial R vector through diagonalization of <r1|Hbar|r1>
Check eeccsd_cis_approx_slow() for details.
- pyscf.pbc.cc.eom_kccsd_rhf.ipccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2ph operators are of the form s_{ij}^{ b}, i.e. ‘jb’ indices are coupled.
- pyscf.pbc.cc.eom_kccsd_rhf.ipccsd_star_contract(eom, ipccsd_evals, ipccsd_evecs, lipccsd_evecs, kshift, imds=None)[source]#
For description of arguments, see ipccsd_star_contract in kccsd_ghf.py.
- pyscf.pbc.cc.eom_kccsd_rhf.join_indices(indices, struct)[source]#
Returns a joined index for an array of indices.
- Args:
indices (np.array): an array of indices struct (np.array): an array of index ranges
- Example:
indices = np.array((3, 4, 5)) struct = np.array((10, 10, 10)) join_indices(indices, struct): 345
- pyscf.pbc.cc.eom_kccsd_rhf.leaccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2hp operators are of the form s_{ l}^{cd}, i.e. ‘ld’ indices are coupled.
- pyscf.pbc.cc.eom_kccsd_rhf.lipccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2hp operators are of the form s_{kl}^{ d}, i.e. ‘ld’ indices are coupled.
- pyscf.pbc.cc.eom_kccsd_rhf.vector_to_amplitudes_singlet(vector, nkpts, nmo, nocc, kconserv)[source]#
Transform 1-dimensional array to 3- and 7-dimensional arrays, r1 and r2.
- For example:
vector: a 1-d array with all r1 elements, and r2 elements whose indices
satisfy (i k_i a k_a) >= (j k_j b k_b)
return: [r1, r2], where r1 = r_{i k_i}^{a k_a} is a 3-d array whose elements can be accessed via
r1[k_i, i, a].
- r2 = r_{i k_i, j k_j}^{a k_a, b k_b} is a 7-d array whose elements can
be accessed via r2[k_i, k_j, k_a, i, j, a, b]
pyscf.pbc.cc.eom_kccsd_rhf_ea module#
- pyscf.pbc.cc.eom_kccsd_rhf_ea.amplitudes_to_vector(cc_or_eom, t1, t2, kshift=0, kconserv=None)[source]#
EA amplitudes to vector.
pyscf.pbc.cc.eom_kccsd_rhf_ip module#
- pyscf.pbc.cc.eom_kccsd_rhf_ip.amplitudes_to_vector(cc_or_eom, t1, t2, kshift=0, kconserv=None)[source]#
IP amplitudes to vector.
pyscf.pbc.cc.eom_kccsd_uhf module#
- class pyscf.pbc.cc.eom_kccsd_uhf.EOMEA(cc)[source]#
Bases:
EOMEA
- get_diag(kshift, imds=None)#
- get_padding_k_idx(cc)#
- mask_frozen(vector, kshift, const=100000000000000.0)#
Replaces all frozen orbital indices of vector with the value const.
- matvec(vector, kshift, imds=None, diag=None)#
2ph operators are of the form s_{ j}^{ab}, i.e. ‘jb’ indices are coupled
- class pyscf.pbc.cc.eom_kccsd_uhf.EOMIP(cc)[source]#
Bases:
EOMIP
- get_diag(kshift, imds=None)#
- get_padding_k_idx(cc)#
- mask_frozen(vector, kshift, const=100000000000000.0)#
Replaces all frozen orbital indices of vector with the value const.
- matvec(vector, kshift, imds=None, diag=None)#
2ph operators are of the form s_{ij}^{ b}, i.e. ‘jb’ indices are coupled
- pyscf.pbc.cc.eom_kccsd_uhf.eaccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2ph operators are of the form s_{ j}^{ab}, i.e. ‘jb’ indices are coupled
- pyscf.pbc.cc.eom_kccsd_uhf.ipccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
2ph operators are of the form s_{ij}^{ b}, i.e. ‘jb’ indices are coupled
- pyscf.pbc.cc.eom_kccsd_uhf.mask_frozen_ea(eom, vector, kshift, const=100000000000000.0)[source]#
Replaces all frozen orbital indices of vector with the value const.
- pyscf.pbc.cc.eom_kccsd_uhf.mask_frozen_ip(eom, vector, kshift, const=100000000000000.0)[source]#
Replaces all frozen orbital indices of vector with the value const.
pyscf.pbc.cc.kccsd module#
- class pyscf.pbc.cc.kccsd.GCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#
Bases:
GCCSD
- ccsd(t1=None, t2=None, eris=None, **kwargs)[source]#
Ground-state unrestricted (U)CCSD.
- Kwargs:
- mbpt2bool
Use one-shot MBPT2 approximation to CCSD.
- energy(t1, t2, eris)#
CCSD correlation energy
- get_frozen_mask()#
Boolean mask for orbitals in k-point post-HF method.
Creates a boolean mask to remove frozen orbitals and keep other orbitals for post-HF calculations.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object.- Returns:
moidx (list of
ndarray
of bool): Boolean mask of orbitals to include.
- get_nmo(per_kpoint=False)#
Number of orbitals for k-point calculations.
Number of orbitals for use in a calculation with k-points, taking into account frozen orbitals.
- Note:
If per_kpoint is False, then the number of orbitals here is equal to max(nocc) + max(nvir), where each max is done over all k-points. Otherwise the number of orbitals is returned as a list of number of orbitals at each k-point.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of orbitals at each k-point.For a description of False, see Note.
- Returns:
- nmo (int, list of int): Number of orbitals. For return type, see description of arg
per_kpoint.
- get_nocc(per_kpoint=False)#
Number of occupied orbitals for k-point calculations.
Number of occupied orbitals for use in a calculation with k-points, taking into account frozen orbitals.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of occupiedorbitals at each k-point. False gives the max of this list.
- Returns:
- nocc (int, list of int): Number of occupied orbitals. For return type, see description of arg
per_kpoint.
- property nkpts#
- to_gpu(out=None)#
Convert a method to its corresponding GPU variant, and recursively converts all attributes of a method to cupy objects or gpu4pyscf objects.
- update_amps(t1, t2, eris)#
pyscf.pbc.cc.kccsd_rhf module#
- class pyscf.pbc.cc.kccsd_rhf.RCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#
Bases:
CCSD
- ccsd(t1=None, t2=None, eris=None, mbpt2=False)[source]#
Ground-state CCSD.
- Kwargs:
- mbpt2bool
Use one-shot MBPT2 approximation to CCSD.
- property ccsd_vector_desc#
Description of the ground-state vector.
- eaccsd(nroots=1, left=False, koopmans=False, guess=None, partition=None, eris=None, kptlist=None)[source]#
- energy(t1, t2, eris)#
CCSD correlation energy
- get_frozen_mask()#
Boolean mask for orbitals in k-point post-HF method.
Creates a boolean mask to remove frozen orbitals and keep other orbitals for post-HF calculations.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object.- Returns:
moidx (list of
ndarray
of bool): Boolean mask of orbitals to include.
- get_nmo(per_kpoint=False)#
Number of orbitals for k-point calculations.
Number of orbitals for use in a calculation with k-points, taking into account frozen orbitals.
- Note:
If per_kpoint is False, then the number of orbitals here is equal to max(nocc) + max(nvir), where each max is done over all k-points. Otherwise the number of orbitals is returned as a list of number of orbitals at each k-point.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of orbitals at each k-point.For a description of False, see Note.
- Returns:
- nmo (int, list of int): Number of orbitals. For return type, see description of arg
per_kpoint.
- get_nocc(per_kpoint=False)#
Number of occupied orbitals for k-point calculations.
Number of occupied orbitals for use in a calculation with k-points, taking into account frozen orbitals.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of occupiedorbitals at each k-point. False gives the max of this list.
- Returns:
- nocc (int, list of int): Number of occupied orbitals. For return type, see description of arg
per_kpoint.
- get_normt_diff(t1, t2, t1new, t2new)#
Calculates norm(t1 - t1new) + norm(t2 - t2new).
- property imds#
- ipccsd(nroots=1, left=False, koopmans=False, guess=None, partition=None, eris=None, kptlist=None)[source]#
- kernel(t1=None, t2=None, eris=None, mbpt2=False)[source]#
Kernel function is the main driver of a method. Every method should define the kernel function as the entry of the calculation. Note the return value of kernel function is not strictly defined. It can be anything related to the method (such as the energy, the wave-function, the DFT mesh grids etc.).
- max_space = 20#
- property nkpts#
- to_gpu(out=None)#
Convert a method to its corresponding GPU variant, and recursively converts all attributes of a method to cupy objects or gpu4pyscf objects.
- update_amps(t1, t2, eris)#
- pyscf.pbc.cc.kccsd_rhf.describe_nested(data)[source]#
Retrieves the description of a nested array structure. Args:
data (iterable): a nested structure to describe;
- Returns:
A nested structure where numpy arrays are replaced by their shapes;
The overall number of scalar elements;
The common data type;
- pyscf.pbc.cc.kccsd_rhf.get_normt_diff(cc, t1, t2, t1new, t2new)[source]#
Calculates norm(t1 - t1new) + norm(t2 - t2new).
- pyscf.pbc.cc.kccsd_rhf.nested_to_vector(data, destination=None, offset=0)[source]#
Puts any nested iterable into a vector. Args:
data (Iterable): a nested structure of numpy arrays; destination (array): array to store the data to; offset (int): array offset;
- Returns:
If destination is not specified, returns a vectorized data and the original nested structure to restore the data into its original form. Otherwise returns a new offset.
- pyscf.pbc.cc.kccsd_rhf.vector_to_nested(vector, struct, copy=True, ensure_size_matches=True)[source]#
Retrieves the original nested structure from the vector. Args:
vector (array): a vector to decompose; struct (Iterable): a nested structure with arrays’ shapes; copy (bool): whether to copy arrays; ensure_size_matches (bool): if True, ensures all elements from the vector are used;
- Returns:
A nested structure with numpy arrays and, if ensure_size_matches=False, the number of vector elements used.
pyscf.pbc.cc.kccsd_rhf_ksymm module#
pyscf.pbc.cc.kccsd_t module#
Module for running k-point ccsd(t)
- pyscf.pbc.cc.kccsd_t.kernel(mycc, eris, t1=None, t2=None, max_memory=2000, verbose=4)[source]#
Returns the CCSD(T) for general spin-orbital integrals with k-points.
- Note:
Returns real part of the CCSD(T) energy, raises warning if there is a complex part.
- Args:
- mycc (
GCCSD
): Coupled-cluster object storing results of a coupled-cluster calculation.
- eris (
_ERIS
): Integral object holding the relevant electron- repulsion integrals and Fock matrix elements
t1 (
ndarray
): t1 coupled-cluster amplitudes t2 (ndarray
): t2 coupled-cluster amplitudes max_memory (float): Maximum memory used in calculation (NOT USED) verbose (int,Logger
): verbosity of calculation- mycc (
- Returns:
energy_t (float): The real-part of the k-point CCSD(T) energy.
pyscf.pbc.cc.kccsd_t_rhf module#
Module for running restricted closed-shell k-point ccsd(t)
- pyscf.pbc.cc.kccsd_t_rhf.check_read_success(filename, **kwargs)[source]#
Determine criterion for successfully reading a dataset based on its meta values.
For now, returns False.
- pyscf.pbc.cc.kccsd_t_rhf.create_eris_vooo(ooov, nkpts, nocc, nvir, kconserv, out=None)[source]#
Creates vooo from ooov array.
This is not exactly chemist’s notation, but close. Here a chemist notation vooo is created from physicist ooov, and then the last two indices of vooo are swapped.
- pyscf.pbc.cc.kccsd_t_rhf.create_eris_vvop(vovv, oovv, nkpts, nocc, nvir, kconserv, out=None)[source]#
Creates vvop from vovv and oovv array (physicist notation).
- pyscf.pbc.cc.kccsd_t_rhf.create_t3_eris(mycc, kconserv, eris, tmpfile='tmp_t3_eris.h5')[source]#
Create/transpose necessary eri integrals needed for fast read-in by CCSD(T).
- pyscf.pbc.cc.kccsd_t_rhf.kernel(mycc, eris, t1=None, t2=None, max_memory=2000, verbose=4)[source]#
Returns the CCSD(T) for restricted closed-shell systems with k-points.
- Note:
Returns real part of the CCSD(T) energy, raises warning if there is a complex part.
- Args:
- mycc (
RCCSD
): Coupled-cluster object storing results of a coupled-cluster calculation.
- eris (
_ERIS
): Integral object holding the relevant electron- repulsion integrals and Fock matrix elements
t1 (
ndarray
): t1 coupled-cluster amplitudes t2 (ndarray
): t2 coupled-cluster amplitudes max_memory (float): Maximum memory used in calculation (NOT USED) verbose (int,Logger
): verbosity of calculation- mycc (
- Returns:
energy_t (float): The real-part of the k-point CCSD(T) energy.
pyscf.pbc.cc.kccsd_t_rhf_slow module#
Module for running restricted closed-shell k-point ccsd(t)
- pyscf.pbc.cc.kccsd_t_rhf_slow.kernel(mycc, eris, t1=None, t2=None, max_memory=2000, verbose=4)[source]#
Returns the CCSD(T) for restricted closed-shell systems with k-points.
- Note:
Returns real part of the CCSD(T) energy, raises warning if there is a complex part.
- Args:
- mycc (
RCCSD
): Coupled-cluster object storing results of a coupled-cluster calculation.
- eris (
_ERIS
): Integral object holding the relevant electron- repulsion integrals and Fock matrix elements
t1 (
ndarray
): t1 coupled-cluster amplitudes t2 (ndarray
): t2 coupled-cluster amplitudes max_memory (float): Maximum memory used in calculation (NOT USED) verbose (int,Logger
): verbosity of calculation- mycc (
- Returns:
energy_t (float): The real-part of the k-point CCSD(T) energy.
pyscf.pbc.cc.kccsd_uhf module#
- class pyscf.pbc.cc.kccsd_uhf.KUCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#
Bases:
UCCSD
- energy(t1, t2, eris)#
UCCSD correlation energy
- get_frozen_mask()#
Boolean mask for orbitals in k-point post-HF method.
Creates a boolean mask to remove frozen orbitals and keep other orbitals for post-HF calculations.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object.- Returns:
moidx (list of
ndarray
of bool): Boolean mask of orbitals to include.
- get_nmo(per_kpoint=False)#
Number of orbitals for k-point calculations.
Number of orbitals for use in a calculation with k-points, taking into account frozen orbitals.
- Note:
If per_kpoint is False, then the number of orbitals here is equal to max(nocc) + max(nvir), where each max is done over all k-points. Otherwise the number of orbitals is returned as a list of number of orbitals at each k-point.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of orbitals at each k-point.For a description of False, see Note.
- Returns:
- nmo (int, list of int): Number of orbitals. For return type, see description of arg
per_kpoint.
- get_nocc(per_kpoint=False)#
Number of occupied orbitals for k-point calculations.
Number of occupied orbitals for use in a calculation with k-points, taking into account frozen orbitals.
- Args:
mp (
MP2
): An instantiation of an SCF or post-Hartree-Fock object. per_kpoint (bool, optional): True returns the number of occupiedorbitals at each k-point. False gives the max of this list.
- Returns:
- nocc (int, list of int): Number of occupied orbitals. For return type, see description of arg
per_kpoint.
- Notes:
For specifying frozen orbitals inside mp, the following options are accepted:
+=========================+========================================+===============================+ | Argument (Example) | Argument Meaning | Example Meaning | +=========================+========================================+===============================+ | int (1) | Freeze the same number of orbitals | Freeze one (lowest) orbital | | | regardless of spin and/or kpt | for all kpts and spin cases | +————————-+—————————————-+——————————-+ | 2-tuple of list of int | inner list: List of orbitals indices | Freeze the orbitals [0,4] for | | ([0, 4], [0, 5, 6]) | to freeze at all kpts | spin0, and orbitals [0,5,6] | | | outer list: Spin index | for spin1 at all kpts | +————————-+—————————————-+——————————-+ | list(2) of list of list | inner list: list of orbital indices to | Freeze orbital 0 for spin0 at | | ([[0,],[]], | freeze at each kpt for given spin | kpt0, and freeze orbital 0,1 | | [[0,1],[4]]) | outer list: spin index | for spin1 at kpt0 and orbital | | | | 4 at kpt1 | +————————-+—————————————-+——————————-+
- get_normt_diff(t1, t2, t1new, t2new)#
Calculates norm(t1 - t1new) + norm(t2 - t2new).
- max_space = 20#
- property nkpts#
- to_gpu(out=None)#
Convert a method to its corresponding GPU variant, and recursively converts all attributes of a method to cupy objects or gpu4pyscf objects.
- update_amps(t1, t2, eris)#
pyscf.pbc.cc.kintermediates module#
- pyscf.pbc.cc.kintermediates.get_full_t3p2(mycc, t1, t2, eris)[source]#
Build the entire T3[2] array in memory.
- pyscf.pbc.cc.kintermediates.get_t3p2_imds_slow(cc, t1, t2, eris=None, t3p2_ip_out=None, t3p2_ea_out=None)[source]#
Calculates T1, T2 amplitudes corrected by second-order T3 contribution and intermediates used in IP/EA-CCSD(T)a
- Args:
- cc (
KGCCSD
): Object containing coupled-cluster results.
- t1 (
ndarray
): T1 amplitudes.
- t2 (
ndarray
): T2 amplitudes from which the T3[2] amplitudes are formed.
- eris (
_PhysicistsERIs
): Antisymmetrized electron-repulsion integrals in physicist’s notation.
- t3p2_ip_out (
ndarray
): Store results of the intermediate used in IP-EOM-CCSD(T)a.
- t3p2_ea_out (
ndarray
): Store results of the intermediate used in EA-EOM-CCSD(T)a.
- cc (
- Returns:
- delta_ccsd (float):
- Difference of perturbed and unperturbed CCSD ground-state energy,
energy(T1 + T1[2], T2 + T2[2]) - energy(T1, T2)
- pt1 (
ndarray
): Perturbatively corrected T1 amplitudes.
- pt2 (
ndarray
): Perturbatively corrected T2 amplitudes.
- Reference:
Matthews, J. F. Stanton “A new approach to approximate…”
JCP 145, 124102 (2016); DOI:10.1063/1.4962910, Equation 14
- Shavitt and Bartlett “Many-body Methods in Physics and Chemistry”
2009, Equation 10.33
pyscf.pbc.cc.kintermediates_rhf module#
pyscf.pbc.cc.kintermediates_rhf_ksymm module#
pyscf.pbc.cc.kintermediates_uhf module#
pyscf.pbc.cc.kuccsd_rdm module#
- pyscf.pbc.cc.kuccsd_rdm.make_rdm1(mycc, t1, t2, l1=None, l2=None, ao_repr=False)[source]#
One-particle spin density matrices dm1a, dm1b in MO basis (the occupied-virtual blocks due to the orbital response contribution are not included).
dm1a[p,q] = <q_alpha^dagger p_alpha> dm1b[p,q] = <q_beta^dagger p_beta>
The convention of 1-pdm is based on McWeeney’s book, Eq (5.4.20).
Module contents#
- pyscf.pbc.cc.CCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)#
- pyscf.pbc.cc.KCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)#