When used as input argument for a stress calculation the stress is set to zero for the indicated components of the stress tensor. When used as input argument for an optimization the strain is kept fixed along the indicated directions.
Only constrain the optimization of a bulk system along the x- and z-axis:
# Set up lattice
lattice = SimpleCubic(3.731*Angstrom)
# Define elements
elements = [Silver, Cerium]
# Define coordinates
cartesian_coordinates = [[ 0. , 0. , 0. ],
[ 1.8655, 1.8655, 1.8655]]*Angstrom
# Set up configuration
bulk_configuration = BulkConfiguration(
bravais_lattice=lattice,
elements=elements,
cartesian_coordinates=cartesian_coordinates
)
# Run the optimization
constraints = [FixStrain(x=True, y=False, z=True)]
bulk_configuration = OptimizeGeometry(
bulk_configuration,
constraints=constraints,
)