Conversation
…nd inner iterations
… SCF and inner iterations
…rations in SolverOptions
…cutoff, and inner iterations options
14 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces advanced performance optimization options to the cheq solver, allowing users to trade numerical exactness for computational speed when solving large-scale charge equilibration problems. The changes are well-integrated across the library API, CLI, and documentation.
Key changes:
- Added three configurable "lossy" optimization features: hard cutoff radius for pair interactions, toggleable hydrogen SCF (self-consistent field), and experimental hydrogen-focused inner iterations
- Refactored the solver's core
solvemethod to support multiple optimization pathways with clean separation between exact and approximate calculation modes - Implemented spatial hashing (neighbor list) for efficient O(N) pair interaction computation when using cutoff radius
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/solver/options.rs | Adds three new fields to SolverOptions: hydrogen_scf, cutoff_radius, and hydrogen_inner_iters with appropriate defaults |
| src/solver/implementation.rs | Refactors solver logic to support optimization pathways, extracts run_single_solve helper, adds spatial hashing for cutoff, and includes comprehensive tests for new features |
| src/lib.rs | Minor refactoring to use contains_key instead of get().is_some() for cleaner code |
| src/bin/modules/cli.rs | Exposes all three new solver options as CLI arguments with appropriate documentation |
| src/bin/modules/app.rs | Connects CLI arguments to SolverOptions fields |
| USAGE.md | Documents the new CLI options and updates the argument reference table |
| README.md | Adds mention of lossy optimization knobs to the features list |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ct lossy simplification Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Introduces several advanced, configurable "lossy" optimization options to the
cheqsolver, allowing users to trade numerical exactness for significant performance gains on large-scale systems. These new features, exposed through both the library API (SolverOptions) and the CLI, include a hard cutoff radius for pair interactions, the ability to disable the non-linear hydrogen SCF term, and an experimental hydrogen-focused inner iteration loop. These additions provide sophisticated knobs for performance tuning in computationally demanding scenarios.Changes:
Implemented a Hard Cutoff Radius for Pair Interactions:
cutoff_radiusoption toSolverOptions.J_ijinteractions for atom pairs within the given radius, drastically reducing the complexity from O(N²) to O(N).Added Toggle for Non-Linear Hydrogen SCF:
hydrogen_scfboolean flag inSolverOptions.false, the solver treats hydrogen with a fixed hardness, turning the problem into a single-shot linear solve that converges in one iteration.Introduced an Experimental Hydrogen Inner Iteration Loop:
hydrogen_inner_itersoption to perform a set number of fast, hydrogen-only charge updates before each full SCF cycle.Exposed All New Options in the CLI:
SolverOptions(--cutoff,--hydrogen-scf,--hydrogen-inner-iters) are now available as command-line arguments.USAGE.mdandREADME.mdto document these advanced options and explain their performance implications.Refactored Solver for Optimization Hooks:
solvemethod was refactored to cleanly integrate the new optimization pathways.hydrogen_scfis enabled and whether acutoff_radiusis provided, ensuring a clear separation between the exact (lossless) and approximate (lossy) calculation modes.