-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from JoonhoLee-Group/allow_noci
Allow for NOCI trial.
- Loading branch information
Showing
25 changed files
with
656 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,46 +15,33 @@ | |
# Author: Fionn Malone <[email protected]> | ||
# | ||
|
||
import plum | ||
|
||
from ipie.estimators.estimator_base import EstimatorBase | ||
from ipie.estimators.local_energy_batch import ( | ||
local_energy_batch, | ||
local_energy_multi_det_trial_batch, | ||
) | ||
from ipie.utils.backend import arraylib as xp | ||
|
||
from ipie.trial_wavefunction.particle_hole import ( | ||
ParticleHoleNaive, | ||
ParticleHoleWicks, | ||
ParticleHoleWicksNonChunked, | ||
ParticleHoleWicksSlow, | ||
) | ||
from ipie.trial_wavefunction.single_det import SingleDet | ||
|
||
from ipie.estimators.local_energy_noci import local_energy_noci | ||
from ipie.estimators.local_energy_sd import local_energy_single_det_uhf | ||
from ipie.estimators.local_energy_wicks import ( | ||
local_energy_multi_det_trial_wicks_batch, | ||
local_energy_multi_det_trial_wicks_batch_opt, | ||
local_energy_multi_det_trial_wicks_batch_opt_chunked, | ||
) | ||
from ipie.estimators.local_energy_sd import ( | ||
local_energy_single_det_uhf, | ||
) | ||
|
||
from ipie.hamiltonians.generic import GenericComplexChol, GenericRealChol | ||
from ipie.systems.generic import Generic | ||
from ipie.hamiltonians.generic import GenericRealChol, GenericComplexChol | ||
from ipie.trial_wavefunction.noci import NOCI | ||
from ipie.trial_wavefunction.particle_hole import ( | ||
ParticleHole, | ||
ParticleHoleNaive, | ||
ParticleHoleNonChunked, | ||
ParticleHoleSlow, | ||
) | ||
from ipie.trial_wavefunction.single_det import SingleDet | ||
from ipie.utils.backend import arraylib as xp | ||
from ipie.walkers.uhf_walkers import UHFWalkers | ||
|
||
import plum | ||
|
||
|
||
# Single dispatch | ||
_dispatcher = { | ||
ParticleHoleNaive: local_energy_multi_det_trial_batch, | ||
ParticleHoleWicks: local_energy_multi_det_trial_wicks_batch_opt_chunked, | ||
ParticleHoleWicksNonChunked: local_energy_multi_det_trial_wicks_batch_opt, | ||
ParticleHoleWicksSlow: local_energy_multi_det_trial_wicks_batch, | ||
SingleDet: local_energy_batch, | ||
} | ||
|
||
|
||
@plum.dispatch | ||
def local_energy( | ||
|
@@ -88,7 +75,7 @@ def local_energy( | |
system: Generic, | ||
hamiltonian: GenericRealChol, | ||
walkers: UHFWalkers, | ||
trial: ParticleHoleWicks, | ||
trial: ParticleHole, | ||
): | ||
return local_energy_multi_det_trial_wicks_batch_opt_chunked(system, hamiltonian, walkers, trial) | ||
|
||
|
@@ -98,7 +85,7 @@ def local_energy( | |
system: Generic, | ||
hamiltonian: GenericRealChol, | ||
walkers: UHFWalkers, | ||
trial: ParticleHoleWicksNonChunked, | ||
trial: ParticleHoleNonChunked, | ||
): | ||
return local_energy_multi_det_trial_wicks_batch_opt(system, hamiltonian, walkers, trial) | ||
|
||
|
@@ -108,11 +95,16 @@ def local_energy( | |
system: Generic, | ||
hamiltonian: GenericRealChol, | ||
walkers: UHFWalkers, | ||
trial: ParticleHoleWicksSlow, | ||
trial: ParticleHoleSlow, | ||
): | ||
return local_energy_multi_det_trial_wicks_batch(system, hamiltonian, walkers, trial) | ||
|
||
|
||
@plum.dispatch | ||
def local_energy(system: Generic, hamiltonian: GenericRealChol, walkers: UHFWalkers, trial: NOCI): | ||
return local_energy_noci(system, hamiltonian, walkers, trial) | ||
|
||
|
||
class EnergyEstimator(EstimatorBase): | ||
def __init__( | ||
self, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,18 +17,18 @@ | |
# linusjoonho <[email protected]> | ||
# | ||
|
||
from ipie.utils.misc import is_cupy | ||
|
||
from ipie.trial_wavefunction.particle_hole import ParticleHoleWicks | ||
from ipie.trial_wavefunction.noci import NOCI | ||
from ipie.trial_wavefunction.single_det import SingleDet | ||
|
||
from ipie.estimators.greens_function_multi_det import ( | ||
greens_function_multi_det_wicks_opt, | ||
greens_function_noci, | ||
) | ||
from ipie.estimators.greens_function_single_det import ( | ||
greens_function_single_det_batch, | ||
greens_function_single_det, | ||
greens_function_single_det_batch, | ||
) | ||
from ipie.estimators.greens_function_multi_det import greens_function_multi_det | ||
from ipie.estimators.greens_function_multi_det import greens_function_multi_det_wicks_opt | ||
from ipie.trial_wavefunction.noci import NOCI | ||
from ipie.trial_wavefunction.particle_hole import ParticleHole | ||
from ipie.trial_wavefunction.single_det import SingleDet | ||
from ipie.utils.misc import is_cupy | ||
|
||
|
||
def compute_greens_function(walker_batch, trial): | ||
|
@@ -59,8 +59,8 @@ def get_greens_function(trial): | |
else: | ||
compute_greens_function = greens_function_single_det | ||
elif isinstance(trial, NOCI): | ||
compute_greens_function = greens_function_multi_det | ||
elif isinstance(trial, ParticleHoleWicks): | ||
compute_greens_function = greens_function_noci | ||
elif isinstance(trial, ParticleHole): | ||
compute_greens_function = greens_function_multi_det_wicks_opt | ||
else: | ||
compute_greens_function = None | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.