-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electron-phonon extension #294
base: develop
Are you sure you want to change the base?
Electron-phonon extension #294
Conversation
ipie/addons/ephqmc/trial_wavefunction/variational/coherent_state_variational.py
Outdated
Show resolved
Hide resolved
ipie/addons/ephqmc/trial_wavefunction/variational/coherent_state_variational.py
Outdated
Show resolved
Hide resolved
ipie/addons/ephqmc/trial_wavefunction/variational/coherent_state_variational.py
Outdated
Show resolved
Hide resolved
Run the tests locally and make sure jax (and probably jaxlib) is added to requirements.txt |
For example:
|
Should only require jax and jaxlib when one needs to use the electron-phonon module. It's also likely that we will get rid of jax dependence completely soon... |
Where did the example go? |
@m-baumgarten Could you guard any jax imports so that the tests run when jax is not installed? Add a skip to the unit tests so that the tests don't fail. Make an environment without jax and test it locally. |
@m-baumgarten can you resolve the conflict. |
@m-baumgarten will this feature be merged? If so, can you please resolve the conflicts and address any remaining comments? |
I think all comments should be addressed. Just changed the propagator file, should be ready to go now. |
@m-baumgarten Could you fix the failing tests? |
…ein into multiel_holstein
…ein into multiel_holstein
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the comments for merge.
ipie/propagation/propagator.py
Outdated
|
||
Propagator = {GenericRealChol: PhaselessGeneric, GenericComplexChol: PhaselessGeneric} | ||
Propagator = {GenericRealChol: PhaselessGeneric, GenericComplexChol: PhaselessGeneric, HolsteinModel: HolsteinPropagatorImportance} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if we want to modify the propagator class this way. Was there no other way?
ipie/estimators/energy.py
Outdated
|
||
@plum.dispatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why you had to make changes in ipie's native estimator class. Couldn't you write a customized estimator class?
@@ -108,7 +108,7 @@ def local_energy_noci( | |||
walkers : WalkerBatch | |||
Walkers object. | |||
trial : trial object | |||
Trial wavefunctioni. | |||
Trial wavefunction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great catch!
ipie/addons/eph/__init__.py
Outdated
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Directory for additions to ipie which depend on the core ipie library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete lines 15-17. we meant this to be an instruction for contributing to addons.
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Directory for additions to ipie which depend on the core ipie library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Directory for additions to ipie which depend on the core ipie library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be deleted?
# limitations under the License. | ||
|
||
# pylint: disable=import-error | ||
import jax.numpy as npj |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there JAX left?
|
||
# pylint: disable=import-error | ||
import jax.numpy as npj | ||
from jax.config import config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there JAX left?
from ipie.addons.eph.trial_wavefunction.toyozawa import circ_perm | ||
|
||
# pylint: disable=import-error | ||
import jax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there JAX left?
from ipie.addons.eph.trial_wavefunction.variational.estimators import gab | ||
|
||
# pylint: disable=import-error | ||
import jax |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there JAX left?
What?
This pull request adds functionalities that allow running Diffusion MC for a 1D Holstein Chain based on [1] using an AFQMC object. Trials currently implemented include a simple coherent state trial as well as a Toyozawa ansatz.
Why?
Implements a convenient framework for continued method development for electron-phonon models.
How?
Major additions include the designated electron-phonon walker class
EphWalkers
, keeping track of bosonic overlaps and carrying phonon displacements.Two propagators are added,
HolsteinPropagatorFree
andHolsteinPropagatorImportance
, allowing for DMC propagation of bosonic degrees of freedom.Additionally, in
ipie/ipie/trial_wavefunction/holstein
two trial wave functions are implemented,CoherentStateTrial
andToyozawaTrial
.To estimate the ground state energy one can use the regular
EnergyEstimator
.Lastly, the Holstein Hamiltonian is implemented in
ipie/ipie/hamiltonians/elph/holstein.py
.Testing Steps
Example code can be found in
ipie/examples/13-1d_holstein
. Some reference values to compare to can be found in [1].References
[1] Joonho Lee, Shiwei Zhang, and David R. Reichman (2021) Phys. Rev. B 103, 115123