Skip to content

Parameterize convergence criteria - #17

Merged
niklashoelter merged 4 commits into
masterfrom
parameterize-convergence-criteria-12337392020986584388
Feb 2, 2026
Merged

niklashoelter merged 4 commits into
masterfrom
parameterize-convergence-criteria-12337392020986584388

Conversation

@niklashoelter

Copy link
Copy Markdown
Owner

Implemented parameterization of convergence functions as requested.

  • Defaults: Force 0.05, Energy None.
  • Priority: Force > Energy.
  • Warnings: Issued when both are set or when energy is requested for single structure optimization.
  • Config: Added force_convergence_criterion and energy_convergence_criterion keys.

PR created automatically by Jules for task 12337392020986584388 started by @niklashoelter

This change introduces parameterized convergence criteria for geometry optimization.
Users can now specify `force_convergence_criterion` and `energy_convergence_criterion` in the configuration file.

- Added `force_convergence_criterion` (default 5e-2) and `energy_convergence_criterion` (default None) to `DEFAULT_CONFIG`.
- Updated `optimize_single_structure` to use the configured force criterion and warn if energy criterion is requested (as only force is supported for single structure optimization).
- Updated `_optimize_batch_structures` to support both criteria, prioritizing force if both are set.
- Added validation for the new criteria in `validate_config`.
- Added tests in `tests/test_convergence_criteria.py`.

Co-authored-by: niklashoelter <83964137+niklashoelter@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@niklashoelter

Copy link
Copy Markdown
Owner Author

@jules You should also update the config.json files in example folders and the default config within its class.

@google-labs-jules

Copy link
Copy Markdown
Contributor

@jules You should also update the config.json files in example folders and the default config within its class.

Thank you for the suggestion. I have updated the examples/config.json file to include the new force_convergence_criterion and energy_convergence_criterion parameters. I also verified that the DEFAULT_CONFIG in src/gpuma/config.py was already updated in the previous commit.

This change introduces parameterized convergence criteria for geometry optimization.
Users can now specify `force_convergence_criterion` and `energy_convergence_criterion` in the configuration file.

- Added `force_convergence_criterion` (default 5e-2) and `energy_convergence_criterion` (default None) to `DEFAULT_CONFIG`.
- Updated `optimize_single_structure` to use the configured force criterion and warn if energy criterion is requested (as only force is supported for single structure optimization).
- Updated `_optimize_batch_structures` to support both criteria, prioritizing force if both are set.
- Added validation for the new criteria in `validate_config`.
- Updated `examples/config.json` to include the new criteria.
- Added tests in `tests/test_convergence_criteria.py`.

Co-authored-by: niklashoelter <83964137+niklashoelter@users.noreply.github.com>
@niklashoelter

Copy link
Copy Markdown
Owner Author

@jules please update the README as well

@google-labs-jules

Copy link
Copy Markdown
Contributor

@jules please update the README as well

I have updated the README.md to include the force_convergence_criterion and energy_convergence_criterion in the configuration examples and descriptions.

google-labs-jules Bot and others added 2 commits February 2, 2026 16:11
This change introduces parameterized convergence criteria for geometry optimization.
Users can now specify `force_convergence_criterion` and `energy_convergence_criterion` in the configuration file.

- Added `force_convergence_criterion` (default 5e-2) and `energy_convergence_criterion` (default None) to `DEFAULT_CONFIG`.
- Updated `optimize_single_structure` to use the configured force criterion and warn if energy criterion is requested (as only force is supported for single structure optimization).
- Updated `_optimize_batch_structures` to support both criteria, prioritizing force if both are set.
- Added validation for the new criteria in `validate_config`.
- Updated `examples/config.json` and `README.md` to include the new criteria.
- Added tests in `tests/test_convergence_criteria.py`.

Co-authored-by: niklashoelter <83964137+niklashoelter@users.noreply.github.com>
@niklashoelter
niklashoelter merged commit 39a3a27 into master Feb 2, 2026
1 check passed
@niklashoelter
niklashoelter deleted the parameterize-convergence-criteria-12337392020986584388 branch February 2, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant