gnrs.optimize¶
gnrs.optimize.optimization_task¶
This module provides the GeometryOptimizationTask class for performing geometry optimization tasks.
This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.
- class gnrs.optimize.optimization_task.GeometryOptimizationTask[source]¶
Bases:
TaskABCTask for relaxing geometry of crystal structures.
Initialize the geometry optimization task.
- Parameters:
comm – MPI communicator
config – Config dictionary
gnrs_info – Genarris info dictionary
optimizer – Optimizer
energy_method – Energy calculator(optional)
- __init__(comm, config, gnrs_info, optimizer, energy_method=None)[source]¶
Initialize the geometry optimization task.
- pack_settings()[source]¶
Pack settings for the optimization task.
- Returns:
Task settings dictionary
- Return type:
- print_settings(task_set)[source]¶
Print the task settings.
- Parameters:
task_set (dict) – Task settings dictionary
- Return type:
None
gnrs.optimize.bfgs¶
This module provides a wrapper around the BFGS implementation from ASE.
This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.
- class gnrs.optimize.bfgs.BFGSOptimizer[source]¶
Bases:
GeometryOptimizerABCLimited-memory BFGS optimization using ASE’s BFGS implementation.
- fmax¶
Maximum force tolerance for convergence criterion
- steps¶
Maximum number of optimization steps to perform
- fix_sym¶
Whether to fix the symmetry of the structure
- cell_opt¶
Whether to optimize the cell parameters as well
- opt_name¶
Name of the optimizer for storing in the crystal info
- converged¶
Whether the optimization successfully converged
Initialize the geometry optimizer.
- Parameters:
comm – MPI communicator for parallel computation
task_set – Optimization settings
opt_name – Optimizer
energy_method – Energy calculation method
- __init__(*args)[source]¶
Initialize the geometry optimizer.
- Parameters:
comm – MPI communicator for parallel computation
task_set – Optimization settings
opt_name – Optimizer
energy_method – Energy calculation method
- optimize(xtal)[source]¶
Performs geometry optimization using BFGS algorithm.
- Parameters:
xtal (ase.atoms.Atoms) – ASE Atoms object
- Return type:
None
- update(xtal)[source]¶
Update the optimizer with the new structure.
- Parameters:
xtal (ase.atoms.Atoms)
- Return type:
None
gnrs.optimize.lbfgs¶
This module provides a wrapper around the LBFGS implementation from ASE.
This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.
- class gnrs.optimize.lbfgs.LBFGSOptimizer[source]¶
Bases:
GeometryOptimizerABCLimited-memory BFGS optimization using ASE’s LBFGS implementation.
- fmax¶
Maximum force tolerance for convergence criterion
- steps¶
Maximum number of optimization steps to perform
- fix_sym¶
Whether to fix the symmetry of the structure
- cell_opt¶
Whether to optimize the cell parameters as well
- opt_name¶
Name of the optimizer for storing in the crystal info
- converged¶
Whether the optimization successfully converged
Initialize the geometry optimizer.
- Parameters:
comm – MPI communicator for parallel computation
task_set – Optimization settings
opt_name – Optimizer
energy_method – Energy calculation method
- __init__(*args)[source]¶
Initialize the geometry optimizer.
- Parameters:
comm – MPI communicator for parallel computation
task_set – Optimization settings
opt_name – Optimizer
energy_method – Energy calculation method
- optimize(xtal)[source]¶
Performs geometry optimization using LBFGS algorithm.
- Parameters:
xtal (ase.atoms.Atoms) – ASE Atoms object
- Return type:
None
- update(xtal)[source]¶
Update the optimizer with the new structure.
- Parameters:
xtal (ase.atoms.Atoms)
- Return type:
None
gnrs.optimize.rigid_press¶
This module provides a wrapper around the rigid_press C code.
This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.
- class gnrs.optimize.rigid_press.RIGID_PRESSOptimizer[source]¶
Bases:
GeometryOptimizerABCOptimizes structure using rigid_press C code.
Initialize the geometry optimizer.
- Parameters:
comm – MPI communicator for parallel computation
task_set – Optimization settings
opt_name – Optimizer
energy_method – Energy calculation method
- __init__(*args)[source]¶
Initialize the geometry optimizer.
- Parameters:
comm – MPI communicator for parallel computation
task_set – Optimization settings
opt_name – Optimizer
energy_method – Energy calculation method
gnrs.optimize.symm_rigid_press¶
This module provides a wrapper around the Rigid Press implementation with symmetry constraints.
This source code is licensed under the BSD-3-Clause license found in the LICENSE file in the root directory of this source tree.
- class gnrs.optimize.symm_rigid_press.SYMM_RIGID_PRESSOptimizer[source]¶
Bases:
GeometryOptimizerABCOptimizes crystal structures using rigid_press algorithm with symmetry constraints.
This optimizer uses van der Waals cutoff matrices for tight molecular packing and preserves symmetry during optimization.
- opt_name¶
Name identifier for the optimizer
- int_scale¶
Interaction scale factor
- method¶
Optimization method to use
- tol¶
Convergence tolerance
- maxiter¶
Maximum number of iterations
- vol_tol¶
Volume tolerance
- debug_flag¶
Whether to enable debug output
Initialize the symmetry-preserving rigid press optimizer.