Sire also has a complete energy engine meaning that energies can be calculated for entire systems or views within systems, across all frames or subsets of frames of a trajectory. This is used in BioSimSpace to calculate different types of protein-ligand restraints used in alchemical absolute binding free energy calculations . These engines are powered by a complete internal Computer Algebra System (CAS) in sire.cas. Data, such as bond and angle potentials, are stored as algebraic expressions. These are converted to and from parameter values (e.g. k and r0 for bonds) as and when needed. This gives substantial flexibility to all aspects of the program, for example sire.cas powers the user-supplied equations that control how forcefield parameters are perturbed across a λ-coordinate during a GPU-accelerated OpenMM molecular dynamics free energy simulation.