  In variational quantum algorithms, constraints are usually added to the
problem objective via penalty terms. For linear inequality constraints, this
procedure requires additional slack qubits. Those extra qubits tend to blow up
the search space and complicate the parameter landscapes to be navigated by the
classical optimizers. In this work, we explore approaches to model linear
inequalities for quantum algorithms without these drawbacks. More concretely,
our main suggestion is to omit the slack qubits completely and evaluate the
inequality classically during parameter tuning. We test our methods on QAOA as
well as on Trotterized adiabatic evolution, and present empirical results. As a
benchmark problem, we consider different instances of the multi-knapsack
problem. Our results show that removing the slack bits from the circuit
Hamiltonian and considering them only for the expectation value yields better
solution quality than the standard approach. The tests have been carried out
using problem sizes up to 26 qubits. Our methods can in principle be applied to
any problem with linear inequality constraints, and are suitable for
variational as well as digitized versions of adiabatic quantum computing.
