Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
db8001b
getting started on gradients with psi4
maxscheurer Jan 11, 2021
5e2e7b3
add basis gradient tests
maxscheurer Jan 16, 2021
a72f71d
started cvs-adc0 gradient
iubr Sep 19, 2021
7e5c14d
added the cvs-adc2 1PDMs
iubr Oct 26, 2021
87599e7
cleaned up code; fixed a few TODOs; remaining: 1/sqrt2, antisymm, ad…
iubr Nov 11, 2021
678a6d4
tweak test infrastructure
maxscheurer Dec 14, 2021
8fb606c
try to finally make damn tests work :(
maxscheurer Dec 14, 2021
999ef3f
flake 8 happy?
maxscheurer Dec 14, 2021
8fccd86
all molecules hate me, just h2o for now
maxscheurer Dec 16, 2021
1ff8973
refactor gradient results, add test for correlation energy
maxscheurer Dec 17, 2021
6ba9bc5
add adc2x gradients, fix cvs-adc2x energy stuff
maxscheurer Dec 19, 2021
854d459
adc3 amplitude response
maxscheurer Feb 8, 2022
299ee5b
correct densities
maxscheurer Feb 8, 2022
f718601
adc3 gradients working
maxscheurer Feb 9, 2022
60444a7
warn instead of fail
maxscheurer Aug 25, 2024
65bfcc3
check for warning
maxscheurer Aug 25, 2024
164b41e
merge master
maxscheurer Mar 26, 2025
be40624
switch to parametrize, restructure tests
maxscheurer Mar 4, 2026
d7579da
fix cvs-adc2x gradients and generation
maxscheurer Mar 5, 2026
8998b6d
fix generation and tests
maxscheurer May 29, 2026
9107c8f
Reduce PySCF gradient contraction memory (#215)
maxscheurer Jun 14, 2026
4dab726
Integrate master refactor into gradients branch (#224)
maxscheurer Jun 16, 2026
26c38a4
Speed up restricted AO-pair TPDM transform (#225)
maxscheurer Jun 17, 2026
63cb0ea
Record merge of master into gradients
maxscheurer Jun 17, 2026
4b3b83c
Add geometry optimization scanner for gradients (#226)
maxscheurer Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion adcc/ElectronicStates.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,19 @@ def excitation_vector(self):
"""List of excitation vectors"""
return self._excitation_vector

@property
def total_energy(self):
"""Total energies (ground state + excitation) of all computed states"""
return np.array([self._total_energy(i) for i in range(self.size)])

def _total_energy(self, state_n: int) -> float:
"""Computes the total energy for a single state"""
if self.method.level == MethodLevel.ZERO:
return (self._excitation_energy[state_n]
+ self.reference_state.energy_scf)
return (self._excitation_energy[state_n]
+ self.ground_state.energy(self.method.level.to_int()))

@property
def state_diffdm(self) -> list[OneParticleDensity]:
"""List of difference density matrices of all computed states"""
Expand Down Expand Up @@ -305,7 +318,7 @@ def excitation_property_keys(self) -> list[str]:
# NOTE: this currently assumes that all available properties are available
# on the corresponding state_view class
assert self._state_view_cls is not None
blacklist = ("parent_state")
blacklist = ("parent_state", "ground_state", "reference_state", "method")
ret = []
for key in dir(self._state_view_cls):
# private fields or ao transformed densities or other fields
Expand Down
25 changes: 25 additions & 0 deletions adcc/Excitation.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,31 @@ def __init__(self, parent_state, index: int):
super().__init__(parent_state, index)
self._parent_state: ElectronicTransition

# -----------------------------------------------------------------------
# Forwarding properties for gradient code access
# These forward to the parent ElectronicStates container and are excluded
# from excitation_property_keys (see ElectronicStates blacklist).
# -----------------------------------------------------------------------

@property
def ground_state(self):
"""The ground state (LazyMp) of the parent ElectronicStates"""
return self._parent_state.ground_state

@property
def reference_state(self):
"""The HF reference state of the parent ElectronicStates"""
return self._parent_state.reference_state

@property
def method(self):
"""The ADC method of the parent ElectronicStates"""
return self._parent_state.method

# -----------------------------------------------------------------------
# Transition properties (delegated to parent)
# -----------------------------------------------------------------------

@property
def transition_dm(self) -> OneParticleOperator:
"""The transition density matrix"""
Expand Down
Loading
Loading