Constraints
Constraints in MAPLE allow you to impose geometric restrictions on atoms or internal coordinates during optimization, scan, and dynamics calculations. They are specified in the post-processing section of the input file, which follows the coordinate block. Constraint commands fix specific degrees of freedom (atom positions, bond lengths, angles, or dihedrals) at their initial values, while scan commands define coordinate ranges to be systematically explored.
Atom Constraints (C Command)
The C command freezes an atom at its current position. The atom will not move during optimization or dynamics. This is useful for anchoring specific parts of a molecular system, such as fixing a metal center or holding boundary atoms in place.
| Format | Description |
|---|---|
C i |
Fix the position of atom i |
C 3
This freezes atom 3 at its initial Cartesian coordinates. All three spatial components (x, y, z) are held fixed.
You can fix multiple atoms by including multiple C commands:
C 1
C 5
C 12
Bond Constraints (B Command)
The B command fixes the distance between two atoms at its initial value. During optimization, the bond length will remain constant while the rest of the system relaxes.
| Format | Description |
|---|---|
B i j |
Fix the bond distance between atoms i and j |
B 1 5
This constrains the distance between atoms 1 and 5 at whatever value it has in the input geometry.
Angle Constraints (A Command)
The A command fixes the bond angle formed by three atoms. The angle i-j-k (with j as the vertex atom) is held constant during the calculation.
| Format | Description |
|---|---|
A i j k |
Fix the bond angle at vertex atom j between atoms i, j, and k |
A 2 1 4
This constrains the angle formed by atoms 2-1-4 at its initial value.
Dihedral Constraints (D Command)
The D command fixes the dihedral (torsion) angle formed by four atoms. The torsion angle defined by the i-j-k-l atom sequence is held constant throughout the simulation.
| Format | Description |
|---|---|
D i j k l |
Fix the dihedral angle formed by atoms i, j, k, l |
D 1 2 3 6
This constrains the torsion angle along the 1-2-3-6 atom chain at its initial value.
Scan Coordinates (S Command)
The S command defines an internal coordinate to be scanned over a range of values. It is used exclusively with #scan tasks. The scan systematically varies the specified coordinate from its initial value, stepping by a fixed increment for a given number of steps. At each step, the remaining degrees of freedom are optimized.
| Coordinate Type | Format | Description |
|---|---|---|
| Bond length | S i j step nsteps |
Scan the distance between atoms i and j |
| Bond angle | S i j k step nsteps |
Scan the angle at vertex j |
| Dihedral angle | S i j k l step nsteps |
Scan the torsion angle along i-j-k-l |
The step parameter specifies the increment per step (in Angstroms for bond lengths, degrees for angles), and nsteps is the number of steps to take.
S 1 2 0.05 10
This scans the bond length between atoms 1 and 2, increasing it by 0.05 Angstroms at each of 10 steps.
S 2 1 3 10.0 6
This scans the bond angle at atom 1 (between atoms 2, 1, and 3), increasing it by 10 degrees at each of 6 steps.
Tip
You can define multiple S commands to perform a multi-dimensional scan. MAPLE will systematically vary all scan coordinates, creating a grid of geometries across the combined coordinate space.
POST Command
The POST command allows you to load constraint definitions from an external file instead of listing them inline. This is useful when you have a large number of constraints or want to reuse the same constraint set across multiple calculations.
POST /path/to/constraints.txt
The external file should contain constraint commands (one per line) in the same format as inline constraints:
C 1
C 2
B 3 7
A 4 5 6
D 1 2 3 4
Examples
Constrained optimization: freeze atoms and fix a bond
#model = uma
#device = gpu0
#opt(method=lbfgs, convergence=tight)
0 1
C 0.000000 0.000000 0.000000
C 1.540000 0.000000 0.000000
O 2.340000 1.100000 0.000000
H -0.392000 1.011000 0.000000
H -0.392000 -0.506000 0.875000
H -0.392000 -0.506000 -0.875000
H 1.932000 -0.506000 0.875000
H 1.932000 -0.506000 -0.875000
C 3
B 1 2
Atom 3 (oxygen) is frozen and the C-C bond (atoms 1-2) is held at its initial distance while everything else optimizes.
Constrained optimization: fix a dihedral angle
#model = aimnet2
#device = gpu0
#opt(method=lbfgs)
0 1
C 0.000000 0.000000 0.000000
C 1.540000 0.000000 0.000000
C 2.100000 1.450000 0.000000
C 3.640000 1.450000 0.000000
H -0.392000 1.011000 0.000000
H -0.392000 -0.506000 0.875000
H 1.932000 -0.506000 0.875000
H 1.932000 -0.506000 -0.875000
H 1.700000 1.956000 0.875000
H 1.700000 1.956000 -0.875000
H 4.032000 0.944000 0.875000
H 4.032000 0.944000 -0.875000
H 4.032000 2.461000 0.000000
D 5 1 2 3
The dihedral angle along H(5)-C(1)-C(2)-C(3) is fixed at its initial value while the rest of the geometry relaxes.
1D bond scan
#model = uma
#device = gpu0
#scan(method=lbfgs)
0 1
C 0.000000 0.000000 0.000000
C 1.540000 0.000000 0.000000
H -0.392000 1.011000 0.000000
H -0.392000 -0.506000 0.875000
H -0.392000 -0.506000 -0.875000
H 1.932000 0.506000 0.875000
H 1.932000 0.506000 -0.875000
H 1.932000 -1.011000 0.000000
S 1 2 0.05 10
Scans the C-C bond in 10 increments of 0.05 Angstroms.
2D scan: bond length + bond angle
#model = uma
#device = gpu0
#scan(method=lbfgs)
0 1
O 0.000000 0.000000 0.117300
H 0.000000 0.757160 -0.469200
H 0.000000 -0.757160 -0.469200
S 1 2 0.05 5
S 2 1 3 5.0 6
Simultaneously scans the O-H bond length (5 steps of 0.05 Angstroms) and the H-O-H bond angle (6 steps of 5 degrees), producing a 2D potential energy surface.
Using the POST command for external constraints
#model = uma
#device = gpu0
#opt(method=lbfgs)
XYZ /path/to/molecule.xyz
POST /path/to/constraints.txt
