10.21.9. pbc.cc — Coupled cluster with PBCs

The pbc.cc module implements the coupled cluster methods with periodic boundary conditions. It is analogous to the cc module.

10.21.9.2. Program reference

class pyscf.pbc.cc.ccsd.GCCSD(mf, frozen=None, mo_coeff=None, mo_occ=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]
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]
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.kccsd.CCSD

alias of pyscf.pbc.cc.kccsd.GCCSD

class pyscf.pbc.cc.kccsd.GCCSD(mf, frozen=None, mo_coeff=None, mo_occ=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.

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

pyscf.pbc.cc.kccsd.KCCSD

alias of pyscf.pbc.cc.kccsd.GCCSD

pyscf.pbc.cc.kccsd.KGCCSD

alias of pyscf.pbc.cc.kccsd.GCCSD

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_rhf.KRCCSD

alias of pyscf.pbc.cc.kccsd_rhf.RCCSD

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

Ground state amplitudes to a vector.

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.

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

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

vector_to_amplitudes(vec)[source]

Ground state vector to apmplitudes.

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.

class pyscf.pbc.cc.kccsd_uhf.KUCCSD(mf, frozen=None, mo_coeff=None, mo_occ=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 np.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).

pyscf.pbc.cc.kccsd_uhf.UCCSD

alias of pyscf.pbc.cc.kccsd_uhf.KUCCSD

pyscf.pbc.cc.kccsd_uhf.get_normt_diff(cc, t1, t2, t1new, t2new)[source]

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

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.

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

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.

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.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_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_uhf.cc_Wvvvv_half(cc, t1, t2, eris)[source]

Similar to cc_Wvvvv, without anti-symmetrization

class pyscf.pbc.cc.eom_kccsd_ghf.EOMEA(cc)[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.

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.

class pyscf.pbc.cc.eom_kccsd_ghf.EOMEA_Ta(cc)[source]

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

class pyscf.pbc.cc.eom_kccsd_ghf.EOMEE(cc)[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.

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.

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_ghf.EOMIP(cc)[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

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

class pyscf.pbc.cc.eom_kccsd_ghf.EOMIP_Ta(cc)[source]

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_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]

class pyscf.pbc.cc.eom_kccsd_rhf.EOMEA(cc)[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.

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

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

class pyscf.pbc.cc.eom_kccsd_rhf.EOMEA_Ta(cc)[source]

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

class pyscf.pbc.cc.eom_kccsd_rhf.EOMEE(cc)[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.

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.

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]
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().

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.

class pyscf.pbc.cc.eom_kccsd_rhf.EOMEESpinFlip(cc)[source]
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]
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]
ccsd_star_contract(ipccsd_evals, ipccsd_evecs, lipccsd_evecs, kshift, imds=None)

For description of arguments, see ipccsd_star_contract in kccsd_ghf.py.

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.

matvec(vector, kshift, imds=None, diag=None)

2ph operators are of the form s_{ij}^{ b}, i.e. ‘jb’ indices are coupled.

class pyscf.pbc.cc.eom_kccsd_rhf.EOMIP_Ta(cc)[source]

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

class pyscf.pbc.cc.eom_kccsd_uhf.EOMEA(cc)[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

class pyscf.pbc.cc.eom_kccsd_uhf.EOMIP(cc)[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

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.