Prelude
Add <span class="title-ref">QuadraticModel</span> implementation to Python, Cython and C++. Quadratic models can be represented by a degree 2 polynomial over binary, spin and integer variables.
We began using [Reno](https://docs.openstack.org/reno/) as a changelog tool after the release of 0.10.0.dev6. Content added before that release is not included. See [releases](https://github.com/dwavesystems/dimod/releases) for previous release notes.
New Features
- Add <span class="title-ref">ConstrainedQuadraticModel.add_discrete</span> method. This allows users to create a discrete variable via a one-hot constraint. A disjoint set of discrete variables are tracked by the <span class="title-ref">CQM</span> and serialized.
<!-- -->
- Add support for quadratic model objectives and constraints in constrained quadratic models. Previously CQMs only supported binary quadratic models.
<!-- -->
- Add new <span class="title-ref">QuadraticModel</span> class for creating quadratic models.
<!-- -->
- Add <span class="title-ref">CaseLabelDQM</span> class. Provides means of labeling cases of discrete variables.
<!-- -->
- Begin using reno for changelog.
<!-- -->
- Add <span class="title-ref">BinaryQuadraticModel.add_linear_inequality_constraint</span> and <span class="title-ref">DiscreteQuadraticModel.add_linear_inequality_constraint</span> methods.
<!-- -->
- Create <span class="title-ref">dimod/libcpp.pxd</span> Cython header file. This allows user to <span class="title-ref">cimport</span> C++ classes and functions defined in <span class="title-ref">dimod/include/</span>
<!-- -->
- Use C++ <span class="title-ref">BinaryQuadraticModel</span> rather than <span class="title-ref">AdjVectorBQM</span> as the underlying object in <span class="title-ref">cyDiscreteQuadraticModel</span>. This means that the underlying implementation is now version controlled.
<!-- -->
- Add new <span class="title-ref">Vartype.INTEGER</span> variable type.
<!-- -->
- Add <span class="title-ref">QuadraticModelBase::scale</span> method. Scales offset, linear biases, and quadratic biases by a provided scale factor.
Upgrade Notes
- Symbolically multiplying, subtracting and adding <span class="title-ref">BinaryQuadraticModel\`s with different vartypes now creates a \`QuadraticModel</span> rather than raising an error.
<!-- -->
- Use C++ <span class="title-ref">BinaryQuadraticModel</span> rather than <span class="title-ref">AdjVectorBQM</span> as the underlying object in <span class="title-ref">cyDiscreteQuadraticModel</span>. Any code that relied on the old <span class="title-ref">AdjVectorBQM</span> implementation will need to be upgraded.
<!-- -->
- Make <span class="title-ref">dimod.vartypes.ExtendedVartype</span> an alias for <span class="title-ref">dimod.vartypes.Vartype</span>. Also remove <span class="title-ref">ExtendedVartypeLike</span> from <span class="title-ref">dimod.vartypes</span> and <span class="title-ref">dimod.typing</span>.
Bug Fixes
- Fix subtracting a <span class="title-ref">BinaryQuadraticModel</span> from a number. Before it would return <span class="title-ref">bqm - 1</span> rather than correctly returning <span class="title-ref">1 - bqm</span>.
<!-- -->
- Stop using deprecated numpy aliases like <span class="title-ref">np.int</span>, <span class="title-ref">np.float</span>, and <span class="title-ref">np.complex</span>.