implement a ConstrainedPolynomialModel class
Application This would allow inexperienced user to specify optimization problems at a high a level, without needing to worry about technical concerns such as making objectives and constraints quadratic' and to build up models from understandable components.
Proposed Solution Introduce a ConstrainedPolynomialModel class that subsumes all current model types and features
- higher order terms
- all variable types (Binary, Spin, Discrete, Integer)
- (higher order) constraints
- arithmetic operations
The polynomial reduction algorithm can be extended to other variable types. Higher order constraints can be reduced the same way as objective functions. Constrained models can be combined arithmetically by taking the union of constraints of the arguments, making CPMs closed under addition, subtraction multiplication and non-negative integer powers.
Linking https://github.com/dwavesystems/dimod/issues/988#issuecomment-914477913 for cross reference.