├── examples ├── slowgrowth_fixpot │ ├── ICONST │ ├── KPOINTS │ ├── echo_sg.py │ ├── INCAR │ ├── POSCAR │ └── analysis.ipynb ├── cineb_fixpot │ ├── FS_conv.db │ ├── IS_conv.db │ ├── band_fixchg.db │ ├── output │ │ ├── neb.traj │ │ ├── restart.db │ │ ├── band_init.db │ │ ├── geom_conv.db │ │ ├── neb_conv.db │ │ ├── restart.nelect_net │ │ └── LOG.cineb_fixpot_conv.1991756 │ └── cineb_fixpot.py ├── geomopt_fixpot │ ├── ouput │ │ ├── FS.traj │ │ ├── IS.traj │ │ ├── FS_conv.db │ │ ├── IS_conv.db │ │ ├── LOG.ase-vasp-IS.sh.1988320 │ │ └── LOG.ase-vasp-FS.sh.1988319 │ ├── geomopt_fixpot.py │ ├── FS.vasp │ └── IS.vasp ├── md_fixpot │ ├── md-langevin_fixpot.py │ └── input.vasp └── tutorial.md ├── echo ├── __init__.py ├── vaspmd.py ├── sp.py ├── utils.py ├── data.py ├── analysis.py ├── opt.py ├── md.py └── neb.py ├── .gitignore ├── README.md └── LICENSE /examples/slowgrowth_fixpot/ICONST: -------------------------------------------------------------------------------- 1 | R 137 95 0 2 | R 95 43 0 3 | S 1 -1 0 4 | -------------------------------------------------------------------------------- /examples/cineb_fixpot/FS_conv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/cineb_fixpot/FS_conv.db -------------------------------------------------------------------------------- /examples/cineb_fixpot/IS_conv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/cineb_fixpot/IS_conv.db -------------------------------------------------------------------------------- /examples/cineb_fixpot/band_fixchg.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/cineb_fixpot/band_fixchg.db -------------------------------------------------------------------------------- /examples/cineb_fixpot/output/neb.traj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/cineb_fixpot/output/neb.traj -------------------------------------------------------------------------------- /examples/geomopt_fixpot/ouput/FS.traj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/geomopt_fixpot/ouput/FS.traj -------------------------------------------------------------------------------- /examples/geomopt_fixpot/ouput/IS.traj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/geomopt_fixpot/ouput/IS.traj -------------------------------------------------------------------------------- /examples/cineb_fixpot/output/restart.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/cineb_fixpot/output/restart.db -------------------------------------------------------------------------------- /examples/slowgrowth_fixpot/KPOINTS: -------------------------------------------------------------------------------- 1 | KPOINTS created by Atomic Simulation Environment 2 | 0 3 | Gamma 4 | 1 1 1 5 | 0 0 0 6 | -------------------------------------------------------------------------------- /examples/cineb_fixpot/output/band_init.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/cineb_fixpot/output/band_init.db -------------------------------------------------------------------------------- /examples/cineb_fixpot/output/geom_conv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/cineb_fixpot/output/geom_conv.db -------------------------------------------------------------------------------- /examples/cineb_fixpot/output/neb_conv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/cineb_fixpot/output/neb_conv.db -------------------------------------------------------------------------------- /examples/geomopt_fixpot/ouput/FS_conv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/geomopt_fixpot/ouput/FS_conv.db -------------------------------------------------------------------------------- /examples/geomopt_fixpot/ouput/IS_conv.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zishengz/echo/HEAD/examples/geomopt_fixpot/ouput/IS_conv.db -------------------------------------------------------------------------------- /examples/cineb_fixpot/output/restart.nelect_net: -------------------------------------------------------------------------------- 1 | -3.548099999999976717e+00 2 | -3.562899999999899592e+00 3 | -3.620300000000042928e+00 4 | -3.583800000000110231e+00 5 | -3.573900000000094224e+00 6 | -------------------------------------------------------------------------------- /examples/slowgrowth_fixpot/echo_sg.py: -------------------------------------------------------------------------------- 1 | from echo.vaspmd import slow_growth 2 | from ase.io import read, write 3 | from ase.md.velocitydistribution import MaxwellBoltzmannDistribution 4 | 5 | 6 | geom_inp = read('POSCAR') 7 | 8 | slow_growth( 9 | geom_inp, 10 | nsteps = 6000, 11 | pot_target = -0.0591593 * 1, 12 | pot_ref = 4.6, 13 | pot_step = 928 * 0.001, 14 | ) 15 | 16 | 17 | -------------------------------------------------------------------------------- /examples/slowgrowth_fixpot/INCAR: -------------------------------------------------------------------------------- 1 | #NELECT=930.0711617900769 2 | 3 | NPAR=6 4 | #ISTART = 0 5 | #ICHARG = 2 6 | #LWAVE = F 7 | #LCHARG = F 8 | 9 | ENCUT = 300 10 | EDIFF = 1e-5 11 | ALGO = F 12 | GGA = PE 13 | IVDW = 11 14 | PREC = L 15 | LREAL= A 16 | ISMEAR = 0 17 | SIGMA = 0.1 18 | 19 | LSOL = .TRUE. 20 | EB_K = 78.4 21 | LAMBDA_D_K = 3.0 22 | TAU = 0.0 23 | #NC_K = 0.00025 24 | 25 | IBRION=0 26 | TEBEG=300 27 | TEEND=300 28 | MDALGO=2 29 | SMASS=0 30 | 31 | INCREM=0.001 32 | POTIM=1 33 | NSW=1 34 | 35 | LBLUEOUT=T 36 | 37 | -------------------------------------------------------------------------------- /examples/geomopt_fixpot/ouput/LOG.ase-vasp-IS.sh.1988320: -------------------------------------------------------------------------------- 1 | VASP settings: 2 | {'encut': 400, 'sigma': 0.1, 'eb_k': 78.4, 'tau': 0, 'lambda_d_k': 3, 'ediff': 1e-05, 'algo': 'Fast', 'gga': 'RP', 'prec': 'Normal', 'ismear': 0, 'nelm': 300, 'npar': 4, 'lcharg': False, 'lsol': True, 'lreal': 'Auto', 'xc': 'rpbe', 'pp': 'PBE', 'setups': 'recommended', 'txt': '-', 'kpts': [1, 1, 1], 'gamma': True, 'reciprocal': False, 'ignore_constraints': False, 'charge': 0, 'custom': {}} 3 | Starting from input geometry... 4 | Charge state read from last INCAR: 3.6193 |e| 5 | 6 | FIX-POTENTIAL GEOMOPT (pot_target= 0.0, fmax=0.02, pot_conv= 0.001) 7 | Potentiostat step set to 3.172000 |e|/V (NELECT_neu=1586.000 |e|) 8 | Step 1: NELECT_net= -3.6193 |e|; U_she= -0.0009 V; GCFE_el= -436.9315 eV 9 | Conv 1: Potential [o] U_diff= -0.0009 V | Forces [o] F_max= 0.0179 eV/Å 10 | CONVERGED 11 | 12 | real 6m3.381s 13 | user 17m9.550s 14 | sys 0m15.146s 15 | -------------------------------------------------------------------------------- /examples/md_fixpot/md-langevin_fixpot.py: -------------------------------------------------------------------------------- 1 | from ase.calculators.vasp import Vasp 2 | from ase.io import read 3 | from echo.md import langevin_fixpot 4 | import sys 5 | 6 | vaspsol = Vasp( 7 | lcharg=False, 8 | npar=4, 9 | xc='pbe', 10 | ivdw=11, 11 | ismear=0, 12 | sigma=0.1, 13 | encut=300, 14 | lreal='Auto', 15 | prec='Low', 16 | # isym=0, 17 | algo='Fast', 18 | nelm=300, 19 | ediff=1e-5, 20 | gamma=True, 21 | kpts=[1, 1, 1], 22 | charge=0, 23 | lsol=True, eb_k=78.4, tau=0, lambda_d_k=3, 24 | setups='recommended', 25 | txt='vasp.out', 26 | directory='tmp') 27 | 28 | geom_inp = read(sys.argv[1]) 29 | 30 | langevin_fixpot( 31 | atoms=geom_inp, 32 | timestep_fs=1, 33 | temperature_K=300, 34 | nsteps=1000, 35 | friction=0.1, 36 | label='md-fp', 37 | pot_target=0, 38 | pot_step=1, 39 | pot_ref=4.6, 40 | potentiostat_nsteps=5, 41 | calculator=vaspsol 42 | ) 43 | 44 | -------------------------------------------------------------------------------- /echo/__init__.py: -------------------------------------------------------------------------------- 1 | # Initialize a flag to track if the message has been printed 2 | _initialized = False 3 | 4 | # Define a function to print the message once 5 | def initialize_module(): 6 | global _initialized 7 | if not _initialized: 8 | # logo art adapted from https://patorjk.com/software/taag/#p=testall&f=Graffiti&t=EChO 9 | print(""" 10 | ███████ ██████ ██ ██████ 11 | ██ ██ ██ ██ ██ 12 | █████ ██ ███████ ██ ██ 13 | ██ ██ ██ ██ ██ ██ 14 | ███████ lectro ██████ ██ ██ emical ██████ ptimizer 15 | """) 16 | 17 | print(' Copyright © 2024 Zisheng Zhang') 18 | print(' Please cite: JACS, 2024, 146, 14, 9623-9630 ') 19 | print(' & JACS 2025, accepted. DOI:10.1021/jacs.5c00775') 20 | 21 | _initialized = True 22 | 23 | # Call the function during the first import 24 | initialize_module() 25 | 26 | # The rest of your module initialization can go here if needed -------------------------------------------------------------------------------- /examples/geomopt_fixpot/geomopt_fixpot.py: -------------------------------------------------------------------------------- 1 | 2 | from ase.calculators.vasp import Vasp 3 | from ase.io import read, write 4 | from ase.optimize import LBFGSLineSearch 5 | import sys 6 | 7 | from echo.opt import opt_fix_pot 8 | 9 | vaspsol = Vasp( 10 | lcharg=False, 11 | npar=4, 12 | xc='rpbe', 13 | # ivdw=11, 14 | ismear=0, 15 | sigma=0.1, 16 | encut=400, 17 | lreal='Auto', 18 | prec='Normal', 19 | # isym=0, 20 | algo='Fast', 21 | nelm=300, 22 | ediff=1e-5, 23 | gamma=True, 24 | kpts=[1, 1, 1], 25 | charge=0, 26 | lsol=True, eb_k=78.4, tau=0, lambda_d_k=3, 27 | setups='recommended', 28 | ) 29 | 30 | fn_inp = sys.argv[1] 31 | geom_inp = read(fn_inp) 32 | label_inp = fn_inp.split('.')[0] 33 | 34 | geom_out = opt_fix_pot( 35 | geom_inp, 36 | label=label_inp, 37 | pot_target=0.0, 38 | pot_ref=4.6, 39 | # pot_step=1.5, 40 | calculator=vaspsol, 41 | optimizer=LBFGSLineSearch, 42 | fmax=0.02, 43 | pot_conv=0.001 44 | ) 45 | 46 | write(f'{label_inp}-opt.vasp', geom_out) 47 | -------------------------------------------------------------------------------- /examples/geomopt_fixpot/ouput/LOG.ase-vasp-FS.sh.1988319: -------------------------------------------------------------------------------- 1 | VASP settings: 2 | {'encut': 400, 'sigma': 0.1, 'eb_k': 78.4, 'tau': 0, 'lambda_d_k': 3, 'ediff': 1e-05, 'algo': 'Fast', 'gga': 'RP', 'prec': 'Normal', 'ismear': 0, 'nelm': 300, 'npar': 4, 'lcharg': False, 'lsol': True, 'lreal': 'Auto', 'xc': 'rpbe', 'pp': 'PBE', 'setups': 'recommended', 'txt': '-', 'kpts': [1, 1, 1], 'gamma': True, 'reciprocal': False, 'ignore_constraints': False, 'charge': 0, 'custom': {}} 3 | Starting from input geometry... 4 | Charge state read from last INCAR: 3.5657 |e| 5 | 6 | FIX-POTENTIAL GEOMOPT (pot_target= 0.0, fmax=0.02, pot_conv= 0.001) 7 | Potentiostat step set to 3.172000 |e|/V (NELECT_neu=1586.000 |e|) 8 | Step 1: NELECT_net= -3.5657 |e|; U_she= -0.0015 V; GCFE_el= -436.9170 eV 9 | Conv 1: Potential [x] U_diff= -0.0015 V | Forces [o] F_max= 0.0165 eV/Å 10 | Step 2: NELECT_net= -3.5703 |e|; U_she= 0.0002 V; GCFE_el= -436.9229 eV 11 | Conv 2: Potential [o] U_diff= 0.0002 V | Forces [o] F_max= 0.0164 eV/Å 12 | CONVERGED 13 | 14 | real 9m8.902s 15 | user 50m31.732s 16 | sys 1m11.808s 17 | -------------------------------------------------------------------------------- /examples/cineb_fixpot/cineb_fixpot.py: -------------------------------------------------------------------------------- 1 | from ase.calculators.vasp import Vasp 2 | from ase.io import read, write 3 | from ase.db import connect 4 | from ase.optimize import FIRE 5 | import sys 6 | 7 | from echo.neb import neb_fix_pot 8 | 9 | vaspsol = Vasp( 10 | lcharg=False, 11 | npar=8, 12 | xc='rpbe', 13 | # ivdw=11, 14 | ismear=0, 15 | sigma=0.1, 16 | encut=400, 17 | lreal='Auto', 18 | prec='Normal', 19 | # isym=0, 20 | algo='Fast', 21 | nelm=300, 22 | ediff=1e-5, 23 | gamma=True, 24 | kpts=[1, 1, 1], 25 | charge=0, 26 | lsol=True, eb_k=78.4, tau=0, lambda_d_k=3, 27 | setups='recommended', 28 | txt='vasp.out') 29 | 30 | # Read from converged db file from fixpot geomopt 31 | fn_ini = sys.argv[1] 32 | with connect(fn_ini) as db: 33 | for r in db.select(): 34 | geom_ini = r.toatoms() 35 | nelect_net_ini = r.nelect_net 36 | pot_ini = r.pot 37 | gcfe_ini = r.gcfe 38 | fn_fin = sys.argv[2] 39 | with connect(fn_fin) as db: 40 | for r in db.select(): 41 | geom_fin = r.toatoms() 42 | nelect_net_fin = r.nelect_net 43 | pot_fin = r.pot 44 | gcfe_fin = r.gcfe 45 | 46 | band_inp = None 47 | # try: 48 | # n_images = len(read('band_init.db', index=':')) 49 | # band_inp = read('neb.traj', index=f'{-n_images}:') 50 | # except: 51 | # band_inp = None 52 | band_inp = read('band_fixchg.db', index=':') 53 | 54 | band_conv = neb_fix_pot( 55 | geom_ini, 56 | geom_fin, 57 | pot_ini=pot_ini, 58 | pot_fin=pot_fin, 59 | nelect_net_ini=nelect_net_ini, 60 | nelect_net_fin=nelect_net_fin, 61 | gcfe_ini=gcfe_ini, 62 | gcfe_fin=gcfe_fin, 63 | pot_target=0, 64 | pot_ref=4.6, 65 | climb=True, 66 | calculator=vaspsol, 67 | optimizer=FIRE, 68 | fmax=0.02, 69 | pot_conv=0.001, 70 | band_inp=band_inp 71 | ) 72 | 73 | write('geom_conv.db', band_conv) 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | -------------------------------------------------------------------------------- /echo/vaspmd.py: -------------------------------------------------------------------------------- 1 | 2 | from ase.io import read, write 3 | from ase.db import connect 4 | from echo.utils import get_nelect_neu_pp, get_GCDFT 5 | import os 6 | 7 | # functions for interfacing with vasp 8 | 9 | def get_bluemoon(): 10 | # read from a single-step REPORT file with IBLUEOUT=T 11 | # returns: cv, lambda, |z|^(-1/2), GkT, |z|^(-1/2)*(lambda+GkT), T_inst 12 | data_raw = open('REPORT').readlines() 13 | return [eval(l.split()[2]) for l in data_raw if 'cc>' in l][0],\ 14 | [eval(l.split()[1]) for l in data_raw if 'b_m>' in l][0],\ 15 | [eval(l.split()[2]) for l in data_raw if 'b_m>' in l][0],\ 16 | [eval(l.split()[3]) for l in data_raw if 'b_m>' in l][0],\ 17 | [eval(l.split()[4]) for l in data_raw if 'b_m>' in l][0],\ 18 | [eval(l.split()[2]) for l in data_raw if 'tmprt>' in l][0] 19 | 20 | def slow_growth( 21 | atoms, 22 | nsteps = 10, 23 | pot_target=0.0, 24 | pot_ref=4.6, 25 | pot_step=None, 26 | ): 27 | write('ini.vasp', atoms) 28 | nelect_neu = get_nelect_neu_pp(atoms) 29 | if pot_step is None: 30 | pot_step = 0.002 * nelect_neu 31 | print(f'Potentiostat step set to {pot_step:.6f} |e|/V (NELECT_neu={nelect_neu:8.3f} |e|)') 32 | nelect_net_now = 0 33 | 34 | for i in range(nsteps): 35 | os.system('$VASP_COMMAND > vasp.out') 36 | # GCDFT data extraction 37 | nelect_net_now, pot_now, energy_gcdft_now = get_GCDFT(pot_ref, dirName='.') 38 | nelect_net_new = nelect_net_now - (pot_target-pot_now)*pot_step 39 | # Blue moon ensemble data extraction 40 | os.system('cat REPORT >> bluemoon.txt') 41 | cv, bm1, bm2, bm3, bm4, temp = get_bluemoon() 42 | # write to a trajectory db 43 | geom_fin = read('vasprun.xml') 44 | with connect(f'sg_traj.db', append=True) as db: 45 | db.write( 46 | geom_fin, 47 | charge_net=-nelect_net_now, 48 | nelect_net = nelect_net_now, 49 | nelect = nelect_net_now + nelect_neu, 50 | pot=pot_now, 51 | gcfe=energy_gcdft_now, 52 | potene=geom_fin.get_potential_energy(), 53 | temperature=temp, 54 | z=bm2**-2, 55 | cv=cv, 56 | fe_grad=bm4/bm2, 57 | ) 58 | print(f'cv= {cv:.4f} T= {temp} pot= {pot_now:.3f} chg_net {-nelect_net_now:.3f} gcfe= {energy_gcdft_now:.3f} epot= {geom_fin.get_potential_energy():.3f} z= {bm2**-2:.3f} fe_grad= {bm4/bm2:.3f}') 59 | # update the NELECT in INCAR (1st line) 60 | incar = open('INCAR').readlines() 61 | incar[0] = f'NELECT={nelect_net_new + nelect_neu}\n' 62 | with open('INCAR', 'w') as f: 63 | for l in incar: 64 | f.write(l) 65 | # update the POSCAR input structure 66 | os.system('cp CONTCAR POSCAR') 67 | 68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # EChO 2 | 3 | **E**lectro-**Ch**emical **O**ptimizer 4 | 5 | `EChO` is an toolkit for exploring structure and dynamics of electrochemical surfaces/interfaces under a fixed electrode potential and within a grand canonical ensemble of electrons. 6 | 7 | Currently, `EChO` supports the following calculations at exact **FIXED-POTENTIAL**: local optimization, transition state search, molecular dynamics, and free energetics via thermodynamic integration. 8 | 9 | It is an external standalone code, interacting with VASP via ASE interface, needless of any extra and elaborate patching on VASP! 10 | 11 | Please make sure to cite the following papers if you use `EChO` in your research: 12 | 13 | - J. Am. Chem. Soc. 2024, 146, 14, 9623–9630. [[link]](https://doi.org/10.1021/jacs.3c12934) [[bibtex]](https://scholar.googleusercontent.com/scholar.bib?q=info:qFJ9T1LlKo4J:scholar.google.com/&output=citation&scisdr=ClGobQuFEJXb1FnTVG0:AFWwaeYAAAAAZ-3VTG2hHFvnWSI4mdgEc7_TCo8&scisig=AFWwaeYAAAAAZ-3VTAgCu-zQ_y9aHxgAZxvbrV4&scisf=4&ct=citation&cd=-1&hl=en) 14 | 15 | - J. Am. Chem. Soc. 2025, accepted. [[link]](10.1021/jacs.5c00775) [[bibtex]](https://scholar.googleusercontent.com/scholar.bib?q=info:qFJ9T1LlKo4J:scholar.google.com/&output=citation&scisdr=ClGobQuFEJXb1FnTVG0:AFWwaeYAAAAAZ-3VTG2hHFvnWSI4mdgEc7_TCo8&scisig=AFWwaeYAAAAAZ-3VTAgCu-zQ_y9aHxgAZxvbrV4&scisf=4&ct=citation&cd=-1&hl=en) 16 | 17 | 18 | 19 | ## Requirements 20 | 21 | - `Python` 3.6 or higher 22 | - `ASE` 3.22.1 or higher 23 | - `VASP` 5.4.1 or higher, with `VASPsol` add-on 24 | 25 | 26 | ## Installation 27 | 28 | If your machine has Git installed, simply clone the repo to your local directory by: 29 | ``` 30 | git clone https://github.com/zishengz/echo 31 | ``` 32 | Or, you can also download and unzip the source code: 33 | ``` 34 | wget https://github.com/zishengz/echo/archive/refs/heads/main.zip 35 | unzip main.zip 36 | rm main.zip 37 | mv main echo 38 | ``` 39 | After fetching the gocia repo, add it to your PYTHONPATH by: 40 | ``` 41 | export PYTHONPATH=$PYTHONPATH:`pwd`/echo/ 42 | ``` 43 | Remember to add this export line to your ~/.bashrc or the submission script, so that EChO package is accessible by Python when you run the job. 44 | 45 | You need to use the absolute path (you can check it by running pwd in Bash shell) for this purpose. 46 | 47 | After these, run the following line to test: 48 | ```python 49 | python -c 'import echo' 50 | ``` 51 | If no error occurs, EChO should have been imported into your path! 52 | 53 | 54 | #### ASE-related settings 55 | In the jobs submission script, besides the `PYTHONPATH`, you should also set some [environment variables](https://wiki.fysik.dtu.dk/ase/ase/calculators/vasp.html#environment-variables) for the `ASE` interface to `VASP`: 56 | ```bash 57 | export PYTHONPATH=$PYTHONPATH:/xxx/echo-main 58 | export VASPHOME=/xxx/vasp.x.x.x/bin 59 | export VASP_COMMAND="mpirun -n $NSLOTS $VASPHOME/vasp_std" 60 | export VASP_PP_PATH=/xxx/potentials/ 61 | ``` 62 | 63 | The `VASP_COMMAND` would vary from machine to machine, depending on job scheduler and number of cores to use. You may need to adjust it yourself (and the script header, of course). 64 | 65 | 66 | ## Tutorials 67 | 68 | See the `examples` folder. 69 | -------------------------------------------------------------------------------- /echo/sp.py: -------------------------------------------------------------------------------- 1 | from echo.utils import get_GCDFT, get_nelect_neu_pp, get_nelect_incar 2 | from ase.db import connect 3 | from ase.io import read, write 4 | from ase.calculators.vasp import Vasp 5 | import numpy as np 6 | import os 7 | import json 8 | 9 | 10 | def sp_fix_pot(atoms, label='tmp', pot_target=0.0, pot_ref=4.6, pot_step=None, geom_step=1, calculator=None, pot_conv=0.001): 11 | if f'{label}_conv.db' in os.listdir() and f'{label}_gcdft.json' in os.listdir(): 12 | print('Converged already') 13 | return read(f'{label}_conv.db'), json.load(open(f'{label}_gcdft.json')) 14 | 15 | atoms_opt = atoms.copy() 16 | 17 | # # Re-initialize calculator 18 | # mycalc = Vasp() 19 | # mycalc.fromdict(calculator.asdict()) 20 | mycalc = calculator 21 | mycalc.set(directory=label, txt='vasp.out') 22 | print(f'VASP settings:\n{mycalc.todict()}') 23 | 24 | atoms_opt.set_calculator(mycalc) 25 | nelect_neu = get_nelect_neu_pp(atoms_opt) 26 | try: 27 | nelect_now = get_nelect_incar(label) 28 | charge_now = nelect_neu-nelect_now 29 | print(f'Charge state read from last INCAR: {charge_now:.4f} |e|') 30 | except: 31 | charge_now = 0 32 | print('Starting from zero net charge...') 33 | 34 | print(f'\nFIX-POTENTIAL Single Point (pot_target= {pot_target}, pot_conv= {pot_conv})') 35 | if pot_step is None: 36 | pot_step = 0.002 * nelect_neu 37 | print(f'Potentiostat step set to {pot_step:.6f} |e|/V (NELECT_neu={nelect_neu:8.3f} |e|)') 38 | 39 | # Set calculator and start the run! 40 | atoms_opt.calc.set(charge=charge_now) 41 | traj_nelect = [] 42 | traj_pot = [] 43 | traj_gcfe = [] 44 | nsteps_opt_now = geom_step 45 | converged_forces = False 46 | converged_pot = False 47 | while not converged_pot: 48 | sp_tmp = atoms_opt.get_potential_energy() 49 | nelect_net_now, pot_now, energy_gcdft_now = get_GCDFT(pot_ref, dirName=label) 50 | traj_nelect.append(nelect_net_now) 51 | traj_pot.append(pot_now) 52 | traj_gcfe.append(energy_gcdft_now) 53 | np.savetxt(f'{label}/log_nelect.txt', np.array(traj_nelect)) 54 | np.savetxt(f'{label}/log_potential.txt', np.array(traj_pot)) 55 | np.savetxt(f'{label}/log_gcfe.txt', np.array(traj_gcfe)) 56 | print(f'Step {len(traj_nelect):4}: NELECT_net= {traj_nelect[-1]:8.4f} |e|; U_she= {traj_pot[-1]:8.4f} V; GCFE_el= {traj_gcfe[-1]:12.4f} eV') 57 | 58 | # Convergence check and optimizer adjusting 59 | print(f'Conv {len(traj_nelect):4}: ', end='') 60 | u_diff = pot_now - pot_target 61 | if np.abs(u_diff) < pot_conv: 62 | converged_pot=True 63 | print(f'Potential [o] U_diff= {u_diff:8.4f} V | ', end='') 64 | else: 65 | converged_pot=False 66 | print(f'Potential [x] U_diff= {u_diff:8.4f} V | ', end='') 67 | 68 | if converged_pot: 69 | print('CONVERGED') 70 | break 71 | else: 72 | nelect_net_new = nelect_net_now - (pot_target-pot_now)*pot_step 73 | atoms_opt.calc.set(charge=-nelect_net_new) 74 | 75 | with connect(f'{label}_conv.db', append=False) as db: 76 | db.write( 77 | atoms_opt, 78 | charge_net=-traj_nelect[-1], 79 | nelect_net = traj_nelect[-1], 80 | pot=traj_pot[-1], 81 | gcfe=traj_gcfe[-1], 82 | potene=atoms_opt.get_potential_energy() 83 | ) 84 | return atoms_opt 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /examples/cineb_fixpot/output/LOG.cineb_fixpot_conv.1991756: -------------------------------------------------------------------------------- 1 | Ini state: NELECT_net= -3.6193 |e|; U_she= -0.0009 V; GCFE_el= -436.9315 eV 2 | Fin state: NELECT_net= -3.5703 |e|; U_she= 0.0002 V; GCFE_el= -436.9229 eV 3 | Target potential: 0 V (SHE refernce: 4.6 V) 4 | n_images= 5 (from RXN RSSD=4.4638 A) 5 | CINEB directories: ['img001', 'img002', 'img003', 'img004', 'img005'] 6 | Geometry: Starting from provided band 7 | Charge states: Restarting from scratch (linear CT interpolation) 8 | Net charges along the band: [-3.61113333 -3.60296667 -3.5948 -3.58663333 -3.57846667] 9 | Reaction coordinate (RSSD): [0.0, 21.6965, 21.7213, 21.7821, 21.8679, 26.7994, 4.4638] Å 10 | 11 | Transition state search 12 | 13 | FIX-POTENTIAL NEB (pot_target= 0, fmax=0.02, pot_conv= 0.001) 14 | Potentiostat step set to 3.172000 |e|/V (NELECT_neu=1586.000 |e|) 15 | 16 | Step 1: NELECT_net: [-3.6111, -3.603, -3.5948, -3.5866, -3.5785] 17 | Step 1: U_she: [0.016, 0.0101, -0.0034, 0.0014, 0.0026] 18 | Step 1: GCFE_el: [-436.6366, -436.1642, -436.5545, -436.7824, -436.8903] 19 | Conv 1: Potential [x] U_diff= 0.0160 V | Forces [x] F_max= 0.1612 eV/Å 20 | 21 | Step 2: NELECT_net: [-3.5604, -3.571, -3.6054, -3.5821, -3.5701] 22 | Step 2: U_she: [0.0051, 0.0023, -0.0018, 0.0002, 0.0007] 23 | Step 2: GCFE_el: [-436.6025, -436.1405, -436.561, -436.7794, -436.884] 24 | Conv 2: Potential [x] U_diff= 0.0051 V | Forces [x] F_max= 0.1332 eV/Å 25 | 26 | Step 3: NELECT_net: [-3.5443, -3.5638, -3.611, -3.5814, -3.5678] 27 | Step 3: U_she: [0.0023, 0.0011, -0.0013, -0.0006, -0.0005] 28 | Step 3: GCFE_el: [-436.5917, -436.1339, -436.5637, -436.777, -436.8806] 29 | Conv 3: Potential [x] U_diff= 0.0023 V | Forces [x] F_max= 0.1178 eV/Å 30 | 31 | Step 4: NELECT_net: [-3.5371, -3.5604, -3.615, -3.5832, -3.5693] 32 | Step 4: U_she: [0.0006, -0.0003, 0.0002, -0.0003, -0.0003] 33 | Step 4: GCFE_el: [-436.5867, -436.1314, -436.5665, -436.7782, -436.8817] 34 | Conv 4: Potential [o] U_diff= 0.0006 V | Forces [x] F_max= 0.1037 eV/Å 35 | 36 | Step 5: NELECT_net: [-3.5353, -3.5614, -3.6143, -3.584, -3.5701] 37 | Step 5: U_she: [-0.0018, -0.0007, -0.0015, 0.0002, -0.0016] 38 | Step 5: GCFE_el: [-436.5849, -436.1296, -436.5633, -436.7787, -436.8784] 39 | Conv 5: Potential [x] U_diff= 0.0018 V | Forces [x] F_max= 0.0514 eV/Å 40 | 41 | Step 6: NELECT_net: [-3.5409, -3.5636, -3.6192, -3.5834, -3.5753] 42 | Step 6: U_she: [-0.0011, 0.0002, -0.0001, -0.0006, 0.0005] 43 | Step 6: GCFE_el: [-436.5902, -436.1338, -436.5688, -436.7793, -436.8864] 44 | Conv 6: Potential [x] U_diff= 0.0011 V | Forces [x] F_max= 0.0473 eV/Å 45 | 46 | Step 7: NELECT_net: [-3.5444, -3.563, -3.6197, -3.5852, -3.5739] 47 | Step 7: U_she: [-0.0007, -0.0001, -0.0001, -0.0002, -0.0001] 48 | Step 7: GCFE_el: [-436.5922, -436.1331, -436.5687, -436.7809, -436.8845] 49 | Conv 7: Potential [o] U_diff= 0.0007 V | Forces [x] F_max= 0.0452 eV/Å 50 | 51 | Step 8: NELECT_net: [-3.5466, -3.5633, -3.6202, -3.5857, -3.5744] 52 | Step 8: U_she: [-0.0005, 0.0001, -0.0, 0.0006, 0.0002] 53 | Step 8: GCFE_el: [-436.5961, -436.1345, -436.5681, -436.7812, -436.8863] 54 | Conv 8: Potential [o] U_diff= 0.0006 V | Forces [x] F_max= 0.0344 eV/Å 55 | 56 | Step 9: NELECT_net: [-3.5481, -3.5629, -3.6203, -3.5838, -3.5739] 57 | Step 9: U_she: [-0.0005, 0.0, 0.0002, -0.0002, 0.0005] 58 | Step 9: GCFE_el: [-436.597, -436.1344, -436.5683, -436.7808, -436.8874] 59 | Conv 9: Potential [o] U_diff= 0.0005 V | Forces [o] F_max= 0.0196 eV/Å 60 | CONVERGED 61 | 62 | real 886m21.912s 63 | user 17099m35.697s 64 | sys 175m33.731s 65 | -------------------------------------------------------------------------------- /echo/utils.py: -------------------------------------------------------------------------------- 1 | from echo.data import pp_dict 2 | from ase.db import connect 3 | from ase.io import read, write 4 | from ase.geometry import find_mic 5 | from ase.calculators.vasp import Vasp 6 | import numpy as np 7 | import os 8 | 9 | 10 | 11 | def get_fmax(forces): 12 | return np.sqrt((forces**2).sum(axis=1).max()) 13 | 14 | 15 | def get_nelect_neu(poscar='POSCAR', potcar='POTCAR', dirName='.'): 16 | elem_list = [l.split()[-2] 17 | for l in open(f'{dirName}/{potcar}').readlines() if 'TITEL' in l] 18 | elem_list = [e.split('_')[0] if '_' in e else e for e in elem_list] 19 | zval_list = [eval(l.split()[-4]) 20 | for l in open(f'{dirName}/{potcar}').readlines() if 'ZVAL' in l] 21 | atom_list = read(f'{dirName}/{poscar}').get_chemical_symbols() 22 | return sum([zval_list[elem_list.index(a)] for a in atom_list]) 23 | 24 | 25 | def get_nelect_neu_ase(atoms): 26 | # Return neutral charge state via ASE 27 | # There must be a calculator attached to the Atoms! 28 | calc_tmp = Vasp() 29 | calc_tmp.fromdict(atoms.calc.todict()) 30 | calc_tmp.set(directory='.', charge=0) 31 | calc_tmp.write_input(atoms) 32 | #nelect_neu = eval([l for l in open('INCAR').readlines() if 'NELECT' in l][0].split()[-1]) 33 | nelect_neu = get_nelect_neu() 34 | for f in ['POSCAR', 'POTCAR', 'INCAR', 'KPOINTS', 'ase-sort.dat']: 35 | os.remove(f) 36 | return nelect_neu 37 | 38 | def get_nelect_dict_pp(atoms, setting='recommended', pp_dir='potpaw_PBE'): 39 | list_elems_unique = list(set(atoms.get_chemical_symbols())) 40 | vasp_pp_path = os.environ['VASP_PP_PATH'] 41 | nelect_dict = {} 42 | for elem in list_elems_unique: 43 | elem_pp = elem 44 | try: 45 | elem_pp += pp_dict[setting][elem] 46 | except: 47 | pass 48 | nelect_dict[elem] = eval([l for l in open(f'{vasp_pp_path}/{pp_dir}/{elem_pp}/POTCAR').readlines() if 'ZVAL' in l][0].split()[5]) 49 | return nelect_dict 50 | 51 | 52 | def get_nelect_neu_pp(atoms, setting='recommended', pp_dir='potpaw_PBE'): 53 | list_elems = atoms.get_chemical_symbols() 54 | nelect_dict = get_nelect_dict_pp(atoms=atoms, setting=setting, pp_dir=pp_dir) 55 | nelect_neu = 0 56 | for elem in list_elems: 57 | nelect_neu += nelect_dict[elem] 58 | return nelect_neu 59 | 60 | def get_nelect_incar(workdir): 61 | return eval([l for l in open(f'{workdir}/INCAR').readlines() if 'NELECT' in l][0].split()[-1]) 62 | 63 | def extract_VASPsol(dirName='.', outname='vasp.out'): 64 | tmpHome = os.getcwd() 65 | os.chdir(dirName) 66 | fermi_shift = eval([l for l in open(outname).readlines() 67 | if 'FERMI_SHIFT' in l][-1].split()[2]) 68 | e_fermi = eval([l for l in open('OUTCAR').readlines() 69 | if 'E-fermi' in l][-1].split()[2]) 70 | nelect_now = eval([l for l in open('OUTCAR').readlines() 71 | if 'NELECT' in l][-1].split()[2]) 72 | energy_dft = eval([l for l in open('OSZICAR').readlines() 73 | if 'F=' in l][-1].split()[4]) 74 | os.chdir(tmpHome) 75 | return nelect_now, energy_dft, e_fermi, fermi_shift 76 | 77 | 78 | def get_GCDFT(u_ref=4.6, poscar='POSCAR', potcar='POTCAR', dirName='.', outname='vasp.out'): 79 | nelect_neu = get_nelect_neu(poscar, potcar, dirName) 80 | nelect_now, energy_dft, e_fermi, fermi_shift = extract_VASPsol( 81 | dirName, outname) 82 | nelect_net = nelect_now - nelect_neu 83 | work_function = -e_fermi - fermi_shift 84 | u_she = work_function - u_ref 85 | energy_gcdft = energy_dft + nelect_net*(fermi_shift+work_function) 86 | return nelect_net, u_she, energy_gcdft 87 | 88 | 89 | def get_GCDFT_neb(workdirs, u_ref=4.6, poscar='POSCAR', potcar='POTCAR', outname='vasp.out'): 90 | nelect_neu = get_nelect_neu(f'img001/{poscar}', f'img001/{potcar}') 91 | neb_nelect_net = [] 92 | neb_u_she = [] 93 | neb_energy_gcdft = [] 94 | for dir in workdirs: 95 | nelect_now, energy_dft, e_fermi, fermi_shift = extract_VASPsol( 96 | dir, outname) 97 | nelect_net = nelect_now - nelect_neu 98 | work_function = -e_fermi - fermi_shift 99 | u_she = work_function - u_ref 100 | energy_gcdft = energy_dft + nelect_net*(fermi_shift+work_function) 101 | # append results 102 | neb_nelect_net.append(nelect_net) 103 | neb_u_she.append(u_she) 104 | neb_energy_gcdft.append(energy_gcdft) 105 | return neb_nelect_net, neb_u_she, neb_energy_gcdft 106 | 107 | 108 | def get_rmsd(s, s_ref, list_ind=None): 109 | if list_ind is not None: 110 | tmp = s.positions[list_ind] - s_ref.positions[list_ind] 111 | else: 112 | tmp = s.positions - s_ref.positions 113 | if s.cell is not None and s.pbc is not None: 114 | tmp, _ = find_mic(tmp, s.cell, s.pbc) 115 | tmp **= 2 116 | return np.sqrt(tmp.sum(axis=1).mean()) 117 | 118 | def get_rssd(s, s_ref, list_ind=None): 119 | if list_ind is not None: 120 | tmp = s.positions[list_ind] - s_ref.positions[list_ind] 121 | else: 122 | tmp = s.positions - s_ref.positions 123 | if s.cell is not None and s.pbc is not None: 124 | tmp, _ = find_mic(tmp, s.cell, s.pbc) 125 | tmp **= 2 126 | return np.sqrt(tmp.sum(axis=1).sum()) 127 | 128 | # NEB band interval conversion 129 | 130 | 131 | # NEB band transformation to diff IS/FS 132 | 133 | -------------------------------------------------------------------------------- /echo/data.py: -------------------------------------------------------------------------------- 1 | 2 | pp_dict = { 3 | 'minimal': { 4 | 'K': '_pv', 5 | 'Ca': '_pv', 6 | 'Rb': '_pv', 7 | 'Sr': '_sv', 8 | 'Y': '_sv', 9 | 'Zr': '_sv', 10 | 'Nb': '_pv', 11 | 'Cs': '_sv', 12 | 'Ba': '_sv', 13 | 'Fr': '_sv', 14 | 'Ra': '_sv', 15 | 'Sc': '_sv' 16 | }, 17 | 18 | # VASP recommended 19 | 'recommended': { 20 | 'Li': '_sv', 21 | 'Na': '_pv', 22 | 'K': '_sv', 23 | 'Ca': '_sv', 24 | 'Sc': '_sv', 25 | 'Ti': '_sv', 26 | 'V': '_sv', 27 | 'Cr': '_pv', 28 | 'Mn': '_pv', 29 | 'Ga': '_d', 30 | 'Ge': '_d', 31 | 'Rb': '_sv', 32 | 'Sr': '_sv', 33 | 'Y': '_sv', 34 | 'Zr': '_sv', 35 | 'Nb': '_sv', 36 | 'Mo': '_sv', 37 | 'Tc': '_pv', 38 | 'Ru': '_pv', 39 | 'Rh': '_pv', 40 | 'In': '_d', 41 | 'Sn': '_d', 42 | 'Cs': '_sv', 43 | 'Ba': '_sv', 44 | 'Pr': '_3', 45 | 'Nd': '_3', 46 | 'Pm': '_3', 47 | 'Sm': '_3', 48 | 'Eu': '_2', 49 | 'Gd': '_3', 50 | 'Tb': '_3', 51 | 'Dy': '_3', 52 | 'Ho': '_3', 53 | 'Er': '_3', 54 | 'Tm': '_3', 55 | 'Yb': '_2', 56 | 'Lu': '_3', 57 | 'Hf': '_pv', 58 | 'Ta': '_pv', 59 | 'W': '_pv', 60 | 'Tl': '_d', 61 | 'Pb': '_d', 62 | 'Bi': '_d', 63 | 'Po': '_d', 64 | 'At': '_d', 65 | 'Fr': '_sv', 66 | 'Ra': '_sv' 67 | }, 68 | 69 | # https://wiki.materialsproject.org/Pseudopotentials_Choice 70 | 'materialsproject': 71 | # Alkali and alkali-earth 72 | { 73 | 'Li': '_sv', 74 | 'Na': '_pv', 75 | 'K': '_sv', 76 | 'Cs': '_sv', 77 | 'Rb': '_sv', 78 | 'Be': '_sv', 79 | 'Mg': '_pv', 80 | 'Ca': '_sv', 81 | 'Sr': '_sv', 82 | 'Ba': '_sv', 83 | # d-elements, transition metals 84 | 'Sc': '_sv', 85 | 'Y': '_sv', 86 | 'Ti': '_pv', 87 | 'Zr': '_sv', 88 | 'Hf': '_pv', 89 | 'V': '_sv', 90 | 'Nb': '_pv', 91 | 'Ta': '_pv', 92 | 'Cr': '_pv', 93 | 'Mo': '_pv', 94 | 'W': '_sv', # updated from W_pv 95 | 'Mn': '_pv', 96 | 'Tc': '_pv', 97 | 'Re': '_pv', 98 | 'Fe': '_pv', 99 | 'Co': '', 100 | 'Ni': '_pv', 101 | 'Cu': '_pv', 102 | 'Zn': '', 103 | 'Ru': '_pv', 104 | 'Rh': '_pv', 105 | 'Pd': '', 106 | 'Ag': '', 107 | 'Cd': '', 108 | 'Hg': '', 109 | 'Ir': '', 110 | 'Pt': '', 111 | 'Os': '_pv', 112 | # Main group 113 | 'Ga': '_d', 114 | 'Ge': '_d', 115 | 'Al': '', 116 | 'As': '', 117 | 'Se': '', 118 | 'Br': '', 119 | 'In': '_d', 120 | 'Sn': '_d', 121 | 'Tl': '_d', 122 | 'Pb': '_d', 123 | 'Bi': '_d', # ? 124 | 'Po': '', 125 | 'At': '_d', 126 | # Rare-earth, f-electrons 127 | 'La': '', 128 | 'Ce': '', 129 | 'Pr': '_3', 130 | 'Nd': '_3', 131 | 'Pm': '_3', 132 | 'Sm': '_3', 133 | 'Eu': '', 134 | 'Gd': '', 135 | 'Tb': '_3', 136 | 'Dy': '_3', 137 | 'Ho': '_3', 138 | 'Er': '_3', 139 | 'Tm': '_3', 140 | 'Yb': '', 141 | 'Lu': '_3' 142 | }, 143 | 144 | # 145 | 'gw': { 146 | 'H': '_GW', 147 | 'He': '_GW', 148 | 'Li': '_sv_GW', 149 | 'Be': '_sv_GW', 150 | 'B': '_GW', 151 | 'C': '_GW', 152 | 'N': '_GW', 153 | 'O': '_GW', 154 | 'F': '_GW', 155 | 'Ne': '_GW', 156 | 'Na': '_sv_GW', 157 | 'Mg': '_sv_GW', 158 | 'Al': '_GW', 159 | 'Si': '_GW', 160 | 'P': '_GW', 161 | 'S': '_GW', 162 | 'Cl': '_GW', 163 | 'Ar': '_GW', 164 | 'K': '_sv_GW', 165 | 'Ca': '_sv_GW', 166 | 'Sc': '_sv_GW', 167 | 'Ti': '_sv_GW', 168 | 'V': '_sv_GW', 169 | 'Cr': '_sv_GW', 170 | 'Mn': '_sv_GW', 171 | 'Fe': '_sv_GW', 172 | 'Co': '_sv_GW', 173 | 'Ni': '_sv_GW', 174 | 'Cu': '_sv_GW', 175 | 'Zn': '_sv_GW', 176 | 'Ga': '_d_GW', 177 | 'Ge': '_d_GW', 178 | 'As': '_GW', 179 | 'Se': '_GW', 180 | 'Br': '_GW', 181 | 'Kr': '_GW', 182 | 'Rb': '_sv_GW', 183 | 'Sr': '_sv_GW', 184 | 'Y': '_sv_GW', 185 | 'Zr': '_sv_GW', 186 | 'Nb': '_sv_GW', 187 | 'Mo': '_sv_GW', 188 | 'Tc': '_sv_GW', 189 | 'Ru': '_sv_GW', 190 | 'Rh': '_sv_GW', 191 | 'Pd': '_sv_GW', 192 | 'Ag': '_sv_GW', 193 | 'Cd': '_sv_GW', 194 | 'In': '_d_GW', 195 | 'Sn': '_d_GW', 196 | 'Sb': '_d_GW', 197 | 'Te': '_GW', 198 | 'I': '_GW', 199 | 'Xe': '_GW', 200 | 'Cs': '_sv_GW', 201 | 'Ba': '_sv_GW', 202 | 'La': '_GW', 203 | 'Ce': '_GW', 204 | 'Hf': '_sv_GW', 205 | 'Ta': '_sv_GW', 206 | 'W': '_sv_GW', 207 | 'Re': '_sv_GW', 208 | 'Os': '_sv_GW', 209 | 'Ir': '_sv_GW', 210 | 'Pt': '_sv_GW', 211 | 'Au': '_sv_GW', 212 | 'Hg': '_sv_GW', 213 | 'Tl': '_d_GW', 214 | 'Pb': '_d_GW', 215 | 'Bi': '_d_GW', 216 | 'Po': '_d_GW', 217 | 'At': '_d_GW', 218 | 'Rn': '_d_GW' 219 | } 220 | } -------------------------------------------------------------------------------- /echo/analysis.py: -------------------------------------------------------------------------------- 1 | from ase.utils.forcecurve import fit_raw 2 | from ase.db import connect 3 | 4 | 5 | def fit_images(neb_db): 6 | R = [] 7 | E = [] 8 | F = [] 9 | A = [] 10 | pbc = [] 11 | for r in neb_db.select(): 12 | R.append(r.toatoms().positions) 13 | E.append(r.gcfe) 14 | F.append(r.toatoms().get_forces()) 15 | A = r.toatoms().cell 16 | pbc = r.toatoms().pbc 17 | return fit_raw(E, F, R, A, pbc) 18 | 19 | 20 | class NEBTools: 21 | """Class to make many of the common tools for NEB analysis available to 22 | the user. Useful for scripting the output of many jobs. Initialize with 23 | list of images which make up one or more band of the NEB relaxation.""" 24 | 25 | def __init__(self, images): 26 | self.images = images 27 | 28 | def get_fit(self): 29 | return fit_images(self.images) 30 | 31 | def get_barrier(self, fit=True, raw=False): 32 | """Returns the barrier estimate from the NEB, along with the 33 | Delta E of the elementary reaction. If fit=True, the barrier is 34 | estimated based on the interpolated fit to the images; if 35 | fit=False, the barrier is taken as the maximum-energy image 36 | without interpolation. Set raw=True to get the raw energy of the 37 | transition state instead of the forward barrier.""" 38 | forcefit = fit_images(self.images) 39 | energies = forcefit.energies 40 | fit_energies = forcefit.fit_energies 41 | dE = energies[-1] - energies[0] 42 | if fit: 43 | barrier = max(fit_energies) 44 | else: 45 | barrier = max(energies) 46 | if raw: 47 | barrier += self.images[0].get_potential_energy() 48 | return barrier, dE 49 | 50 | 51 | def get_fmax(self, **kwargs): 52 | """Returns fmax, as used by optimizers with NEB.""" 53 | neb = NEB(self.images, **kwargs) 54 | forces = neb.get_forces() 55 | return np.sqrt((forces ** 2).sum(axis=1).max()) 56 | 57 | def plot_band(self, ax=None): 58 | """Plots the NEB band on matplotlib axes object 'ax'. If ax=None 59 | returns a new figure object.""" 60 | forcefit = fit_images(self.images) 61 | ax = forcefit.plot(ax=ax) 62 | return ax.figure 63 | 64 | 65 | def plot_bands(self, constant_x=False, constant_y=False, 66 | nimages=None, label='nebplots'): 67 | """Given a trajectory containing many steps of a NEB, makes 68 | plots of each band in the series in a single PDF. 69 | 70 | constant_x: bool 71 | Use the same x limits on all plots. 72 | constant_y: bool 73 | Use the same y limits on all plots. 74 | nimages: int 75 | Number of images per band. Guessed if not supplied. 76 | label: str 77 | Name for the output file. .pdf will be appended. 78 | """ 79 | from matplotlib import pyplot 80 | from matplotlib.backends.backend_pdf import PdfPages 81 | if nimages is None: 82 | nimages = self._guess_nimages() 83 | nebsteps = len(self.images) // nimages 84 | if constant_x or constant_y: 85 | sys.stdout.write('Scaling axes.\n') 86 | sys.stdout.flush() 87 | # Plot all to one plot, then pull its x and y range. 88 | fig, ax = pyplot.subplots() 89 | for index in range(nebsteps): 90 | images = self.images[index * nimages:(index + 1) * nimages] 91 | NEBTools(images).plot_band(ax=ax) 92 | xlim = ax.get_xlim() 93 | ylim = ax.get_ylim() 94 | pyplot.close(fig) # Reference counting "bug" in pyplot. 95 | with PdfPages(label + '.pdf') as pdf: 96 | for index in range(nebsteps): 97 | sys.stdout.write('\rProcessing band {:10d} / {:10d}' 98 | .format(index, nebsteps)) 99 | sys.stdout.flush() 100 | fig, ax = pyplot.subplots() 101 | images = self.images[index * nimages:(index + 1) * nimages] 102 | NEBTools(images).plot_band(ax=ax) 103 | if constant_x: 104 | ax.set_xlim(xlim) 105 | if constant_y: 106 | ax.set_ylim(ylim) 107 | pdf.savefig(fig) 108 | pyplot.close(fig) # Reference counting "bug" in pyplot. 109 | sys.stdout.write('\n') 110 | 111 | 112 | def _guess_nimages(self): 113 | """Attempts to guess the number of images per band from 114 | a trajectory, based solely on the repetition of the 115 | potential energy of images. This should also work for symmetric 116 | cases.""" 117 | e_first = self.images[0].get_potential_energy() 118 | nimages = None 119 | for index, image in enumerate(self.images[1:], start=1): 120 | e = image.get_potential_energy() 121 | if e == e_first: 122 | # Need to check for symmetric case when e_first = e_last. 123 | try: 124 | e_next = self.images[index + 1].get_potential_energy() 125 | except IndexError: 126 | pass 127 | else: 128 | if e_next == e_first: 129 | nimages = index + 1 # Symmetric 130 | break 131 | nimages = index # Normal 132 | break 133 | if nimages is None: 134 | sys.stdout.write('Appears to be only one band in the images.\n') 135 | return len(self.images) 136 | # Sanity check that the energies of the last images line up too. 137 | e_last = self.images[nimages - 1].get_potential_energy() 138 | e_nextlast = self.images[2 * nimages - 1].get_potential_energy() 139 | if not (e_last == e_nextlast): 140 | raise RuntimeError('Could not guess number of images per band.') 141 | sys.stdout.write('Number of images per band guessed to be {:d}.\n' 142 | .format(nimages)) 143 | return nimages 144 | 145 | 146 | 147 | -------------------------------------------------------------------------------- /examples/tutorial.md: -------------------------------------------------------------------------------- 1 | # EChO tutorial 2 | Please firstly make sure you have installed properly the `EChO` and `VASPsol` and have set the related environment variables. 3 | 4 | 5 | ## Fixed-potential geometry optimization 6 | The related files are in `examples/geomopt_fixpot`. 7 | 8 | ### Inputs 9 | You will need to: 10 | - Provide the initial geometry in VASP format (or whatever format that includes cell information and constraints). In the example they are `IS.vasp` and `FS.vasp`. 11 | - Set VASP parameters in `geomopt_fixpot.py`. 12 | - Set `pot_target` to the desired potential values, with `u_ref` being the SHE reference level. 13 | 14 | ### Outputs 15 | Supposing we are running the job for `IS.vasp`: 16 | - `IS_conv.db` contains the converged geometry with all calculated properties (potential energy, electronic free energy, forces, net charge, potential). 17 | - `IS.log` stores the iteration printout of the geometry optimization. 18 | - `IS.traj` stores the trajectory of the geometry optimization, with forces and potential energy. 19 | - `LOG.xxx` is the output by job scheduler, which contains `EChO` printout. You may redirect it to any file in the submission script. 20 | 21 | ### Comments 22 | - We recommend using initial geometry optimized under fixed-charge condition (regular approach by VASP) to speed up the force convergence, unless you would like to study a specific configuration that is only stabilized under applied potential. 23 | - Recommended values of `u_ref` are 4.44 V (IUPAC value, theoretically self-consistent) and 4.6 V (benchmarked against exprimental PZC by Hennig groups). 24 | - Multiple fixed-potential geometry optimization jobs can be run in the same directory since a working directory will be created for each job. 25 | - The way `ASE` works with `VASP` is by writing/reading wavefunctions, so the job will be IO-intensive and takes up a lot of disk space. 26 | 27 | ## Fixed-potential nudged elastic band calculation 28 | The related files are in `examples/cineb_fixpot`. 29 | 30 | ### Inputs 31 | You will need to: 32 | - Provide `IS_conv.db` and `FS_conv.db` from **converged** fixed-potential geometry optimization of the initial and final state. 33 | - You can provide a structure trajectory file (here we use `band_fixchg.db`) as the initial guess of the geometries along the band. Otherwise IDPP method will be used to interpolate between initial and final state geometries. 34 | - Set `pot_target` to the desired potential values, with `u_ref` being the SHE reference level. 35 | 36 | ### Outputs 37 | - `neb_conv.db` contains the converged band with all calculated properties (potential energy, electronic free energy, forces, net charge, potential). 38 | - `band_init.db` stores the initial band. 39 | - `neb.log` stores the iteration printout of the geometry optimization. 40 | - `neb.traj` stores the trajectory of the geometry optimization, with forces and potential energy. 41 | - `restart.db` contains the band from the last CINEB iteration. 42 | - `restart.nelect_neu` contains the net `NELECT` from the last CINEB iteration. 43 | - `LOG.xxx` is the iteration printout by `EChO`. 44 | 45 | 46 | ### Comments 47 | - It is highly recommended to start from a band from converged (CI)NEB run under fixed-charge condition. 48 | - Parralelization over images is not supported. 49 | 50 | 51 | ## Fixed-potential molecular dynamics (MD) 52 | The related files are in `examples/md_fixpot` 53 | 54 | ### Inputs 55 | You would only need a structure file and an EChO script. 56 | 57 | EChO will use the ASE calculator interface of VASP for the force calls. Hence, you need to define the VASP Calculator in the main py script. 58 | 59 | You also need to provide the potentiostating parameters, see below: 60 | - pot_target: the target potential, relative to the provided reference potential 61 | - pot_step: a multiplier factor for potentiostating, in unit of e/V. It will be multiplied to the difference between current and target potentials to determine the amount of fractional electrons to add/remove. 62 | - pot_ref: the reference potential in vacuum scale. 4.6 V is the benchmarked value for VASPsol. 63 | - potentiostat_nsteps: the interval of performing potentiostating. At $n$, EChO does potentiostating every $n$ MD step. 64 | 65 | All other parameters are the same as in a regular Langevin MD. 66 | 67 | ### Outputs 68 | 69 | The raw output file (EChO.log) written by the EChO script will contain all the essential potentiostating information such as net charge, potential, and electronic grand canonical free energy. 70 | 71 | Other MD-related information, such as temperature and potential energy, are written by ASE to a separate file (md-fp.log). 72 | 73 | The full trajectory will be written to a ASE datafile on the fly (typically very large, therefore not provided in the example set). 74 | 75 | 76 | ## Fixed-potential constrained MD + thermodynamic integration 77 | The related files are in `examples/slowgrowth_fixpot` 78 | 79 | This can be used to obtain the fixed-potential free energy profile via the [Blue Moon Ensemble method](https://www.vasp.at/wiki/index.php/Blue_moon_ensemble). 80 | 81 | In this study, we use the internal slow-growth functionality and SHAKE constraints of VASP for each MD step. `EChO` will handle the electronic degree of freedom (i.e., potentiostating) and keep track of all key quantities. 82 | 83 | 84 | ### Inputs 85 | In this section, we are not using the ASE calculator interface of VASP, but directly calling VASP instead. Hence, the minimal input set includes a full VASP input set: 86 | - `POSCAR`, `POTCAR`, `KPOINTS` 87 | - `INCAR` which calls **one** step of slow-growth. Please do not add NELECT because it will be rewritten by EChO in the 1st line for every FPMD step. 88 | - `ICONST` which describe the collective variable to be constrained and sampled. 89 | - `echo_sg.py` which sets the FPMD-related parameters. 90 | 91 | ### Outputs 92 | Please keep the raw output file written by the EChO script, as it contains all the essential information such as collective variable, temperature, potential, net charge, potential energy, electronic grand canonical free energy, and free energy gradient. 93 | 94 | The full trajectory will be written to a ASE datafile on the fly (typically very large, therefore not provided in the example set). 95 | 96 | For data extraction and analysis, you may refer to `examples/slowgrowth_fixpot/analysis.ipynb` for an exmaple. 97 | 98 | 99 | 100 | 101 | -------------------------------------------------------------------------------- /echo/opt.py: -------------------------------------------------------------------------------- 1 | from echo.utils import get_GCDFT, get_fmax, get_nelect_neu_pp, get_nelect_incar 2 | from ase.db import connect 3 | from ase.io import read, write 4 | from ase.calculators.vasp import Vasp 5 | import numpy as np 6 | import os 7 | import json 8 | 9 | 10 | def opt_fix_chg(atoms, label='tmp', net_charge=0, calculator=None, optimizer=None, fmax=0.01, steps=1000, must_run=False): 11 | if not must_run and f'{label}_conv.db' in os.listdir(): 12 | print('Converged already') 13 | return read(f'{label}_conv.db') 14 | 15 | # # Re-initialize calculator 16 | # mycalc = Vasp() 17 | # mycalc.fromdict(calculator.asdict()) 18 | mycalc=calculator 19 | mycalc.set(directory=label, charge=net_charge, txt='vasp.out') 20 | print(f'VASP settings:\n{mycalc.todict()}') 21 | 22 | # Read geometry if trajectory file exists 23 | restart_traj = False 24 | fn_traj = f'{label}.traj' 25 | try: 26 | atoms_opt = read(fn_traj) 27 | print(f'Reading geometry from {fn_traj}...') 28 | restart_traj=True 29 | except: 30 | atoms_opt = atoms.copy() 31 | atoms_opt.set_calculator() 32 | print('Starting from input geometry...') 33 | 34 | # End if converged already 35 | if restart_traj and atoms_opt.calc is not None: 36 | print('Checking forces from restart file...') 37 | if get_fmax(atoms_opt.get_forces()) < fmax: 38 | print('Converged already!') 39 | return atoms_opt 40 | 41 | 42 | # Set calculator and optimizer & RUN! 43 | print(f'\nFIX-CHARGE GEOMOPT (fmax={fmax})') 44 | atoms_opt.set_calculator(mycalc) 45 | geomopt = optimizer(atoms_opt, trajectory=fn_traj, logfile='-') 46 | geomopt.run(fmax=fmax, steps=steps) 47 | print('CONVERGED') 48 | write(f'{label}_conv.db', atoms_opt) 49 | return atoms_opt 50 | 51 | 52 | def opt_fix_pot(atoms, label='tmp', pot_target=0.0, pot_ref=4.6, pot_step=None, geom_step=1, calculator=None, optimizer=None, fmax=0.01, pot_conv=0.001, geom_boost=3): 53 | if f'{label}_conv.db' in os.listdir() and f'{label}_gcdft.json' in os.listdir(): 54 | print('Converged already') 55 | return read(f'{label}_conv.db'), json.load(open(f'{label}_gcdft.json')) 56 | 57 | # # Re-initialize calculator 58 | # mycalc = Vasp() 59 | # mycalc.fromdict(calculator.asdict()) 60 | mycalc = calculator 61 | mycalc.set(directory=label, txt='vasp.out') 62 | print(f'VASP settings:\n{mycalc.todict()}') 63 | 64 | # Read geometry if trajectory file exists 65 | restart_traj = False 66 | fn_traj = f'{label}.traj' 67 | try: 68 | atoms_opt = read(fn_traj) 69 | print(f'Reading geometry from {fn_traj}...') 70 | restart_traj = True 71 | except: 72 | atoms_opt = atoms.copy() 73 | atoms_opt.set_calculator(mycalc) 74 | print('Starting from input geometry...') 75 | 76 | # Get charge state and set calculator 77 | if restart_traj and 'charge' in atoms_opt.calc.todict().keys(): 78 | charge_now = atoms_opt.calc.todict()['charge'] 79 | atoms_opt.set_calculator(mycalc) 80 | nelect_neu = get_nelect_neu_pp(atoms_opt) 81 | print(f'Charge state read from trajectory: {charge_now:.4f} |e|') 82 | else: 83 | atoms_opt.set_calculator(mycalc) 84 | nelect_neu = get_nelect_neu_pp(atoms_opt) 85 | try: 86 | nelect_now = get_nelect_incar(label) 87 | charge_now = nelect_neu-nelect_now 88 | print(f'Charge state read from last INCAR: {charge_now:.4f} |e|') 89 | except: 90 | charge_now = 0 91 | print('Starting from zero net charge...') 92 | 93 | print(f'\nFIX-POTENTIAL GEOMOPT (pot_target= {pot_target}, fmax={fmax}, pot_conv= {pot_conv})') 94 | if pot_step is None: 95 | pot_step = 0.002 * nelect_neu 96 | print(f'Potentiostat step set to {pot_step:.6f} |e|/V (NELECT_neu={nelect_neu:8.3f} |e|)') 97 | 98 | # Set calculator and start the run! 99 | atoms_opt.calc.set(charge=charge_now) 100 | traj_nelect = [] 101 | traj_pot = [] 102 | traj_gcfe = [] 103 | nsteps_opt_now = geom_step 104 | converged_forces = False 105 | converged_pot = False 106 | while not (converged_forces and converged_pot): 107 | geomopt = optimizer(atoms_opt, trajectory=fn_traj, logfile=f'{label}.log') 108 | geomopt.run(fmax=fmax, steps=nsteps_opt_now) 109 | nelect_net_now, pot_now, energy_gcdft_now = get_GCDFT(pot_ref, dirName=label) 110 | traj_nelect.append(nelect_net_now) 111 | traj_pot.append(pot_now) 112 | traj_gcfe.append(energy_gcdft_now) 113 | np.savetxt(f'{label}/log_nelect.txt', np.array(traj_nelect)) 114 | np.savetxt(f'{label}/log_potential.txt', np.array(traj_pot)) 115 | np.savetxt(f'{label}/log_gcfe.txt', np.array(traj_gcfe)) 116 | print(f'Step {len(traj_nelect):4}: NELECT_net= {traj_nelect[-1]:8.4f} |e|; U_she= {traj_pot[-1]:8.4f} V; GCFE_el= {traj_gcfe[-1]:12.4f} eV') 117 | 118 | # Convergence check and optimizer adjusting 119 | print(f'Conv {len(traj_nelect):4}: ', end='') 120 | u_diff = pot_now - pot_target 121 | if np.abs(u_diff) < pot_conv: 122 | converged_pot=True 123 | nsteps_opt_now = geom_boost * geom_step 124 | print(f'Potential [o] U_diff= {u_diff:8.4f} V | ', end='') 125 | else: 126 | converged_pot=False 127 | nsteps_opt_now = geom_step 128 | print(f'Potential [x] U_diff= {u_diff:8.4f} V | ', end='') 129 | 130 | fmax_now = get_fmax(atoms_opt.get_forces()) 131 | if fmax_now < fmax: 132 | converged_forces=True 133 | print(f'Forces [o] F_max= {fmax_now:8.4f} eV/Å') 134 | else: 135 | nsteps_opt_now *= geom_boost 136 | converged_forces=False 137 | print(f'Forces [x] F_max= {fmax_now:8.4f} eV/Å') 138 | 139 | if converged_forces and converged_pot: 140 | print('CONVERGED') 141 | break 142 | else: 143 | nelect_net_new = nelect_net_now - (pot_target-pot_now)*pot_step 144 | atoms_opt.calc.set(charge=-nelect_net_new) 145 | 146 | with connect(f'{label}_conv.db', append=False) as db: 147 | db.write( 148 | atoms_opt, 149 | charge_net=-traj_nelect[-1], 150 | nelect_net = traj_nelect[-1], 151 | pot=traj_pot[-1], 152 | gcfe=traj_gcfe[-1], 153 | potene=atoms_opt.get_potential_energy() 154 | ) 155 | return atoms_opt 156 | -------------------------------------------------------------------------------- /echo/md.py: -------------------------------------------------------------------------------- 1 | from echo.utils import get_GCDFT, get_fmax, get_nelect_neu_pp, get_nelect_incar 2 | from ase.calculators.vasp import Vasp 3 | from ase.io import read, write 4 | from ase.db import connect 5 | from ase.optimize import FIRE 6 | import numpy as np 7 | from ase import units 8 | 9 | from ase.md.langevin import Langevin 10 | from ase.md.velocitydistribution import MaxwellBoltzmannDistribution 11 | 12 | from ase.constraints import FixInternals 13 | 14 | def langevin_fixpot( 15 | atoms=None, 16 | timestep_fs=1, 17 | temperature_K=300, 18 | nsteps = 1000, 19 | friction=0.1, 20 | label='', 21 | pot_target=0.0, 22 | pot_ref=4.6, 23 | pot_step=None, 24 | potentiostat_nsteps=10, 25 | calculator=None, 26 | ): 27 | mycalc = calculator 28 | mycalc.set(directory=label, txt='vasp.out') 29 | print(f'VASP settings:\n{mycalc.todict()}') 30 | 31 | # Read geometry if trajectory file exists 32 | restart_traj = False 33 | fn_traj = f'{label}.traj' 34 | try: 35 | geom_md = read(fn_traj) 36 | print(f'Reading geometry from {fn_traj}...') 37 | restart_traj = True 38 | except: 39 | geom_md = atoms.copy() 40 | geom_md.set_calculator(mycalc) 41 | print('Starting from input geometry...') 42 | 43 | # Get charge state and set calculator 44 | if restart_traj and 'charge' in geom_md.calc.todict().keys(): 45 | charge_now = geom_md.calc.todict()['charge'] 46 | geom_md.set_calculator(mycalc) 47 | nelect_neu = get_nelect_neu_pp(geom_md) 48 | print(f'Charge state read from trajectory: {charge_now:.4f} |e|') 49 | else: 50 | geom_md.set_calculator(mycalc) 51 | nelect_neu = get_nelect_neu_pp(geom_md) 52 | try: 53 | nelect_now = get_nelect_incar(label) 54 | charge_now = nelect_neu-nelect_now 55 | print(f'Charge state read from last INCAR: {charge_now:.4f} |e|') 56 | except: 57 | charge_now = 0 58 | print('Starting from zero net charge...') 59 | 60 | dyn = Langevin( 61 | atoms=geom_md, 62 | timestep=timestep_fs * units.fs, 63 | temperature_K=temperature_K, 64 | friction=friction, 65 | logfile=f'{label}.log', 66 | trajectory=f'{label}.traj', 67 | ) 68 | 69 | print(f'\nFIX-POTENTIAL BOMD (pot_target= {pot_target}, timestep={timestep_fs} fs, potentialstat per {potentiostat_nsteps} fs)') 70 | if pot_step is None: 71 | pot_step = 0.002 * nelect_neu 72 | print(f'Potentiostat step set to {pot_step:.6f} |e|/V (NELECT_neu={nelect_neu:8.3f} |e|)') 73 | 74 | geom_md.calc.set(charge=charge_now) 75 | traj_nelect = [] 76 | traj_pot = [] 77 | traj_gcfe = [] 78 | nsteps_done = 0 79 | while nsteps_done < nsteps: 80 | dyn.run(potentiostat_nsteps) 81 | nsteps_done += potentiostat_nsteps 82 | nelect_net_now, pot_now, energy_gcdft_now = get_GCDFT(pot_ref, dirName=label) 83 | traj_nelect.append(nelect_net_now) 84 | traj_pot.append(pot_now) 85 | traj_gcfe.append(energy_gcdft_now) 86 | np.savetxt(f'{label}/log_nelect.txt', np.array(traj_nelect)) 87 | np.savetxt(f'{label}/log_potential.txt', np.array(traj_pot)) 88 | np.savetxt(f'{label}/log_gcfe.txt', np.array(traj_gcfe)) 89 | print(f'Step {len(traj_nelect):4}: NELECT_net= {traj_nelect[-1]:8.4f} |e|; U_she= {traj_pot[-1]:8.4f} V; GCFE_el= {traj_gcfe[-1]:12.4f} eV') 90 | with connect(f'{label}_traj.db', append=True) as db: 91 | db.write( 92 | geom_md, 93 | charge_net=-traj_nelect[-1], 94 | nelect_net = traj_nelect[-1], 95 | pot=traj_pot[-1], 96 | gcfe=traj_gcfe[-1], 97 | potene=geom_md.get_potential_energy() 98 | ) 99 | if nsteps_done >= nsteps: 100 | break 101 | else: 102 | nelect_net_new = nelect_net_now - (pot_target-pot_now)*pot_step 103 | geom_md.calc.set(charge=-nelect_net_new) 104 | return geom_md 105 | 106 | def langevin_fixpot_slowgrowth_combobond( 107 | atoms=None, 108 | cv_combo = None, 109 | cv_ini = None, 110 | cv_fin = None, 111 | grwoth_per_step = 0.0001, 112 | timestep_fs=1, 113 | temperature_K=300, 114 | nsteps = 10000, 115 | friction=0.1, 116 | label='', 117 | pot_target=0.0, 118 | pot_ref=4.6, 119 | pot_step=None, 120 | potentiostat_nsteps=1, 121 | calculator=None, 122 | ): 123 | mycalc = calculator 124 | mycalc.set(directory=label, txt='vasp.out') 125 | print(f'VASP settings:\n{mycalc.todict()}') 126 | 127 | # Read geometry if trajectory file exists 128 | restart_traj = False 129 | fn_traj = f'{label}.traj' 130 | try: 131 | geom_md = read(fn_traj) 132 | print(f'Reading geometry from {fn_traj}...') 133 | restart_traj = True 134 | except: 135 | geom_md = atoms.copy() 136 | geom_md.set_calculator(mycalc) 137 | print('Starting from input geometry...') 138 | 139 | # Get charge state and set calculator 140 | if restart_traj and 'charge' in geom_md.calc.todict().keys(): 141 | charge_now = geom_md.calc.todict()['charge'] 142 | geom_md.set_calculator(mycalc) 143 | nelect_neu = get_nelect_neu_pp(geom_md) 144 | print(f'Charge state read from trajectory: {charge_now:.4f} |e|') 145 | else: 146 | geom_md.set_calculator(mycalc) 147 | nelect_neu = get_nelect_neu_pp(geom_md) 148 | try: 149 | nelect_now = get_nelect_incar(label) 150 | charge_now = nelect_neu-nelect_now 151 | print(f'Charge state read from last INCAR: {charge_now:.4f} |e|') 152 | except: 153 | charge_now = 0 154 | print('Starting from zero net charge...') 155 | 156 | # Read CV now if restart 157 | if restart_traj: 158 | try: 159 | cv_now = eval(open(f'{label}/cv_now.txt').read()) 160 | except: 161 | cv_now = None 162 | 163 | dyn = Langevin( 164 | atoms=geom_md, 165 | timestep=timestep_fs * units.fs, 166 | temperature_K=temperature_K, 167 | friction=friction, 168 | logfile=f'{label}.log', 169 | trajectory=f'{label}.traj', 170 | ) 171 | 172 | print(f'\nFIX-POTENTIAL BOMD (pot_target= {pot_target}, timestep={timestep_fs} fs, potentialstat per {potentiostat_nsteps} fs)') 173 | if pot_step is None: 174 | pot_step = 0.002 * nelect_neu 175 | print(f'Potentiostat step set to {pot_step:.6f} |e|/V (NELECT_neu={nelect_neu:8.3f} |e|)') 176 | 177 | geom_md.calc.set(charge=charge_now) 178 | traj_nelect = [] 179 | traj_pot = [] 180 | traj_gcfe = [] 181 | nsteps_done = 0 182 | if cv_now is not None: 183 | cv_now = cv_init 184 | while nsteps_done < nsteps and cv_now <= cv_fin: 185 | geom_md.set_constraint( 186 | FixInternals(bondcombos=[cv_now, cv_combo]) 187 | ) 188 | dyn.run(potentiostat_nsteps) 189 | cv_now += grwoth_per_step 190 | nsteps_done += potentiostat_nsteps 191 | nelect_net_now, pot_now, energy_gcdft_now = get_GCDFT(pot_ref, dirName=label) 192 | traj_nelect.append(nelect_net_now) 193 | traj_pot.append(pot_now) 194 | traj_gcfe.append(energy_gcdft_now) 195 | np.savetxt(f'{label}/log_nelect.txt', np.array(traj_nelect)) 196 | np.savetxt(f'{label}/log_potential.txt', np.array(traj_pot)) 197 | np.savetxt(f'{label}/log_gcfe.txt', np.array(traj_gcfe)) 198 | np.savetxt(f'{label}/cv_now.txt', cv_now - grwoth_per_step) 199 | print(f'Step {len(traj_nelect):4}: NELECT_net= {traj_nelect[-1]:8.4f} |e|; U_she= {traj_pot[-1]:8.4f} V; GCFE_el= {traj_gcfe[-1]:12.4f} eV') 200 | with connect(f'{label}_traj.db', append=True) as db: 201 | db.write( 202 | geom_md, 203 | charge_net=-traj_nelect[-1], 204 | nelect_net = traj_nelect[-1], 205 | pot=traj_pot[-1], 206 | gcfe=traj_gcfe[-1], 207 | potene=geom_md.get_potential_energy(), 208 | cv=cv_now - grwoth_per_step, 209 | ) 210 | if nsteps_done >= nsteps: 211 | break 212 | else: 213 | nelect_net_new = nelect_net_now - (pot_target-pot_now)*pot_step 214 | geom_md.calc.set(charge=-nelect_net_new) 215 | return geom_md 216 | 217 | 218 | #def langevin_fixpot_slowgrowth_vasp( 219 | 220 | -------------------------------------------------------------------------------- /echo/neb.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | from echo.utils import get_rssd, get_nelect_neu_pp, get_GCDFT_neb 4 | from ase.io import read, write 5 | from ase.db import connect 6 | from ase.calculators.vasp import Vasp 7 | from ase.neb import NEB 8 | import numpy as np 9 | import os 10 | 11 | 12 | def neb_fix_chg(img_ini, img_fin, n_images=None, band_inp=None, net_charge=0, climb=False, calculator=None, optimizer=None, fmax=0.01, steps=1000): 13 | print('\nTransition state search') 14 | if n_images == None: 15 | rssd_rxn = get_rssd(img_ini, img_fin) 16 | n_images = max(int(get_rssd(img_ini, img_fin) / 0.8), 3) 17 | print(f'n_images= {n_images} (from RXN RSSD={rssd_rxn:.4f} A)') 18 | else: 19 | print(f'n_images= {n_images}') 20 | workdirs = [f'img{i+1:03}' for i in range(n_images)] 21 | print(f'CINEB directories: {workdirs}') 22 | 23 | restart_neb = False 24 | if band_inp is not None: 25 | band = band_inp.copy() 26 | restart_neb = True 27 | print('Starting from provided band') 28 | else: 29 | try: 30 | band = read('neb.traj', index=f'{-n_images-2}:') 31 | restart_neb = True 32 | print('Restarting band from neb.traj') 33 | except: 34 | band = [img_ini] 35 | band += [img_ini.copy() for i in range(n_images)] 36 | band += [img_fin] 37 | print('Band will be initialized by IDPP interpolation') 38 | 39 | # Set separate calculators for each image 40 | for i in range(len(band)-2): 41 | band[i+1].calc = Vasp() 42 | band[i+1].calc.fromdict(calculator.asdict()) 43 | band[i+1].calc.set(charge=net_charge, directory=workdirs[i], txt='vasp.out', lreal='Auto') 44 | 45 | cineb = NEB(band, climb=climb) 46 | if not restart_neb: 47 | cineb.interpolate(method='idpp') 48 | nebopt = optimizer(cineb, trajectory='neb.traj', logfile='-') 49 | nebopt.run(fmax=fmax, steps=steps) 50 | print('CONVERGED') 51 | write('neb-conv.db', band) 52 | return band 53 | 54 | 55 | def neb_fix_pot(img_ini, img_fin, n_images=None, band_inp=None, chg_inp=None, pot_ini=0, pot_fin=0, gcfe_ini=0, gcfe_fin=0, nelect_net_ini=0, nelect_net_fin=0, pot_target=0.0, pot_ref=4.6, pot_step=None, geom_step=1, climb=False, calculator=None, optimizer=None, fmax=0.01, pot_conv=0.001, geom_boost=3): 56 | print( 57 | f'Ini state: NELECT_net= {nelect_net_ini:8.4f} |e|; U_she= {pot_ini:8.4f} V; GCFE_el= {gcfe_ini:12.4f} eV') 58 | print( 59 | f'Fin state: NELECT_net= {nelect_net_fin:8.4f} |e|; U_she= {pot_fin:8.4f} V; GCFE_el= {gcfe_fin:12.4f} eV') 60 | print(f'Target potential: {pot_target} V (SHE refernce: {pot_ref} V)') 61 | 62 | # Determine number of images along the band 63 | if n_images == None: 64 | rssd_rxn = get_rssd(img_ini, img_fin) 65 | n_images = max(int(get_rssd(img_ini, img_fin) / 0.8), 3) 66 | print(f'n_images= {n_images} (from RXN RSSD={rssd_rxn:.4f} A)') 67 | else: 68 | print(f'n_images= {n_images}') 69 | workdirs = [f'img{i+1:03}' for i in range(n_images)] 70 | print(f'CINEB directories: {workdirs}') 71 | 72 | # Geometry along the band 73 | restart_band = False 74 | if band_inp is None: 75 | try: 76 | # Read the restart.db 77 | band = [img_ini]+read('restart.db', index=f'1:{n_images+1}')+[img_fin] 78 | print('Geometry: Restarting from the last band in restart.db') 79 | restart_band = True 80 | except: 81 | # Start from scratch 82 | band = [img_ini] 83 | band += [img_ini.copy() for i in range(n_images)] 84 | band += [img_fin] 85 | print('Geometry: Starting from scratch (IDPP interpolation)') 86 | else: 87 | print('Geometry: Starting from provided band') 88 | # Use the provided band geometry (excluding IS/FS) 89 | if len(band_inp) == n_images: 90 | band = [img_ini] + band_inp + [img_fin] 91 | elif len(band_inp) == n_images+2: 92 | band = [img_ini] + band_inp[1:n_images+1] + [img_fin] 93 | else: 94 | print('Input band has wrong size! Check it pls') 95 | exit() 96 | 97 | 98 | # Get neutrla state charge 99 | geom_tmp = img_ini.copy() 100 | geom_tmp.calc = Vasp() 101 | geom_tmp.calc.fromdict(calculator.todict()) 102 | nelect_neu = get_nelect_neu_pp(geom_tmp) 103 | 104 | # Charge state along the band 105 | if restart_band: 106 | nelect_net_guess = [] 107 | with connect('restart.db') as db: 108 | for r in db.select(): 109 | try: 110 | nelect_net_guess.append(r.nelect_net) 111 | except: 112 | nelect_net_guess.append(-r.charge_net) 113 | print(f'Charge states: Restarting from restart.db') 114 | else: 115 | try: 116 | nelect_net_guess = np.loadtxt('restart.nelect_net') 117 | print(f'Charge states: Restarting from restart.nelect_net') 118 | except: 119 | nelect_net_guess = np.linspace( 120 | nelect_net_ini, nelect_net_fin, n_images+2)[1:-1] 121 | print(f'Charge states: Restarting from scratch (linear CT interpolation)') 122 | print(f'Net charges along the band: {nelect_net_guess}') 123 | 124 | # Set CINEB band! 125 | cineb = NEB(band, climb=climb) 126 | if not restart_band and band_inp is None: 127 | cineb.interpolate(method='idpp') 128 | write('band_init.db', band, append=False) 129 | rssd_img = [get_rssd(band[0], band[m]) 130 | for m in range(n_images+2)] 131 | print( 132 | f'Reaction coordinate (RSSD): {[round(n, 4) for n in rssd_img]} Å') 133 | 134 | # Set separate calculators for each image 135 | print('\nTransition state search') 136 | for i in range(n_images): 137 | band[i+1].calc = Vasp() 138 | band[i+1].calc.fromdict(calculator.asdict()) 139 | band[i+1].calc.set(charge=-nelect_net_guess[i], directory=workdirs[i], txt='vasp.out', lreal='Auto') 140 | 141 | # Starting the run! 142 | print(f'\nFIX-POTENTIAL NEB (pot_target= {pot_target}, fmax={fmax}, pot_conv= {pot_conv})') 143 | if pot_step is None: 144 | # choose potentionstat step 145 | pot_step = 0.002 * nelect_neu 146 | print(f'Potentiostat step set to {pot_step:.6f} |e|/V (NELECT_neu={nelect_neu:8.3f} |e|)') 147 | 148 | traj_nelect = [] 149 | traj_pot = [] 150 | traj_gcfe = [] 151 | nsteps_opt_now = geom_step 152 | converged_forces = False 153 | converged_pot = False 154 | while not (converged_forces and converged_pot): 155 | nebopt = optimizer(cineb, 156 | trajectory='neb.traj', logfile='neb.log') 157 | nebopt.run(fmax=fmax, steps=nsteps_opt_now) 158 | nelect_net_now, pot_now, energy_gcdft_now = get_GCDFT_neb(workdirs, pot_ref) 159 | 160 | traj_nelect.append(nelect_net_now) 161 | traj_pot.append(pot_now) 162 | traj_gcfe.append(energy_gcdft_now) 163 | 164 | # Write restart files 165 | with connect('restart.db', append=False) as db: 166 | for ii in range(n_images+2): 167 | if ii == 0: 168 | db.write(band[ii], 169 | charge_net=-nelect_net_ini, 170 | nelect_net=nelect_net_ini, 171 | pot=pot_ini, 172 | gcfe=gcfe_ini, 173 | potene=band[ii].get_potential_energy()) 174 | elif ii == n_images+1: 175 | db.write(band[ii], 176 | charge_net=-nelect_net_fin, 177 | nelect_net=nelect_net_fin, 178 | pot=pot_fin, 179 | gcfe=gcfe_fin, 180 | potene=band[ii].get_potential_energy()) 181 | else: 182 | db.write(band[ii], 183 | charge_net=-nelect_net_now[ii-1], 184 | nelect_net=nelect_net_now[ii-1], 185 | pot=pot_now[ii-1], 186 | gcfe=energy_gcdft_now[ii-1], 187 | potene=band[ii].get_potential_energy()) 188 | np.savetxt('restart.nelect_net', np.array(nelect_net_now)) 189 | 190 | print( 191 | f'\nStep {len(traj_nelect):4}: NELECT_net: {[round(n,4) for n in nelect_net_now]}') 192 | print(f'Step {len(traj_nelect):4}: U_she: {[round(n,4) for n in pot_now]}') 193 | print( 194 | f'Step {len(traj_nelect):4}: GCFE_el: {[round(n,4) for n in energy_gcdft_now]}') 195 | 196 | # Convergence check and optimizer adjusting 197 | print(f'Conv {len(traj_nelect):4}: ', end='') 198 | u_diff = (np.abs(np.array(pot_now) - pot_target)).max() 199 | if u_diff < pot_conv: 200 | converged_pot = True 201 | nsteps_opt_now = geom_boost * geom_step 202 | print(f'Potential [o] U_diff= {u_diff:8.4f} V | ', end='') 203 | else: 204 | converged_pot = False 205 | nsteps_opt_now = geom_step 206 | print(f'Potential [x] U_diff= {u_diff:8.4f} V | ', end='') 207 | 208 | #fmax = cineb.get_residual() 209 | fmax_now = (np.sqrt((cineb.get_forces()**2).sum(axis=1))).max() 210 | if fmax_now < fmax: 211 | converged_forces = True 212 | print(f'Forces [o] F_max= {fmax_now:8.4f} eV/Å') 213 | else: 214 | nsteps_opt_now *= geom_boost 215 | converged_forces = False 216 | print(f'Forces [x] F_max= {fmax_now:8.4f} eV/Å') 217 | 218 | if converged_forces and converged_pot: 219 | print('CONVERGED') 220 | break 221 | else: 222 | for i in range(len(band)-2): 223 | nelect_net_new = nelect_net_now[i] - (pot_target-pot_now[i])*pot_step 224 | cineb.images[i+1].calc.set(charge=-nelect_net_new) 225 | 226 | os.system('cp restart.db neb_conv.db') 227 | return band 228 | 229 | -------------------------------------------------------------------------------- /examples/geomopt_fixpot/FS.vasp: -------------------------------------------------------------------------------- 1 | Cu H 2 | 1.0000000000000000 3 | 15.3360000000000003 0.0000000000000000 0.0000000000000000 4 | 0.0000000000000000 15.3360000000000003 0.0000000000000000 5 | 0.0000000000000000 0.0000000000000000 25.5000000000000000 6 | Cu H 7 | 144 2 8 | Selective dynamics 9 | Cartesian 10 | 1.2779999488800324 1.2779999488800324 9.3073649000000529 F F F 11 | 3.8340000000000001 1.2779999488800324 9.3073649000000529 F F F 12 | 6.3900000511199684 1.2779999488800324 9.3073649000000529 F F F 13 | 8.9459999488800328 1.2779999488800324 9.3073649000000529 F F F 14 | 11.5020000000000007 1.2779999488800324 9.3073649000000529 F F F 15 | 14.0580000511199685 1.2779999488800324 9.3073649000000529 F F F 16 | 1.2779999488800324 3.8340000000000001 9.3073649000000529 F F F 17 | 3.8340000000000001 3.8340000000000001 9.3073649000000529 F F F 18 | 6.3900000511199684 3.8340000000000001 9.3073649000000529 F F F 19 | 8.9459999488800328 3.8340000000000001 9.3073649000000529 F F F 20 | 11.5020000000000007 3.8340000000000001 9.3073649000000529 F F F 21 | 14.0580000511199685 3.8340000000000001 9.3073649000000529 F F F 22 | 0.0000000000000000 0.0000000000000000 11.1147297699999790 F F F 23 | 2.5560000511199679 0.0000000000000000 11.1147297699999790 F F F 24 | 5.1119999488800323 0.0000000000000000 11.1147297699999790 F F F 25 | 7.6680000000000001 0.0000000000000000 11.1147297699999790 F F F 26 | 10.2240000511199689 0.0000000000000000 11.1147297699999790 F F F 27 | 12.7799999488800324 0.0000000000000000 11.1147297699999790 F F F 28 | 0.0000000000000000 2.5560000511199679 11.1147297699999790 F F F 29 | 2.5560000511199679 2.5560000511199679 11.1147297699999790 F F F 30 | 5.1119999488800323 2.5560000511199679 11.1147297699999790 F F F 31 | 7.6680000000000001 2.5560000511199679 11.1147297699999790 F F F 32 | 10.2240000511199689 2.5560000511199679 11.1147297699999790 F F F 33 | 12.7799999488800324 2.5560000511199679 11.1147297699999790 F F F 34 | 1.2779999488800324 6.3900000511199684 9.3073649000000529 F F F 35 | 3.8340000000000001 6.3900000511199684 9.3073649000000529 F F F 36 | 6.3900000511199684 6.3900000511199684 9.3073649000000529 F F F 37 | 8.9459999488800328 6.3900000511199684 9.3073649000000529 F F F 38 | 11.5020000000000007 6.3900000511199684 9.3073649000000529 F F F 39 | 14.0580000511199685 6.3900000511199684 9.3073649000000529 F F F 40 | 1.2779999488800324 8.9459999488800328 9.3073649000000529 F F F 41 | 3.8340000000000001 8.9459999488800328 9.3073649000000529 F F F 42 | 6.3900000511199684 8.9459999488800328 9.3073649000000529 F F F 43 | 8.9459999488800328 8.9459999488800328 9.3073649000000529 F F F 44 | 11.5020000000000007 8.9459999488800328 9.3073649000000529 F F F 45 | 14.0580000511199685 8.9459999488800328 9.3073649000000529 F F F 46 | 0.0000000000000000 5.1119999488800323 11.1147297699999790 F F F 47 | 2.5560000511199679 5.1119999488800323 11.1147297699999790 F F F 48 | 5.1119999488800323 5.1119999488800323 11.1147297699999790 F F F 49 | 7.6680000000000001 5.1119999488800323 11.1147297699999790 F F F 50 | 10.2240000511199689 5.1119999488800323 11.1147297699999790 F F F 51 | 12.7799999488800324 5.1119999488800323 11.1147297699999790 F F F 52 | 0.0000000000000000 7.6680000000000001 11.1147297699999790 F F F 53 | 2.5560000511199679 7.6680000000000001 11.1147297699999790 F F F 54 | 5.1119999488800323 7.6680000000000001 11.1147297699999790 F F F 55 | 7.6680000000000001 7.6680000000000001 11.1147297699999790 F F F 56 | 10.2240000511199689 7.6680000000000001 11.1147297699999790 F F F 57 | 12.7799999488800324 7.6680000000000001 11.1147297699999790 F F F 58 | 1.2779999488800324 11.5020000000000007 9.3073649000000529 F F F 59 | 3.8340000000000001 11.5020000000000007 9.3073649000000529 F F F 60 | 6.3900000511199684 11.5020000000000007 9.3073649000000529 F F F 61 | 8.9459999488800328 11.5020000000000007 9.3073649000000529 F F F 62 | 11.5020000000000007 11.5020000000000007 9.3073649000000529 F F F 63 | 14.0580000511199685 11.5020000000000007 9.3073649000000529 F F F 64 | 1.2779999488800324 14.0580000511199685 9.3073649000000529 F F F 65 | 3.8340000000000001 14.0580000511199685 9.3073649000000529 F F F 66 | 6.3900000511199684 14.0580000511199685 9.3073649000000529 F F F 67 | 8.9459999488800328 14.0580000511199685 9.3073649000000529 F F F 68 | 11.5020000000000007 14.0580000511199685 9.3073649000000529 F F F 69 | 14.0580000511199685 14.0580000511199685 9.3073649000000529 F F F 70 | 0.0000000000000000 10.2240000511199689 11.1147297699999790 F F F 71 | 2.5560000511199679 10.2240000511199689 11.1147297699999790 F F F 72 | 5.1119999488800323 10.2240000511199689 11.1147297699999790 F F F 73 | 7.6680000000000001 10.2240000511199689 11.1147297699999790 F F F 74 | 10.2240000511199689 10.2240000511199689 11.1147297699999790 F F F 75 | 12.7799999488800324 10.2240000511199689 11.1147297699999790 F F F 76 | 0.0000000000000000 12.7799999488800324 11.1147297699999790 F F F 77 | 2.5560000511199679 12.7799999488800324 11.1147297699999790 F F F 78 | 5.1119999488800323 12.7799999488800324 11.1147297699999790 F F F 79 | 7.6680000000000001 12.7799999488800324 11.1147297699999790 F F F 80 | 10.2240000511199689 12.7799999488800324 11.1147297699999790 F F F 81 | 12.7799999488800324 12.7799999488800324 11.1147297699999790 F F F 82 | 1.2784628880905056 1.2790135307250445 13.0061434024934588 T T T 83 | 3.8339242759716927 1.2778600303630938 13.0060712402908401 T T T 84 | 6.3894877696727432 1.2773029719885609 13.0056135892278029 T T T 85 | 8.9473231826735518 1.2782849096646929 13.0063397124046958 T T T 86 | 11.5021200952111737 1.2789394021378004 13.0078245941439743 T T T 87 | 14.0569404656969148 1.2792229567677327 13.0070464156293610 T T T 88 | 1.2766960944159846 3.8344646935462143 13.0072114928090254 T T T 89 | 3.8320266939833947 3.8335889157496190 13.0068394153208260 T T T 90 | 6.3877701767837101 3.8324874599965177 13.0062730966416176 T T T 91 | 8.9454433136314577 3.8335236537931263 13.0073946042754738 T T T 92 | 11.5004972956784481 3.8345087574506098 13.0078511970579473 T T T 93 | 14.0556308030414865 3.8349725660259297 13.0075918462134652 T T T 94 | 1.2790187520166765 6.3896058343823592 13.0068839848433022 T T T 95 | 3.8343755200892451 6.3888262263022710 13.0069557841860082 T T T 96 | 6.3894553492654520 6.3877295348695151 13.0058867947358952 T T T 97 | 8.9480982064151000 6.3883996578305107 13.0060787791952013 T T T 98 | 11.5037086121618728 6.3899083203549294 13.0081350281076613 T T T 99 | 14.0578064393844961 6.3902777325633897 13.0079583300217738 T T T 100 | 1.2792756325397827 8.9470719147249884 13.0072112336116614 T T T 101 | 3.8347157740301365 8.9461080532447177 13.0074583778961088 T T T 102 | 6.3897547106127419 8.9462595072390005 13.0067174121260063 T T T 103 | 8.9485705839069425 8.9471031923617907 13.0068811709459080 T T T 104 | 11.5043611028631201 8.9474319214783087 13.0088157440940311 T T T 105 | 14.0582843883779098 8.9472843738178671 13.0079130602459028 T T T 106 | 1.2776644446409562 11.5019325330940845 13.0080388034158450 T T T 107 | 3.8331639722155195 11.5009345758334192 13.0075465196687396 T T T 108 | 6.3888974372839149 11.5008280459198939 13.0074789884313144 T T T 109 | 8.9466976042473014 11.5014506923961601 13.0084124862322952 T T T 110 | 11.5021062562110341 11.5022307128150132 13.0090111008098983 T T T 111 | 14.0568506904989867 11.5019338565100817 13.0089155782886525 T T T 112 | 1.2790722589512487 14.0570591888434766 13.0066534270021190 T T T 113 | 3.8344980046855150 14.0562308584347964 13.0064777740180286 T T T 114 | 6.3902591188154334 14.0556162206714319 13.0058805921591958 T T T 115 | 8.9481829671204398 14.0564386362617579 13.0067403449285042 T T T 116 | 11.5032101321581024 14.0574552043011938 13.0083896665746597 T T T 117 | 14.0577504721840416 14.0572544412012306 13.0078672284068340 T T T 118 | 0.0021426312822092 0.0007792442704387 14.8235761712112009 T T T 119 | 2.5572731561751443 15.3359231118874764 14.8229042633726102 T T T 120 | 5.1145354150276043 15.3336836134937737 14.8222469552534761 T T T 121 | 7.6699169431880883 15.3345085884237591 14.8227636227336212 T T T 122 | 10.2248966699317005 15.3363697748912262 14.8246859195068019 T T T 123 | 12.7823797783267459 0.0013844149856546 14.8254183196328420 T T T 124 | 15.3337814146164089 2.5559483220975836 14.8239861408151654 T T T 125 | 2.5531865273106593 2.5548949151234699 14.8236737004831678 T T T 126 | 5.1108829278713044 2.5527853485111813 14.8230424728941763 T T T 127 | 7.6655094099667940 2.5534537775914350 14.8232503803278082 T T T 128 | 10.2208591087388445 2.5550842333118138 14.8251599689096381 T T T 129 | 12.7787933303229693 2.5564498034303966 14.8253190624281963 T T T 130 | 15.3346696171564769 5.1131940031659964 14.8248316769508097 T T T 131 | 2.5537251373564702 5.1128369702524399 14.8244128218059608 T T T 132 | 5.1112618860634766 5.1105438550030708 14.8238348644607747 T T T 133 | 7.6659755049794152 5.1105619167614282 14.8229386753100343 T T T 134 | 10.2219111062416186 5.1126056213416424 14.8248454343597498 T T T 135 | 12.7797680772361755 5.1138821971134822 14.8259349550118209 T T T 136 | 15.3391182595387612 7.6686470863905827 14.8253952426621680 T T T 137 | 2.5577558640142581 7.6677162431205677 14.8242052465035581 T T T 138 | 5.1146177213240094 7.6657250372797883 14.8238957964870011 T T T 139 | 7.6699250664971004 7.6662016863593498 14.8175555503021279 T T T 140 | 10.2267456511811456 7.6680307690652931 14.8208929027060510 T T T 141 | 12.7840802985409443 7.6689925008323057 14.8275018075439746 T T T 142 | 15.3361164345276322 10.2236646847033814 14.8266499338540658 T T T 143 | 2.5545301057473675 10.2228097363650097 14.8252470922004580 T T T 144 | 5.1119954678095425 10.2214715545915542 14.8250484364585997 T T T 145 | 7.6673508765611222 10.2224425496930866 14.8242772144901434 T T T 146 | 10.2235499319911991 10.2236928672450293 14.8263035514664860 T T T 147 | 12.7815290588207464 10.2238065512495755 14.8280222400884494 T T T 148 | 0.0001288724496507 12.7812179947159201 14.8256308966961221 T T T 149 | 2.5550357284281668 12.7808437945461577 14.8248346560657360 T T T 150 | 5.1125977826163007 12.7792610797944839 14.8242873239899851 T T T 151 | 7.6675104646618575 12.7798183101777756 14.8244485659098526 T T T 152 | 10.2227441787906184 12.7815060707634931 14.8263417268903233 T T T 153 | 12.7808026897684979 12.7816801161281681 14.8269695160881163 T T T 154 | 8.9475862067528862 8.0715943589697901 18.4556489274128062 T T T 155 | 8.9464322173986144 7.3311992773800991 18.5652187562847928 T T T 156 | -------------------------------------------------------------------------------- /examples/geomopt_fixpot/IS.vasp: -------------------------------------------------------------------------------- 1 | Cu H 2 | 1.0000000000000000 3 | 15.3360000000000003 0.0000000000000000 0.0000000000000000 4 | 0.0000000000000000 15.3360000000000003 0.0000000000000000 5 | 0.0000000000000000 0.0000000000000000 25.5000000000000000 6 | Cu H 7 | 144 2 8 | Selective dynamics 9 | Cartesian 10 | 1.2779999488800324 1.2779999488800324 9.3073649000000529 F F F 11 | 3.8340000000000001 1.2779999488800324 9.3073649000000529 F F F 12 | 6.3900000511199684 1.2779999488800324 9.3073649000000529 F F F 13 | 8.9459999488800328 1.2779999488800324 9.3073649000000529 F F F 14 | 11.5020000000000007 1.2779999488800324 9.3073649000000529 F F F 15 | 14.0580000511199685 1.2779999488800324 9.3073649000000529 F F F 16 | 1.2779999488800324 3.8340000000000001 9.3073649000000529 F F F 17 | 3.8340000000000001 3.8340000000000001 9.3073649000000529 F F F 18 | 6.3900000511199684 3.8340000000000001 9.3073649000000529 F F F 19 | 8.9459999488800328 3.8340000000000001 9.3073649000000529 F F F 20 | 11.5020000000000007 3.8340000000000001 9.3073649000000529 F F F 21 | 14.0580000511199685 3.8340000000000001 9.3073649000000529 F F F 22 | 0.0000000000000000 0.0000000000000000 11.1147297699999790 F F F 23 | 2.5560000511199679 0.0000000000000000 11.1147297699999790 F F F 24 | 5.1119999488800323 0.0000000000000000 11.1147297699999790 F F F 25 | 7.6680000000000001 0.0000000000000000 11.1147297699999790 F F F 26 | 10.2240000511199689 0.0000000000000000 11.1147297699999790 F F F 27 | 12.7799999488800324 0.0000000000000000 11.1147297699999790 F F F 28 | 0.0000000000000000 2.5560000511199679 11.1147297699999790 F F F 29 | 2.5560000511199679 2.5560000511199679 11.1147297699999790 F F F 30 | 5.1119999488800323 2.5560000511199679 11.1147297699999790 F F F 31 | 7.6680000000000001 2.5560000511199679 11.1147297699999790 F F F 32 | 10.2240000511199689 2.5560000511199679 11.1147297699999790 F F F 33 | 12.7799999488800324 2.5560000511199679 11.1147297699999790 F F F 34 | 1.2779999488800324 6.3900000511199684 9.3073649000000529 F F F 35 | 3.8340000000000001 6.3900000511199684 9.3073649000000529 F F F 36 | 6.3900000511199684 6.3900000511199684 9.3073649000000529 F F F 37 | 8.9459999488800328 6.3900000511199684 9.3073649000000529 F F F 38 | 11.5020000000000007 6.3900000511199684 9.3073649000000529 F F F 39 | 14.0580000511199685 6.3900000511199684 9.3073649000000529 F F F 40 | 1.2779999488800324 8.9459999488800328 9.3073649000000529 F F F 41 | 3.8340000000000001 8.9459999488800328 9.3073649000000529 F F F 42 | 6.3900000511199684 8.9459999488800328 9.3073649000000529 F F F 43 | 8.9459999488800328 8.9459999488800328 9.3073649000000529 F F F 44 | 11.5020000000000007 8.9459999488800328 9.3073649000000529 F F F 45 | 14.0580000511199685 8.9459999488800328 9.3073649000000529 F F F 46 | 0.0000000000000000 5.1119999488800323 11.1147297699999790 F F F 47 | 2.5560000511199679 5.1119999488800323 11.1147297699999790 F F F 48 | 5.1119999488800323 5.1119999488800323 11.1147297699999790 F F F 49 | 7.6680000000000001 5.1119999488800323 11.1147297699999790 F F F 50 | 10.2240000511199689 5.1119999488800323 11.1147297699999790 F F F 51 | 12.7799999488800324 5.1119999488800323 11.1147297699999790 F F F 52 | 0.0000000000000000 7.6680000000000001 11.1147297699999790 F F F 53 | 2.5560000511199679 7.6680000000000001 11.1147297699999790 F F F 54 | 5.1119999488800323 7.6680000000000001 11.1147297699999790 F F F 55 | 7.6680000000000001 7.6680000000000001 11.1147297699999790 F F F 56 | 10.2240000511199689 7.6680000000000001 11.1147297699999790 F F F 57 | 12.7799999488800324 7.6680000000000001 11.1147297699999790 F F F 58 | 1.2779999488800324 11.5020000000000007 9.3073649000000529 F F F 59 | 3.8340000000000001 11.5020000000000007 9.3073649000000529 F F F 60 | 6.3900000511199684 11.5020000000000007 9.3073649000000529 F F F 61 | 8.9459999488800328 11.5020000000000007 9.3073649000000529 F F F 62 | 11.5020000000000007 11.5020000000000007 9.3073649000000529 F F F 63 | 14.0580000511199685 11.5020000000000007 9.3073649000000529 F F F 64 | 1.2779999488800324 14.0580000511199685 9.3073649000000529 F F F 65 | 3.8340000000000001 14.0580000511199685 9.3073649000000529 F F F 66 | 6.3900000511199684 14.0580000511199685 9.3073649000000529 F F F 67 | 8.9459999488800328 14.0580000511199685 9.3073649000000529 F F F 68 | 11.5020000000000007 14.0580000511199685 9.3073649000000529 F F F 69 | 14.0580000511199685 14.0580000511199685 9.3073649000000529 F F F 70 | 0.0000000000000000 10.2240000511199689 11.1147297699999790 F F F 71 | 2.5560000511199679 10.2240000511199689 11.1147297699999790 F F F 72 | 5.1119999488800323 10.2240000511199689 11.1147297699999790 F F F 73 | 7.6680000000000001 10.2240000511199689 11.1147297699999790 F F F 74 | 10.2240000511199689 10.2240000511199689 11.1147297699999790 F F F 75 | 12.7799999488800324 10.2240000511199689 11.1147297699999790 F F F 76 | 0.0000000000000000 12.7799999488800324 11.1147297699999790 F F F 77 | 2.5560000511199679 12.7799999488800324 11.1147297699999790 F F F 78 | 5.1119999488800323 12.7799999488800324 11.1147297699999790 F F F 79 | 7.6680000000000001 12.7799999488800324 11.1147297699999790 F F F 80 | 10.2240000511199689 12.7799999488800324 11.1147297699999790 F F F 81 | 12.7799999488800324 12.7799999488800324 11.1147297699999790 F F F 82 | 1.2798247904420361 1.2813766777666336 13.0078736359864333 T T T 83 | 3.8399675801742235 1.2814266759771837 13.0149976869184698 T T T 84 | 6.3958356199148074 1.2851674591427531 13.0098565457326583 T T T 85 | 8.9468352930617492 1.2804650509207449 13.0128591787915600 T T T 86 | 11.4950338940455676 1.2876298186794073 13.0108542735982997 T T T 87 | 14.0528541087111787 1.2840897832952547 13.0142447733818418 T T T 88 | 1.2783791851142268 3.8406372264113942 13.0082380106476947 T T T 89 | 3.8438176189486559 3.8373366411872776 13.0152745745676608 T T T 90 | 6.4073604685822225 3.8602107252164219 13.0366771447010308 T T T 91 | 8.9460607262362704 3.8407619258398222 13.0105804041141226 T T T 92 | 11.4819025743875525 3.8625193475506627 13.0370296702620543 T T T 93 | 14.0471657273269432 3.8405934581028331 13.0153317837139273 T T T 94 | 1.2785084904216082 6.3944975545641105 13.0120015149139903 T T T 95 | 3.8427255191228644 6.3891974597580168 13.0115604817410588 T T T 96 | 6.4111399260925417 6.4048461813759836 13.0372589931739782 T T T 97 | 8.9458056326787307 6.3962678251985245 12.9532165480484753 T T T 98 | 11.4772098178695483 6.4086616244325310 13.0368713678232879 T T T 99 | 14.0476844899413287 6.3918424787422117 13.0096210506826075 T T T 100 | 1.2790934275770445 8.9430334656811539 13.0119574364554360 T T T 101 | 3.8433010134580763 8.9446243418078932 13.0115750527682383 T T T 102 | 6.4118462116566812 8.9262600580212208 13.0374910017392907 T T T 103 | 8.9466404961450756 8.9381021246802792 12.9533798969111231 T T T 104 | 11.4781764755203834 8.9301424414203971 13.0365060902308407 T T T 105 | 14.0483620685014543 8.9477595496020239 13.0098043384510245 T T T 106 | 1.2793189976608281 11.4969648498829269 13.0078218094871740 T T T 107 | 3.8449630290070682 11.4962723910396249 13.0151758101484383 T T T 108 | 6.4088780464519228 11.4716836441711578 13.0367023321865467 T T T 109 | 8.9474758978753179 11.4932746875795928 13.0108702205633175 T T T 110 | 11.4830201925902564 11.4755224308869899 13.0372182777816743 T T T 111 | 14.0481222559395871 11.4992548746693366 13.0154652756588156 T T T 112 | 1.2801082713492240 14.0558890353436148 13.0078058948415176 T T T 113 | 3.8404552349560879 14.0523876051132675 13.0148959608713035 T T T 114 | 6.3964756935283500 14.0472264239258529 13.0097557455305051 T T T 115 | 8.9474897942532507 14.0538433369476312 13.0128998879490538 T T T 116 | 11.4957833939145786 14.0503063658752758 13.0110284961050660 T T T 117 | 14.0531638163850392 14.0549350276908029 13.0146810171266658 T T T 118 | 0.0088043695616913 0.0022164954047547 14.8265370971410650 T T T 119 | 2.5505801736101228 15.3355344177719584 14.8278215301853518 T T T 120 | 5.1124442262420731 15.3329172894287122 14.8331565603524069 T T T 121 | 7.6625770216152445 15.3332610581280946 14.8265648735448163 T T T 122 | 10.2292832019414774 15.3362554114740277 14.8276472100296264 T T T 123 | 12.7832277250718924 0.0029375258983395 14.8330009974147110 T T T 124 | 15.3376426749041492 2.5547446198816512 14.8302526157568284 T T T 125 | 2.5539992579747541 2.5518589461168300 14.8310423252970551 T T T 126 | 5.1176063051941139 2.5614548939120891 14.8386952265014891 T T T 127 | 7.6714574548999925 2.5699501538470959 14.8316278949869460 T T T 128 | 10.2192358948480937 2.5730305396885087 14.8330487931020301 T T T 129 | 12.7760860416593154 2.5675707058987354 14.8376977456224903 T T T 130 | 15.3251830790229331 5.1114809075266532 14.8306732136551727 T T T 131 | 2.5620295106008855 5.1087650106423883 14.8315152989893644 T T T 132 | 5.1251811891561765 5.1235541277147378 14.8410202959431530 T T T 133 | 7.6903461275572722 5.1333651030306688 14.8904838267471451 T T T 134 | 10.2022671050744087 5.1370469780438910 14.8910558808562303 T T T 135 | 12.7655352567061104 5.1296371199406607 14.8406929616590233 T T T 136 | 15.3202669040053223 7.6703977807084467 14.8257629068448153 T T T 137 | 2.5688769301649996 7.6678133566281970 14.8273243899114888 T T T 138 | 5.1318935319378784 7.6649258250075594 14.8392347855668199 T T T 139 | 7.6989311419785862 7.6640905164820357 14.9679148986602311 T T T 140 | 10.2000257275003907 7.6680003523530926 14.9691800614683608 T T T 141 | 12.7608260102613347 7.6706106367015616 14.8359391453219676 T T T 142 | 15.3270490749349655 10.2291830706289755 14.8306660125349588 T T T 143 | 2.5634456084591748 10.2269911102708377 14.8313137773007107 T T T 144 | 5.1268547717922139 10.2069792061026963 14.8407447992558481 T T T 145 | 7.6922602255091306 10.1967699450875582 14.8901557540052174 T T T 146 | 10.2041366238938682 10.1991336908234089 14.8916654431335420 T T T 147 | 12.7674477880686261 10.2111331219024972 14.8409005709782953 T T T 148 | 0.0033339676310124 12.7854953880327535 14.8305264066413933 T T T 149 | 2.5552469312301778 12.7835489656720700 14.8309544082547262 T T T 150 | 5.1188573904978512 12.7688847810833437 14.8383549406495927 T T T 151 | 7.6727960920378298 12.7601978232354067 14.8314307989802305 T T T 152 | 10.2205722528866279 12.7634090864672096 14.8332724863645034 T T T 153 | 12.7774637104722171 12.7736181902670101 14.8383147006003036 T T T 154 | 8.9477039595217516 9.0048410955919191 15.5150799512527016 T T T 155 | 8.9433618238365771 6.3264016058975612 15.5158665312708646 T T T 156 | -------------------------------------------------------------------------------- /examples/slowgrowth_fixpot/POSCAR: -------------------------------------------------------------------------------- 1 | Pt H O 2 | 1.0000000000000000 3 | 11.2486546999999995 0.0000000000000000 0.0000000000000000 4 | 0.0000000000000000 9.7416207000000004 0.0000000000000000 5 | 0.0000000000000000 0.0000000000000000 32.0000000000000000 6 | Pt H O 7 | 64 72 36 8 | Selective dynamics 9 | Cartesian 10 | 7.0304091700000004 0.8118017300000000 3.2961220199999999 F F F 11 | 9.8425728400000008 0.8118017300000000 3.2961220199999999 F F F 12 | 0.0000000000000000 3.2472069000000001 3.2961220199999999 F F F 13 | 2.8121636699999999 3.2472069000000001 3.2961220199999999 F F F 14 | 5.6243273399999998 3.2472069000000001 3.2961220199999999 F F F 15 | 8.4364910099999992 3.2472069000000001 3.2961220199999999 F F F 16 | 4.2182455000000001 5.6826120800000002 3.2961220199999999 F F F 17 | 7.0304091700000004 5.6826120800000002 3.2961220199999999 F F F 18 | 9.8425728400000008 5.6826120800000002 3.2961220199999999 F F F 19 | 4.2182455000000001 0.8118017300000000 3.2961220199999999 F F F 20 | 0.0000000000000000 8.1180172600000002 3.2961220199999999 F F F 21 | 2.8121636699999999 8.1180172600000002 3.2961220199999999 F F F 22 | 1.4060818300000000 5.6826120800000002 3.2961220199999999 F F F 23 | 1.4060818300000000 0.8118017300000000 3.2961220199999999 F F F 24 | 1.4060818300000000 7.3062155300000002 1.0000000000000000 F F F 25 | 7.0304091700000004 7.3062155300000002 1.0000000000000000 F F F 26 | 4.2182455000000001 7.3062155300000002 1.0000000000000000 F F F 27 | 5.6243273399999998 8.1180172600000002 3.2961220199999999 F F F 28 | 8.4364910099999992 4.8708103500000002 1.0000000000000000 F F F 29 | 5.6243273399999998 4.8708103500000002 1.0000000000000000 F F F 30 | 2.8121636699999999 4.8708103500000002 1.0000000000000000 F F F 31 | 0.0000000000000000 4.8708103500000002 1.0000000000000000 F F F 32 | 9.8425728400000008 2.4354051800000001 1.0000000000000000 F F F 33 | 7.0304091700000004 2.4354051800000001 1.0000000000000000 F F F 34 | 4.2182455000000001 2.4354051800000001 1.0000000000000000 F F F 35 | 1.4060818300000000 2.4354051800000001 1.0000000000000000 F F F 36 | 8.4364910099999992 0.0000000000000000 1.0000000000000000 F F F 37 | 5.6243273399999998 0.0000000000000000 1.0000000000000000 F F F 38 | 2.8121636699999999 0.0000000000000000 1.0000000000000000 F F F 39 | 9.8425728400000008 7.3062155300000002 1.0000000000000000 F F F 40 | 8.4364910099999992 8.1180172600000002 3.2961220199999999 F F F 41 | 1.2967536500000001 4.1782525300000000 5.5331505200000004 T T T 42 | 2.6870950300000001 1.7850597600000000 5.5589591199999999 T T T 43 | 9.5384890299999991 7.5711040900000004 7.8669686800000003 T T T 44 | 6.7593823799999999 7.7078297700000000 7.7905703300000004 T T T 45 | 3.7848230100000002 7.6972861799999999 7.7923463300000000 T T T 46 | 1.0711089800000000 7.6112900999999997 7.7914473800000001 T T T 47 | 8.1336136200000002 5.1292746999999999 7.8962371899999999 T T T 48 | 5.3319763399999998 5.0887764000000004 7.7195640200000000 T T T 49 | 2.6112427500000002 5.2129096700000002 7.7364734999999998 T T T 50 | -0.1497349900000000 5.1878271600000003 7.8202665099999997 T T T 51 | 9.5549136699999995 2.6954581599999998 7.8644941199999998 T T T 52 | 6.7758461600000004 2.7059431300000001 7.8802477900000003 T T T 53 | 3.7821905099999999 2.6893659900000002 7.9465057100000003 T T T 54 | 1.0483249900000000 2.6749479100000002 7.9494685699999996 T T T 55 | 8.1885856700000001 0.3990770000000000 7.8950544100000002 T T T 56 | 5.0948375700000001 0.3316293300000000 7.8742913600000000 T T T 57 | 2.4754814800000000 0.3323597800000000 7.8901130899999998 T T T 58 | -0.4176618200000000 0.2542195900000000 7.8816914000000002 T T T 59 | 9.6482145599999996 8.9780066900000008 5.5131332100000003 T T T 60 | 6.9052300000000004 8.9428702300000005 5.5195908700000000 T T T 61 | 4.0295490999999997 9.0600655799999998 5.4804783800000001 T T T 62 | 1.2611114400000001 9.1838909399999995 5.5455289299999997 T T T 63 | 8.3105024000000007 6.5118627399999998 5.5980465700000002 T T T 64 | 5.5178967999999999 6.5522142099999998 5.5466061199999999 T T T 65 | 2.6771375200000000 6.5536594700000004 5.5137027300000003 T T T 66 | -0.1322723000000000 6.5949291099999998 5.5264601400000002 T T T 67 | 9.7124149299999996 4.1544624600000004 5.5530655099999997 T T T 68 | 6.9086514299999999 4.1847462100000001 5.5076701699999999 T T T 69 | 3.9467763599999999 4.0955402799999998 5.4676261000000004 T T T 70 | 8.2282569999999993 1.6651499900000000 5.5525663300000003 T T T 71 | 5.5228576699999996 1.8237743099999999 5.5966873100000001 T T T 72 | -0.3108590800000000 1.8583329799999999 5.6140437700000003 T T T 73 | 0.0000000000000000 0.0000000000000000 1.0000000000000000 F F F 74 | 4.4709902399999999 7.8985675100000003 11.2404899500000006 T T T 75 | 3.6054494699999999 7.0900137100000000 16.3017965999999994 T T T 76 | 2.1456792500000001 6.6738309200000003 16.7359797899999982 T T T 77 | 9.8370608199999996 8.3221844300000001 15.9883966599999994 T T T 78 | 0.8903778000000000 8.6823468100000003 11.9196670099999995 T T T 79 | 11.9615936200000004 8.7492076000000001 10.3377381300000000 T T T 80 | 2.9261430399999999 2.6950521900000002 10.4502827600000003 T T T 81 | 4.1722895600000003 3.7915128299999998 10.3928301899999997 T T T 82 | 4.9555487899999999 9.6540221499999994 14.7675445900000000 T T T 83 | 5.5182660300000004 1.3487807700000001 14.5423528999999991 T T T 84 | 2.6880377599999998 1.7152344600000000 12.6823294299999993 T T T 85 | 3.5509712100000002 1.1522663300000000 13.6431948399999996 T T T 86 | 5.0520665899999999 4.8990893599999996 12.1095938099999998 T T T 87 | 5.6562843599999999 5.2085339399999997 10.6325178499999993 T T T 88 | -1.4272797100000001 4.1820444800000001 17.5997414899999995 T T T 89 | -1.9619385899999999 3.9088870999999998 19.0595336499999988 T T T 90 | -0.1798653200000000 6.4729697699999997 17.3250775399999988 T T T 91 | 5.4767155799999996 9.0699279799999992 18.0931312899999988 T T T 92 | 8.5950131699999996 8.6438590000000008 15.0536041300000001 T T T 93 | 5.9302529699999997 7.9445155999999999 14.5534544500000003 T T T 94 | 4.9167015799999998 8.0490873399999998 13.3528599299999993 T T T 95 | 8.8112962899999996 2.2513637499999999 11.2786302299999992 T T T 96 | -0.5585839800000000 1.9721864899999999 13.4966206599999996 T T T 97 | 0.6332417100000000 2.7185649100000000 12.9619760300000006 T T T 98 | 2.1166421199999998 2.6200732499999999 18.2432760800000011 T T T 99 | 1.6620092500000001 0.6234003800000000 19.0463928799999991 T T T 100 | 0.7025648300000000 -0.4572908100000000 19.6963947300000015 T T T 101 | 3.4358294400000000 1.7184142000000000 18.2971197500000002 T T T 102 | 0.6816314500000000 9.0865102300000000 14.2582061499999995 T T T 103 | 1.9063684400000001 9.6835564400000003 13.4124582700000001 T T T 104 | 7.9816137700000001 4.1636501700000004 10.6816509499999999 T T T 105 | 5.4222001300000002 9.2262497799999998 11.3730240600000005 T T T 106 | -2.1609310599999998 2.3699525000000001 17.0658587399999995 T T T 107 | 1.0351011800000001 5.4904909799999997 9.6756992000000004 T T T 108 | 1.1673779000000000 5.8850540400000000 11.2257712999999999 T T T 109 | 2.5035891200000000 7.6436512800000003 10.4768560799999992 T T T 110 | 6.0566273199999996 1.3712695800000001 17.8853298900000013 T T T 111 | 4.9677541500000002 0.9815107900000000 16.7845907899999993 T T T 112 | 3.6090049999999998 6.4637683299999997 10.4772959100000005 T T T 113 | 7.2881545100000000 1.8307781599999999 11.1788345499999995 T T T 114 | -0.6787096400000000 2.4224218799999999 16.6250600400000010 T T T 115 | 8.8539360499999997 5.4043277200000004 11.1612354200000006 T T T 116 | 4.7289062299999998 7.9006197100000000 19.0287882999999987 T T T 117 | 3.0860071599999999 5.4502024499999999 15.4200297800000001 T T T 118 | 2.7267162800000002 4.0107598299999996 14.8057770400000006 T T T 119 | 5.0014201600000003 1.7315356799999999 11.0280259199999993 T T T 120 | -1.0055953600000000 1.6060517700000001 9.9565523900000006 T T T 121 | 9.9942797399999996 0.6155987200000000 11.1026925999999992 T T T 122 | 7.8308848099999997 2.7616471599999999 14.5380125200000005 T T T 123 | 7.4597008899999997 2.4962981700000002 12.9535639899999993 T T T 124 | -0.6843266300000000 5.8651271800000000 12.1129811699999994 T T T 125 | 2.0851519299999999 5.7079338200000000 13.7241291800000003 T T T 126 | 9.5491173099999997 5.4102187700000002 13.1733838500000005 T T T 127 | 0.8814223700000000 2.8568407900000001 15.2813976100000009 T T T 128 | 7.5958105700000003 5.3277792200000000 18.1998868300000005 T T T 129 | 6.4500536999999998 6.4683627699999997 18.1222711399999987 T T T 130 | 8.2734917400000008 -0.8775969500000000 11.3654089099999993 T T T 131 | 9.3528690399999999 -1.5475712900000000 12.2268225499999996 T T T 132 | 7.7559507800000000 5.8910270300000001 15.7684110499999992 T T T 133 | 6.9266951199999998 5.7732311500000000 14.4625898399999997 T T T 134 | 1.8355190699999999 1.9139043300000000 16.2412819299999995 T T T 135 | 1.4242676400000001 7.1560255200000000 13.4205635500000007 T T T 136 | 11.5862098499999995 7.7136342999999998 17.9243104899999999 T T T 137 | 6.0597034299999999 4.0455023299999997 13.6357163900000007 T T T 138 | 0.6697060700000000 2.3038057200000002 10.8971094999999991 T T T 139 | 6.2989870200000002 7.7139184199999997 10.5625512500000003 T T T 140 | 8.6676282899999997 10.0547307700000008 17.1632018700000017 T T T 141 | 8.3765697699999997 0.8558256900000000 18.5632894499999992 T T T 142 | 4.6135001500000001 4.8718722699999999 13.9201779999999999 T T T 143 | 7.5612927000000001 6.8228160000000004 10.1131744900000005 T T T 144 | 5.7027170700000003 1.1283011599999999 9.9085892300000005 T T T 145 | 1.1747432700000000 3.7866047200000001 10.8710282700000000 T T T 146 | 8.2026284199999999 5.0919873200000003 10.3471547600000005 T T T 147 | 8.2211296800000007 1.0381295200000000 17.6401280599999986 T T T 148 | 7.1355516799999998 7.7145510000000002 9.9845674599999992 T T T 149 | 8.9796017799999994 -0.6848602700000000 12.0176161599999993 T T T 150 | 5.5461794299999996 8.1529034899999999 18.4986618800000002 T T T 151 | 6.8099758599999998 5.6169319299999998 17.7099780799999991 T T T 152 | 5.3742222300000000 8.2005962799999992 11.5928160699999996 T T T 153 | 2.6226339699999999 1.9462434900000001 18.7674334700000003 T T T 154 | 7.7802445799999997 6.1511333199999996 14.8106233100000004 T T T 155 | 1.8092284100000000 6.3673100199999997 13.0484770999999995 T T T 156 | -1.6855503599999999 4.5760059000000002 18.4983846900000017 T T T 157 | 1.3192565900000000 2.7702458000000001 16.1909951200000002 T T T 158 | 9.6323968099999995 5.8952467899999998 12.3503668500000003 T T T 159 | 5.4741708100000004 4.8999104100000004 13.3771111000000005 T T T 160 | 4.7277525999999996 4.9503694800000000 11.0051033599999997 T T T 161 | 7.0478011399999998 2.4989081899999999 13.9484747000000002 T T T 162 | 9.3874326000000003 9.0441788299999999 15.4849326699999992 T T T 163 | 10.1679930800000005 1.5418884500000001 10.9506791000000003 T T T 164 | 3.1283413499999999 0.8873700800000000 12.8096402600000001 T T T 165 | 1.4291140400000000 2.8633477300000001 11.2672203500000006 T T T 166 | 3.0257425699999998 4.8714628500000003 14.5554893399999994 T T T 167 | 4.7716410199999997 0.8897426500000000 15.0464967299999994 T T T 168 | 3.7889897000000001 2.8046018099999999 10.0001471899999999 T T T 169 | 3.4428065200000000 7.3745730199999997 10.1418583699999996 T T T 170 | 5.6899850900000004 1.0498347400000001 10.9086165000000008 T T T 171 | 1.2162708000000000 8.9878476599999999 13.4825618699999996 T T T 172 | 0.0806859900000000 2.6443649300000001 13.8089429300000006 T T T 173 | 0.9806531000000001 8.2152923999999992 11.0414606800000001 T T T 174 | 3.1300565800000002 6.2891434899999998 16.6294050800000015 T T T 175 | 4.9758721699999997 8.1662379299999994 14.3581496899999994 T T T 176 | 7.8709986000000001 2.5224712199999999 11.5413885900000004 T T T 177 | 11.7829070599999994 7.1182772500000002 17.1300588199999986 T T T 178 | 0.8975361800000000 5.2193740100000001 10.5966807299999992 T T T 179 | -1.5169011500000000 2.9010206900000002 16.5900552300000008 T T T 180 | 0.9921073300000000 -0.0702726600000000 18.8300384799999989 T T T 181 | 5.1357197200000000 1.0272929500000001 17.7457097799999985 T T T 182 | -------------------------------------------------------------------------------- /examples/md_fixpot/input.vasp: -------------------------------------------------------------------------------- 1 | Pt O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H 2 | 1.0000000000000000 3 | 11.2486546999999995 0.0000000000000000 0.0000000000000000 4 | 0.0000000000000000 9.7416207000000004 0.0000000000000000 5 | 0.0000000000000000 0.0000000000000000 32.0000000000000000 6 | Pt O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H O H 7 | 64 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 8 | Selective dynamics 9 | Cartesian 10 | 0.0000000000000000 0.0000000000000000 0.9999999999999999 F F F 11 | 2.8121636687788998 0.0000000000000000 0.9999999999999999 F F F 12 | 5.6243273375577996 0.0000000000000000 0.9999999999999999 F F F 13 | 8.4364910063366985 0.0000000000000000 0.9999999999999999 F F F 14 | 1.4060818343894499 2.4354051767621745 0.9999999999999999 F F F 15 | 4.2182455031683492 2.4354051767621745 0.9999999999999999 F F F 16 | 7.0304091719472499 2.4354051767621745 0.9999999999999999 F F F 17 | 9.8425728407261488 2.4354051767621745 0.9999999999999999 F F F 18 | 0.0000000000000000 4.8708103535243490 0.9999999999999999 F F F 19 | 2.8121636687788998 4.8708103535243490 0.9999999999999999 F F F 20 | 5.6243273375577996 4.8708103535243490 0.9999999999999999 F F F 21 | 8.4364910063366985 4.8708103535243490 0.9999999999999999 F F F 22 | 1.4060818343894499 7.3062155302865239 0.9999999999999999 F F F 23 | 4.2182455031683492 7.3062155302865239 0.9999999999999999 F F F 24 | 7.0304091719472499 7.3062155302865239 0.9999999999999999 F F F 25 | 9.8425728407261488 7.3062155302865239 0.9999999999999999 F F F 26 | 1.4060818343894499 0.8118017255873915 3.2961220205671427 F F F 27 | 4.2182455031683492 0.8118017255873915 3.2961220205671427 F F F 28 | 7.0304091719472499 0.8118017255873915 3.2961220205671427 F F F 29 | 9.8425728407261488 0.8118017255873915 3.2961220205671427 F F F 30 | 0.0000000000000000 3.2472069023495660 3.2961220205671427 F F F 31 | 2.8121636687788998 3.2472069023495660 3.2961220205671427 F F F 32 | 5.6243273375577996 3.2472069023495660 3.2961220205671427 F F F 33 | 8.4364910063366985 3.2472069023495660 3.2961220205671427 F F F 34 | 1.4060818343894499 5.6826120791117409 3.2961220205671427 F F F 35 | 4.2182455031683492 5.6826120791117409 3.2961220205671427 F F F 36 | 7.0304091719472499 5.6826120791117409 3.2961220205671427 F F F 37 | 9.8425728407261488 5.6826120791117409 3.2961220205671427 F F F 38 | 0.0000000000000000 8.1180172558739159 3.2961220205671427 F F F 39 | 2.8121636687788998 8.1180172558739159 3.2961220205671427 F F F 40 | 5.6243273375577996 8.1180172558739159 3.2961220205671427 F F F 41 | 8.4364910063366985 8.1180172558739159 3.2961220205671427 F F F 42 | -0.2076520381253982 1.7991393941251754 5.5463027909799054 T T T 43 | 2.5942909379756829 1.8306079590231858 5.5836019704503119 T T T 44 | 5.4128118005850174 1.7650914657965611 5.5418205199976303 T T T 45 | 8.2269661999539672 1.7670264370013435 5.5564560435140358 T T T 46 | 1.1807589668487526 4.2334221109084300 5.5637308017962148 T T T 47 | 4.0082447245497912 4.1878623226336771 5.5404730318595403 T T T 48 | 6.8227146186134595 4.2209895490635239 5.5272752736530686 T T T 49 | 9.6142419796095240 4.2028020146334324 5.5429521478927652 T T T 50 | -0.2167759066412467 6.6627930045870007 5.5674189199505060 T T T 51 | 2.6078590770122667 6.6635431139275489 5.5415438667757284 T T T 52 | 5.3893285600854623 6.6502859545447404 5.5458898486628323 T T T 53 | 8.1701552444296475 6.6248874085777425 5.5595663895554361 T T T 54 | 1.1535499462458456 9.0640257077509734 5.5633372744141782 T T T 55 | 3.9759443648701041 9.1045868641212628 5.5409427477939097 T T T 56 | 6.8092740495710764 9.0776819361518548 5.5357599608480550 T T T 57 | 9.5973398863614481 9.0724856474424751 5.5472311951454447 T T T 58 | -0.4564454920585574 0.3335436945934198 7.8589093796396874 T T T 59 | 2.4572964787131935 0.2702015491196268 7.8281143924105203 T T T 60 | 5.2583947909544628 0.2631040849248208 7.8488696669304696 T T T 61 | 8.0059755808308175 0.2976581194724224 7.8619476419096417 T T T 62 | 0.9547414258718692 2.7382354615315521 7.9183352096641020 T T T 63 | 3.7161677592098021 2.6936012633129951 7.9021855011639506 T T T 64 | 6.6581357515635657 2.7359955154660387 7.7875637404936908 T T T 65 | 9.5073859547093260 2.7666266039716398 7.8584024315746133 T T T 66 | -0.4539521769756971 5.1537412702793857 7.8259971130690325 T T T 67 | 2.5040205206253252 5.1668278245667896 7.7832610483321814 T T T 68 | 5.2656224372782923 5.1788222200641698 7.8297338881821954 T T T 69 | 7.9960080882162821 5.2012900119058978 7.8867689500757292 T T T 70 | 0.9677741262566825 7.6094695546487117 7.8966926054358195 T T T 71 | 3.7864211479648771 7.6092910169882089 7.8564380784010019 T T T 72 | 6.6403869657440939 7.6146626188042550 7.8782200761869658 T T T 73 | 9.4605082057987850 7.6229640253730508 7.8346682590864738 T T T 74 | 0.9376763985375763 7.4454009434436657 10.2041198363192347 T T T 75 | 11.3841344073003601 8.0365995099985774 10.5705553863100246 T T T 76 | 1.8105277138493949 7.8315738917913640 10.4178680526788412 T T T 77 | 4.1248693284401003 6.3093224049678778 16.1830236683844042 T T T 78 | 3.4233372381389735 6.7700813009508396 16.7897639354938519 T T T 79 | 4.7882756788121927 7.0141778131705887 15.7650447589872478 T T T 80 | 5.8894570014200935 7.9639769363645794 15.0852429630987697 T T T 81 | 6.7360612894871714 7.4248051523938017 15.1727118250433026 T T T 82 | 5.8176561027611733 8.1352563150705048 14.1160977211424985 T T T 83 | 7.7332811252781894 2.1486172287573888 10.8874389521813288 T T T 84 | 8.7141719787019181 2.0544515660107474 10.9935906285739851 T T T 85 | 7.5032190549440045 1.7426625451836626 10.0143979612341560 T T T 86 | 8.3561539872873531 1.1078831152316602 17.9040912838008062 T T T 87 | 9.2324399904537611 0.7484540342241277 17.5977119113231062 T T T 88 | 8.2085227004132086 0.6785585248678473 18.7678434967293732 T T T 89 | 1.4192966132996068 4.7395593829338409 10.7274438179236427 T T T 90 | 1.1516067638926533 5.5445504973150843 10.2501077535277538 T T T 91 | 1.2289752244423733 4.0411442280185979 10.0569593900253516 T T T 92 | -0.6018005013609454 2.7184418639819841 13.4617779853045310 T T T 93 | 0.1287267049698595 2.5118222265934627 14.1497288399367047 T T T 94 | -0.4927510380819722 3.6932137617465299 13.3893145903682544 T T T 95 | 2.5448039535708440 9.0113851787325920 12.6807224863874488 T T T 96 | 3.0218049850317548 8.3526589284367532 12.1144879275074349 T T T 97 | 1.6090649473111109 8.7151073430577259 12.8683289789810349 T T T 98 | 1.9943970007352718 0.1688069335160508 18.1909376107173451 T T T 99 | 2.6321732831216331 0.8178393909630319 17.7405102153684417 T T T 100 | 1.9205238390151058 0.4265386902960989 19.1232470563225512 T T T 101 | 0.5009891729122310 5.2569267903994179 13.1088938994397388 T T T 102 | 0.8364467309878274 4.9810494660495817 12.1809270327718711 T T T 103 | 1.3043743729135822 5.1904036366044730 13.7475276696259492 T T T 104 | 10.5246699119621905 7.5439676979753401 15.9706573871946063 T T T 105 | -0.2258475379709375 6.7449166570255024 16.2663368474788435 T T T 106 | 10.8516371464030357 7.7614711853690084 15.0256465791605880 T T T 107 | 3.5367373387603354 1.6927428303485574 16.6915845349948242 T T T 108 | 3.8271296748887456 2.6234503732646424 16.9136025497020199 T T T 109 | 4.4046509957372573 1.2066108321274351 16.5708271420480600 T T T 110 | 3.9799525186970746 7.3134124569527694 11.0721977248990999 T T T 111 | 4.1711689924593456 7.5446243445312815 10.1244353021419418 T T T 112 | 4.2489628874218655 6.3383083348453573 11.1860959183442468 T T T 113 | 11.4896056199056549 7.9507541494066718 13.4489056668140048 T T T 114 | 10.8503421190012759 8.2510327003858102 12.7445825332882183 T T T 115 | 11.5966454467895339 6.9776325920676925 13.3060226087559403 T T T 116 | 4.0723194636275917 2.5979276483542990 9.9960048545335294 T T T 117 | 3.3676743887611456 2.1770397738983518 10.5887161857364802 T T T 118 | 4.2394779416648509 3.5535232779031838 10.3058904436684404 T T T 119 | 5.8914459083692892 0.5585893221392293 16.4511655089066124 T T T 120 | 6.0270556644665980 9.5062784081723564 15.8599970533493586 T T T 121 | 6.7895311068625839 0.8406409669894680 16.7591602389909369 T T T 122 | 4.0012006673304281 3.0104315068895868 13.1542687894257853 T T T 123 | 3.1669621941764525 2.6444474204806037 12.6978029839433404 T T T 124 | 3.6953233413840039 3.7503976329650102 13.7344739598156220 T T T 125 | 4.9018173472677447 4.8363781892612661 11.2622895337964479 T T T 126 | 4.7097506835365266 4.2134668709851368 12.0450094259154703 T T T 127 | 5.9525487469042266 4.8973838652973640 11.2505251528455048 T T T 128 | 0.3449350828888830 5.2673520803280027 16.9803152288961563 T T T 129 | -0.4928946237725484 4.7688440355757624 17.3110413029732122 T T T 130 | 0.8789299817384376 4.5909458634195319 16.5377704841912561 T T T 131 | 2.3307516587857311 7.1427604313119923 17.8453079475358543 T T T 132 | 2.2503087580740355 8.1370711878815154 17.9095092955799977 T T T 133 | 1.4691098081413658 6.8068328881733997 17.5297587442473279 T T T 134 | 7.4338670411698509 4.9022308226422737 11.0347916851689316 T T T 135 | 7.6586059128263546 3.9691174523660910 10.7427365285801475 T T T 136 | 8.0041465092421333 5.0883208078078388 11.8732191284470154 T T T 137 | 6.2284037346862453 1.4065426865136135 12.9280285888943727 T T T 138 | 5.3447374182764955 1.8947061572487902 13.0590039554150454 T T T 139 | 6.6247496055039248 1.6591568726700119 12.0775939505420116 T T T 140 | 10.8233699885362533 0.2331258035485104 16.9792490347031304 T T T 141 | 11.6385400122681677 0.1803858903912260 17.5637801236930855 T T T 142 | 10.7080507392002069 9.0571432591464074 16.6679922625472479 T T T 143 | 7.8854826275918706 7.8161798097666049 10.4980825249784004 T T T 144 | 7.8719044099561373 6.8402842641473081 10.5954767043793616 T T T 145 | 7.1855479259069988 8.1012867412781144 11.1374101161797281 T T T 146 | 7.4708053860688430 4.1289909430240908 16.2523278589928637 T T T 147 | 7.6527614737621183 3.3166946876388872 15.6658815196683090 T T T 148 | 6.5610164852074870 4.0087932078965469 16.6878356152376739 T T T 149 | 2.3643551960183236 1.6191667355125232 11.5941629565563584 T T T 150 | 1.4498669613677184 1.6294070605289175 11.2489534679535321 T T T 151 | 2.5206785772832214 0.6385218449425628 11.9851605271956920 T T T 152 | 2.8367121554162904 5.3017538918838172 14.1404364154454480 T T T 153 | 3.1557624279132748 5.9449427964866697 13.4915312759921715 T T T 154 | 3.2720934855819537 5.6666087264575777 15.0099367213718544 T T T 155 | 4.9194592404338513 4.1412355172449820 17.3260895507895825 T T T 156 | 4.9963546815807049 4.3169951363593375 18.2884351756704291 T T T 157 | 4.6251561358104629 4.9929846642413489 16.8959867263522234 T T T 158 | 10.6674206886357616 1.6373705067481459 11.1124066196242222 T T T 159 | -0.5022663979140622 2.2868208831624659 10.4048933060556781 T T T 160 | 10.6804503915126467 2.1150426305255627 12.0076252627162798 T T T 161 | 8.1949853272518389 2.1011782122987950 14.7939434412179107 T T T 162 | 9.0190548538239970 2.3385397264367604 14.2875726610602580 T T T 163 | 7.4874801188027957 1.8747317436791568 14.1571089122720934 T T T 164 | 8.9638655233165441 5.8577212647674619 12.8151145006721290 T T T 165 | -1.3538595143986694 5.6497140450525887 12.9151207615128740 T T T 166 | 8.6487085068736036 6.0928317324068519 13.7522943329824177 T T T 167 | 0.9580576545991824 2.2574991988794082 15.5025845351367195 T T T 168 | 1.9253001780467938 2.0198664594334041 15.6360776670410289 T T T 169 | 0.4020414899469044 1.5464587392393738 15.9622704120759344 T T T 170 | 9.4944683058554578 3.9442095396985444 18.0117345984971102 T T T 171 | 9.5177265407748042 2.9776936845389592 17.9997350727845884 T T T 172 | 8.6853269031115552 4.1318967865155258 17.4454174598876115 T T T 173 | 10.2799394637356123 -1.0267086489636801 11.1485246702665783 T T T 174 | 10.3991710898120910 -0.0504586780519460 11.0275238497725088 T T T 175 | 9.3394047987729110 -1.3469147998286972 10.8490575894964003 T T T 176 | 8.0790681671679501 6.4896847808004088 15.2136344020047449 T T T 177 | 8.9054112674498569 6.8314444366090568 15.6218439694546500 T T T 178 | 7.8338594315051076 5.6147145283674753 15.6578480367137374 T T T 179 | 5.9562177836567756 8.5333206828616603 12.4326080646176749 T T T 180 | 5.9493716477219216 9.5392912331865762 12.5815669443618638 T T T 181 | 5.1289874729662763 8.2753361170289459 11.9884828413400566 T T T 182 | -------------------------------------------------------------------------------- /examples/slowgrowth_fixpot/analysis.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "code", 5 | "execution_count": 2, 6 | "metadata": {}, 7 | "outputs": [], 8 | "source": [ 9 | "import matplotlib.pyplot as plt\n", 10 | "import numpy as np" 11 | ] 12 | }, 13 | { 14 | "cell_type": "code", 15 | "execution_count": 3, 16 | "metadata": {}, 17 | "outputs": [], 18 | "source": [ 19 | "outname = './EChO.log'\n", 20 | "\n", 21 | "# The output format is like:\n", 22 | "# cv= 4.3047 T= 300.677 pot= 0.996 chg_net -0.000 gcfe= -961.064 epot= -966.405 z= 1.062 fe_grad= 2.197\n", 23 | "\n", 24 | "cv = []\n", 25 | "temperature = []\n", 26 | "potential = []\n", 27 | "net_charge = []\n", 28 | "gcfe = []\n", 29 | "epot = []\n", 30 | "fe_grad = []\n", 31 | "\n", 32 | "for l in open(outname).readlines():\n", 33 | " if l[:2] == 'cv':\n", 34 | " tmp = l.split()\n", 35 | " cv.append(eval(tmp[1]))\n", 36 | " temperature.append(eval(tmp[3]))\n", 37 | " potential.append(eval(tmp[5]))\n", 38 | " net_charge.append(eval(tmp[7]))\n", 39 | " gcfe.append(eval(tmp[9]))\n", 40 | " epot.append(eval(tmp[11]))\n", 41 | " fe_grad.append(eval(tmp[15]))\n" 42 | ] 43 | }, 44 | { 45 | "cell_type": "code", 46 | "execution_count": 7, 47 | "metadata": {}, 48 | "outputs": [ 49 | { 50 | "data": { 51 | "text/plain": [ 52 | "Text(0.5, 0, 'Reaction coordinate $\\\\xi$ ($\\\\mathrm{\\\\AA}$)')" 53 | ] 54 | }, 55 | "execution_count": 7, 56 | "metadata": {}, 57 | "output_type": "execute_result" 58 | }, 59 | { 60 | "data": { 61 | "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEPCAYAAABRHfM8AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/OQEPoAAAACXBIWXMAAAsTAAALEwEAmpwYAAA1/0lEQVR4nO3deXxU9dX48c+ZTCY7IZBAgLCvsiMBRWV3wRW12rrX/rSKdevyPLWtXZ7azVqt2qpFi1Ytrq27IiKoICLIIii7YU1kS8KWEAJZzu+PO8EhZLmBzMxNct6v17zI3Hvn3pObYc58d1FVjDHGmPr4oh2AMcaYpsEShjHGGFcsYRhjjHHFEoYxxhhXLGEYY4xxxR/tAE5Eenq6duvWLdphNJrcPSWUHKqgb2ZKtEMxxjRjS5cuLVDVjIa+rkknjG7durFkyZJoh9Fo7vrvF3y0fheLfnFmtEMxxjRjIrLleF5nVVIeEhfr43B5ZbTDMMaYGlnC8JBAjI9DljCMMR5lCcNDrIRhjPEySxgeEoiJobxSqai06VqMMd5jCcND4mKdP4eVMowxXmQJw0MCMc6f41B5RZQjMcaYY1nC8BArYRhjvMwShod8U8KwhGFMNGzevJmMjAzGjRvHuHHjmDt3brRD8pQmPXCvuQn4LWEYE21jx47lv//97zHbKysr8fmi9x27au0iEYlaDJYwPCTOHwNYG4YxtfntW6tYvW3/CZ+nf8dW/ObCAe6O7d+f7OxsMjIyuPXWW7nllls4dOgQw4YN48EHH6S0tJQbb7yRbdu2kZyczPTp02nVqtWR1xcUFHDjjTeyf/9+OnbsyDPPPMPHH3/MvffeS1xcHJs3b2b69OkMGjSImTNn8oc//IGKigpuv/12rrzySq6//noSEhJYv349L774Irfccgt79+7lpJNOoqioiDvvvJOpU6fy+OOPU1FRwRlnnMGCBQvCklisSspD4vzWhmFMtM2dO/dIldS+ffvIy8vj4Ycf5oEHHuCuu+7iscce46OPPqK8vJwlS5Ywbdo0JkyYwAcffMB3v/tdnnjiiaPOd++993LHHXfwwQcfMGzYMF577TUAysrKeOONN7j//vv517/+RWVlJffccw9z5sxh/vz5TJ06lYoK58tjdnY2c+bM4aOPPqJPnz7Mnj2bIUOGADBs2DDWrl3L4cOH+eCDD5g4cWLYSiFWwvCQOKuSMqZObksFJ6J6lVSvXr1IS0sDYN26ddxwww0AFBUVMXHiRFavXs3ixYt59tlnKSsrY/To0Uedb/Xq1SxatIh77rmHgwcPcu2115Kens7QoUMB6Ny5M3v27KGgoICvvvqKs88+G3BKJvn5+QCMGDECgA0bNjB8+PAj2+bPnw/ABRdcwIwZM3j99df52c9+FqY7YwnDUwJWwjDGc0LbLfr27cv9999P165dUVUqKirYunUro0aN4tprrwWckkOofv36cckllxxJJGVlZXzyySdHlQJUlfT0dE466STef/99YmNjKSsrIzY29qgYevbsyeeff863vvUtli5deuT111xzDVOmTKGoqIh+/fqF50YQoSopEXlKRHaJyMpa9ouI/E1EckTkCxE5ORJxeU1VG4YlDGO86c9//jNTpkxhwoQJnHXWWWzbto2bbrqJ999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ch+QCXUTEX8MHdl2rfG0DOouIL+QDuwtOd86GqiuGuq7jJobQ32E70ElEJCRpdAE2NDRgF/e1+r2r9W9Ug5uB5ar6a5fhfAH0ARaLSCvgQqBCRKqSXQBIA8YCHwa3nQRUXwPbeJSVMMyJegg4S0SG4tSz7w828CYEu2QOFJEROG0CilPlg4h8D+ebcJXPcD5I7xWRJBGJF5HTg/t24tS112QRTp39T0UkVpyxCxfiLHzfUHXFUNd1GhrDpzhVNXcEG8AvBY53FHR997X6vavrb1Rda6CXiHRxGcsMnGQAzkC9g0B/nPaPocGfZxJsSBeROGA48L7L85sos4RhToiq5gPPAr9S1QqcD8qhwCagAJgGpKrqauABnA/LncAgnLrxqvNUvbYXsBXIw2nABfgT8MtgFcr/VLv+YeAinB46BcBjwHWquvY4fpdaY6jrOg2NIXj8pTjdUPcEr/FqQ+MNnqvO+0q1e1fX36iG09+PUyJZJiIlIvKOOGtq1+ZZ4DwRScBJCv9S1a2quqPqAfwd+FYwWVwEfKSq247ndzeRZ2t6G2PqFfyAzwPOUtXldRz3R2CXqj7k4pyLgBtUdWVjxWnCyxKGMaZe4kwcOAvopqp7oxyOiRKrkjLGuPEEcKsli5bNShjGGGNcsRKGMcYYVyxhGGOMccUShjHGGFcsYRhjjHHFEoYxxhhXLGEYY4xxxRKGMcYYV/4/ZgUfKaTwRVEAAAAASUVORK5CYII=", 62 | "text/plain": [ 63 | "
" 64 | ] 65 | }, 66 | "metadata": { 67 | "needs_background": "light" 68 | }, 69 | "output_type": "display_data" 70 | } 71 | ], 72 | "source": [ 73 | "# Thermodynamic intergration\n", 74 | "fe = [np.trapz(fe_grad[:i])*(cv[1]-cv[0]) for i in range(len(fe_grad))]\n", 75 | "\n", 76 | "plt.plot(cv, fe, label='Free energy')\n", 77 | "plt.axhline(0, color='k', linestyle='--', alpha=0.5)\n", 78 | "\n", 79 | "plt.legend(frameon=False, fontsize='small')\n", 80 | "\n", 81 | "plt.ylim(min(fe) - 0.1, min(fe) + 1.1)\n", 82 | "plt.ylabel('Free energy (eV)', fontsize='large')\n", 83 | "plt.xlabel('Reaction coordinate $\\\\xi$ ($\\\\mathrm{\\\\AA}$)', fontsize='large')\n", 84 | "\n", 85 | "#plt.savefig('fes.pdf', bbox_inches = \"tight\", transparent=True)" 86 | ] 87 | } 88 | ], 89 | "metadata": { 90 | "kernelspec": { 91 | "display_name": "base", 92 | "language": "python", 93 | "name": "python3" 94 | }, 95 | "language_info": { 96 | "codemirror_mode": { 97 | "name": "ipython", 98 | "version": 3 99 | }, 100 | "file_extension": ".py", 101 | "mimetype": "text/x-python", 102 | "name": "python", 103 | "nbconvert_exporter": "python", 104 | "pygments_lexer": "ipython3", 105 | "version": "3.8.16" 106 | } 107 | }, 108 | "nbformat": 4, 109 | "nbformat_minor": 2 110 | } 111 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------