Release Notes¶
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()
.
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
.
0.12.1¶
Bug Fixes¶
Add the ability to set offsets on
ObjectiveView
andConstraintView
. This was previously removed in dimod 0.12.0. See #1287
Add
ObjectiveView.add_linear_from()
andConstraintView.add_linear_from()
methods. These were previously removed in dimod 0.12.0.
Add
ObjectiveView.add_variable()
andConstraintView.add_variable()
methods. These were previously removed in dimod 0.12.0.
0.12.0¶
Bug Fixes¶
Fix constrained quadratic model serialziation to correctly encode all variables in the objective.
0.12.0rc1¶
Deprecation Notes¶
Deprecate the
cascade
keyword argument inConstrainedQuadraticModel.fix_variable()
.
Deprecate the
cascade
keyword argument inConstrainedQuadraticModel.fix_variables()
.
0.12.0.dev3¶
New Features¶
Add C++
dimod::ConstrainedQuadraticModel
class.
Add C++
ConstrainedQuadraticModel.add_constraint()
overload that allows a user to move a binary quadratic model or quadratic model as a constraint.
Add C++
ConstrainedQuadraticModel.constraint_weak_ptr()
method.
Make
BinaryQuadraticModel.vartype
callable. This allows for more uniform syntax between binary quadratic models, quadratic models and constrained quadratic models.
Replace current
ConstrainedQuadraticModel
implementation with one implemented in Cython.
Add
ConstrainedQuadraticModel.clear()
method.
Bug Fixes¶
Fix a performance regression introduced in 0.10.0 when loading linear binary quadratic models from files.
Fix the handling of self-loops in
dimod::Expression::add_quadratic()
and similar methods.
Fix C++
ConstrainedQuadraticModel.remove_variable()
method. Previously it would segmentation fault.
0.12.0.dev0¶
Prelude¶
The entire C++ library has been rewritten for performance and consistency.
New Features¶
New
dimod::abc::QuadraticModelBase
abstract base class.
Better performance for linear models.
Add
dimod.cyqmbase.cyQMBase_template
Cython class to serve as an abstract base class for Cython quadratic models.
Break
dimod/libcpp.pxd
into a full Cython subpackage to mirror the structure underdimod/include/
. This allows for better organization, and less need to recompile all Cython files when changing parts of the C++ library. Packages that depend on dimod are still encouraged to use thefrom dimod.libcpp cimport ...
syntax.
Build wheels for Python 3.11.
Upgrade Notes¶
Rewrite
dimod::QuadraticModelBase
and move it todimod::abc::QuadraticModelBase
inabc.h
.
Move
dimod::Vartype
,dimod::vartype_info
, anddimod::vartype_limits` to ``vartypes.h
.
Remove the
dimod::Neighborhood
class.
Remove
iterators.h
.
Move
dimod::BinaryQuadraticModel
tobinary_quadratic_model.h
.
Remove
dimod.binary.cybqm.cyBQMBase
class.
Remove
dimod.quadratic.cyqm.cyQMBase
class.
Build
manylinux2014
wheels. Previously we builtmanylinux2010
.
Build
arm64
andx86_64
wheels for macos. Previously we builtx86_64
anduniversal2
.
0.11.6.dev2¶
Bug Fixes¶
Fix the type of soft constraint weights when loaded from files. The issue was introduced in 0.11.6.dev1.
0.11.6.dev1¶
Bug Fixes¶
Fix the performance of
ConstrainedQuadraticModel.from_file()
for constrained quadratic models with a large number of constraints. The poor performanc was accidentally introduced in 0.11.6.dev0.
0.11.6.dev0¶
New Features¶
Add
Variables._remove()
method.
Added
weight
and penalty parameters onConstrainedQuadraticModel.add_constraint
methods to encoded weighted constraints.
Add constrained quadratic model serialization version 1.3 to support soft constraints.
0.11.5¶
New Features¶
Add
ConstrainedQuadraticModel.is_linear()
method.
Add
ConstrainedQuadraticModel.spin_to_binary()
method.
Add
Variables._clear()
method for use by classes that haveVariables
as an attribute.
Add C++
dimod::QuadraticModel::clear()
method.
Add C++
dimod::BinaryQuadraticModel::clear()
method.
Add
QuadraticModel.clear()
method.
Add
BinaryQuadraticModel.clear()
method.
Add typing support for the
dimod.variables.Variables
class. See #1221.
Bug Fixes¶
Fix
as_samples()
when given aSampleSet
and using thelabels_type
keyword argument. Previously it would raise aTypeError
. This fix allows constructions likebqm.energies(sampleset)
to function correctly.
Refactor
dimod.typing.SamplesLike
anddimod.typing.SampleLike
.SampleLike
now correctly includes constructions like([0, 1], 'ab')
.
Make
Vartype.INTEGER
andVartype.REAL
pickleable. This fixes the pickling of many downstream objects likeQuadraticModel
andSampleSet
.
0.11.4¶
New Features¶
Add
ConstrainedQuadraticModel.__str__()
method. See #1188.
Speed up the construction of Variables objects from a range or another Variables.
Add optional keyword argument
labels_type
to theas_samples()
function.
Speed up
BinaryQuadraticModel.energies()
andQuadraticModel.energies()
in cases where the model has a small subset of the variables in the samples.
Speed up
SampleSet.from_samples_cqm()
in cases where there are constraints with a small number of variables relative to the objective.
0.11.3¶
New Features¶
Add
dimod::QuadraticModelBase::energy()
method todimod/libcpp.pxd
for Cython access.
Randomly generated variable and constraint labels now begin with a letter and do not contain dashes. This ensures that they can be serialized to LP files. See #1206.
Bug Fixes¶
Fix
dimod.lp.dump()
anddimod.lp.dumps()
to output bounds for REAL variables.
0.11.2¶
New Features¶
Add
dimod.lp.dump()
anddimod.lp.dumps()
functions to encode constrained quadratic models as LP files.
Expand supported NumPy version range to
numpy>=1.17.3,<2.0.0
Build with oldest-supported-numpy for compatibility. See #208.
Add
plant_solution
keyword argument todimod.generators.random_nae3sat()
,dimod.generators.random_2in4sat()
anddimod.generators.frustrated_loop
functions. Add
Add
dimod::QuadraticModel::add_quadratic_back()
anddimod::BinaryQuadraticModel::add_quadratic_back()
methods in C++ code.
Improve the performance of
QuadraticModel.from_file()
, which also improves the performance ofConstrainedQuadraticModel.from_file()
.
Deprecation Notes¶
Deprecated
planted_solution
keyword argument indimod.generators.frustrated_loop()
.
0.11.1¶
New Features¶
Add
dimod.generators.random_nae3sat()
function for generating not-all-equal 3-satisfiability problems as binary quadratic models.
Add
dimod.generators.random_2in4sat()
function for generating 2-in-4 satisfiability problems as binary quadratic models.
Bug Fixes¶
Drop pyparsing dependency. The functionality that required it was removed in version 0.11.0.
Added missing import of
BinaryQuadraticModel
required bydimod.serialization.json.DimodDecoder
0.11.0¶
New Features¶
Add the ability to specify a default variable type and bounds for missing variables when calling
QuadraticModel.add_linear()
andQuadraticModel.add_linear_from()
.
Add
QuadraticModel::swap()
andBinaryQuadraticModel::swap()
methods to the C++ code. See #928.
Add
lp.loads()
andlp.load()
functions.
Improve the performance of the
ConstrainedQuadraticModel.from_lp_file()
method.
Improve the performance of iteration over
Variables
objects.
Upgrade Notes¶
Drop support for Numpy 1.19
Some malformed LP-files that previously caused
ConstrainedQuadraticModel.from_lp_file()
to emit a warning now raise an error instead.
Provide
manylinux2014
wheels for Python 3.10 rather thanmanylinux2010
.
Deprecation Notes¶
Deprecate
ConstrainedQuadraticModel.from_lp_file()
method. Users should use the more explicitlp.loads()
andlp.load()
functions instead. TheConstrainedQuadraticModel.from_lp_file()
will be removed in dimod 0.13.0.
The
default_lower_bounds
anddefault_upper_bounds
keyword arguments forConstrainedQuadraticModel.from_lp_file()
are deprecated and do nothing.
Bug Fixes¶
In the cqm_to_bqm function, set the Lagrange multiplier to one if the maximum absolute bias is zero.
dimod.variables.Variables
objects now correctly raise anIndexError
when given negative indices that are out of range.
0.10.17¶
New Features¶
Add
BinaryQuadraticModel::lower_bound()
andBinaryQuadraticModel::upper_bound()
methods to the C++ code.
Improve the performance of the
QuadraticModel.update()
method.
Improve the performance of the
ConstrainedQuadraticModel.set_objective()
method.
QuadraticModel.update()
now accepts binary quadratic models in addition to quadratic models.
Add
QuadraticModel.add_variables_from_model()
method. See #1157.
0.11.0rc1¶
Prelude¶
Add support for real-valued variables.
New Features¶
Improved deprecation warnings and documentation. See #192.
Add C++
Vartype::REAL
, a new variable type for real-valued variables.
Support variables with
Vartype::REAL
in C++QuadraticModel
.
Add
Vartype.REAL
, a new variable type for real-valued variables.
Add
Real()
andReals()
functions for creating quadratic models with a single real-valued variable.
Support variables with
Vartype.REAL
inQuadraticModel
.
ConstrainedQuadraticModel.to_file()
now uses serialization format 1.2. This format is backwards compatibile.
Add
vartype
andlinear_only
arguments toConstrainedQuadraticModel.num_biases()
.
Add
vartype
andinclude_objective
arguments toConstrainedQuadraticModel.num_quadratic_variables()
.
Add
check_header
keyword-only argument toConstrainedQuadraticModel.from_file()
.
Add a global flag
dimod.REAL_INTERACTIONS
. When this flag is set toFalse
, variables with variable typeVartype.REAL
cannot have interactions.dimod.REAL_INTERACTIONS
is set toFalse
by default.
Upgrade Notes¶
Remove
.vartypes
,.lower_bounds
, and.upper_bounds
attributes fromConstrainedQuadraticModel.variables
. These were previously deprecated in dimod 0.10.6.
Remove
.vartype()
method fromConstrainedQuadraticModel.variables
. It was previously deprecated in dimod 0.10.6.
Remove
bqm_index_labelled_input
decorator. It was previously deprecated in dimod 0.10.8.
Remove
SampleSet.is_writeable
attribute.
Remove
dimod.generators.knapsack()
. It was previously deprecated in dimod 0.10.6.
Remove
dimod.generators.multi_knapsack()
. It was previously deprecated in dimod 0.10.6.
Remove
dimod.generators.bin_packing()
. It was previously deprecated in dimod 0.10.6.
Remove
HigherOrderComposite.sample_ising()
method. It was previously scheduled to be removed in dimod 0.10.0.
Remove
PolySampler.sample()
,PolySampler.sample_ising()
, andPolySampler.sample_qubo()
methods. These were previously scheduled to be removed in dimod 0.10.0.
AdjVectorBQM
andAdjDictBQM
are now aliases forBinaryQuadraticModel
andDictBQM
respectively rather than having their own implementation with a slightly different API. They were previously deprecated in dimod 0.10.0.
The
dimod.bqm
namespace has been removed.
The
dimod.core.bqm
namespace has been removed.
dimod::AdjVectorBQM
has been removed from the C++ code.
Some composites were migrated to dwave-preprocessing in dimod0.10.0. Trying to import and use these composites from dimod now raises an exception rather than a warning. The affected composites:
ClipComposite
ConnectedComponentsComposite
FixedVariableComposite
RoofDualityComposite
ScaleComposite
SpinReversalTransformComposite
The
fix_variables()
was migrated to dwave-preprocessing in dimod 0.10.0. Trying to import and use it now raises an exception rather than a warning.
Packages that require binary compatibility with dimod and that were compiled with 0.10.0 will not work with 0.11.0.
Deprecation Notes¶
Deprecate support for the
ConstrainedQuadraticModel.add_variable(v, vartype)
argument order. UseConstrainedQuadraticModel.add_variable(vartype, v)
instead. See #969.
In the future,
ConstrainedQuadraticModel.num_quadratic_variables()
will also include the objective towards the count by default.