pyscf.pbc.cc package#

Submodules#

pyscf.pbc.cc.ccsd module#

class pyscf.pbc.cc.ccsd.GCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#

Bases: GCCSD

ao2mo(mo_coeff=None)[source]#
ccsd(t1=None, t2=None, eris=None, mbpt2=False)[source]#

Ground-state unrestricted (U)CCSD.

Kwargs:
mbpt2bool

Use one-shot MBPT2 approximation to CCSD.

class pyscf.pbc.cc.ccsd.RCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#

Bases: RCCSD

ao2mo(mo_coeff=None)[source]#
ccsd(t1=None, t2=None, eris=None, mbpt2=False)[source]#

Ground-state CCSD.

Kwargs:
mbpt2bool

Use one-shot MBPT2 approximation to CCSD.

class pyscf.pbc.cc.ccsd.UCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#

Bases: UCCSD

ao2mo(mo_coeff=None)[source]#
ccsd(t1=None, t2=None, eris=None, mbpt2=False)[source]#

Ground-state unrestricted (U)CCSD.

Kwargs:
mbpt2bool

Use one-shot MBPT2 approximation to CCSD.

pyscf.pbc.cc.eom_kccsd_ghf module#

class pyscf.pbc.cc.eom_kccsd_ghf.EOMEA(cc)[source]#

Bases: EOMEA

amplitudes_to_vector(r1, r2, kshift, kconserv=None)[source]#
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.

eaccsd_star_contract(eaccsd_evals, eaccsd_evecs, leaccsd_evecs, kshift, imds=None)[source]#
gen_matvec(kshift, imds=None, left=False, **kwargs)[source]#
get_diag(kshift, imds=None)#
get_init_guess(kshift, nroots=1, koopmans=False, diag=None)[source]#
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

make_imds(eris=None)[source]#
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#
vector_size()[source]#
vector_to_amplitudes(vector, kshift=None, nkpts=None, nmo=None, nocc=None, kconserv=None)[source]#
class pyscf.pbc.cc.eom_kccsd_ghf.EOMEA_Ta(cc)[source]#

Bases: EOMEA

Class for EOM EACCSD(T)*(a) method by Matthews and Stanton.

make_imds(eris=None)[source]#
class pyscf.pbc.cc.eom_kccsd_ghf.EOMEE(cc)[source]#

Bases: EOM

amplitudes_to_vector(r1, r2, kshift, kconserv=None)[source]#
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.

gen_matvec(kshift, imds=None, left=False, **kwargs)[source]#
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.

make_imds(eris=None)[source]#
matvec(vector, kshift, imds=None, diag=None)#

Spin-orbital EOM-EE-CCSD equations with k points.

property nkpts#
vector_size(kshift=0)[source]#

Size of the linear excitation operator R vector based on spin-orbital basis.

Kwargs:
kshiftint

index of kpt in R(k)

Returns:

size (int): number of unique elements in linear excitation operator R

Notes:

The vector size is kshift-dependent if nkpts is an even number

vector_to_amplitudes(vector, kshift=None, nkpts=None, nmo=None, nocc=None, kconserv=None)[source]#
class pyscf.pbc.cc.eom_kccsd_ghf.EOMIP(cc)[source]#

Bases: EOMIP

amplitudes_to_vector(r1, r2, kshift, kconserv=None)[source]#
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

gen_matvec(kshift, imds=None, left=False, **kwargs)[source]#
get_diag(kshift, imds=None)#
get_init_guess(kshift, nroots=1, koopmans=False, diag=None)[source]#
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.

ipccsd_star_contract(ipccsd_evals, ipccsd_evecs, lipccsd_evecs, kshift, imds=None)[source]#
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

make_imds(eris=None)[source]#
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#
vector_size()[source]#
vector_to_amplitudes(vector, kshift=None, nkpts=None, nmo=None, nocc=None, kconserv=None)[source]#
class pyscf.pbc.cc.eom_kccsd_ghf.EOMIP_Ta(cc)[source]#

Bases: EOMIP

Class for EOM IPCCSD(T)*(a) method by Matthews and Stanton.

make_imds(eris=None)[source]#
pyscf.pbc.cc.eom_kccsd_ghf.amplitudes_to_vector_ea(r1, r2, kshift, kconserv)[source]#
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.amplitudes_to_vector_ip(r1, r2, kshift, kconserv)[source]#
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_diag(eom, kshift, imds=None)[source]#
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.enforce_2p_spin_ea_doublet(r2, kconserv, kshift, orbspin)[source]#
pyscf.pbc.cc.eom_kccsd_ghf.enforce_2p_spin_ip_doublet(r2, kconserv, kshift, orbspin)[source]#
pyscf.pbc.cc.eom_kccsd_ghf.get_padding_k_idx(eom, cc)[source]#
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_diag(eom, kshift, imds=None)[source]#
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_ghf.vector_to_amplitudes_ip(vector, kshift, nkpts, nmo, nocc, kconserv)[source]#

pyscf.pbc.cc.eom_kccsd_rhf module#

class pyscf.pbc.cc.eom_kccsd_rhf.EOMEA(cc)[source]#

Bases: EOMEA

amplitudes_to_vector(r1, r2, kshift=None, kconserv=None)[source]#
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.

ea_vector_to_amplitudes(vec)[source]#

Ground state vector to apmplitudes.

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.

make_imds(eris=None)[source]#
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#
vector_size()[source]#
vector_to_amplitudes(vector, kshift=None)[source]#
class pyscf.pbc.cc.eom_kccsd_rhf.EOMEA_Ta(cc)[source]#

Bases: EOMEA

Class for EOM EACCSD(T)*(a) method by Matthews and Stanton.

make_imds(eris=None)[source]#
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.

make_imds(eris=None)[source]#
matvec(vector, kshift, imds=None, diag=None)#

Spin-orbital EOM-EE-CCSD equations with k points.

property nkpts#
vector_size(kshift=0)[source]#

Size of the linear excitation operator R vector based on spin-orbital basis.

Kwargs:
kshiftint

index of kpt in R(k)

Returns:

size (int): number of unique elements in linear excitation operator R

Notes:

The vector size is kshift-dependent if nkpts is an even number

class pyscf.pbc.cc.eom_kccsd_rhf.EOMEESinglet(cc)[source]#

Bases: EOMEE

amplitudes_to_vector(r1, r2, kshift=None, kconserv=None)[source]#
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.

gen_matvec(kshift, imds=None, left=False, **kwargs)[source]#
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().

vector_size(kshift=0)[source]#

Size of the linear excitation operator R vector based on spatial orbital basis.

r1 : r_{i k_i}${a k_a} r2 : r_{i k_i, J k_J}^{a k_a, B k_B}

Only r1aa, r2abab spin blocks are considered.

vector_to_amplitudes(vector, kshift=None, nkpts=None, nmo=None, nocc=None, kconserv=None)[source]#
class pyscf.pbc.cc.eom_kccsd_rhf.EOMEESpinFlip(cc)[source]#

Bases: EOMEE

vector_size(kshift=0)[source]#

Size of the linear excitation operator R vector based on spin-orbital basis.

Kwargs:
kshiftint

index of kpt in R(k)

Returns:

size (int): number of unique elements in linear excitation operator R

Notes:

The vector size is kshift-dependent if nkpts is an even number

class pyscf.pbc.cc.eom_kccsd_rhf.EOMEETriplet(cc)[source]#

Bases: EOMEE

vector_size(kshift=0)[source]#

Size of the linear excitation operator R vector based on spin-orbital basis.

Kwargs:
kshiftint

index of kpt in R(k)

Returns:

size (int): number of unique elements in linear excitation operator R

Notes:

The vector size is kshift-dependent if nkpts is an even number

class pyscf.pbc.cc.eom_kccsd_rhf.EOMIP(cc)[source]#

Bases: EOMIP

amplitudes_to_vector(r1, r2, kshift=None, kconserv=None)[source]#
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)#
ip_amplitudes_to_vector(t1, t2)[source]#

Ground state amplitudes to a vector.

property ip_vector_desc#

Description of the IP vector.

ip_vector_to_amplitudes(vec)[source]#

Ground state vector to amplitudes.

l_matvec(vector, kshift, imds=None, diag=None)#

2hp operators are of the form s_{kl}^{ d}, i.e. ‘ld’ indices are coupled.

make_imds(eris=None)[source]#
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#
vector_size()[source]#
vector_to_amplitudes(vector, kshift=None)[source]#
class pyscf.pbc.cc.eom_kccsd_rhf.EOMIP_Ta(cc)[source]#

Bases: EOMIP

Class for EOM IPCCSD(T)*(a) method by Matthews and Stanton.

make_imds(eris=None)[source]#
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_diag(eom, kshift, imds=None, diag=None)[source]#
pyscf.pbc.cc.eom_kccsd_rhf.eaccsd_matvec(eom, vector, kshift, imds=None, diag=None)[source]#
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(eom, vector, kshift, imds=None, diag=None)[source]#
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_diag(eom, kshift, imds=None, diag=None)[source]#
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_ea.iter_12(cc_or_eom, k)[source]#

Iterates over EA index slices.

pyscf.pbc.cc.eom_kccsd_rhf_ea.vector_size(cc_or_eom, kshift=0)[source]#

The total number of elements in EA vector.

pyscf.pbc.cc.eom_kccsd_rhf_ea.vector_to_amplitudes(cc_or_eom, vec, kshift=0)[source]#

EA vector to apmplitudes.

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_rhf_ip.iter_12(cc_or_eom, k)[source]#

Iterates over IP index slices.

pyscf.pbc.cc.eom_kccsd_rhf_ip.vector_size(cc_or_eom, kshift=0)[source]#

The total number of elements in IP vector.

pyscf.pbc.cc.eom_kccsd_rhf_ip.vector_to_amplitudes(cc_or_eom, vec, kshift=0)[source]#

IP vector to apmplitudes.

pyscf.pbc.cc.eom_kccsd_uhf module#

class pyscf.pbc.cc.eom_kccsd_uhf.EOMEA(cc)[source]#

Bases: EOMEA

amplitudes_to_vector(r1, r2, kshift, kconserv=None)[source]#
get_diag(kshift, imds=None)#
get_init_guess(kshift, nroots=1, koopmans=False, diag=None)[source]#
get_padding_k_idx(cc)#
make_imds(eris=None, t1=None, t2=None)[source]#
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

vector_size()[source]#
vector_to_amplitudes(vector, kshift, nkpts=None, nmo=None, nocc=None, kconserv=None)[source]#
class pyscf.pbc.cc.eom_kccsd_uhf.EOMIP(cc)[source]#

Bases: EOMIP

amplitudes_to_vector(r1, r2, kshift, kconserv=None)[source]#
gen_matvec(kshift, imds=None, left=False, **kwargs)[source]#
get_diag(kshift, imds=None)#
get_init_guess(kshift, nroots=1, koopmans=False, diag=None)[source]#
get_padding_k_idx(cc)#
make_imds(eris=None, t1=None, t2=None)[source]#
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

vector_size()[source]#
vector_to_amplitudes(vector, kshift, nkpts=None, nmo=None, nocc=None, kconserv=None)[source]#
pyscf.pbc.cc.eom_kccsd_uhf.amplitudes_to_vector_ea(r1, r2, kshift, kconserv)[source]#
pyscf.pbc.cc.eom_kccsd_uhf.amplitudes_to_vector_ip(r1, r2, kshift, kconserv)[source]#
pyscf.pbc.cc.eom_kccsd_uhf.eaccsd_diag(eom, kshift, imds=None)[source]#
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.get_padding_k_idx(eom, cc)[source]#
pyscf.pbc.cc.eom_kccsd_uhf.ipccsd_diag(eom, kshift, imds=None)[source]#
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.eom_kccsd_uhf.vector_to_amplitudes_ea(vector, kshift, nkpts, nmo, nocc, kconserv)[source]#
pyscf.pbc.cc.eom_kccsd_uhf.vector_to_amplitudes_ip(vector, kshift, nkpts, nmo, nocc, kconserv)[source]#

pyscf.pbc.cc.kccsd module#

pyscf.pbc.cc.kccsd.CCSD#

alias of GCCSD

class pyscf.pbc.cc.kccsd.GCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#

Bases: GCCSD

amplitudes_to_vector(t1, t2)[source]#
ao2mo(mo_coeff=None)[source]#
ccsd(t1=None, t2=None, eris=None, **kwargs)[source]#

Ground-state unrestricted (U)CCSD.

Kwargs:
mbpt2bool

Use one-shot MBPT2 approximation to CCSD.

ccsd_t(t1=None, t2=None, eris=None)[source]#
dump_flags(verbose=None)[source]#
energy(t1, t2, eris)#

CCSD correlation energy

from_uccsd(t1, t2, orbspin=None)[source]#
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 occupied

orbitals 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.

init_amps(eris)[source]#
property nkpts#
spatial2spin(tx, orbspin=None, kconserv=None)[source]#
spin2spatial(tx, orbspin=None, kconserv=None)[source]#
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.

to_uccsd(t1, t2, orbspin=None)[source]#
update_amps(t1, t2, eris)#
vector_to_amplitudes(vec, nmo=None, nocc=None)[source]#
pyscf.pbc.cc.kccsd.KCCSD#

alias of GCCSD

pyscf.pbc.cc.kccsd.KGCCSD#

alias of GCCSD

pyscf.pbc.cc.kccsd.check_antisymm_12(cc, kpts, integrals)[source]#
pyscf.pbc.cc.kccsd.check_antisymm_34(cc, kpts, integrals)[source]#
pyscf.pbc.cc.kccsd.check_antisymm_3412(cc, kpts, integrals)[source]#
pyscf.pbc.cc.kccsd.energy(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kccsd.spatial2spin(tx, orbspin, kconserv)[source]#

Convert T1/T2 of spatial orbital representation to T1/T2 of spin-orbital representation

pyscf.pbc.cc.kccsd.spin2spatial(tx, orbspin, kconserv)[source]#
pyscf.pbc.cc.kccsd.update_amps(cc, t1, t2, eris)[source]#

pyscf.pbc.cc.kccsd_rhf module#

pyscf.pbc.cc.kccsd_rhf.KRCCSD#

alias of RCCSD

class pyscf.pbc.cc.kccsd_rhf.RCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#

Bases: CCSD

amplitudes_to_vector(t1, t2)[source]#

Ground state amplitudes to a vector.

ao2mo(mo_coeff=None)[source]#
ccsd(t1=None, t2=None, eris=None, mbpt2=False)[source]#

Ground-state CCSD.

Kwargs:
mbpt2bool

Use one-shot MBPT2 approximation to CCSD.

ccsd_t(t1=None, t2=None, eris=None)[source]#
property ccsd_vector_desc#

Description of the ground-state vector.

dump_flags(verbose=None)[source]#
eaccsd(nroots=1, left=False, koopmans=False, guess=None, partition=None, eris=None, kptlist=None)[source]#
eaccsd_diag(kshift)[source]#
eaccsd_matvec(vector, kshift)[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 occupied

orbitals 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#
init_amps(eris)[source]#
ipccsd(nroots=1, left=False, koopmans=False, guess=None, partition=None, eris=None, kptlist=None)[source]#
ipccsd_diag(kshift)[source]#
ipccsd_matvec(vector, kshift)[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)#
vector_to_amplitudes(vec)[source]#

Ground state vector to apmplitudes.

pyscf.pbc.cc.kccsd_rhf.add_vvvv_(cc, Ht2, t1, t2, eris)[source]#
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.energy(cc, t1, t2, eris)[source]#
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.kconserve_pmatrix(nkpts, kconserv)[source]#
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.update_amps(cc, t1, t2, eris)[source]#
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#

class pyscf.pbc.cc.kccsd_rhf_ksymm.KsymAdaptedRCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#

Bases: RCCSD

amplitudes_to_vector(t1, t2)[source]#

Ground state amplitudes to a vector.

ao2mo(mo_coeff=None)[source]#
energy(t1, t2, eris)#

CCSD correlation energy

init_amps(eris)[source]#
update_amps(t1, t2, eris)#
vector_to_amplitudes(vec)[source]#

Ground state vector to apmplitudes.

pyscf.pbc.cc.kccsd_rhf_ksymm.add_vvvv_(cc, Ht2, t1, t2, eris)[source]#
pyscf.pbc.cc.kccsd_rhf_ksymm.energy(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kccsd_rhf_ksymm.update_amps(cc, t1, t2, eris)[source]#

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

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.get_data_slices(kpt_indices, orb_indices, kconserv)[source]#
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

Returns:

energy_t (float): The real-part of the k-point CCSD(T) energy.

pyscf.pbc.cc.kccsd_t_rhf.transpose_t2(t2, nkpts, nocc, nvir, kconserv, out=None)[source]#

Creates t2.transpose(2,3,1,0).

pyscf.pbc.cc.kccsd_t_rhf.zip_kpoints(kpt_indices)[source]#

Similar to a cartesian product but for a list of kpoint indices for a 3-particle operator. Ensures all indices are integers.

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

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

amplitudes_to_vector(t1, t2)[source]#
ao2mo(mo_coeff=None)[source]#
dump_flags(verbose=None)[source]#
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 occupied

orbitals 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).

init_amps(eris)[source]#
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)#
vector_to_amplitudes(vec, nmo=None, nocc=None, nkpts=None)[source]#
pyscf.pbc.cc.kccsd_uhf.UCCSD#

alias of KUCCSD

pyscf.pbc.cc.kccsd_uhf.add_vvvv_(cc, Ht2, t1, t2, eris)[source]#
pyscf.pbc.cc.kccsd_uhf.amplitudes_to_vector(t1, t2)[source]#
pyscf.pbc.cc.kccsd_uhf.convert_mo_coeff(mo_coeff)[source]#
pyscf.pbc.cc.kccsd_uhf.energy(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kccsd_uhf.get_normt_diff(cc, t1, t2, t1new, t2new)[source]#

Calculates norm(t1 - t1new) + norm(t2 - t2new).

pyscf.pbc.cc.kccsd_uhf.mo_c_list_to_array(mo_coeff)[source]#
pyscf.pbc.cc.kccsd_uhf.update_amps(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kccsd_uhf.vector_to_amplitudes(vec, nmo, nocc, nkpts=1)[source]#

pyscf.pbc.cc.kintermediates module#

pyscf.pbc.cc.kintermediates.Foo(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.Fov(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.Fvv(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.Woooo(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.Wooov(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.Wovoo(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.Wovvo(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.Wvovv(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.Wvvvo(cc, t1, t2, eris, kconserv, WWvvvv=None)[source]#
pyscf.pbc.cc.kintermediates.Wvvvv(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.cc_Foo(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.cc_Fov(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.cc_Fvv(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.cc_Woooo(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.cc_Wovvo(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.cc_Wovvo_jk(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates.cc_Wvvvv(cc, t1, t2, eris, kconserv)[source]#
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.

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:
    1. 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.make_tau(cc, t2, t1, t1p, kconserv, fac=1.0, out=None)[source]#

pyscf.pbc.cc.kintermediates_rhf module#

pyscf.pbc.cc.kintermediates_rhf.Loo(t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates_rhf.Lvv(t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates_rhf.W1ovov(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.W1ovvo(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.W2ovov(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.W2ovvo(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.Woooo(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.Wooov(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.Wovoo(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.Wovov(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.Wovvo(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.Wvovv(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.Wvvvo(t1, t2, eris, kconserv, _Wvvvv=None, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.Wvvvv(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.cc_Foo(t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates_rhf.cc_Fov(t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates_rhf.cc_Fvv(t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates_rhf.cc_Woooo(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.cc_Wvoov(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.cc_Wvovo(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.cc_Wvvvv(t1, t2, eris, kconserv, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf.get_Wvvvv(t1, t2, eris, kconserv, ka, kb, kc)[source]#
pyscf.pbc.cc.kintermediates_rhf.get_t3p2_imds(mycc, t1, t2, eris=None, t3p2_ip_out=None, t3p2_ea_out=None)[source]#

For a description of arguments, see get_t3p2_imds_slow in the corresponding kintermediates.py.

pyscf.pbc.cc.kintermediates_rhf.get_t3p2_imds_slow(cc, t1, t2, eris=None, t3p2_ip_out=None, t3p2_ea_out=None)[source]#

For a description of arguments, see get_t3p2_imds_slow in the corresponding kintermediates.py.

pyscf.pbc.cc.kintermediates_rhf_ksymm module#

pyscf.pbc.cc.kintermediates_rhf_ksymm.Loo(kpts, kqrts, t1, t2, eris, rmat)[source]#
pyscf.pbc.cc.kintermediates_rhf_ksymm.Lvv(kpts, kqrts, t1, t2, eris, rmat)[source]#
pyscf.pbc.cc.kintermediates_rhf_ksymm.cc_Foo(kpts, kqrts, t1, t2, eris, rmat)[source]#
pyscf.pbc.cc.kintermediates_rhf_ksymm.cc_Fov(kpts, kqrts, t1, t2, eris, rmat)[source]#
pyscf.pbc.cc.kintermediates_rhf_ksymm.cc_Fvv(kpts, kqrts, t1, t2, eris, rmat)[source]#
pyscf.pbc.cc.kintermediates_rhf_ksymm.cc_Woooo(kpts, kqrts, t1, t2, eris, rmat, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf_ksymm.cc_Wvoov(kpts, kqrts, t1, t2, eris, rmat, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf_ksymm.cc_Wvovo(kpts, kqrts, t1, t2, eris, rmat, out=None)[source]#
pyscf.pbc.cc.kintermediates_rhf_ksymm.cc_Wvvvv(kpts, kqrts, t1, t2, eris, rmat, out=None)[source]#

pyscf.pbc.cc.kintermediates_uhf module#

pyscf.pbc.cc.kintermediates_uhf.Foo(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Fov(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Fvv(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.W1oovv(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.W2oovv(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Woooo(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Wooov(cc, t1, t2, eris, kconserv)[source]#
pyscf.pbc.cc.kintermediates_uhf.Woovo(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Woovv(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Wovvo(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Wvvov(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Wvvvo(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.Wvvvv(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.cc_Foo(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.cc_Fov(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.cc_Fvv(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.cc_Woooo(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.cc_Wovvo(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.cc_Wvvvv(cc, t1, t2, eris)[source]#
pyscf.pbc.cc.kintermediates_uhf.cc_Wvvvv_half(cc, t1, t2, eris)[source]#

Similar to cc_Wvvvv, without anti-symmetrization

pyscf.pbc.cc.kintermediates_uhf.get_Wvvvv(cc, t1, t2, eris, ka, kb, kc)[source]#
pyscf.pbc.cc.kintermediates_uhf.kconserv_mat(nkpts, kconserv)[source]#
pyscf.pbc.cc.kintermediates_uhf.make_tau(cc, t2, t1, t1p, fac=1.0)[source]#
pyscf.pbc.cc.kintermediates_uhf.make_tau2(cc, t2, t1, t1p, fac=1.0)[source]#

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.GCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#
pyscf.pbc.cc.KCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)#
pyscf.pbc.cc.KGCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#
pyscf.pbc.cc.KRCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#
pyscf.pbc.cc.KUCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#
pyscf.pbc.cc.RCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#
pyscf.pbc.cc.UCCSD(mf, frozen=None, mo_coeff=None, mo_occ=None)[source]#