Skip to content

0.10.0.dev7

Pre-release
Pre-release
Compare
Choose a tag to compare
@arcondello arcondello released this 06 Jul 01:18
· 1352 commits to main since this release
f51f813

Release Notes

0.10.0.dev7

Prelude

Add QuadraticModel 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 as a changelog tool after the release of 0.10.0.dev6. Content added before that release is not included. See releases for previous release notes.

New Features

  • Add ConstrainedQuadraticModel.add_discrete method. This allows users to create a discrete variable via a one-hot constraint. A disjoint set of discrete variables are tracked by the CQM and serialized.
  • Add support for quadratic model objectives and constraints in constrained quadratic models. Previously CQMs only supported binary quadratic models.
  • Add new QuadraticModel class for creating quadratic models.
  • Add CaseLabelDQM class. Provides means of labeling cases of discrete variables.
  • Begin using reno for changelog.
  • Add BinaryQuadraticModel.add_linear_inequality_constraint and DiscreteQuadraticModel.add_linear_inequality_constraint methods.
  • Create dimod/libcpp.pxd Cython header file. This allows user to cimport C++ classes and functions defined in dimod/include/
  • Use C++ BinaryQuadraticModel rather than AdjVectorBQM as the underlying object in cyDiscreteQuadraticModel. This means that the underlying implementation is now version controlled.
  • Add new Vartype.INTEGER variable type.
  • Add QuadraticModelBase::scale method. Scales offset, linear biases, and quadratic biases by a provided scale factor.

Upgrade Notes

  • Symbolically multiplying, subtracting and adding BinaryQuadraticModel`s with different vartypes now creates a `QuadraticModel rather than raising an error.
  • Use C++ BinaryQuadraticModel rather than AdjVectorBQM as the underlying object in cyDiscreteQuadraticModel. Any code that relied on the old AdjVectorBQM implementation will need to be upgraded.
  • Make dimod.vartypes.ExtendedVartype an alias for dimod.vartypes.Vartype. Also remove ExtendedVartypeLike from dimod.vartypes and dimod.typing.

Bug Fixes

  • Fix subtracting a BinaryQuadraticModel from a number. Before it would return bqm - 1 rather than correctly returning 1 - bqm.
  • Stop using deprecated numpy aliases like np.int, np.float, and np.complex.