[ase-users] Installation error using macOS Sierra 10.12.1

Jens Jørgen Mortensen jensj at fysik.dtu.dk
Fri Dec 2 10:22:20 CET 2016


On 12/01/2016 07:49 PM, Adam Jackson via ase-users wrote:
> Terminal sessions on Mac OSX don't load .bashrc automatically, they 
> use .bash_profile.
>  This commonly causes issues when following directions written for 
> other Unix-like operating systems!
>  I suggest adding a block to your .bash_profile which sources .bashrc, 
> i.e.
>
> if [ -f ~/.bashrc ]; then source ~/.bashrc fi
> We should probably add a note to this effect in the documentation?

That's a good idea.  Please do:

https://wiki.fysik.dtu.dk/ase/development/writing_documentation_ase.html

Jens Jørgen

> All the best,
> Adam
> Dr Adam J. Jackson
> Post-doctoral research associate
> Dept of Chemistry
> University College London
>
> ---- On Thu, 01 Dec 2016 16:29:03 +0000 
> *<ase-users-request at listserv.fysik.dtu.dk>* wrote ----
>
>     Send ase-users mailing list submissions to
>     ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>
>
>     To subscribe or unsubscribe via the World Wide Web, visit
>     https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>     or, via email, send a message with subject or body 'help' to
>     ase-users-request at listserv.fysik.dtu.dk
>     <mailto:ase-users-request at listserv.fysik.dtu.dk>
>
>     You can reach the person managing the list at
>     ase-users-owner at listserv.fysik.dtu.dk
>     <mailto:ase-users-owner at listserv.fysik.dtu.dk>
>
>     When replying, please edit your Subject line so it is more specific
>     than "Re: Contents of ase-users digest..."
>
>
>     Today's Topics:
>
>     1. Re: Installation error using macOS Sierra 10.12.1 (Ga?l Donval)
>     2. Re: Clarifications on genetic algorithm (Esben Leonhard Kolsbjerg)
>
>
>     ----------------------------------------------------------------------
>
>
>     Message: 1
>     Date: Thu, 1 Dec 2016 15:22:07 +0000
>     From: Ga?l Donval <G.Donval at bath.ac.uk <mailto:G.Donval at bath.ac.uk>>
>     To: "ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>"
>         <ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>>
>     Subject: Re: [ase-users] Installation error using macOS Sierra
>     10.12.1
>     Message-ID: <1480605727.1377.1.camel at bath.ac.uk
>     <mailto:1480605727.1377.1.camel at bath.ac.uk>>
>     Content-Type: text/plain; charset="utf-8"
>
>     Hi,
>
>     > Based on the tutorial, I have create both a ~/.bashrc and ~/.cshrc
>     > files
>     > that follows the command to include a new path.
>
>     You only need one. Since you can `source` your file, I suppose
>     that it
>     is ~/.bashrc.
>
>     As the doc said, just add:
>
>     export
>     PYTHONPATH=/Users/cennaradipa/Library/Python/2.7/python2.7/site-packages:$PYTHONPATH
>
>     export PATH=/Users/cennaradipa/Library/Python/2.7/bin:$PATH
>
>     to ~/.bashrc, then start a new terminal and check that everything is
>     fine.
>
>     > The only error is "db.py" and it seems that it does not
>     recognize the
>     > ase-gui and ase-build, thinking that its location is in bin/sh
>     > (underline).
>
>     Anyway, that is not very important: as long as you can access these
>     files from your terminal, it is fine.
>
>     > Copying these two files to the bin/sh would solve it but I do not
>     > think
>     > that this is the right way to go, e.g. I already modified the PATH
>     > variable.
>
>     You are right.
>
>     >
>     > Is there something missing here?
>
>     Did you think of restarting the terminal once the changes are
>     done? If
>     not, this is certainly it: /bin/bash reads its configuration when it
>     starts.
>
>     There might be some problems with the way /bin/sh handle things or
>     the
>     way it is called within python on MacOS. But I don't have a Mac so I
>     can't try that myself.
>
>     Cheers,
>     Ga?l
>
>
>
>     ------------------------------
>
>     Message: 2
>     Date: Thu, 1 Dec 2016 16:28:52 +0000
>     From: Esben Leonhard Kolsbjerg <esb at phys.au.dk
>     <mailto:esb at phys.au.dk>>
>     To: "Iyemperumal, Satish Kumar" <siyemperumal at wpi.edu
>     <mailto:siyemperumal at wpi.edu>>, "Kondov, Ivan
>         (SCC)"    <ivan.kondov at kit.edu <mailto:ivan.kondov at kit.edu>>,
>     "ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>"
>         <ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>>
>     Subject: Re: [ase-users] Clarifications on genetic algorithm
>     Message-ID: <CE85F5E6-8F46-41DB-AAE3-963FCEBFDEB0 at phys.au.dk
>     <mailto:E6-8F46-41DB-AAE3-963FCEBFDEB0 at phys.au.dk>>
>     Content-Type: text/plain; charset="utf-8"
>
>     You are, as you say, always optimizing the raw score and you have
>     to manually set the raw_score. I have personally never optimized
>     anything but the calculated energy but this should really not be
>     an issue.
>
>     When you call ?get_all_relaxed_candidates? it will return list of
>     all the relaxed candidates sorted for the raw_score.
>
>     What I don?t understand is why the raw score and the energy isn?t
>     the same as you (I guess) just sat the energy manually in the
>     calculator to the exact same value as the raw_score.
>
>     To answer your question! No, I don?t think it is an issure!
>
>     (Now I?m speculating!)
>     If the wrong files are saved in the database I think the error
>     must come from the fact that the atoms object normally called
>     ?a?/?a3? are not updated in the script you are running. If the
>     relaxation happens outside of the ga-script this could explain
>     both why the wrong energy and structures are not displayed in the
>     database. Could you maybe as an ugly hack (but maybe prettier than
>     what you are doing now) try to load in the relaxed trajectory file
>     after it is relaxed as ?a?/?a3? and the set the raw_score and then
>     add it to the db?
>     I don?t totally get your relaxation procedure but I don?t think it
>     is a standard way and this might be why.
>
>     Esben
>
>
>
>     Fra: "Iyemperumal, Satish Kumar" <siyemperumal at wpi.edu
>     <mailto:siyemperumal at wpi.edu>>
>     Dato: onsdag den 30. november 2016 kl. 16.50
>     Til: Esben Leonhard Kolsbjerg <esb at phys.au.dk
>     <mailto:esb at phys.au.dk>>, "Kondov, Ivan (SCC)"
>     <ivan.kondov at kit.edu <mailto:ivan.kondov at kit.edu>>,
>     "ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>"
>     <ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>>
>     Emne: Re: Clarifications on genetic algorithm
>
>
>     Thanks again for your input, Esben.
>
>
>
>     The code does work. However, it leads to another question as you
>     indicated. Does changing the (1) energy as
>     a.calc.results['energy']=actual_energy*Hartree and (2) manually
>     defining what raw_score is by setting
>     a.info['key_value_pairs']['raw_score'] = -actual_energy * Hartree
>     affect GA procedure.
>
>
>
>     I do not think (1) will be affected since, as you also mentioned
>     earlier that in GA, it is the raw score that is being maximized.
>
>
>
>     In the case of (2), I am manually defining the correct raw scores
>     within the GA script. This however, leads to all_candidates.traj
>     file being generated that is not sorted from low to high energy
>     structures (see attached for example traj file). Moreover, the
>     geometries that are in all_candidates.traj file are not the final
>     ground state geometries (not sure if they are the first ionic step
>     geometries for each relaxed candidate). This makes me think that
>     setting raw_scores perhaps affects the output files like
>     all_candidates.traj generated by ASE. Anyways, due to this
>     trouble, I manually save all the relaxed candidate structures from
>     my NWChem run in separate directories. Finally, for getting the
>     correct structure and energy, I just loop over these NWChem
>     directories to read the correct results instead of postprocessing
>     from ASE generated output files like all_candidates.traj and gadb.db.
>
>
>
>     Do you think this approach is reliable? or do you think changing
>     raw scores inherently messes something up within the GA procedure
>     itself?
>
>
>
>     Thank you for your time again!
>
>     Best,
>     Satish
>     ________________________________
>     From: Esben Leonhard Kolsbjerg <esb at phys.au.dk
>     <mailto:esb at phys.au.dk>>
>     Sent: Wednesday, November 30, 2016 5:09:04 AM
>     To: Iyemperumal, Satish Kumar; Kondov, Ivan (SCC);
>     ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>
>     Subject: Re: Clarifications on genetic algorithm
>
>     I?m not an expert in this database thing. But I took a look in the
>     ase.db.core and as I see it you are not allowed through ase to
>     update values like the energy in a database-file in a row already
>     there.
>
>     So
>     con = connect('gadb.db')
>     con.update(ids=53, **{'energy':100})
>
>     will give you:
>
>     ValueError: Bad key: energy
>
>     What you might be able to do is directly set ?new? results in the
>     calculator attached to the atoms object.
>
>     It will then look something like this:
>     ...
>     with open('in.out') as f:
>     for line in f:
>     line = line.rstrip()
>     if re.search('Total.DFT', line):
>     actual_energy = float(line.strip().split()[-1])
>     a.info['key_value_pairs']['raw_score'] = -actual_energy * Hartree
>     a.calc.results['energy'] = -actual_energy * Hartree # setting the
>     actual calculated property in the results dict of the calculator
>     da.add_relaxed_step(a)
>     ...
>
>     Be aware that this hack might course you trouble elsewhere.
>
>     I just ran a GA with the EMT potential where I think what you are
>     looking for are working.
>
>     Hope it helps?
>
>     Esben
>
>     Fra: "Iyemperumal, Satish Kumar" <siyemperumal at wpi.edu
>     <mailto:siyemperumal at wpi.edu>>
>     Dato: mandag den 28. november 2016 kl. 02.15
>     Til: "Kondov, Ivan (SCC)" <ivan.kondov at kit.edu
>     <mailto:ivan.kondov at kit.edu>>, Esben Leonhard Kolsbjerg
>     <esb at phys.au.dk <mailto:esb at phys.au.dk>>,
>     "ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>"
>     <ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>>
>     Emne: Re: Clarifications on genetic algorithm
>
>
>     I was able to read in the right energies from the output file of
>     nwchem calculations as the raw_scores in the genetic algorithm.
>     But I also wanted to display the correct energy when I enter
>     "ase-db gadb.db", which prints out id, age, user...magmom. To
>     change raw_scores to read correct values, I did
>
>
>
>     ...
>
>     with open('in.out') as f:
>
>     for line in f:
>
>     line = line.rstrip()
>
>     if re.search('Total.DFT', line):
>
>     actual_energy = float(line.strip().split()[-1])
>
>     a.info['key_value_pairs']['raw_score'] = -actual_energy * Hartree
>
>     #a.info['energy'] = -actual_energy * Hartree
>
>     da.add_relaxed_step(a)
>
>     ...
>
>
>     But, when I say a.info['energy'] = -actual_energy * Hartree, the
>     energy is not updated by the actual_energy. I tried ase.db.connect
>     but I could not find a way to modify the energy entry in gadb.db
>     by the actual_energy values. How can I fix this?
>
>
>
>     Thank you for your time on this. Complete updated script is attached.
>
>
>
>     Best,
>     Satish
>     ________________________________
>     From: Kondov, Ivan (SCC) <ivan.kondov at kit.edu
>     <mailto:ivan.kondov at kit.edu>>
>     Sent: Tuesday, November 22, 2016 3:19:09 AM
>     To: Iyemperumal, Satish Kumar; Esben Leonhard Kolsbjerg;
>     ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>
>     Subject: RE: Clarifications on genetic algorithm
>
>     Dear all,
>
>     > 2) I think I found the reason. get_potential_energy() gives the
>     energy
>     corresponding to task=energy. So even if I set task=optimize, the
>     energy
>     corresponds to the energy after first ionic step. I can read the
>     correct
>     energy corresponding to task=optimize
>     > using some readlines() method, but I wanted to know if just
>     updating
>     raw_score of a row in the database file would be sufficient to
>     make a GA run
>     as follows.
>
>     Apropos: task='optimize' with NWChem does not work properly. See
>     my post
>     from 17 October 2016 on this list:
>
>     https://listserv.fysik.dtu.dk/pipermail/ase-users/2016-October/003187.html
>
>
>     Meanwhile I have a local fix which I am testing in operation and
>     will soon
>     make a merge request to include it.
>
>     Best regards,
>     Ivan
>
>
>     -------------- next part --------------
>     An HTML attachment was scrubbed...
>     URL:
>     <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20161201/ee2aa8ac/attachment.html>
>
>
>     ------------------------------
>
>     _______________________________________________
>     ase-users mailing list
>     ase-users at listserv.fysik.dtu.dk
>     <mailto:ase-users at listserv.fysik.dtu.dk>
>     https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>
>     End of ase-users Digest, Vol 102, Issue 3
>     *****************************************
>
>
>
>
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users



More information about the ase-users mailing list