code: def _constraint(self, params):
          
          if (params["spin1x"]**2 + params["spin1y"]**2 +
                  params["spin1z"]**2)**2 > 1:
              return False
          elif (params["spin2x"]**2 + params["spin2y"]**2 +
                    params["spin2z"]**2)**2 > 1:
              return False
          else:
              return True
docs: Evaluates constraint function.