Recent Releases of dimod
dimod - 0.12.19
New Features
- Use
dictrather thancollections.OrderedDictto capture the inputs inTrackingComposite. See also #1395. - Add
dimod.Scopedabstract base class for components that allocate scope-bound resources. - Implement
dimod.Scopedinterface ondimod.Sampleranddimod.Composite. See dwave-system#555. - Add
quadratic_multi_knapsackgenerator function todimod.generators.
- Python
Published by arcondello over 1 year ago
dimod - 0.12.18
New Features
- Add
SampleSet.wait_id()as a proxy to the underlying QPU result future, when sample set is constructed from such a future. See #1392. - Add
multi_knapsack()generator function todimod.generators. - Add
quadratic_knapsack()generator function todimod.generators.
Upgrade Notes
- Drop support for Python 3.8.
Bug Fixes
- Fix warnings caused by using deprecated type aliases.
- Python
Published by arcondello over 1 year ago
dimod - 0.12.17
New Features
- Allow
BinaryQuadraticModel.contract_variables()to contract variables without an interaction. Previously it raised aValueError. - Add
power_r()generator function todimod.generators. The weights of the generated Ising problems follow a power-law distribution with respect to their magnitude. - Add
bin_packinggenerator function todimod.generators. - Add
labelskeyword argument toConstrainedQuadraticModel.iter_constraint_data()andConstrainedQuadraticModel.iter_violations()methods. Thelabelskeyword argument allows a user to generate the data/violations for a subset of the constraints. See #1381. - Add
knapsackgenerator function todimod.generators. - Support Python 3.13.
- Add
quadratic_assignmentgenerator function todimod.generators.
- Python
Published by arcondello almost 2 years ago
dimod - 0.12.16
New Features
- Add
dimod/typing.pdx. This allows users tocimportcommon C types into other namespaces. - Support NumPy 2.0. Also, no longer require NumPy at build-time.
- Reduce the size of manylinux wheels.
Upgrade Notes
- Remove Cython fused types
dimod.cyutilities.SignedInteger,dimod.cyutilities.UnsignedInteger,dimod.cyutilities.Integer, anddimod.cyutilities.ConstInteger,dimod.cyutilities.Numeric, anddimod.cyutilities.ConstNumeric. Use the types indimod.typinginstead. - Remove Cython fused types
dimod.discrete.cydiscrete_quadratic_model.Unsigned,dimod.discrete.cydiscrete_quadratic_model.Integral32plus,dimod.discrete.cydiscrete_quadratic_model.Numeric, anddimod.discrete.cydiscrete_quadratic_model.Numeric32plus. Use the types indimod.typinginstead. - Don\'t include debug info in built
.sofiles.
- Python
Published by arcondello about 2 years ago
dimod - 0.12.15
New Features
- Add C++
QuadraticModelBase::remove_interactions()method. - Add
dimod.generators.random_binary_paint_shop_problem()binary paint shop problem generator. - Add an abstract method
QuadraticViewsMixin.add_quadratic(). - Add a method
QuadraticViewsMixin.add_quadratic_from()to add quadratic interactions. This method is intended to be used as follows:ConstrainedQuadraticModel.objective.add_quadratic_from(), similarly toConstrainedQuadraticModel.objective.add_linear_from(). - Add
check_overlapskeyword argument toConstrainedQuadraticModel.add_discrete(), see #1364.
Upgrade Notes
- All sublcasses of
QuadraticViewsMixin, includingObjectiveView,QuadraticModelandBinaryQuadraticModel, now require to have the methodadd_quadratic().
- Python
Published by arcondello about 2 years ago
dimod - 0.12.11
New Features
Make
SampleSet.relabel_variables()non-blocking in all cases. Previously it would block wheninplace=False.Implement
SampleSetserialization schema version 3.2.0.Version 3.2.0 replaces
floatvalues that represent integers withintin the"data"field of any arrays returned bySampleSet.to_serializable(). In some pathological cases this can result in a much smaller representation when the data dictionaries are json-serialized by avoiding the redundant.0appended to every value.This is a backwards-compatible change.
Add
penalization_methodparameter toBinaryQuadraticModel.add_linear_inequality_constraint(). It allows the use of unbalanced penalization https://arxiv.org/abs/2211.13914 instead of the slack variables method for the inequality constraints.
Bug Fixes
- Fix the behavior of
SampleSet.relabel_variables()wheninplace=True. Previously the method incorrectly returned a copy when the sample set was unresolved.
- Python
Published by arcondello almost 3 years ago
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=2as 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::lpC++ 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.
- Python
Published by arcondello about 3 years ago
dimod - 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.
- Python
Published by arcondello about 3 years ago
dimod - 0.12.7
New Features
- Implement
CaseLabelDQM.to_file()when the keyword argumentignore_labelsis true. Also make the error message clearer in the case thatignore_labelsis false. - Improve the performance of
ConstrainedQuadraticModel.from_discrete_quadratic_model().
Upgrade Notes
- Make the arguments of
DiscreteQuadraticModel.to_file()keyword-only.
- Python
Published by arcondello about 3 years ago
dimod - 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
inplacekeyword argument toConstrainedQuadraticModel.fix_variables().
Upgrade Notes
Add an overload to the C++
QuadraticModel::remove_variable()method. This is binary compatible, but it makes&remove_variableambiguous.The
ConstrainedQuadraticModel.fix_variables()function now returns aConstrainedQuadraticModelrather than an empty dictionary.Change
lp.load()andlp.loads()to raise aValueErrorrrather than aRuntimeErrorwhen given an invalid file format.Make
beta_range,num_reads, andnum_sweepskeyword-only arguments forSimulatedAnnealingSampler.sample().Make
num_readsandseedkeyword-only arguments forRandomSampler.sample().Make
initial_states,initial_states_generator,num_readsandseedkeyword-only arguments forIdentitySampler.sample().Make
rtolandatolkeyword-only arguments forExactCQMSolver.sample_cqm().
Bug Fixes
- Fix
lp.load()andlp.loads()functions to correctly handle maximization objectives. See #1321.
- Python
Published by arcondello about 3 years ago
dimod - 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 aValueErrorwhen given an inconsistent variable type. Previously it incorrectly raised aTypeError.
- Fix
ConstrainedQuadraticModel.add_variable()to raise aValueErrorwhen given invalid variable bounds.
- Python
Published by arcondello over 3 years ago
dimod - 0.12.3
New Features
- Add
compresskeyword 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
copykeyword argument ofConstrainedQuadraticModel.add_constraint_from_model(). Previously it would always make a copy.
- Add missing
#includeindimod/include/dimod/abc.h.
- Fix
ConstrainedQuadraticModel.add_constraint_from_iterable()to no longer raise aNotImplementedErrorwhen given a weight.
- Fix
ConstrainedQuadraticModel.add_constraint()to raise aValueErrorrather than aNotImplementedErrorwhen given an invalid penalty.
- Python
Published by arcondello over 3 years ago
dimod - 0.12.1
Bug Fixes
- Add the ability to set offsets on
ObjectiveViewandConstraintView. 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.
- Python
Published by arcondello over 3 years ago
dimod - 0.12.0
Prelude
The entire C++ library has been rewritten for performance and consistency.
New Features
- New
dimod::abc::QuadraticModelBaseabstract base class.
- Better performance for linear models.
- Add
dimod.cyqmbase.cyQMBase_templateCython class to serve as an abstract base class for Cython quadratic models.
- Break
dimod/libcpp.pxdinto 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.
Add C++
dimod::ConstrainedQuadraticModelclass.
- 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.vartypecallable. This allows for more uniform syntax between binary quadratic models, quadratic models and constrained quadratic models.
- Replace current
ConstrainedQuadraticModelimplementation 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.
Upgrade Notes
- Rewrite
dimod::QuadraticModelBaseand move it todimod::abc::QuadraticModelBaseinabc.h.
- Move
dimod::Vartype,dimod::vartype_info, anddimod::vartype_limits` tovartypes.h``.
- Remove the
dimod::Neighborhoodclass.
- Remove
iterators.h.
- Move
dimod::BinaryQuadraticModeltobinary_quadratic_model.h.
- Remove
dimod.binary.cybqm.cyBQMBaseclass.
- Remove
dimod.quadratic.cyqm.cyQMBaseclass.
- Build
manylinux2014wheels. Previously we builtmanylinux2010.
- Build
arm64andx86_64wheels for macos. Previously we builtx86_64anduniversal2.
Deprecation Notes
- Deprecate the
cascadekeyword argument inConstrainedQuadraticModel.fix_variable().
- Deprecate the
cascadekeyword argument inConstrainedQuadraticModel.fix_variables().
- Python
Published by arcondello over 3 years ago
dimod - 0.12.0.dev3
Fixes
- Fix C++
ConstrainedQuadraticModel.remove_variable()method. Previously it would segmentation fault.
- Python
Published by arcondello over 3 years ago
dimod - 0.12.0.dev1
New Features
- Add C++
dimod::ConstrainedQuadraticModelclass.
- Make
BinaryQuadraticModel.vartypecallable. This allows for more uniform syntax between binary quadratic models, quadratic models and constrained quadratic models.
- Replace current
ConstrainedQuadraticModelimplementation with one implemented in Cython.
- Python
Published by arcondello over 3 years ago
dimod - 0.11.6
New Features
- Add
Variables._remove()method.
- Added
weightand penalty parameters onConstrainedQuadraticModel.add_constraintmethods to encoded weighted constraints.
- Add constrained quadratic model serialization version 1.3 to support soft constraints.
- Python
Published by arcondello over 3 years ago
dimod - 0.12.0.dev0
Prelude
The entire C++ library has been rewritten for performance and consistency.
New Features
- New
dimod::abc::QuadraticModelBaseabstract base class.
- Better performance for linear models.
- Add
dimod.cyqmbase.cyQMBase_templateCython class to serve as an abstract base class for Cython quadratic models.
- Break
dimod/libcpp.pxdinto 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::QuadraticModelBaseand move it todimod::abc::QuadraticModelBaseinabc.h.
- Move
dimod::Vartype,dimod::vartype_info, anddimod::vartype_limits` tovartypes.h``.
- Remove the
dimod::Neighborhoodclass.
- Remove
iterators.h.
- Move
dimod::BinaryQuadraticModeltobinary_quadratic_model.h.
- Remove
dimod.binary.cybqm.cyBQMBaseclass.
- Remove
dimod.quadratic.cyqm.cyQMBaseclass.
- Build
manylinux2014wheels. Previously we builtmanylinux2010.
- Build
arm64andx86_64wheels for macos. Previously we builtx86_64anduniversal2.
- Python
Published by arcondello over 3 years ago
dimod - 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.
- Python
Published by arcondello almost 4 years ago
dimod - 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.
- Python
Published by arcondello almost 4 years ago
dimod - 0.11.6.dev0
New Features
- Add
Variables._remove()method.
- Added
weightand penalty parameters onConstrainedQuadraticModel.add_constraintmethods to encoded weighted constraints.
- Add constrained quadratic model serialization version 1.3 to support soft constraints.
- Python
Published by arcondello almost 4 years ago
dimod - 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 haveVariablesas 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.Variablesclass. See #1221.
Bug Fixes
- Fix
as_samples()when given aSampleSetand using thelabels_typekeyword argument. Previously it would raise aTypeError. This fix allows constructions likebqm.energies(sampleset)to function correctly.
- Refactor
dimod.typing.SamplesLikeanddimod.typing.SampleLike.SampleLikenow correctly includes constructions like([0, 1], 'ab').
- Make
Vartype.INTEGERandVartype.REALpickleable. This fixes the pickling of many downstream objects likeQuadraticModelandSampleSet.
- Python
Published by arcondello almost 4 years ago
dimod - 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_typeto 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.
- Python
Published by arcondello almost 4 years ago
dimod - 0.11.3
New Features
- Add
dimod::QuadraticModelBase::energy()method todimod/libcpp.pxdfor 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.
- Python
Published by arcondello about 4 years ago
dimod - 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_solutionkeyword argument todimod.generators.random_nae3sat(),dimod.generators.random_2in4sat()anddimod.generators.frustrated_loopfunctions.
- 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_solutionkeyword argument indimod.generators.frustrated_loop().
Bug Fixes
- Fix a performance regression to
QuadraticModel.add_linear_from()introduced by #1170 as part of the 0.11.0 release.
- Python
Published by arcondello about 4 years ago
dimod - 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
BinaryQuadraticModelrequired bydimod.serialization.json.DimodDecoder
- Python
Published by arcondello about 4 years ago
dimod - 0.11.0
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::REALin 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.REALinQuadraticModel.
-
ConstrainedQuadraticModel.to_file()now uses serialization format 1.2. This format is backwards compatibile.
- Add
vartypeandlinear_onlyarguments toConstrainedQuadraticModel.num_biases().
- Add
vartypeandinclude_objectivearguments toConstrainedQuadraticModel.num_quadratic_variables().
- Add
check_headerkeyword-only argument toConstrainedQuadraticModel.from_file().
- Add a global flag
dimod.REAL_INTERACTIONS. When this flag is set toFalse, variables with variable typeVartype.REALcannot have interactions.dimod.REAL_INTERACTIONSis set toFalseby default.
- 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
Variablesobjects.
Upgrade Notes
- Remove
.vartypes,.lower_bounds, and.upper_boundsattributes 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_inputdecorator. It was previously deprecated in dimod 0.10.8.
- Remove
SampleSet.is_writeableattribute.
- 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.
-
AdjVectorBQMandAdjDictBQMare now aliases forBinaryQuadraticModelandDictBQMrespectively rather than having their own implementation with a slightly different API. They were previously deprecated in dimod 0.10.0.
- The
dimod.bqmnamespace has been removed.
- The
dimod.core.bqmnamespace has been removed.
-
dimod::AdjVectorBQMhas 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.
- 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
manylinux2014wheels for Python 3.10 rather thanmanylinux2010.
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.
- 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_boundsanddefault_upper_boundskeyword arguments forConstrainedQuadraticModel.from_lp_file()are deprecated and do nothing.
Bug Fixes
- Fixes performance regression on energy calculations introduced in 0.10.0. See #1025
- In the cqmtobqm function, set the Lagrange multiplier to one if the maximum absolute bias is zero.
-
dimod.variables.Variablesobjects now correctly raise anIndexErrorwhen given negative indices that are out of range.
- Python
Published by arcondello about 4 years ago
dimod - 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.
- Python
Published by arcondello about 4 years ago
dimod - 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::REALin 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.REALinQuadraticModel.
-
ConstrainedQuadraticModel.to_file()now uses serialization format 1.2. This format is backwards compatibile.
- Add
vartypeandlinear_onlyarguments toConstrainedQuadraticModel.num_biases().
- Add
vartypeandinclude_objectivearguments toConstrainedQuadraticModel.num_quadratic_variables().
- Add
check_headerkeyword-only argument toConstrainedQuadraticModel.from_file().
- Add a global flag
dimod.REAL_INTERACTIONS. When this flag is set toFalse, variables with variable typeVartype.REALcannot have interactions.dimod.REAL_INTERACTIONSis set toFalseby default.
Upgrade Notes
- Remove
.vartypes,.lower_bounds, and.upper_boundsattributes 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_inputdecorator. It was previously deprecated in dimod 0.10.8.
- Remove
SampleSet.is_writeableattribute.
- 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.
-
AdjVectorBQMandAdjDictBQMare now aliases forBinaryQuadraticModelandDictBQMrespectively rather than having their own implementation with a slightly different API. They were previously deprecated in dimod 0.10.0.
- The
dimod.bqmnamespace has been removed.
- The
dimod.core.bqmnamespace has been removed.
-
dimod::AdjVectorBQMhas 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.
Bug Fixes
- Fixes performance regression on energy calculations introduced in 0.10.0. See #1025
- Python
Published by arcondello over 4 years ago
dimod - 0.10.16
New Features
- Add
SampleSet.from_samples_cqm()method.
Bug Fixes
-
ExactCQMSolver.sample_cqmnow usesSampleSet.from_samples_cqm. This corrects a small error in the calculation of constraint satisfaction.
-
dimod.generators.random_knapsack()anddimod.generators.random_bin_packing()no longer use a fixed seed by default.
-
ConstrainedQuadraticModel.add_discrete(),ConstrainedQuadraticModel.add_constraint_from_iterable(), andConstrainedQuadraticModel.add_discrete_from_model()now correctly raise an error when given a binary variable that overlaps with an existing discrete constraint. See #1149.
-
SampleSet.from_samples_bqmnow handles empty list input correctly.
- Python
Published by arcondello over 4 years ago
dimod - 0.11.0rc0
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::REALin 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.REALinQuadraticModel.
-
ConstrainedQuadraticModel.to_file()now uses serialization format 1.3. This format is backwards compatibile.
- Add
vartypeandlinear_onlyarguments toConstrainedQuadraticModel.num_biases().
- Add
vartypeandinclude_objectivearguments toConstrainedQuadraticModel.num_quadratic_variables().
Upgrade Notes
- Remove
.vartypes,.lower_bounds, and.upper_boundsattributes 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_inputdecorator. It was previously deprecated in dimod 0.10.8.
- Remove
SampleSet.is_writeableattribute.
- 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.
-
AdjVectorBQMandAdjDictBQMare now aliases forBinaryQuadraticModelandDictBQMrespectively rather than having their own implementation with a slightly different API. They were previously deprecated in dimod 0.10.0.
- The
dimod.bqmnamespace has been removed.
- The
dimod.core.bqmnamespace has been removed.
-
dimod::AdjVectorBQMhas 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
- In the future,
ConstrainedQuadraticModel.num_quadratic_variables()will also include the objective towards the count by default.
Bug Fixes
- Fixes performance regression on energy calculations introduced in 0.10.0. See #1025
- Python
Published by arcondello over 4 years ago
dimod - 0.10.15
Deprecation Notes
- Deprecate
clsparameter indimod.serialization.coo.load()anddimod.serialization.coo.loads().
Bug Fixes
- Fix energy calculations for quadratic models with squared terms. See #1136.
-
dimod.serialization.fileview.load()now correctly propagatesKeyErrorfrom the loading function.
- Python
Published by arcondello over 4 years ago
dimod - 0.11.0.dev0
Prelude
Add support for real-valued variables.
New Features
- Add C++
Vartype::REAL, a new variable type for real-valued variables.
- Support variables with
Vartype::REALin 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.REALinQuadraticModel.
-
ConstrainedQuadraticModel.to_file()now uses serialization format 1.3. This format is backwards compatibile.
- Add
vartypeandlinear_onlyarguments toConstrainedQuadraticModel.num_biases().
- Add
vartypeandinclude_objectivearguments toConstrainedQuadraticModel.num_quadratic_variables().
Deprecation Notes
- In the future,
ConstrainedQuadraticModel.num_quadratic_variables()will also include the objective towards the count by default.
- Python
Published by arcondello over 4 years ago
dimod - 0.10.14
New Features
- Add
Polynomialtodimod.typing.
- Add
Comparison.to_polystring()method.
- Printing
Comparisonobjects now returns an equation representation of the comparison as a string.
- Add
ConstrainedQuadraticModel.relabel_constraints()method. See #1066.
- Add
ConstrainedQuadraticModel.remove_constraint()method. See #1104.
Add methods to report memory usage of quadratic models:
- Add
QuadraticModel.nbytes()method. - Add
BinaryQuadraticModel.nbytes()method. - Add
QuadraticModel::nbytes()method to C++ the code. - Add
BinaryQuadraticModel::nbytes()method to C++ the code.
See #668
- Add
Deprecation Notes
- Deprecate
clsparameter indimod.generators.random.gnm_random_bqm(),dimod.generators.random.gnp_random_bqm(),dimod.generators.random.uniform(),dimod.generators.random.ran_r(),dimod.generators.random.randint(), anddimod.generators.random.doped().
Bug Fixes
-
Comparison.__repr__()now correctly returns a representation that can be passed toeval().
- Fix
dimod.typing.Biasto correctly excludenumpy.complexfloating.
- Attempting to relabel two model variables to the same target will now correctly raise a
ValueError. See #1110.
- Python
Published by arcondello over 4 years ago
dimod - 0.10.13
New Features
- Add
ConstrainedQuadraticModel.add_discrete_from_comparison()method.
- Add
ConstrainedQuadraticModel.add_discrete_from_iterable()method.
- Add
ConstrainedQuadraticModel.add_discrete_from_model()method.
-
ConstrainedQuadraticModel.add_discrete()now supports additional argument types.
- Add
QuadraticModel.flip_variable()method.
- Add
ConstrainedQuadraticModel.flip_variable()method.
- Support iterator inputs to
as_samples(). See #543.
- Add
SamplesLikeandSampleLiketodimod.typing. See #1008.
- Add
dimod::vartype_limitsto C++ code for compile-time information about variable types.
- Add
dimod::vartype_infoto C++ code for runtime information about variable types.
- Add
vartype_info()function.
-
BinaryQuadraticModel.resize()now returns the difference in the number of variables between the current and previous binary quadratic model. Previously it always returned 0. See #1091
- Add
BinaryQuadraticModel.maximum_energy_delta()method.
- Add
ConstrainedQuadraticModel.set_lower_bound()method. See #1105.
- Add
ConstrainedQuadraticModel.set_upper_bound()method. See #1105.
Upgrade Notes
-
as_samples()no longer always casts input sample values to integers.
-
QuadraticModel.energies()andBinaryQuadraticModel.energies()now return a NumPy array with dtypenp.float64be default. Previously they defaulted to match the dtype of the model.
- Bounds for integer variables are no longer rounded to the nearest int in
QuadraticModelandConstrainedQuadraticModel.
Deprecation Notes
- Deprecate support for a 2-tuple of
(dict, list)as a samples-like. E.g.({'a': 1, 'b': 0}, ['a', 'b'])is no longer supported.(array_like, labels)is still supported, as is a dictionary. Support will be removed in dimod 0.12.0.
Bug Fixes
-
QuadraticModel.energies()andBinaryQuadraticModel.energies()will return the correct energy when given samples with non-integer values.
- It is no longer possible to add an integer variables to a quadratic model with bounds that do not include at least one integer between them. E.g.
qm.add_variable('INTEGER', 'v', lower_bound=1.2, upper_bound=1.5)will now raise aValueError.
-
ConstrainedQuadraticModel.add_variable()now correctly raises an error when a variable is added twice with inconsistent bounds.
-
ConstrainedQuadraticModel.add_variable()now correctly returns the variable label when a variable is added twice.
- Python
Published by arcondello over 4 years ago
dimod - 0.10.12
New Features
- Add
cascadekeyword argument toConstrainedQuadraticModel.fix_variable()andConstrainedQuadraticModel.fix_variables(). These methods also now return any variables fixed using the cascade keyword argument.
- Add
QuadraticModel::swap_variables()andBinaryQuadraticModel::swap_variables()methods to the C++ code.
- Reintroduce
BinaryQuadraticModel.to_serializable()andBinaryQuadraticModel.from_serializable()methods that were previously removed in dimod 0.10.0, see #847.
Upgrade Notes
-
ConstrainedQuadraticModel.fix_variable()andConstrainedQuadraticModel.fix_variables()now raise aValueErrorif given a variable not in the model.
- Make
use_bytesandbytes_typekeyword-only arguments inBinaryQuadraticModel.to_serializable(). Note thatBinaryQuadraticModel.to_serializable()was removed in 0.10.0 but restored in 0.10.12.
- The
bias_dtypekeyword-only argument inBinaryQuadraticModel.to_serializable()now does nothing. Note thatBinaryQuadraticModel.to_serializable()was removed in 0.10.0 but restored in 0.10.12.
Bug Fixes
- Fix
QuadraticModel.fix_variable()to correctly update the vartypes and bounds of of variables that are not fixed.
- Fix
QuadraticModel.fix_variable()when fixing the last variable in the quadratic model. Previously it would incorrectly raise anAttributeError.
- Python
Published by arcondello over 4 years ago
dimod - 0.10.11
New Features
- Add
.fix_variable()and.fix_variables()methods toConstrainedQuadraticModel.
- Add
.fix_variable()and.fix_variables()methods toQuadraticModel.
- Add
QuadraticModel::resize()method in C++ code.
- Speed up printing sample sets with a large number of variables. See #1068.
- Add ability to pass a slice to
Variables.__getitem__. This allows for syntax likevariables[:5]which will return a newVariablesobject. See #1069.
- Add
BinaryQuadraticModel.iter_linear()method.
- Add
BinaryQuadraticModel.to_polystring()method.
- Add
QuadraticModel.iter_linear()method.
- Add
QuadraticModel.to_polystring()method.
- Introduces variable array methods
dimod.BinaryArray,dimod.SpinArray, anddimod.IntegerArray. These methods build numpy object arrays from their respective generator methodsdimod.Binaries,dimod.Spinsanddimod.Integers.
Upgrade Notes
-
QuadraticViewsMixinnow has.add_linear()as an abstract method.
-
BinaryQuadraticModel.fix_variable()no longer raises aValueErrorwhen given a value that does not match the variable type.
- Python 3.6 is no longer supported.
- NumPy 1.17 and 1.18 are no longer supported.
-
dimod.views.quadratic.QuadraticModelMixinnow has an abstract property.offset.
Bug Fixes
- Fix setting linear and quadratic biases on vartype views when the relevant variable or interaction does not already exist.
-
multiplcation_circuitnow adds the carry from the most significant column in a row into the most significant column of the next row.
- Python
Published by arcondello over 4 years ago
dimod - 0.10.10
Bug Fixes
- Fix energy calculation in binary quadratic models and quadratic models with no variables. Previously an empty sample would incorrectly raise an error.
-
bqm_structureddecorator now correctly raises aBinaryQuadraticModelStructureErrorerror in cases where nodes of the structured sampler do not include all BQM variables.
- Python
Published by arcondello over 4 years ago
dimod - 0.10.9
New Features
- You can now install
dwave-preprocessingas part of the dimod install withpip install dimod[all]
- Add
ConstrainedQuadraticModel.relabel_variables()method to relabel the variables in the objective and constraints.
- Add
drop_variables()andkeep_variables()functions that allow the user to create a new sample set from an old one, retaining only a subset of the variables.
- Backport the use of
dimod.views.quadratic.Adjacency,dimod.views.quadratic.Linear, anddimod.views.quadratic.Quadraticfor use with the deprecatedAdjVectorBQMandAdjDictBQMbinary quadratic model classes.
- Backport
iter_neighborhood(),reduce_linear(),reduce_neighborhood(), andreduce_quadratic()methods for use with the deprecatedAdjVectorBQMandAdjDictBQMbinary quadratic model classes.
Upgrade Notes
-
dwave-preprocessingis no longer a direct dependency. It can still be installed withpip install dimod[all].
Bug Fixes
- Fix instance and subclass testing between deprecated and modern binary quadratic model views. For example
instance(bqm.quadratic, dimod.core.bqm.BQMView)now returnsTruefor modern binary quadratic models.
- Python
Published by arcondello over 4 years ago
dimod - 0.10.8
New Features
- Add
ExactCQMSolverclass withsolve_cqmmethod to reference solvers.
- Add
multiplication_circuit(), a binary quadratic model generator for multiplication circuits.
- Add optional second parameter to
multiplication_circuit()enabling the multiplying arguments of different sizes.
-
dimod.testing.load_sampler_bqm_tests()now also tests the deprecated BQM subclasses, namelyAdjVectorBQMandAdjDictBQM.
- Return a named tuple from
BinaryQuadraticModel.to_numpy_vectors().
- Added
make_quadratic_cqm()- like make quadratic, but returns a CQM treating auxillary variable constraints as proper constraints instead of adding them to the objective.
- Add
independent_set,maximum_independent_set, andmaximum_weight_independent_setfunctions todimod.generators.
- Add official support for Python 3.10.
- Add
aarch64wheels for linux anduniversalwheels for osx.
- Added
reduce_binary_polynomial()that factors out a common basis formake_quadratic()and a futuremake_quadratic_cqm(). Given aBinaryPolynomialit return a list of reduced terms using auxillary variables and a list of constraints on them.
Deprecation Notes
- Deprecate
dimod.decorators.bqm_index_labelled_input()decorator.
Bug Fixes
- Fix
ConstrainedQuadraticModel.add_discrete()to correctly accept an iterator of variables as documented rather than instead requiring a collection.
- Fixed edge case bug when determining dtype in
as_sample().
- No longer throw a
TypeErrorfromConstrainedQuadraticModel.from_lp_filewhen adding a integer quadratic term from constraints.
- Binary quadratic models with
objectdata type now correctly support energy calculations where the given samples contain a superset of the variables in the model. This makes them consistent with binary quadratic models withnp.float32andnp.float64data types.
- Fix
BinaryQuadraticModel.add_linear_fromto work correctly with iterables. Beforelinearhad to be a mapping or (incorrectly) an iterator.
- Python
Published by arcondello over 4 years ago
dimod - 0.10.7
New Features
- Add
ConstrainedQuadraticModel.is_equal()andConstrainedQuadraticModel.is_almost_equal()methods. See #1012
- Add
QuadraticModel.is_almost_equal()method
- Support equality checks between quadratic models and binary quadratic models in
BinaryQuadraticModel.is_equal(),BinaryQuadraticModel.is_almost_equal(),QuadraticModel.is_equal(), andQuadraticModel.is_almost_equal()methods.
- Add
GraphLiketype hint todimod.typing.
- Add
ConstrainedQuadraticModel.iter_constraint_data(),ConstrainedQuadraticModel.iter_violations()andConstrainedQuadraticModel.violations()methods. See 971.
- Added
from_lp_fileclassmethod toConstrainedQuadraticModelthat reads input LP file and converts it to CQM instance.
-
ConstrainedQuadraticModel.set_objectivenow accepts an iterable.
- Add
ConstrainedQuadraticModel.check_feasiblemethod.
- Add
random_bin_packingfunction with the same functionality as the (now deprecated)bin_packing.
- Add
SampleSet.filter()method that returns a sample set with data rows filtered by a given predicate.
- Add
.to_dict()and.from_dict()methods to the sample inverter returned by thecqm_to_bqmfunction. The methods return a json serializable representation of the inversion for storage if needed. See 977.
- Add
random_multi_knapsackfunction with the same functionality as the (now deprecated)multi_knapsack.
- Add
random_knapsackfunction with the same functionality as the (now deprecated)knapsack.
- Allow the offset of a
BinaryQuadraticModelto be specified as a keyword argument.
Upgrade Notes
- The
clskeyword argument of thechimera_anticlusterfunction now does nothing.
Deprecation Notes
- Deprecate
clskeyword argument of thechimera_anticlusterfunction.
- Deprecate
bin_packingfunction in favour ofrandom_bin_packing.
- Deprecate
multi_knapsackfunction in favour ofrandom_multi_knapsack.
- Deprecate
knapsackfunction in favour ofrandom_knapsack.
Bug Fixes
-
QuadraticModelcan now be multiplied by a number in place.
- Fix energy calculations for integer variables with large values. See #982.
- Make
dimod.BinaryQuadraticModela virtual subclass ofdimod.core.bqm.BQM.
- Python
Published by arcondello almost 5 years ago
dimod - 0.9.16
Fixes
- Backport docs build fix for Sphinx 4. https://github.com/dwavesystems/dimod/pull/983
- Backport Python 3.5 support removal. https://github.com/dwavesystems/dimod/pull/985
- Backport dependence on dwave-preprocessing to fix dwave-system (>1.7.0) support of both dimod 0.9 and 0.10. https://github.com/dwavesystems/dimod/pull/981
- Python
Published by randomir almost 5 years ago
dimod - 0.10.6
New Features
- Add
Binaries,SpinsandIntegersfunctions. See #918.
- Add
DiscreteQuadraticModel.get_casesmethod to matchCaseLabelDQM.get_cases.
- Implement
QuadraticModel.remove_interactionmethod, previously it raised aNotImplementedErrorerror.
- Add
linearoption as a newslack_methodforDiscreteQuadraticModel.add_linear_inequality_constraintmethod. This will add only one discrete variable to an inequality constraint with linear number of cases, according to right hand side value of the constraint.
- Add
quicksumfunction for faster summation ofQuadraticModelandBinaryQuadraticModel. Python's built-insumcontinues to work, butquicksumwill generally be faster when adding many objects.
- Add a generator,
dimod.generators.binary_encoding, to create a binary quadratic model that encodes an integer.
Add methods to construct a constrained quadratic model from other model types:
-
ConstrainedQuadraticModel.from_discrete_quadratic_modelwith an aliasConstrainedQuadraticModel.from_dqm -
ConstrainedQuadraticModel.from_quadratic_modelwith two aliasesConstrainedQuadraticModel.from_qmandConstrainedQuadraticModel.from_bqm
See #866.
-
- Add
QuadraticModel.add_quadratic_from()method.
- Add
QuadraticModel.add_linear_from()method.
- Add
ConstrainedQuadraticModel.lower_bound()andConstrainedQuadraticModel.upper_bound()methods.
- Add
cqm_to_bqmfunction.
- Add
ConstrainedQuadraticModel.substitute_self_loopsmethod that replaces integer self-loops by introducing a new variable and adding a constraint.
- Add
copy_alwaysparameter toInitialized.parse_initial_states.
Add new binary quadratic model generators for simple logic gates:
-
dimod.generators.and_gate -
dimod.generators.fulladder_gate -
dimod.generators.halfadder_gate -
dimod.generators.or_gate -
dimod.generators.xor_gate
See #951.
-
-
QuadraticModel.energies,QuadraticModel.energy,BinaryQuadraticModel.energies, andBinaryQuadraticModel.energynow all support samples containing a superset of the variables in the model. Any variables not in the model are ignored when calculating the energy.
- Labels for
dimod.Spin,dimod.Binary, anddimod.Integerare no longer required positional arguments. By default, unique labels are applied via the uuid module.
Upgrade Notes
-
ConstrainedQuadraticModel.objectiveis now always aQuadraticModel. Previously it could either be aBinaryQuadraticModelor aQuadraticModel.
-
ConstrainedQuadraticModel.objectivenow contains all variables in the constrained quadratic model. Previously it could contain a subset of the variables.
Deprecation Notes
- Deprecate
ConstrainedQuadraticModel.variables.vartypes,ConstrainedQuadraticModel.variables.lower_bounds, andConstrainedQuadraticModel.variables.upper_boundsattributes.
- Deprecate
ConstrainedQuadraticModel.variables.vartype()method.
Bug Fixes
-
dimod::QuadraticModelBase.remove_interactionnow correctly returnstruewhen removing a self-loop.
- Return
boolrather thannumpy.bool_fromQuadraticModel.is_equalandBinaryQuadraticModel.is_equalwhen comparing empty models to numbers.
- Fix
as_samplesandInitialized.parse_initial_statesby ensuring that thecopyargument is not ignored inas_samplesandInitialized.parse_initial_statesdoes not modify any input data. See #861.
- Remove unused
ConstrainedQuadraticModel.labelsinstance variable.
- Fix adding constraints with integer variables via
ConstrainedQuadraticModel.add_constraint_from_iterablewhen those integer variables have pre-existing lower or upper bounds. See #943.
- Correctly account for the offset when multiplying binary quadratic models
-
BinaryQuadraticModel.energiesnow has consistent behaviour accross all data types when given samples containing a superset of the variables in the model. Previously binary quadratic models withobjectdata type would allow a superset of variables, whilefloat64andfloat32would not.
- Python
Published by arcondello almost 5 years ago
dimod - 0.10.5
New Features
- Add
QuadraticModel.set_upper_boundandQuadraticModel.set_lower_boundmethods.
Upgrade Notes
- The
preprocessingextra install argument has been removed.
- Remove
dimod.metanamespace. Its functionality,SamplerABCMetaandsamplemixinmethod, has been migrated to thedimod.core.samplernamespace.
Bug Fixes
- Fix
QuadraticModel.energieswhen given samples with values greater than the maximum value representable by an 8 bit integer. Previously samples were incorrectly cast to 8 bit integers.
- When a
QuadraticModelalready has an integer variable, adding it withQuadraticModel.add_variablewith different lower or upper bounds now correctly raises an exception. Likewise, adding or multiplying the same variable symbolically with different bounds will also raise an exception.
- When a
ConstrainedQuadraticModelalready has an integer variable, adding it as part of a constraint or objective with different lower or upper bounds now correctly raises an exception.
- Make
dimod.INTEGERcorrectly deepcopy-able.
- Fix (deprecated)
AdjVectorBQM.to_fileandAdjVectorBQM.from_file. See #898.
- Fix
BinaryQuadraticModel.energiesfor aBQMwithdtype=objectand a single variable with an integer bias. Previously it would raise anumpy.core._exceptions._UFuncOutputCastingError.
- Fix energy calculation when the lower bound (lb) equals the upper bound (lb) in
DiscreteQuadraticModel.add_linear_inequality_constraintandBinaryQuadraticModel.add_linear_inequality_constraint.
- Promote dwave-preprocessing to a full dependency of dimod to avoid issues that occur when dimod is a required package but dwave-preprocessing is not.
- Python
Published by arcondello almost 5 years ago
dimod - 0.10.4
Bug Fixes
- Fix
QuadraticModel.energieswhen given samples with values greater than the maximum value representable by an 8 bit integer. Previously samples were incorrectly cast to 8 bit integers.
- Fix energy calculation when the lower bound (lb) equals the upper bound (lb) in
DiscreteQuadraticModel.add_linear_inequality_constraintandBinaryQuadraticModel.add_linear_inequality_constraint.
- Python
Published by arcondello almost 5 years ago
dimod - 0.10.3
New Features
- Add
QuadraticModel.change_vartype()method.
- Add C++
dimod::QuadraticModel::change_vartype()method. Also add non-const versions ofdimod::QuadraticModel::vartype(),dimod::QuadraticModel::lower_bound(), anddimod::QuadraticModel::upper_bound().
Bug Fixes
- Fix
QuadraticModel.spin_to_binarynot correctly updating the variable type of the changed variables.
- Python
Published by arcondello almost 5 years ago
dimod - 0.10.1
New Features
- Add an optional
labelkeyword argument toConstrainedQuadraticModel.add_discrete. The method also now returns the assigned label, whether supplied or generated. This is consistent withConstrainedQuadraticModel.add_constraint.
-
cyBQMandcyQMfused types can now be cimported from thedimodnamespace.
- Add
.data()method tocyQM_templateandcyBQM_templatethat returns a const pointer to the underlying C++QuadraticModelandBinaryQuadraticModelrespectively.
Upgrade Notes
-
BinaryQuadraticModel.data.vartype()is now accessed as a method rather than as an attribute. This is consistent withQuadraticModel.data.vartype().BinaryQuadraticModel.vartypeis still an attribute.
-
from dimod cimport cyBQMnow is a fused type containingcyBQM_float32andcyBQM_float64. You can use thecyBQMcontainingcyAdjVectorBQMwithfrom dimod.bqm cimport cyBQM.
Bug Fixes
- Fix wrong behaviour when the lower bound (lb) equals the upper bound (lb) in
add_linear_equality_constraint. Correct behaviour is to add constraint as eqaulity when lb is equal ub.
- Python
Published by arcondello almost 5 years ago
dimod - 0.10.0rc1
Release Notes
0.10.0rc1
New Features
- Add
num_quadratic_variablesto the header of the file created byConstrainedQuadraticModel.to_file. This increments the version to 1.1.
- You can now install preprocessing as part of the dimod install with
pip install dimod[preprocessing]
Deprecation Notes
Some composites have been migrated to
dwave-preprocessing. The affected composites:-
ClipComposite -
ConnectedComponentsComposite -
FixedVariableComposite -
RoofDualityComposite -
ScaleComposite -
SpinReversalTransformComposite
you no longer can use the composites without having
dwave-preprocessinginstalled. Using them with it installed results in a deprecation warning.-
- Python
Published by arcondello almost 5 years ago
dimod - 0.10.0.dev8
Release Notes
0.10.0.dev8
New Features
- Add binpacking, knapsack and multiknapsack constrained quadratic model generators.
- Add
BinaryQuadraticModel.is_almost_equalmethod for testing approximate equality to other binary quadratic models.
- Add
Variables.copymethod, implemented as acpdefmethod for Cython and Python access.
Support specifying lower and upper bounds for integer variables in quadratic models:
- Add
lower_boundandupper_boundkeyword arguments toQuadraticModel.add_variable. - Add
QuadraticModel.lower_boundandQuadraticModel.upper_boundmethods.
- Add
Upgrade Notes
- Remove
dimod.utils.LockableDictanddimod.decorators.lockable_method. AlsoSampleSet.is_writeablecan no longer be set toFalse.
Deprecation Notes
-
AdjVectorBQMandAdjDictBQMare deprecated and will be removed in dimod 0.11.0. UseBinaryQuadraticModelwithdtype=np.float64anddtype=objectrespectively.
-
SampleSet.is_writeableis deprecated and now always returns True.
Bug Fixes
- Add support for AdjVectorBQM and AdjDictBQM in ConstrainedQuadraticModel.
- Fix shallow copies of
Variablesobjects when usingcopy.copy.
- Implement rule of five for
dimod::NeighborhoodIterator,dimod::ConstNeighborhoodIterator, anddimod::ConstQuadraticIterator. This fixes double frees caused by the default copy constructor copying information that is not intended to be shared.
- Fix shallow copies of
BinaryQuadraticModelwithobjectdtype when usingcopy.copy.
- Python
Published by arcondello almost 5 years ago
dimod - 0.10.0.dev7
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.addlinearinequalityconstraint and DiscreteQuadraticModel.addlinearinequalityconstraint 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.
- Python
Published by arcondello almost 5 years ago
dimod - 0.10.0.dev6
Changes
- Promote
dimod.binary.binary_quadratic_model.BinaryQuadraticModekto the top-leveldimodnamespace and removedimod.binary_quadratic_model.BinaryQuadraticModel#847
Fixes
- Fix issue where
Variables._relabelmislabeled other variables a0791b0
- Python
Published by arcondello about 5 years ago
dimod - 0.10.0.dev5
New Features
- Add
add_bqmmethod to C++ BinaryQuadraticModel https://github.com/dwavesystems/dimod/pull/821, https://github.com/dwavesystems/dimod/pull/823 - Add
Structured.valid_bqm_graphmethod for verifying input problem structure https://github.com/dwavesystems/dimod/pull/832 - Reimplement
BinaryQuadraticModelto use new C++ code https://github.com/dwavesystems/dimod/pull/828 BinaryQuadraticModelcan now be manipulated symbolically https://github.com/dwavesystems/dimod/pull/834loadfunction can now load all model types https://github.com/dwavesystems/dimod/pull/841, https://github.com/dwavesystems/dimod/pull/843DiscreteQuadraticModelnow has an.offsetattribute https://github.com/dwavesystems/dimod/pull/838- Add
ConstrainedQuadraticModelclass https://github.com/dwavesystems/dimod/pull/839 - Add
make_header,read_headerandwrite_headerutility functions https://github.com/dwavesystems/dimod/pull/842 - Add
ExactDQMSamplerhttps://github.com/dwavesystems/dimod/pull/820
Fix
- Fix type promotions in binary quadratic models with object biases https://github.com/dwavesystems/dimod/pull/836
- Python
Published by arcondello about 5 years ago
dimod - 0.10.0.dev4
New Features
- Support PEP518 for building the package https://github.com/dwavesystems/dimod/pull/814
- Add
cyVariables.size()and.at(..)to improve cython access to theVariablesobject - Add new
QuadraticModelBaseandBinaryQuadraticModelimplementation in c++ https://github.com/dwavesystems/dimod/pull/818, https://github.com/dwavesystems/dimod/pull/819
Fixes
- Fix broken documentation links https://github.com/dwavesystems/dimod/pull/815
- Python
Published by arcondello about 5 years ago
dimod - 0.10.0.dev3
Changes
- Drop
AdjMapBQMandAdjArrayBQM#788
New Features
gnm_random_bqmgenerator #808- Allow sample methods decorated by nonblockingsamplemethod to return sample sets that can indicate their doneness. This allows ScaleComposite to be properly non-blocking even when there is a vartype change #805
DiscreteQuadraticModel.degree()method
Improvements
DiscreteQuadraticModel.adjis no longer constructed each time on the fly #807- Cython implementation of the
Variablesobject https://github.com/dwavesystems/dimod/pull/812
Fixes
- Windows wheels now correctly include
.pxdfiles.
- Python
Published by arcondello over 5 years ago
dimod - 0.10.0.dev2
Changes
- Drop
AdjMapBQMandAdjArrayBQM#788
New Features
gnm_random_bqmgenerator #808- Allow sample methods decorated by nonblockingsamplemethod to return sample sets that can indicate their doneness. This allows ScaleComposite to be properly non-blocking even when there is a vartype change #805
DiscreteQuadraticModel.degree()method
Improvements
DiscreteQuadraticModel.adjis no longer constructed each time on the fly #807
Fixes
- Windows wheels now correctly include
.pxdfiles.
- Python
Published by arcondello over 5 years ago
dimod - 0.10.0.dev1
Changes
- Drop
AdjMapBQMandAdjArrayBQM#788
New Features
gnm_random_bqmgenerator #808- Allow sample methods decorated by nonblockingsamplemethod to return sample sets that can indicate their doneness. This allows ScaleComposite to be properly non-blocking even when there is a vartype change #805
DiscreteQuadraticModel.degree()method
Improvements
DiscreteQuadraticModel.adjis no longer constructed each time on the fly #807
- Python
Published by arcondello over 5 years ago
dimod - 0.9.14
New Features
DiscreteQuadraticModelandSampleSetnow use the same underlying variable representation. #772, #779DiscreteQuadraticModel.add_linear_equality_constraintmethod. #774, #787, #798AdjVectorBQM.add_linear_equality_constraintmethod. #784- Samplers now swallow unknown keyword arguments. #796, #799
SpinReversalTransformCompositeno longer requires a structured sampler. #802
Fixes
- Stopped using deprecated methods and functions to reduce the number of deprecation warnings. #773
DiscreteQuadraticModel.copy()now works correctly. #777- Fix handling of integer-valued floats in Variables. #779
- Fix the
cyDiscreteQuadraticModel.dtypesetting. #783
- Python
Published by arcondello over 5 years ago
dimod - 0.9.13
Fixes
DQM.from_numpy_vectors,.set_quadraticand.set_quadratic_casenow correctly raise aValueErrorwhen the user attempts to create an interaction between cases in a variableBQM.from_numpy_vectorsnow maintains the correct variable orderAdjDictBQMbiases are no longer 0 dimensional arrays when constructed from a numpy matrix- Fixed column alignment issue when printing sample sets
New Features
- C++
AdjVectorBQMandAdjMapBQMcan now be constructed from COO-formatted arrays - Python
AdjVectorBQM.from_numpy_vectorsandAdjMapBQM.from_numpy_vectorsis now much more performant - Cython
DiscreteQuadrataticModelobject now uses C++ COO constructors rather than an ad hoc implementation gnp_random_bqmgenerator for randomly connected BQMs
- Python
Published by arcondello over 5 years ago
dimod - 0.9.11
Changes
- Deprecated
SampleSet.append_variables
New Features
append_variablesfunction, replacing the funcionality ofSampleSet.append_variablesappend_vectorsfunction, to add more data vactors to a sample set- Documentation improvements
- Support for python 3.9
Fixes
- Fix c++ target for windows build
- Python
Published by arcondello over 5 years ago
dimod - 0.9.9
New Features
- New parallel constructor for c++ AdjMapBQM
DQM.to_filenow returns a seekable file-likeDQM.from_numpy_vectorsnow reserves the quadratic vectors which should reduce memory and speed up construction
Fixes
DQM.from_filenow correctly accepts bytes-like objects
Changes
DQM.to_file'scompressedkwarg has been deprecated in favor ofcompress
- Python
Published by arcondello over 5 years ago
dimod - 0.9.7.dev1
New Features
- New
DISCRETEvartype for sample sets
- Python
Published by arcondello almost 6 years ago
dimod - 0.9.7.dev0
New Features
DiscreteQuadraticModelclass- New parallel constructor for dense c++ BQMs
- Python
Published by arcondello almost 6 years ago
dimod - 0.9.6
New Features
Structured.to_networkx_graphmixin method.min,.max, and.summethods on BQM viewsnonblocking_sample_methoddecorators for asynchronous samplersanti_crossing_loops,anti_crossing_clique, anddopedproblem generatorsBQM.to_fileandBQM.from_filemethods for cyBQMs
Fixes
VartypeView.relabel_variablesno longer sometimes returnes models with the wrong vartypeBQM.relabel_variables_as_integersnow works correctly wheninplace=False
- Python
Published by arcondello almost 6 years ago
dimod - 0.9.5
New Features
BQM.normalizenow returns the value the BQM was scaled bySampleSet.relabel_variablesno longer blocks for unresolved sample setsFileViewhas a new parameter,ignore_variablesthat treats the BQM as integer-labelledScaleCompositeno longer blocks
Fixes
FileView.seeknow works correctly withio.SEEK_END
Changes
BinaryPolynomialsupport inScaleCompositehas been removed
- Python
Published by arcondello almost 6 years ago
dimod - 0.9.3
New Features
pack_sampleskwarg forSampleSet.to_serializable()method that allows the user to not pack samples. This means bumping the sample set serialization version to 3.1.0
Fixes
SampleSet.infois now correctly propagated through theClipComposite- All
.pyxand.pxdfiles are included in the MANIFEST which means thatcimport dimodwill now work correctly
- Python
Published by arcondello about 6 years ago
dimod - 0.9.2
New Features
- BQM C++ headers are now in
dimod/include/dimod/. Packages that need access to the headers can get the path using the newget_dimod_headers()function. Note that the C++ code is still considered unstable and does not respect semantic versioning. InitializedABC and accompanyingparse_initial_statesmethod for samplers that accept initial states.IdentitySamplerthat returns passed-in initial states.ising_to_qubofunction now accepts an underspecifiedharg.
Fixes
- General performance and structural improvements to C++ bqms.
- cyBQMs are now pickleable and deepcopyable.
- Python
Published by arcondello about 6 years ago
dimod - 0.9.1
Changes
- Removed deprecated kwarg in
SpinReversalTransformComposite
Fixes
RoofDualityComposite,ConnectedComponentCompositeandFixedVariableCompositenow all work with the new BQM types
New Features
- A sample method testing framework for Samplers
- Significant documentation update
- A unified location for header files
- Python
Published by arcondello over 6 years ago
dimod - 0.9.0.dev6
Fixes
- Fix numpy version range
BQM.get_quadraticnow has consistent/correct behaviour when a default is provided- Restored some removed methods,
BQM.to_coo,.from_coo,.to_numpy_matrix,.from_numpy_matrix,.to_networkx_graph,.from_networkx_graph BQM.energiesnow raises the correct exception when given bad samples
New Features
- Binary quadratic models can now be constructed from linear/quadratic iterators
BQM.baseattribute to help when constructing from viewsBQM.energiesmixin now uses a faster numpy-based energy calculation
- Python
Published by arcondello over 6 years ago
dimod - 0.9.0.dev5
Changes
BinaryQuadraticModelnow subclassesAdjDictBQM- Remove
BinaryQuadraticModel.to_cooandBinaryQuadraticModel.from_coo - Remove
BinaryQuadraticModel.to_numpy_matrixandBinaryQuadraticModel.from_numpy_matrix - Remove
BinaryQuadraticModel.SPINandBinaryQuadraticModel.BINARY - Remove
vartypekeyword argument fromBinaryQuadraticModel.add_variable,BinaryQuadraticModel.add_variables,BinaryQuadraticModel.add_interactionandBinaryQuadraticModel.add_interactions - The
.spinand.binaryproperties of binary quadratic models are now views rather than copies
New Features
as_bqmfunction for constructing binary quadratic models- Most
BinaryQuadraticModelmethods and properties have been added toAdjArrayBQM,AdjDictBQM,AdjMapBQMandAdjVectorBQM
- Python
Published by arcondello over 6 years ago
dimod - 0.9.0.dev4
Fixes
- Fix deserialization of variables that are nested tuples
- Include
shapeablebqm.pyx.srcin themanifest.ini
- Python
Published by arcondello over 6 years ago
dimod - 0.9.0.dev3
Fixes
- Python 3.5+ wheels are now installable on Windows machines that don't have FH4 exception handling
- cyBQMs now correctly use the linear biases when constructed with a linear sequence (rather than dict)
- Install now correctly requires NumPy>=1.16.0
New Features
- Simpler implementation of the
FileView - FileView supports additional
whencevalues forFileView.seek
- Python
Published by arcondello over 6 years ago
dimod - 0.9.0.dev2
Fixes
as_samplesnow respects the provided dtype for SampleSet inputs- cyBQM views now raise the correct exception
New Features
BQM.relabel_variablesfor the cyBQMsiter_safe_relabelsdecorator- The legacy
BinaryQuadraticModelis now a registered subclass of theBQMABC
- Python
Published by arcondello over 6 years ago
dimod - 0.9.0.dev1
Development Release
New Features
- New BQM types:
AdjArrayBQM,AdjDictBQM,AdjMapBQMandAdjVectorBQM
Changes
- Drops support for Python 2.7 and 3.4
- Python
Published by arcondello over 6 years ago