pychemia.population package¶
Subpackages¶
Submodules¶
pychemia.population.ljcluster module¶
-
class
pychemia.population.ljcluster.
LJCluster
(name, composition=None, tag='global', target_forces=0.001, value_tol=0.01, distance_tol=0.1, minimal_density=70.0, refine=True, direct_evaluation=False)[source]¶ Bases:
pychemia.population._population.Population
-
distance
(entry_id, entry_jd, rcut=50)[source]¶ Return a measure of the distance between two clusters by computing a n-dimensional vector of the distances between each atom to the origin and
Parameters: - rcut –
- entry_id – The id of one population entry
- entry_jd – The id of another population entry
Returns: (int) The distance between two clusters
-
to_dict
¶
-
pychemia.population.noncollinearmagmoms module¶
-
class
pychemia.population.noncollinearmagmoms.
NonCollinearMagMoms
(name, source_dir='.', mag_atoms=None, magmom_magnitude=2.0, distance_tolerance=0.1, incar_extra=None, debug=False)[source]¶ Bases:
pychemia.population._population.Population
-
add_random
()[source]¶ Creates a new candidate with random orientiations for the magnetic moments of all the atoms in ‘mag_atoms’
Returns:
-
check_duplicates
(ids)[source]¶ Returns a dictionary of non-equivalent candidates as keys and associated to each key the list of candidates whose distance is less that the ‘distance_tolerance’ argument.
Parameters: ids – Returns:
-
debug_evaluation
(magmom_sph)[source]¶ For debugging ONLY: Fake evaluation of total energy using a magnetic configuration as the minimal energy, the numerical distance with other candidates defines their energy.
Parameters: magmom_sph – Returns:
-
distance
(entry_id, entry_jd)[source]¶ Compute the distance between 2 candidates as the average angular movement between the magnetic moments for all the atoms considered magnetic (‘mag_atoms’)
Parameters: - entry_id –
- entry_jd –
Returns:
-
is_evaluated
(entry_id)[source]¶ One candidate is considered evaluated if it contains any finite value of energy on the properties.energy field
Parameters: entry_id – Returns:
-
move
(entry_id, entry_jd, factor=0.2, in_place=False)[source]¶ Move the magnetic moments from one candidate in the direction of another.
Parameters: - entry_id – Source candidate, this one will be moved
- entry_jd – Destination candidate, this one is not moved.
- factor – (float) a value in range [0,1] 0 being the source, 1 the destination
- in_place – (bool) if true the new magnetic moments replace those in entry_id
Returns:
-
move_random
(entry_id, factor=0.2, in_place=False, kind='move')[source]¶ Change the magnetic orientation randomly for all the atoms considered magnetic ‘mag_atoms’ The ‘factor’ argument scales the intensite of the movement.
Parameters: - entry_id –
- factor –
- in_place –
- kind –
Returns:
-
new_entry
(cartesian_magmoms, active=True)[source]¶ Creates a new entry on the database
Parameters: - cartesian_magmoms – Magnetic moments stored in spherical coordinates
- active –
Returns:
-
to_dict
¶
-
pychemia.population.orbitaldftu module¶
-
class
pychemia.population.orbitaldftu.
OrbitalDFTU
(name, input_path='abinit.in', num_electrons_dftu=None, num_indep_matrices=None, connections=None)[source]¶ Bases:
pychemia.population._population.Population
-
add_random
()[source]¶ Creates a new set of variables to reconstruct the dmatpawu
matrix_i (integers) is a matrix natpawu x ndim with entries are 0 or 1 matrix_d (deltas) is a matrix natpawu x ndim with entries are [0, 0.5) P (matrices) is a set of matrices natpawu x ndim x ndim Those three matrices allow to reconstruct the variable ‘dmatpawu’ used by ABINIT
Returns:
-
check_duplicates
(ids)[source]¶ - For a given list of identifiers ‘ids’ checks the values for the function ‘distance’ and return a dictionary
- where each key is the identifier of a unique candidate and the value is a list of identifiers considered equivalents to it.
Parameters: ids – List of identifiers for wich the check will be performed Returns:
-
cross
(ids)[source]¶ Crossing algorithm used notably by GA to mix the information from several candidates This crossing algorithm is mixing the angles of two correlation matrices preserving the ordering of the atoms where the angles are applied. The occupations and deltas are also mixed independently of the euler angles.
Parameters: ids – Returns:
-
distance
(entry_id, entry_jd)[source]¶ Measure of distance for two entries with identifiers ‘entry_id’ and ‘entry_jd’
Parameters: - entry_id – Identifier of first entry
- entry_jd – Identifier of second entry
Returns:
-
evaluate_entry
(entry_id)[source]¶ Evaluation externalized, no implemented
Parameters: entry_id – Returns:
-
is_evaluated
(entry_id)[source]¶ One candidate is considered evaluated if it contains any finite value of energy on the properties.energy field
Parameters: entry_id – Returns:
-
move
(entry_id, entry_jd, factor=0.2, in_place=False)[source]¶ Move one candidate with identifier ‘entry_id’ in the direction of another candidate ‘entry_jd’
Parameters: - entry_id – Identifier of first entry (Origin)
- entry_jd – Identifier of second entry (Target)
- factor – Scale factor for change, 0 scale is the ‘Origin’ candidate, 1 is the ‘Target’ candidate Intermediate values will change candidates accordingly
- in_place – If True the candidate is changed keeping the identifier unchanged
Returns:
-
move_random
(entry_id, factor=0.2, in_place=False, kind='move')[source]¶ Move one candidate with identifier ‘entry_id’ randomly with a factor given by ‘factor’
Parameters: - entry_id – Identifier of entry
- factor – Factor use to scale the randomness of change
- in_place – If True the candidate is changed keeping the identifier unchanged
- kind – Use when several algorithms are used for movement. One implemented here
Returns:
-
ndim
¶ Dimension of the matrices defined on dmatpawu, for ‘d’ orbitals is 5 for ‘f’ orbitals is 7
Returns:
-
new_entry
(properties, active=True)[source]¶ Creates a new entry on the population database from given data.
Parameters: - properties – dictionary with 3 keys ‘D’ for deltas, ‘I’ for the integers and eigen for the rotation matrix applied to the orbitals
- active – if True, the entry is enabled on the DB to be evaluated.
Returns:
-
prepare_folder
(entry_id, workdir='.', source_dir='.')[source]¶ Prepare directories for abinit execution
Parameters: - entry_id – bson.ObjectID of the entry that will be used for preparing the folder
- source_dir – (str) is the directory where ‘abinit.files’ and ‘batch.pbs’ should be present those directories will be symbolically linked inside the individual work directories
- workdir – (str) Base work directory for abinit executions. Inside this directory, a set of subdirectories will be created using the mongo ID as name.
-
to_dict
¶
-
-
pychemia.population.orbitaldftu.
dmatpawu2params
(dmatpawu, ndim)[source]¶ Takes the contents of the variable ‘dmatpawu’ and return their components as a set of ‘occupations’, ‘deltas’ and ‘euler_angles’ The Euler angles is a ordered list of angles that can rebuild a rotation matrix ‘R’ The rotation matrix ‘R’ is ensured to be an element of SO(ndim), ie det(R)=1. When the eigenvectors return a matrix with determinant -1 a mirror on the first dimension is applied. Such condition has no effect on the physical result of the correlation matrix
Parameters: - dmatpawu – The contents of the variable ‘dmatpawu’. A list of number representing N matrices ndim x ndim
- ndim – ndim is 5 for ‘d’ orbitals and 7 for ‘f’ orbitals
Returns:
pychemia.population.realfunction module¶
-
class
pychemia.population.realfunction.
RealFunction
(function, ndim, limits, local_minimization=False)[source]¶ Bases:
pychemia.population._population.Population
-
actives
¶
-
members
¶
-
pychemia.population.relaxstructures module¶
-
class
pychemia.population.relaxstructures.
RelaxStructures
(name, composition=None, tag='global', target_forces=0.001, value_tol=0.01, distance_tol=0.3, min_comp_mult=2, max_comp_mult=8, pcdb_source=None, pressure=0.0, target_stress=None, target_diag_stress=None, target_nondiag_stress=None)[source]¶ Bases:
pychemia.population._population.Population
-
check_duplicates
(ids)[source]¶ Computes duplicate structures measuring its distance when their value is larger than value_tol. If the distance is lower than ‘distance_tol’ the structures will be cosidered as duplicates.
Parameters: ids – Returns: (dict) Dictionary of duplicates, the keys are the ids of the duplicates and the value is the structure from which the structure is duplicated. In general the energy of the ‘value’ is lower than the ‘key’
-
move
(entry_id, entry_jd, factor=0.2, in_place=False)[source]¶ Moves entry_id in the direction of entry_jd If in_place is True the movement occurs on the same address as entry_id
Parameters: - factor –
- entry_id –
- entry_jd –
- in_place –
Returns:
-
to_dict
¶
-