<div dir="ltr">Thank you, my friends, ASE looks like a promising solution. I'll give it a try.<div><br><br>On Wednesday, September 6, 2017 at 6:13:30 PM UTC-3, Steve Schmerler wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Aug 26 14:38 -0700, Henrique Junior wrote:
<br>> Dear colleagues,
<br>> I’m new to CP2K and I’m going to perform a geometric optimization in my 
<br>> crystalline structure (to calculate vibrational frequencies, also using 
<br>> CP2K). In my geometric optimization, I need to, also, optimize the size of 
<br>> my unitary cell BUT I’d like to specify a range in which the cell is 
<br>> allowed to expand (or contract, of course). Is this possible? Can someone 
<br>> point me to any example?
<br>
<br>If you need a special-purpose optimizer, you may have a look at ASE [1].
<br>They have a CP2K calculator [2] for some time. The ASE structure
<br>optimizer calls CP2K (or any other backend code) in each step to kick
<br>off an SCF calculation to get energy and forces. 
<br>
<br>You want to use one of their optimizers [3], together with the
<br>UnitCellFilter constraint [4] to treat the cell. You would need to
<br>modify the UnitCellFilter to meet you specific needs, or roll your own
<br>entirely [5].
<br>
<br>[1] <a href="https://wiki.fysik.dtu.dk/ase/" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPWl0dTL7cD2DA2glI7Ss-nMs52g';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPWl0dTL7cD2DA2glI7Ss-nMs52g';return true;">https://wiki.fysik.dtu.dk/ase/</a>
<br>[2] <a href="https://wiki.fysik.dtu.dk/ase/ase/calculators/cp2k.html" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2Fase%2Fcalculators%2Fcp2k.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEsf8X9jjHHP3RJC5Z8Zo4orF1IMA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2Fase%2Fcalculators%2Fcp2k.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEsf8X9jjHHP3RJC5Z8Zo4orF1IMA';return true;">https://wiki.fysik.dtu.dk/ase/<wbr>ase/calculators/cp2k.html</a>
<br>[3] <a href="https://wiki.fysik.dtu.dk/ase/ase/optimize.html" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2Fase%2Foptimize.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXWGhXSeVwUwjimUjapK5bSaQfMA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2Fase%2Foptimize.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGXWGhXSeVwUwjimUjapK5bSaQfMA';return true;">https://wiki.fysik.dtu.dk/ase/<wbr>ase/optimize.html</a>
<br>[4] <a href="https://wiki.fysik.dtu.dk/ase/ase/constraints.html#the-unitcellfilter-class" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2Fase%2Fconstraints.html%23the-unitcellfilter-class\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGz8D4FFPOHndkIRFXzmdudpz2phA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2Fase%2Fconstraints.html%23the-unitcellfilter-class\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGz8D4FFPOHndkIRFXzmdudpz2phA';return true;">https://wiki.fysik.dtu.dk/ase/<wbr>ase/constraints.html#the-<wbr>unitcellfilter-class</a>
<br>[5] <a href="https://wiki.fysik.dtu.dk/ase/ase/constraints.html#making-your-own-constraint-class" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2Fase%2Fconstraints.html%23making-your-own-constraint-class\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWyZcbtI_jOic9QZgHy1x_SpiyXQ';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fwiki.fysik.dtu.dk%2Fase%2Fase%2Fconstraints.html%23making-your-own-constraint-class\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGWyZcbtI_jOic9QZgHy1x_SpiyXQ';return true;">https://wiki.fysik.dtu.dk/ase/<wbr>ase/constraints.html#making-<wbr>your-own-constraint-class</a>
<br>
<br>best,
<br>Steve
<br></blockquote></div></div>