Papers
Topics
Authors
Recent
Search
2000 character limit reached

CCResPy: Coupled-Cluster Response in Python

Updated 7 July 2026
  • CCResPy is an open‐source Python/NumPy framework implementing coupled‐cluster (CCSD) response theory for both molecular and 1D periodic systems.
  • It leverages collective indices and tensor-based formulations to compute frequency-dependent electric dipole polarizabilities, addressing challenges in k-space convergence and dipole operator ambiguities.
  • Designed as a method-development platform, CCResPy operates on externally generated mean-field data to facilitate benchmark-quality optical response calculations with transparent, extensible code.

Searching arXiv for CCResPy and closely related periodic CCSD response work. CCResPy, short for Coupled-Cluster Response in Python, is an open-source Python/NumPy implementation of coupled-cluster response theory centered on coupled cluster with single and double excitations (CCSD), its left-eigenvector equations, and linear-response CCSD for general one-body perturbations. In its current documented form, it supports both molecular systems and 1D periodic systems with periodic boundary conditions (PBCs), and has been extended to compute the frequency-dependent electric dipole-electric dipole polarizability tensor in the length gauge for 1D periodic chains. The code is positioned as a specialized method-development platform rather than an all-in-one quantum-chemistry package: it assumes an external mean-field calculation and operates on imported one- and two-electron quantities, dipole integrals, and PBC data (Caricato et al., 2 Aug 2025).

1. Scope and conceptual role

CCResPy is designed around a deliberately narrow but technically demanding target: high-accuracy correlated electronic-structure calculations based on CCSD and CCSD response theory. Its stated capabilities include ground-state CCSD energies and amplitudes, solution of the left-hand Λ\Lambda equations, and linear-response CCSD for one-body perturbations, with the present implementation using these ingredients to evaluate the frequency-dependent electric dipole-electric dipole polarizability. The same framework is used for molecules and for 1D periodic systems through a collective-index formalism that combines orbital and k-point labels (Caricato et al., 2 Aug 2025).

Aspect CCResPy implementation Role
Language Python + NumPy Tensor-based method development
Wavefunction level CCSD Ground state and response
System classes Molecular and 1D PBC Unified tensor equations
Response capability LR-CCSD for one-body perturbations Here applied to α(ω)\boldsymbol{\alpha}(\omega)
External dependencies Mean-field and integrals generated elsewhere CCResPy does not perform SCF

The code is explicitly not described as a full electronic-structure environment. It does not generate integrals, perform SCF, or carry out geometry optimization. Instead, the reference Hartree-Fock calculation is done externally, in the reported work with the GAUSSIAN development version, and the necessary data are extracted and passed to CCResPy. This places it in the category of a method-development and high-accuracy prototype code, complementary to production packages such as Gaussian, CRYSTAL, and VASP, especially for benchmark-quality optical-response calculations in solids where DFT and TDDFT are usually the default (Caricato et al., 2 Aug 2025).

2. Coupled-cluster and linear-response formulation

The ground-state theory follows the standard single-reference CCSD ansatz with Hartree-Fock reference determinant Φ0|\Phi_0\rangle,

ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,

with single and double excitation amplitudes tIAt_I^A and tIJABt_{IJ}^{AB}. For periodic systems, CCResPy introduces collective indices PpkpP \equiv p k_p, so that molecular and periodic equations can be written in the same algebraic form. In this notation, the periodic CCSD correlation energy per unit cell is

Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,

with NkN_k the number of k-points, fPQf_{PQ} Fock-matrix elements in the crystal-orbital/k-point basis, and α(ω)\boldsymbol{\alpha}(\omega)0 antisymmetrized two-electron integrals. The dressed doubles amplitudes are

α(ω)\boldsymbol{\alpha}(\omega)1

α(ω)\boldsymbol{\alpha}(\omega)2

The amplitude equations are written in the usual residual-equals-zero form with orbital-energy denominators

α(ω)\boldsymbol{\alpha}(\omega)3

Their working expressions follow Gauss-Stanton-Bartlett style CCSD gradients and intermediates, adapted to PBC in the sense described in the source work. Intermediates such as α(ω)\boldsymbol{\alpha}(\omega)4, α(ω)\boldsymbol{\alpha}(\omega)5, α(ω)\boldsymbol{\alpha}(\omega)6, and α(ω)\boldsymbol{\alpha}(\omega)7-type tensors are computed once per CCSD iteration and then reused in the tensor contractions (Caricato et al., 2 Aug 2025).

For response properties, CCResPy also solves the α(ω)\boldsymbol{\alpha}(\omega)8-CCSD equations for the de-excitation amplitudes α(ω)\boldsymbol{\alpha}(\omega)9 and Φ0|\Phi_0\rangle0. These left eigenvectors enter the symmetric linear-response formalism and the construction of Φ0|\Phi_0\rangle1-type intermediates and Φ0|\Phi_0\rangle2-type one-particle transition-density-like tensors. For a one-electron perturbation Φ0|\Phi_0\rangle3, the linear-response function is expressed as

Φ0|\Phi_0\rangle4

but CCResPy does not form the Jacobian Φ0|\Phi_0\rangle5 explicitly. Instead, it solves directly for perturbed amplitudes Φ0|\Phi_0\rangle6 from

Φ0|\Phi_0\rangle7

For electric-dipole response, the polarizability tensor is obtained as

Φ0|\Phi_0\rangle8

An important implementation choice is that the present symmetric LR formulation requires only perturbed Φ0|\Phi_0\rangle9-amplitudes. The alternative non-symmetric formulation involving perturbed ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,0-amplitudes ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,1 is explicitly noted as not yet implemented. This keeps the current response machinery aligned with the existing CCSD, ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,2-CCSD, and tensor-intermediate infrastructure (Caricato et al., 2 Aug 2025).

3. Periodic boundary conditions and k-space treatment

The periodic implementation targets 1D crystals: infinite chains with translation vector ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,3 along one spatial direction. The underlying mean-field data are generated with Gaussian-type orbitals and Bloch orbitals under PBCs. GAUSSIAN provides the crystal-orbital coefficients ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,4, AO-basis Fock and overlap matrices, AO-basis two-electron repulsion integrals, AO dipole integrals, and the real-space and reciprocal-space parameters ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,5 and ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,6. CCResPy reconstructs the k-point mesh internally from the reciprocal-space sampling parameter and transforms all AO quantities to the crystal-orbital/k-point basis (Caricato et al., 2 Aug 2025).

Momentum conservation is enforced through the usual k-selection rules,

ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,7

with integers ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,8 and ΨCC=eT^Φ0,T^=T^1+T^2,|\Psi_{\text{CC}}\rangle = e^{\hat T}|\Phi_0\rangle, \qquad \hat T = \hat T_1 + \hat T_2,9. In consequence, only tIAt_I^A0 independent blocks exist for one-electron quantities and tIAt_I^A1 for two-electron quantities. However, CCResPy deliberately stores the tensors with all k-indices present, as if the dimensions were tIAt_I^A2 and tIAt_I^A3, while setting disallowed elements to zero. This is less efficient in storage and floating-point work, but it permits uniform tensor shapes and a single code path for molecules and periodic systems. The reported implementation treats this as a central design decision: efficiency is sacrificed in favor of correctness, code transparency, and extensibility.

The thermodynamic limit is approached by increasing both the number of replica cells used in real-space integral generation and the number of k-points used to sample the 1D Brillouin zone. No special extrapolation module is built into CCResPy. Instead, the reported study performs direct k-mesh convergence analyses, comparing periodic CCSD and LR-CCSD results with large finite-cluster calculations. A major numerical conclusion is that correlation energies converge much faster with k-point sampling than response properties. In the tested systems, very coarse meshes already yield CCSD correlation energies close to cluster references, whereas polarizabilities, especially along the periodic direction, require substantially denser k-point sampling for semi-quantitative agreement (Caricato et al., 2 Aug 2025).

4. Electric dipole operator and the length-gauge ambiguity

A central conceptual issue in the periodic implementation concerns the electric dipole operator in the length gauge. For finite molecules, the electric dipole operator is a straightforward one-body operator. For periodic solids, the position operator is ill-defined under PBC, and the modern theory of polarization replaces a naive position expectation value by a Berry-phase formulation for static polarization. In the periodic Gaussian framework used here, length-gauge dipole integrals in the Bloch-orbital basis involve k-derivatives of Bloch orbitals,

tIAt_I^A4

with tIAt_I^A5 analogous to a coupled-perturbed orbital-response matrix (Caricato et al., 2 Aug 2025).

The reported difficulty is that tIAt_I^A6 lacks certain diagonal contributions, described as “missing integers,” associated with the arbitrary k-dependent phases of Bloch orbitals. In Hartree-Fock and DFT linear-response polarizabilities in the length gauge, these omitted pieces do not affect the result because only off-diagonal dipole blocks enter. In CCSD linear response, however, the full dipole matrix appears in the working expressions for the property coupling vector and the final response function. Consequently, the ambiguity propagates directly into the CCSD polarizability calculation.

The observed numerical effect depends on the system. For the HtIAt_I^A7 chain, the impact is reported to be very small compared with ordinary k-point convergence errors. For LiH chains, deviations of several atomic units in the longitudinal component tIAt_I^A8 remain even at large k-meshes and are attributed primarily to the missing-integer issue. The source work emphasizes that this is not a failure of CCSD itself but a problem in the operator definition supplied to the response equations. If a fully phase-consistent tIAt_I^A9 were available, the CC equations implemented in CCResPy would not need to change (Caricato et al., 2 Aug 2025).

The velocity gauge is identified as an alternative route, since it expresses the dipole perturbation in terms of the momentum operator and avoids the tIJABt_{IJ}^{AB}0 construction. At finite basis and finite truncation level, however, length-gauge and velocity-gauge formulations are not numerically identical. A plausible implication is that gauge comparison will be necessary not only as a diagnostic of the operator issue but also as a measure of basis-set and truncation error in future periodic CC response work.

5. Software architecture and numerical strategy

CCResPy is written in Python, with tensor algebra handled through NumPy and einsum contractions. BLAS and LAPACK are used indirectly through NumPy, and shared-memory parallelism is inherited from the linked linear-algebra backend. The implementation is intentionally equation-like: tensor storage and index order are chosen so that the code mirrors the mathematical expressions as closely as possible. Quantities such as tIJABt_{IJ}^{AB}1, tIJABt_{IJ}^{AB}2, and tIJABt_{IJ}^{AB}3 are stored in array layouts that preserve the correspondence between code and working equations (Caricato et al., 2 Aug 2025).

Periodic quantities are generally complex, so the same infrastructure supports real molecular tensors and complex periodic tensors. Reference data are imported rather than generated internally. The workflow uses GAUSSIAN PBC Hartree-Fock calculations together with gauopen to extract binary data into text or NumPy arrays. The imported information includes crystal-orbital coefficients, AO-basis two-electron integrals, AO Fock and overlap matrices, AO dipole integrals, and the PBC parameters required to reconstruct the reciprocal-space description.

Memory management is a prominent part of the implementation. All arrays are kept in memory except the largest tIJABt_{IJ}^{AB}4 arrays, such as virtual-space two-electron tensors and related tIJABt_{IJ}^{AB}5-type intermediates. These are written to binary files, loaded only when needed for a contraction, and then released. For particularly large contractions, CCResPy checks available memory and either performs the full contraction or falls back to sliced contractions over an outer index, reducing peak memory at the cost of additional Python-level loops. The code uses psutil, tracemalloc, and, on Linux, resource to query and enforce a global memory cap.

All amplitude equations—ground-state tIJABt_{IJ}^{AB}6, left-hand tIJABt_{IJ}^{AB}7, and perturbed tIJABt_{IJ}^{AB}8—are solved iteratively with Jacobi-style fixed-point updates. Convergence thresholds are reported as tIJABt_{IJ}^{AB}9 Ha for the energy, together with RMS and MAX thresholds on amplitude updates of PpkpP \equiv p k_p0 and PpkpP \equiv p k_p1, respectively. A pseudo-energy analogous to the CCSD energy expression is used to monitor convergence of PpkpP \equiv p k_p2 and PpkpP \equiv p k_p3. Pulay DIIS acceleration is employed, with the error vector defined as the difference between successive iterates. In the periodic case, the DIIS overlap matrix is complex Hermitian rather than real symmetric, and old amplitude sets are stored to disk and reloaded when needed. This combination of transparent tensor algebra, explicit iterative solvers, and memory-aware disk staging is characteristic of CCResPy’s role as a research prototype (Caricato et al., 2 Aug 2025).

6. Benchmark systems and numerical behavior

The reported numerical tests use CCResPy on three model classes: an HPpkpP \equiv p k_p4 chain, a LiH chain with fixed geometry, and an optimized LiH chain. In all cases, the comparisons involve isolated molecules, large finite clusters, and periodic calculations with varying reciprocal-space sampling, allowing separate examination of intermolecular effects, finite-size effects, and k-mesh convergence (Caricato et al., 2 Aug 2025).

For the HPpkpP \equiv p k_p5 chain, the geometry is PpkpP \equiv p k_p6 Å with translation vector PpkpP \equiv p k_p7 Å and a 3-21G basis, giving 2 occupied and 6 virtual orbitals per cell. Only PpkpP \equiv p k_p8, the polarizability along the chain direction, is nonzero. Moving from the isolated HPpkpP \equiv p k_p9 molecule to the infinite chain increases the Hartree-Fock energy per cell by about Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,0 mHa, while correlation partially compensates this increase by roughly half. The CCSD and MP2 correlation energies from PBC converge rapidly with k-mesh; for sufficiently dense meshes the differences from cluster references fall to the Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,1–Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,2 Ha range. The polarizability behaves differently: the chain Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,3 is about Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,4–Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,5 a.u. larger than the molecular value, but coarse PBC sampling can qualitatively misrepresent this effect. In particular, PBC(5) underestimates Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,6 by about Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,7 a.u., whereas PBC(21) and larger reduce the discrepancy to about Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,8–Ecorr=1NktIAfIA+14Nk3τIJABIJAB,E_\text{corr} = \frac{1}{N_k}\, t_I^{A} f_{IA} + \frac{1}{4 N_k^3}\, \tau_{IJ}^{AB} \langle IJ || AB \rangle,9 a.u.

For the LiH chain with bond length NkN_k0 Å and NkN_k1 Å in STO-3G, all electrons are correlated, yielding 4 occupied and 8 virtual orbitals per cell. Two independent polarizability components occur: NkN_k2 along the chain and NkN_k3 perpendicular to it. The cluster calculations show an inversion relative to the isolated molecule: in the molecule, NkN_k4, whereas in the chain, NkN_k5. Thus the longitudinal polarizability is strongly enhanced by chain formation, while the transverse polarizability decreases modestly. CCResPy reproduces the perpendicular components well even on relatively small PBC meshes, with remaining differences likely due more to finite-cluster artifacts than to PBC deficiencies. The longitudinal component is more problematic: even at PBC(17)–PBC(21), periodic values differ from cluster references by about NkN_k6–NkN_k7 a.u., approximately NkN_k8 of the full molecule-to-chain increase. The source work attributes this persistent discrepancy mainly to the missing-integer problem in the length-gauge dipole operator rather than to inadequacy of the CCSD response formalism itself.

The optimized LiH chain provides a stricter test because the repeat distance shortens to NkN_k9 Å and the Li–H bond length changes to fPQf_{PQ}0 Å, increasing intercell interaction. The Hartree-Fock energy per cell is lowered by about fPQf_{PQ}1 mHa relative to the previous LiH-chain geometry, while the isolated molecule changes by only about fPQf_{PQ}2 mHa. Correlation energies change little, which is reported as evidence that, in this minimal basis, correlation is mostly local. The reference fPQf_{PQ}3 becomes fPQf_{PQ}4–fPQf_{PQ}5 a.u. smaller than in the previous geometry, whereas molecular values remain nearly unchanged. Once again, the perpendicular polarizabilities are reproduced well at sufficiently large k-meshes, but the longitudinal component differs from cluster results by about fPQf_{PQ}6–fPQf_{PQ}7 a.u. even at PBC(25), reinforcing the interpretation that the dominant limitation is the length-gauge dipole operator rather than geometry-dependent electronic structure.

7. Significance, limitations, and extension paths

The principal significance of CCResPy in its current documented form is that it realizes, within one explicit implementation, periodic CCSD ground state, fPQf_{PQ}8-CCSD, perturbed CCSD amplitudes at complex frequencies, and symmetric CC linear response for 1D periodic systems. The source work identifies this as the first implementation of frequency-dependent electric dipole-electric dipole polarizability for 1D periodic systems at the CCSD level with PBCs. In methodological terms, it extends coupled-cluster response theory—long established for molecular optical rotation, Raman optical activity, and higher-order response—into a domain where DFT and TDDFT have largely dominated practical computations (Caricato et al., 2 Aug 2025).

The implementation also makes clear what CCResPy is not yet. It does not exploit restricted closed-shell spin symmetry, reduced k-space tensor representations, local correlation, or low-rank factorization. All tensors are dense and global. Only 1D periodicity is implemented. The code is therefore best understood as a research prototype and development platform rather than a production workhorse for very large systems or very dense k-meshes. The major scientific limitation highlighted by the benchmarks is the electric-dipole operator in the periodic length gauge, especially for longitudinal response in strongly polarizable chains.

The future directions stated for the code are correspondingly method-oriented. They include more efficient periodic implementations with explicit momentum-conserving k-summations, persistent disk-based strategies for large intermediates, a velocity-gauge formulation of polarizability to avoid the missing-integer issue, higher-order response functions and additional operators such as magnetic dipole and electric quadrupole, and extension to 2D and 3D periodicity. Because the present code is organized around collective indices and tensor intermediates rather than separate molecular and periodic engines, these extensions are presented as additions to the intermediate machinery rather than a wholesale redesign of the architecture. This suggests that CCResPy’s lasting importance may lie not only in the specific 1D polarizability implementation already reported, but also in its role as an explicit, extensible reference implementation for periodic coupled-cluster response theory.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to CCResPy.