Manual submission for NPT ensemble with vc relax #180
-
Dear developers, I am currently exploring NPT relaxation with ab initio methods. In the provided tutorial1,
However, my preference leans towards manual submission because
Unfortunately, the manual process is tailored for NVT relaxation. I am encountering difficulties in configuring an equivalent setup for NPT relaxation. In How can I use NPT for manual submission? Specifically, could you provide me with an example code to generate and load ensemble for NPT? Thanks a lot, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Dear Yubi, There is actually an example in the github repository to do exactly what you want in ``Examples/SimpleVcRelax/vc_relax_no_automatic_submission.py''. Here is the code: import cellconstructor as CC, cellconstructor.Phonons
import sscha, sscha.Ensemble, sscha.SchaMinimizer, sscha.Utilities
import sscha.Relax
# Load the dynamical matrix
dyn = CC.Phonons.Phonons("../ensemble_data_test/dyn", nqirr=1)
# Load the ensemble (0 K)
ensemble = sscha.Ensemble.Ensemble(dyn, T0=0)
ensemble.load("../ensemble_data_test/", population=2, N=1000)
# Prepare the minimization
minim = sscha.SchaMinimizer.SSCHA_Minimizer(ensemble)
# Prepare the auxiliary functions to save the minimization output
ioinfo = sscha.Utilities.IOInfo()
ioinfo.SetupSaving("minim_1")
# Prepare the vc-relax
relax = sscha.Relax.SSCHA(minim, max_pop=1)
relax.setup_custom_functions(custom_function_post=ioinfo.CFP_SaveAll)
# Run the vc-relax
relax.vc_relax(target_press=0, static_bulk_modulus=100,
restart_from_ens=True)
# Save the final dynamical matrix
relax.minim.dyn.save_qe("final_dyn") This is the code to perform 1 single step of the vc-relax with an ensemble already generated and computed. Indeed the steps to generate the ensemble are the same as the standard manual submission as in the code you cited. Adapting it here at the bottom of this script:
The rest should be the same as usual. Also the stress is - dE/dV Bests, |
Beta Was this translation helpful? Give feedback.
Dear Yubi,
There is actually an example in the github repository to do exactly what you want in ``Examples/SimpleVcRelax/vc_relax_no_automatic_submission.py''.
Here is the code: