Skip to content
Merged
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions tests/unit/test_evaluate_gradients_threaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@


def test_transform_consistent_with_wf(H2_casci):
"""Test that evaluate_gradient_threaded works when given states with different numbers of determinants"""
from pyqmc.method.ensemble_optimization_wfbywf import StochasticReconfigurationWfbyWf
from pyqmc.method.ensemble_optimization_threaded import evaluate_gradients_threaded
mol, mf, mc = H2_casci
Expand All @@ -14,10 +15,9 @@ def test_transform_consistent_with_wf(H2_casci):

energy = pyq.EnergyAccumulator(mol)
sr_accumulator = []
tol = 1e-20
tol = 1e-20 # With tol = 1e-20 state 0 has 4 determinants whereas state 1 will have 3
wfs = []
for i in range(2):

wf, to_opt = pyq.generate_slater(mol, mf, mc=mcs[i], optimize_determinants=True, tol = tol)
wfs.append(wf)
sr_accumulator.append(
Expand All @@ -30,12 +30,13 @@ def test_transform_consistent_with_wf(H2_casci):
)
]
)

configs = pyq.initial_guess(mol, 100)
configs = pyq.initial_guess(mol, 1)
configs_ensemble = [
[[copy.deepcopy(configs) for _ in range(2)] for _ in range(len(sr_accumulator[wfi]))]
for wfi in range(2)
]
for i,wf in enumerate(wfs):
print(f"For wf{i} {len(wf.parameters['det_coeff']) = }")
with ProcessPoolExecutor() as executor:
_, data_unweighted, configs = pyqmc.method.sample_many.sample_overlap(
wfs,
Expand Down
Loading