Releases: dwavesystems/dwave-optimization
Releases · dwavesystems/dwave-optimization
0.4.3
New Features
- Implement C++
operator<=>(const Update&, const Update&)
and
operator==(const Update&, const Update&)
. This allowsUpdate
to
be used withstd::ranges::stable_sort()
. - Add a new Cython extension type,
_Graph
. The_Graph
class is
responsible for managing a C++dwave::optimization::Graph
. Also
makeModel
a Python class that inherits from_Graph
, rather than
a Cython extension type. - Add C++
DivideNode
and PythonDivide
symbol, and overriding
__truediv__
.Divide
propagates the division of its
predecessors element-wise. Note that predecessors of Divide must be
either strictly positive or strictly negative. - Add C++
SquareRootNode
and PythonSquareRoot
symbol.
SquareRoot
propagates the square-root(s) of its predecessor
element-wise. - Add
const
and non-const
versions of C++ array iterators. - Make C++ array iterators random access iterators. Previously they
were bidirectional iterators.
Upgrade Notes
- Remove C++
Update::equals(const Update&)
method in favour of
operator==(const Update&, const Update&)
. - It is no longer possible to
from dwave.optimization.model cimport Model
. Instead, importers
shouldfrom dwave.optimization.model cimport _Graph
. A_Graph
has most of the functionality that aModel
did, although most of
the symbol construction methods have been kept onModel
. - The
dwave::optimization::ArrayIterator
class has been moved. It
can now be found as a nested class in theArray
, i.e.
dwave::optimization::Array::const_iterator
.
0.4.2
New Features
- Implement C++
BinaryOpNode::sizeinfo()
overload. - Add C++
ModulusNode
and PythonModulus
symbol.Modulus
propagates the modulus of its two predecessors element-wise. Modulus
symbols may be created with either the%
operator or themod()
function indwave.optimization.mathematical
. See #156.
Bug Fixes
- Fix serializing models with binary operations over dynamic
predecessors. Previously it was not possible to estimate the state
size which caused serialization to fail.
0.4.1
New Features
- Add C++
DisjointListsNode::set_state()
method which allows for
setting the state of disjoint lists directly. - Add C++
XorNode
and PythonXor
symbol.Xor
propagates the
logical exclusive-or of its two predecessors element-wise. See #125. - Add C++
AnyNode
. See #148. - Add
Any
symbol andArraySymbol.any()
method. See #148. - Change the formulation of the
job_shop_scheduling()
generator to
remove redundant list variables and replace them with a disjunctive
non-overlapping constraint between each pair of jobs on the
machines. - Raise clearer error messages when trying to use out-of-bounds
indices. - Add C++
Graph::remove_unused_nodes()
method to remove nodes that
are not used in the objective or constraints. See #41. - Add Python
Model.remove_unused_symbols()
method to remove nodes
that are not used in the objective or constraints. See #41. - Improve the move/copy behavior of C++
ArrayIterator
. - Add C++ index raveling-unraveling utilities functions.
- Add C++
PartialReduceNode
. - Add Python
PartialSum
symbol and addedaxis
keyword in
ArraySymbol.sum()
function.
Upgrade Notes
- Remove redundant list variables in the
job_shop_scheduling()
generator and add disjunctive non-overlapping constraints between
each pair of jobs on the machines. - Drop support for Python 3.8.
- Change C++
ArrayIterator
to no longer have ownership of its fill
value when masked. - Remove
vartypes.hpp
. TheVartype
enum was not used by any other
classes or functions.
Bug Fixes
- Update C++
UnaryOpNode
to correctly handle dynamic predecessors. - Fix the possibility of creating a dangling reference when using a
masked C++ArrayIterator
. - Implement missing overloads for
NaryMaximumNode::max()
,
NaryMaximumNode::min()
, andNaryMaximumNode::integral()
. - Implement missing overloads for
NaryMinimumNode::max()
,
NaryMinimumNode::min()
, andNaryMinimumNode::integral()
. - Fix two bugs in advanced indexing node propogation in the case of a
non-const main array with dynamic indexers, e.g.A[x]
whereA
is
a 1d integer decision variable andx
is a list. The first bug
could cause segfaults during propagation, and the second could lead
to incorrect output if both arrays were changed during propagation. - Update the logic in the
capacitated_vehicle_routing_with_time_windows()
generator function
to correctly account for asymmetric time-distance matrices. - Fix the type information for
ArraySymbol.__abs__()
.
0.4.0
New Features
- Add capacitated vehicle routing problem with time windows generator.
See #104. - Reduce the number of symbols in the model returned by
job_shop_scheduling()
generator. - Add
Array::integral()
,Array::max()
, andArray::min()
overloads for all existing C++ nodes. - Add C++
is_integer()
function. - Support Python 3.13.
Model.add_constraints()
now returns the symbol for the constraint.- Fully support scalar (0-dimensional) indices for advanced indexing
operations, e.g.A[i, :, j, :]
wherei
andj
are nodes with
scalar output. Previously, this would work only if the final output
of the indexing operation was also scalar.
Upgrade Notes
- Using advanced indexing nodes with indexing arrays that have a
higher dimension than one (e.g.A[:, i, :, j]
wherei
andj
are 2d arrays) has been disabled. Previously, it was possible to
construct models that used this functionality, but the behavior of
the model during state initialization and propagation may not have
been correct.
Bug Fixes
- Fix combined indexing. Previously indexing an array symbol by a
mixture of arrays, integers, and non-empty slices would always
result in an error. - Update
AdvancedIndexingNode
to check the indices of its indexing
arrays to prevent out-of-bounds access. - Fix the case of using scalar indices in an advanced indexing
operation where the indices were not grouped, e.g.A[:, i, :, j]
,
which was technically unsupported but no errors were raised. This
could also lead to segfaults during state initialization or
propagation.
0.3.0
New Features
- Add
Symbol.id()
method to return the identity of the underlying
node. - Add bin packing generator.
- Add support for exponentiation of
ArraySymbol
for positive integer
exponents other than 2. - Implement
ArrayNode
andDecisionNode
C++ classes. These classes
are useful when creating nodes that require their predecessor(s) to
be both arrays and node. See #75. - Update C++ nodes that previously inherited from both
Array
and
Node
to inherit fromArrayNode
. - Update C++ nodes that previously inherited from both
Decision
and
Node
to inherit fromDecisionNode
. - Add
ArraySymbol.initialize_arraynode()
Cython method. - Update C++
Graph
to hold a vector ofDecisionNode*
for easy
access. This will increase the memory usage for graphs with many
decisions, but provide faster access. - Support binary operations between symbols representing a scalar and
other array symbols. - Add
SizeNode
C++ class.SizeNode
reports the size of its
predecessor. See #48. - Add
Size
Python class.Size
reports the size of its predecessor. See #48. - Add C++
Graph::objective()
method for accessing the current
objective. - Add
::operands()
method to C++BinaryOpNode
,NaryOpNode
,
ReduceNode
, andUnaryOpNode
. This method allows access to the
Array*
of the node's predecessors without a dynamic cast. - Add C++
LogicalNode
and PythonLogical
symbol.Logical
propagates the truth value(s) of its predecessor element-wise. - Add C++
NotNode
and PythonNot
symbol.Not
propagates the
inverse of the truth value(s) of its predecessor element-wise. - Add C++
void Graph::commit(State& state, std::vector<const Node*>&& changed) const
overload. - Add C++
void Graph::propagate(State& state, std::vector<const Node*>&& changed) const
overload. - Add C++
void Graph::revert(State& state, std::vector<const Node*>&& changed) const
overload. - Add predecessor shape test when initializing the state of C++
ArrayValidationNode
. - Add C++
WhereNode
. See #66. - Add Python
Where
symbol andwhere
function. See #66.
Upgrade Notes
-
Require and/or return
ArrayNode*
in many places that previously
required and/or returned anArray*
.The following
Graph
methods now require anArrayNode*
argument:
Graph.set_objective()
,Graph.add_constraint()
,
Graph.constraints()
,Graph.decisions()
.The following nodes now require a
ArrayNode*
as argument(s) to
their constructor:AdvancedIndexingNode
,ArrayValidationNode
,
BasicIndexingNode
,BinaryOpNode
,NaryOpNode
,
PermutationNode
,QuadraticModelNode
.ReduceNode
,
ReshapeNode
, andUnaryOpNode
.Python code is not affected.
-
Remove
ArraySymbol.initialize_array()
Cython method. Python code
is not affected. -
Require
ArrayNode*
as an argument to thesymbol_from_ptr()
Cython function.
Bug Fixes
- Fix
Array::min()
. Previously it incorrectly reported the smallest
number expressible by adouble
, rather than the lowest. See
#85. - Implement C++
UnaryOpNode::max()
,UnaryOpNode::min()
, and
UnaryOpNode::logical()
. ThereforeAbsoluteNode
,NegativeNode
,
andSquareNode
will now correctly propagate their minimum and
maximum value and will now correctly report if they represent
integer or boolean values.
Other Notes
- Switch to using Meson as the build
system. When installing from source withpip
orpypa/build
,
Meson will be used to install the package. Previouslysetuptools
andsetuptools_dso
were used.
0.2.0
New Features
- Add C++
NaryOpNode(std::span<Node*>)
andNaryOpNode(std::span<Array*>)
constructors. - Add
Model.num_edges()
method. See #28. - Add quadratic assignment problem generator. See #29.
- Add C++ method to rotate elements in a disjoint list.
- Add support for
<,>,==,!=,<=,>=
operators betweenConstant
and array-like objects. - Add support for
bool(constant)
,int(constant)
, andnot constant
whenconstant
is an instance ofConstant
encoding a single scalar value. - Make
repr()
of symbols unique to the underlying node, rather than to the Python symbol. See #52. - Allow
dwave.optimization.generators.traveling_salesperson()
to accept an asymmetric distance matrix. - Allow
dwave.optimization.generators.flow_shop_scheduling()
to accept non-integer processing times. - Implement
ArraySymbol.__iadd__()
andArraySymbol.__imul__()
. The+=
operator will now return aNaryAdd
symbol. The*=
operator will now return aNaryMultiply
symbol. - Implement
NaryAdd.__iadd__()
. In-place addition with aNaryAdd
symbol will no longer create a new symbol. - Implement
NaryAdd.__imul__()
. In-place multiplication with aNaryMultiply
symbol will no longer create a new symbol. - Add missing
typing
information todwave.optimization.add()
,dwave.optimization.maximum()
,dwave.optimization.minimum()
, anddwave.optimization.multiply()
. - Support NumPy 2.0. Also, no longer require NumPy at build-time.
- Speed up
Model.iter_symbols()
and other symbol iteration methods.
Upgrade Notes
- Raise a
ValueError
when callingbool()
on anArraySymbol
. dwave.optimization.add()
,dwave.optimization.maximum()
,dwave.optimization.minimum()
, anddwave.optimization.multiply()
no longer accept a tuple of symbols as inputs.dwave.optimization.logical_and()
anddwave.optimization.logical_or()
arguments have been renamed.- Remove
.from_ptr()
cdef
method from all of the symbol classes.
Bug Fixes
- Fix
ArraySymbol.all()
for empty array symbols. See #43. - Add missing
copy()
override for C++DisjointBitSetsNode
states. - Fix
Symbol.to_networkx()
to no longer be compiler-dependant. See #18. - Fix
dwave.optimization.generators.job_shop_scheduling()
for problems with the number of jobs is different than the number of machines. - Return
NotImplemented
fromArraySymbol
operator methods for unknown types. - Fix return type of
Symbol.maybe_equals()
to be integer instead of boolean. See #23.
0.1.0
Prelude
- The first release of
dwave-optimization
.
0.1.0rc1
Update version 0.1.0rc0 -> 0.1.0rc1
0.1.0rc0
Initial pre-release.