Skip to content

Releases: dwavesystems/dwave-optimization

0.6.10

16 Dec 18:22
74f1426

Choose a tag to compare

New Features

  • Add the MatrixMultiplication symbol and corresponding method
    matmul. The matmul method follows the behavior of NumPy's
    matmul, meaning that it works with matrices, vectors, and higher
    order arrays.

Upgrade Notes

  • Opt ArraySymbol out of NumPy interoperability. This means that
    trying to use an ArraySymbol with most NumPy functions/operators
    will fail. Prefer to use the functions in
    dwave.optimization.mathematical.

Bug Fixes

  • Fix type promotion when using NumPy arrays as the left-hand-side of
    operations with ArraySymbol.
  • Fix the maximum possible value reported by SetNode::max().
    Previously it would erroneously return a value derived from the
    maximum subset size.
  • Fix BinaryOpNode at C++ level so that it does not
    accept predecessors that have different, broadcastable shape if they
    have the same size.

0.6.9

27 Nov 20:21
4a2f4ed

Choose a tag to compare

New Features

  • Add Roll symbol and corresponding roll() function. See
    #423.
  • Support Modulus symbol in expressions used in AccumulateZip.

Bug Fixes

  • Change C++ function broadcast_shape() correctly throw an error
    when an attempt to broadcast a dynamically sized shape would result
    in an invalid result. See
    #429.
  • Fix BinaryNode::shape(const State&) and
    BinaryNode::size(const State&) so that they do not propagate the
    wrong shape/size when both predecessors have the same shape.
  • Fix Reduce symbol's bounds when given a dynamic predecessor that
    is always empty.

0.6.8

19 Nov 22:28
641f262

Choose a tag to compare

New Features

  • Add ArraySymbol.info() method for information about the values an
    array might take.
  • Add set union operation to C++ ValuesInfo class.
  • DisjointLists symbols are now indexable, returning the
    corresponding DisjointList (singular) symbol for the given index.
    This allows the method of creating disjoint lists on the model to be
    simplified, returning only a DisjointLists symbol instead of a
    tuple of the symbol and a list of DisjointList symbols. A new
    method Model.disjoint_lists_symbol() has been added to the Model
    class which implements this.
  • Added IsIn symbol/node which computes the element-wise containment
    of one symbol with another.
  • Support equality and inequality comparison to
    std::default_sentinel for C++ BufferIterator.
  • Implement BufferIterator::operator+= and
    BufferIterator::operator+ for multi-increments.
  • Make ARange symbol aware of the Size symbol. See
    #390.
  • Added Transpose symbol/node which computes the transpose of a
    symbol.
  • Consolidate C++ ReduceNode and PartialReduceNode into a single
    node type.
  • Support reductions over multiple axes for all reduce operations. See
    #347.

Upgrade Notes

  • Drop support for Python 3.9.

Deprecation Notes

  • The Model.disjoint_lists() method has been deprecated. Use
    Model.disjoint_lists_symbol() instead.
  • Make PartialProd and PartialSum symbols aliases for Prod and
    Sum.

Bug Fixes

  • Fixed issue (#409) in how ARangeNode calculated its sizeinfo.min and
    sizeinfo.max.
  • Fix an issue with AccumulateZip when given an expression that
    contains unbounded input symbols. For some expressions, this would
    result in malformed data being propagated through the expression on
    initialization, which could then affect all subsequent propagations.
  • Fix BroadcastTo symbol's diff creation. Previously it would
    sometimes propagate the wrong information when broadcasting
    high-demensional arrays.
  • Make the C++ deduplicate_diff_view a non-template class. Rather,
    make the constructor templated. This avoids a potential recursion
    when using deduplicate_diff_view in some concepts.

0.6.7

01 Oct 22:50
42217b4

Choose a tag to compare

New Features

  • Make dwave.optimization.symbols a sub-package rather than a sub-module.
  • Index-wise bounds added to NumberNode. Available to both IntegerNode and
    BinaryNode.

0.6.6

18 Sep 00:08
cc14092

Choose a tag to compare

Bug Fixes

  • Fix setting or mutating Model.objective. Until dwave-optimization
    0.6.4, it was possible to set the objective of a Model directly.
    However, in 0.6.4 and 0.6.5 doing so would result in that change not
    being reflected in serialized models. This fix restores support for
    setting or mutating Model.objective directly.

0.6.5

12 Sep 16:59
5924f97

Choose a tag to compare

New Features

  • Add support for bool dtype to the C++ BufferIterator.
  • Add new dwave-optimization/common.hpp for compiler support and
    backports from C++23.
  • Add new dwave-optimization/fraction.hpp for C++ fraction class.
  • Add support for broadcasting array symbols to new shapes. This
    includes:
    • A BroadcastTo symbol.
    • New broadcast_to() and broadcast_symbols() functions.
    • A C++ BroadcastToNode.
  • Support reshaping dynamically sized symbols when the size of each
    "row" in the new shape evenly divides the size of each "row" in
    the original shape.
  • Add Cos and Sin symbols to support trigonometric sine and
    cosine.
  • Add C++ CosNode and SinNode to support trigonometric sine and
    cosine.
  • Added SoftMax symbol/node which returns the softmax of its
    predecessor.

Upgrade Notes

  • Remove dwave-optimization/utils.hpp header.
  • Move C++ double_kahan implementation behind the compilation
    barrier.

Bug Fixes

  • Fix SetNode::assign() method. Previously it would sometimes
    propagate incorrect updates when assigned a smaller state.

0.6.4

06 Aug 22:17
86d11fb

Choose a tag to compare

New Features

  • Add ArgSort symbol/node which returns a stable argsort of its
    predecessor.
  • Add expression() decorator for constructing expressions.
  • Add the AccumulateZip symbol and corresponding AccumulateZipNode
    node in the C++. This symbol computes an arbitrary accumulate
    operation on 1-d arrays, similar to numpy.ufunc.accumulate, except
    that it takes any number of operands/predecessors. The accumulate
    operation is supplied by the user and encoded as an Expression.
  • The Constant symbol is now able to pass ownership of the
    corresponding numpy array to the ConstantNode which prevents the
    numpy array from being garbage collected even after the symbol has
    been collected. This means it is no longer necessary to save
    references to all the numpy arrays used by Constant symbols on the
    model itself. To support this, a new constructor for the C++
    ConstantNode has been added which takes a special
    ConstantNode::DataSource struct allowing the Python reference
    count to modified when appropriate.
  • Support automatic constant promotion for arithmetic operations on
    Symbols. This enables operations like model.binary() + 5, where
    the 5 will automatically be converted to a Constant symbol and
    added to the model.
  • Add std::initializer_list and std::span overloads to several
    InputNode methods.
  • Allow the user to provide an initial value to ArraySymbol.max(),
    .min(), .prod(), and .sum() methods.
  • Add Resize symbol and C++ ResizeNode.
  • Change the behavior of Model.constant() to keep a cache of
    symbols. Multiple calls to Model.constant() with the same array
    will no longer create redundant symbols.
  • Add C++ deduplicate_diff_view range view.
  • Add C++ type_list utility class.
  • Added Mean symbol/node which returns the mean of its predecessor.
  • Add support for Python 3.14.

Upgrade Notes

  • Move C++ deduplicate_diff() function from
    dwave-optimization/utils.hpp to dwave-optimization/array.hpp.
  • Change the signatures of the C++ ravel_multi_index() and
    unravel_index() functions to accept shapes rather than strides.
    This is consistent with NumPy.
  • Remove C++ Array::View::at() method.

Bug Fixes

  • Implement the C++ UnaryOpNode::sizeinfo() method to handle unary
    operations on dynamic arrays.
  • There was an issue on some models with "diamonds" in the multi-DAG
    structure where adding subsequent nodes could trigger a exponential
    recursion of calling Array::min()/max(). This has been fixed by
    using a min/max cache by default in these methods.

0.6.3

03 Jul 23:52
57c93d7

Choose a tag to compare

New Features

  • Update the C++ ConstantNode constructors to accept const double*
    rather than double*.
  • Add the Extract symbol and node, following the behavior of
    numpy.extract. See
    #272.
  • Allow BinaryOpNode (which Add, And, Multiply, etc. rely on) to
    accept two dynamic-sized predecessors, as long as they have an
    equivalent shape as determined by their sizeinfo().
  • Add .lower_bound(), .upper_bound(), and .integral() methods to
    the Input symbol.
  • The Where node/symbol now supports the case of all three
    predecessors being dynamic, as long as they have the same shape and
    size.

Upgrade Notes

  • Switch from pkgutil-style namespace package to native namespace
    package (PEP 420). While native namespace packages and pkgutil-style
    namespace packages are largely compatible, we recommend using only
    native ones going forward.

Bug Fixes

  • Fix constructing Constant symbols from read-only NumPy arrays. See
    #296.
  • Fix potential IndexError raised by
    capacitated_vehicle_routing_with_time_windows(). See
    #306.
  • Due to the way AdvancedIndexingNode held the data for
    its shape in the dynamic size case (i.e. when the indexers are
    dynamic), it was possible to encounter issues when mutating multiple
    states on the model. This has been fixed by tracking the shape on
    the node's state data.
  • Previously, the size info as reported by
    ArrayIndexingNode was correct only when the advanced
    indexing operation had no empty slices (i.e. all axes were specified
    with indexing arrays), and even in that case, the full size
    information from the indexing predecessors was not utilized. This
    has been fixed, so certain operations on advanced indexing nodes may
    now be allowed that weren't previously, and a size check may fail
    on certain models that worked before (operations such as
    A + B\[i,:, j, :\] where A is a dynamic 2d array,
    and i and j are dynamic 1d arrays, but
    the dimensions do not match).
  • Fix C++ SizeInfo::substitute() method. Previously it would not
    correctly update the min/max.
  • Fix C++ BasicIndexingNode::sizeinfo() and
    AdvancedIndexingNode::sizeinfo() methods. Previously they would
    sometimes report incorrect size information when indexing or being
    indexed by dynamic nodes.
  • Previously, the check in BinaryOpNode (used by Add, Subtract,
    Maximum, etc) for ensuring that predecessors have the same dynamic
    size did not recurse, meaning that the node might reject some
    predecessors that were actually valid. This has been fixed.
  • Update buffer access to Constant and to ArraySymbol states to
    raise a BufferError when requesting unsupported flags.

0.6.2

02 Jun 14:25
e6e1ae2

Choose a tag to compare

New Features

  • Add C++ ExpNode and Python Exp symbol. Exp propagates the
    base-e exponential values of its predecessor element-wise. See
    #282.
  • Add Input symbol and corresponding InputNode node in the C++.
    This symbol is meant to function as a "placeholder" in a model.
  • Improve the error messages returned by ListVariable.set_state()
    and SetVariable.set_state().
  • Add C++ CollectionNode::assign() method.
  • Add absolute function as an alias for the built-in abs.
  • Add Python safe_divide() function and SafeDivide symbol. Also
    add C++ SafeDivideNode. See
    #290.
  • Add overloads to C++ methods Graph::commit(),
    Graph::propagate(), and Graph::revert() that commit, propagate,
    or revert respectively all nodes in the graph.
  • Add a default constructor for C++ BinaryNode.

Upgrade Notes

  • Rename the first argument ListVariable.set_state() and
    SetVariable.set_state() from state to values.

Bug Fixes

  • Make C++ dwave::optimization::functional objects more consistent
    with the standard library by adding overloads for other numeric
    types and marking most operations as constexpr.
  • Fix iteration over ArraySymbols. Now iteration works correctly for
    ArraySymbols with more than one dimension and a fixed size. Other
    ArraySymbols now raise a TypeError. See
    #287.

0.6.1

07 Apr 20:43
fb09392

Choose a tag to compare

New Features

  • Add C++ BSplineNode and Python BSpline symbol. BSpline
    propagates the bspline interpolation values of its predecessor
    element-wise given the bspline constants (degree, knots and
    coefficients).