[ase-users] [ase-developers] ASE calculator interface proposal
Jens Jørgen Mortensen
jensj at fysik.dtu.dk
Fri Feb 1 12:47:57 CET 2013
Den 01-02-2013 12:20, Max Hoffmann skrev:
> Dear All,
>
> I have a question regarding [1], where is says "The read_atoms()
> method is equivalent to:"
> Can you clarify, where this 'read_atoms' is precisely located? More
> specifically, what is 'ABC' in :
>
>>>> atoms = ABC.read_atoms('si.abc')
> Because: Following the text above 'ABC' would be the uninstantiated
> calculator class.
Yes, that is correct ABC is the uninstantiated class. read_atoms is a
so-called class-method. You can see the implementation here:
https://trac.fysik.dtu.dk/projects/ase/browser/branches/aep1/ase/calculators/calculator.py#L198
http://docs.python.org/2/library/functions.html#classmethod
Jens Jørgen
> Though I think such a constructor is uncommon in python. As a python user
> I would expect to either have a read_atoms function as in
> ase.io.ABC.read_atoms('...') or
> alternatively use the constructor like
> ase.calculators.abc.ABC(read_atoms='si.abc').
>
> Best,
> Max.
>
>
> [1] https://wiki.fysik.dtu.dk/ase/development/proposals/calculators.html
>
>
> 2013/1/28 John Kitchin <jkitchin at andrew.cmu.edu>:
>>> * Restart
>>>>> There is another use mode worth discussing. In the following example:
>>>>>
>>>>> myatoms = Atoms(..., ideal positions)
>>>>>
>>>>> calc = MyCalculator(arg1, atoms=myatoms, kwargs)
>>>>> # I greatly prefer this to myatoms.set_calculator(calc)
>>>>> atoms.get_potential_energy()
>>>>
>>>> I like that way of attaching the calculator to the atoms. I'll put that
>>>> idea in the proposal.
>>>>> 1. The first time you run this, a calculation get run.
>>> As a personal preference :-), I do not like that heavy calculations get
>>> run when one creates an object (even though some GPAW functionality behaves
>>> this way), but that user has to explicitly request calculation by calling a
>>> function.
>>
>> Maybe something above was unclear. No calculation is done until
>> atoms.get_potential_energy() is called.
>>
>>
>>
>> _______________________________________________
>> 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