mod two_phase¶
- module two_phase¶
Two-phase relaxation on a compacted surface.
Locatelli and Schoen relax a perturbed cluster first on a modified pair potential that penalizes pair distances beyond a cutoff, then relax that minimum on the plain potential and judge the plain energy. Doye’s compression is the centroid form of the same idea. The transformed surface reorders basin areas so that compact packings own more of the quench catchment, which is what separates the decahedral and tetrahedral global minima from the icosahedral floors at 75, 98 and 102 to 104 points by two orders of magnitude in cost.
Nothing here names a structure. The penalty reads pair distances of the coordinates being relaxed and a cutoff that is either fixed or a fraction of the largest pair distance of the structure entering the quench.
Locatelli, M.; Schoen, F. Comput. Optim. Appl. 2002, 21, 55 <https://doi.org/10.1023/A:1013596313166>; Grosso, A.; Locatelli, M.; Schoen, F. Math. Program. 2007, 110, 373 <https://doi.org/10.1007/s10107-006-0006-3>; Doye, J. P. K. Phys. Rev. E 2000, 62, 8753 <https://doi.org/10.1103/PhysRevE.62.8753>.
Types
A surface allocator posterior several chains update together.
Evidence is keyed by the occupied validated source. Chains that share a key draw from that key’s posterior. Importing a peer reply does not replace a walk’s coordinates, held arm, local rewards, or random stream.
Variables
- const DEFAULT_SURFACE_BLOCK: usize¶
Hops an arm is held for before the allocator redraws.
Functions
- fn largest_pair_distance(x: ArrayView1<f64>) -> f64¶
Largest pair distance in a 3N coordinate vector; zero below two points.
- fn penalty(x: ArrayView1<f64>, cutoff: f64, beta: f64, mu: f64) -> (f64, Array1<f64>)¶
Penalty energy and gradient added to the plain surface in phase one.
beta * sum_{i<j} max(0, r_ij^2 - cutoff^2)^2 + mu * sum_i |r_i - r_cm|^2. The centroid contributes no gradient of its own because displacements from it sum to zero.
- fn penalty_axes(x: ArrayView1<f64>, cutoff: f64, beta: f64, mu: f64, axes: [f64; 3]) -> (f64, Array1<f64>)¶
Diameter penalty with axis weights on the squared pair components.
The spherical penalty is weights
[1, 1, 1]. A prolate or oblate penalty uses other positive weights on the y and z components.
- fn penalty_body(x: ArrayView1<f64>, cutoff: f64, beta: f64, mu: f64, axes: [f64; 3]) -> (f64, Array1<f64>)¶
Axis-weighted diameter penalty in the inertia frame of
x.The weights are applied in order of increasing inertia eigenvalue, so the first weight lies on the longest principal axis of the structure being relaxed. The frame is rebuilt from those coordinates.
- fn penalty_groups(x: ArrayView1<f64>, groups: &[Vec<usize>], cutoff: f64, beta: f64, mu: f64) -> (f64, Array1<f64>)¶
Penalty energy and gradient on rigid-group centroids.
Same diameter and compression terms as
penalty, evaluated between and on the group centroids. Each centroid’s gradient is spread equally over the group’s atoms, so intramolecular bonds feel no relative force.
A fresh shared posterior over the plain surface plus
transforms.
Enums
- enum Cutoff¶
How the diameter cutoff is chosen for one relaxation.
- Fixed(f64)¶
A fixed pair-distance cutoff in the objective’s length units.
- Relative(f64)¶
A fraction of the largest pair distance of the structure being relaxed.
Structs and Unions
- struct SurfacePortfolio¶
A learned choice of relaxation surface per hop.
Which transform helps is a property of the landscape: centroid compression separates the octahedral and tetrahedral minima at 38 and 98 points, the diameter penalty separates the Marks decahedron at 75, and neither is worth its second relaxation on a single-funnel size. Rather than name the answer per size, the arms are the plain surface and every configured transform, and a Normal-Gamma Thompson allocator rewarded by the depth the quench reached picks one per hop, the same reward that allocates move kernels in
crate::methods::cluster_hopping.An arm is held for a block of hops, not one: a walk on the compacted surface and a walk on the plain one visit different minima, and alternating them every hop is a walk on neither. A screening relaxation opens a hop; every
blockhops the arm is redrawn, and the block’s reward is the energy its walk took off the run’s best, zero when it took none.Implementations
- impl SurfacePortfolio¶
Functions
- fn adopt_checkpoint(&mut self, interval: usize, source: SourceTransferKey) -> Result<(), &'static str>¶
Adopt a checkpoint only when its interval is this portfolio’s block.
- fn begin(&mut self, screening: bool) -> Option<TwoPhase>¶
The surface for the relaxation about to start.
A screening relaxation opens a hop; the block’s arm is redrawn once the block is spent, with the finished block’s improvement credited to the arm that walked it.
- fn draws(&self) -> &[usize]¶
Draws taken per arm, the plain surface first.
- fn import_evidence(&mut self, message: SurfaceEvidenceMessage) -> Result<(), &'static str>¶
Store a peer reply under its original key.
Local rewards, the held arm, and the random stream stay as they are. Coordinates are not portfolio state and are not an argument.
- fn means(&self) -> Vec<f64>¶
Posterior mean depth reward per arm, the plain surface first.
- fn new(transforms: &[TwoPhase], seed: u64) -> Self¶
The plain surface plus every transform, uninformative until fed.
- fn note_perturbed_input(&mut self, _perturbed: &SourceTransferKey)¶
The relaxation input is not a source and does not replace occupancy.
- fn observe(&mut self, screening: bool, reached: f64, best: f64)¶
Records what a full relaxation on the held arm reached against the run’s best.
- fn set_occupied_source(&mut self, source: SourceTransferKey) -> Result<(), &'static str>¶
Record the occupied validated source. A mismatched block interval is refused.
- fn sharing(mut self, shared: SharedSurfaceAllocator, source: SourceTransferKey) -> Result<Self, &'static str>¶
Draw from and credit a posterior shared with other chains.
sourceis the key the credit writes and the draw reads. A book with no source stays empty, and every chain keeps a private allocator.
- struct TwoPhase¶
First-phase transform of the relaxation surface.
- beta: f64¶
Strength of the quartic diameter penalty.
- mu: f64¶
Strength of the centroid compression; zero leaves it off.
Implementations
- impl TwoPhase¶
Functions
- fn cutoff_for(&self, x: ArrayView1<f64>) -> f64¶
The cutoff that applies to a relaxation starting from
x.
- fn diameter(cutoff: f64, beta: f64) -> Self¶
A diameter penalty at a fixed cutoff, no centroid compression.
- fn is_active(&self) -> bool¶
Whether the first phase changes anything at all.
- fn relative(kappa: f64, beta: f64) -> Self¶
A diameter penalty at a fraction of the entering structure’s diameter.