#! Various constrained energy minimizations of HOOH with cc-pvdz RHF.
#! For the "frozen" bonds, angles and dihedrals, these coordinates are
#! constrained to remain at their initial values.  For "fixed" bonds,
#! angles, or dihedrals, the equilibrium (final) value of the coordinate
#! is provided by the user.

# Minimized energy with OH bonds at 0.950 Angstroms. # TEST
OH_950_stre       = -150.78666731                    # TEST
# Minimized energy with OOH angles at 105.0 degrees. # TEST
OOH_105_bend      = -150.78617685                    # TEST
# Minimized energy with HOOH torsion at 120.0 degrees. # TEST
HOOH_120_dihedral = -150.78664695                      # TEST

set globals {
  diis false
  basis cc-pvdz
}

# Constrained minimization with O-H bonds frozen from start to 0.950 Angstroms.
molecule { 
  H 
  O 1 0.950
  O 2 1.400 1 100.0
  H 3 0.950 2 100.0 1 115.0
} 
  
set optking {
  frozen_distance = ("
    1  2
    3  4
  ")
}
thisenergy = optimize('scf')

# Constrained minimization with O-H bonds fixed to reach equilibrium at 0.950 Angstroms.
molecule {
  H
  O 1 0.90
  O 2 1.40 1 100.0 
  H 3 0.90 2 100.0 1 115.0
}

set optking {
  frozen_distance = "" # Need to zero out previously used constraints.
  fixed_distance = ("
    1  2 0.950
    3  4 0.950
  ")
}
thisenergy = optimize('scf')

# Constrained minimization with O-O-H bonds frozen from start at 105.0 degrees.
molecule {
  H
  O 1 0.90
  O 2 1.40 1 105.0
  H 3 0.90 2 105.0 1 115.0
}

set optking {
  fixed_distance = (" ")
  frozen_bend = ("
    1 2 3
    2 3 4
  ")
}
thisenergy = optimize('scf')

# Constrained minimization with O-O-H angles fixed to reach eq. at 105.0 degrees.
molecule {
  H
  O 1 0.90
  O 2 1.40 1 100.0
  H 3 0.90 2 100.0 1 115.0
}

set optking {
  frozen_bend = ""
  fixed_bend = ("
    1 2 3 105.0
    2 3 4 105.0
  ")
}
thisenergy = optimize('scf')

# Constrained minimization with H-O-O-H dihedral frozen from start to 120.0 degrees.
molecule {
  H
  O 1 0.90
  O 2 1.40 1 100.0
  H 3 0.90 2 100.0 1 120.0
}

set optking {
  fixed_bend = ""
  frozen_dihedral = ("
    1 2 3 4
  ")
}
thisenergy = optimize('scf')

# Constrained minimization with H-O-O-H dihedral fixed to 120.0 degrees.
molecule {
  H
  O 1 0.90
  O 2 1.40 1 100.0
  H 3 0.90 2 100.0 1 115.0
}

set optking {
  frozen_dihedral = ""
  fixed_dihedral = ("
    1 2 3 4 120.0
  ")
}
thisenergy = optimize('scf')

