Releases: dwavesystems/dimod
0.12.8
New Features
- Add
dimod.generators.magic_square()
which allows for the generation of a constrained quadratic model whose feasible solutions are normal magic squares. The function also generates magic squares of squares when passedpower=2
as a keyword argument. - Implement version 2.0 of constrained quadratic model serialization. See
ConstrainedQuadraticModel.to_file()
for details. - Improve LP file reading by wrapping HiGHS LP file parser.
- Add C++
ConstrainedQuadraticModel::remove_constraints_if()
method.
Upgrade Notes
- Remove the
ObjectView.to_file()
method. - Remove the
ConstraintView.to_file()
method. - Remove
dimod::lp
C++ namespace. - Drop support for Python 3.7.
Bug Fixes
- Fix
ConstrainedQuadraticModel.from_discrete_quadratic_model()
incorrectly formulating the discrete constraints. This bug was
introduced in version 0.12.7. - Fix
dimod.generators.frustrated_loop()
to correctly handle graphs with tuple labels. See #1342.
0.12.8rc2
Bug Fixes
- Fix loading constrained quadratic models that are serialized with CQM serialization version 2.0 and that have tuple labels.
- Support serializing constraints that need more than 2GB to save.
0.12.8rc1
Fixes
- Fix
ConstrainedQuadraticModel.from_discrete_quadratic_model()
incorrectly formulating the discrete constraints. This bug was introduced in version 0.12.7.
0.12.8rc0
New Features
- Implement version 2.0 of constrained quadratic model serialization. See
ConstrainedQuadraticModel.to_file()
for details.
Upgrade Notes
- Remove the
ObjectView.to_file()
method. - Remove the
ConstraintView.to_file()
method.
0.12.7
New Features
- Implement
CaseLabelDQM.to_file()
when the keyword argumentignore_labels
is true. Also make the error message clearer in the case thatignore_labels
is false. - Improve the performance of
ConstrainedQuadraticModel.from_discrete_quadratic_model()
.
Upgrade Notes
- Make the arguments of
DiscreteQuadraticModel.to_file()
keyword-only.
0.12.6
New Features
- Add
dimod::Constraint::clear()
C++ method.
0.12.5
New Features
-
Add
dimod::ConstrainedQuadraticModel::constraints()
method that returns a view of the constraints that is easily iterated over. -
Improve the performance of fixing and removing variables from constrained quadratic model expressions.
-
Implement the
Expression::fix_variable()
C++ method. Previously it would throwstd::logic_error("not implemented - fix_variable")
. -
Improve the performance of
ConstrainedQuadraticModel.fix_variable()
andConstrainedQuadraticModel.fix_variables()
. -
Add
inplace
keyword argument toConstrainedQuadraticModel.fix_variables()
.
Upgrade Notes
-
Add an overload to the C++
QuadraticModel::remove_variable()
method. This is binary compatible, but it makes&remove_variable
ambiguous. -
The
ConstrainedQuadraticModel.fix_variables()
function now returns aConstrainedQuadraticModel
rather than an empty dictionary. -
Change
lp.load()
andlp.loads()
to raise aValueErrorr
rather than aRuntimeError
when given an invalid file format. -
Make
beta_range
,num_reads
, andnum_sweeps
keyword-only arguments forSimulatedAnnealingSampler.sample()
. -
Make
num_reads
andseed
keyword-only arguments forRandomSampler.sample()
. -
Make
initial_states
,initial_states_generator
,num_reads
andseed
keyword-only arguments forIdentitySampler.sample()
. -
Make
rtol
andatol
keyword-only arguments forExactCQMSolver.sample_cqm()
.
Bug Fixes
- Fix
lp.load()
andlp.loads()
functions to correctly handle maximization objectives. See #1321.
0.12.4
New Features
- Improve the performance of the
ConstrainedQuadraticModel.add_variables()
method.
- Allow discrete constraints added by
ConstrainedQuadraticModel.add_discrete()
to have zero or one variables.
Upgrade Notes
- Remove the undocumented
cyConstrainedQuadraticModel.add_variable()
method.
Bug Fixes
- Fix
ConstrainedQuadraticModel.add_variable()
to raise aValueError
when given an inconsistent variable type. Previously it incorrectly raised aTypeError
.
- Fix
ConstrainedQuadraticModel.add_variable()
to raise aValueError
when given invalid variable bounds.
0.12.3
New Features
- Add
compress
keyword argument toConstrainedQuadraticModel.to_file()
.
- Add
ConstraintView.set_weight()
method. This allows users to set the weight of existing constraints.
Upgrade Notes
- When the constraint is hard,
ConstraintView.penalty()
now returnsNone
. Previously it would return either'linear'
or'quadratic'
.
Bug Fixes
- Fix the
copy
keyword argument ofConstrainedQuadraticModel.add_constraint_from_model()
. Previously it would always make a copy.
- Add missing
#include
indimod/include/dimod/abc.h
.
- Fix
ConstrainedQuadraticModel.add_constraint_from_iterable()
to no longer raise aNotImplementedError
when given a weight.
- Fix
ConstrainedQuadraticModel.add_constraint()
to raise aValueError
rather than aNotImplementedError
when given an invalid penalty.
0.12.2
New Features
- Implement
Expression::remove_variable()
method in the C++ code.
- Implement
Expression.remove_variable()
method in the Python code.
- Add
dimod/libcpp/expression.pxd
anddimod/libcpp/constraint.pxd
.