Skip to content

Releases: dwavesystems/dwave-optimization

0.7.1

Choose a tag to compare

@arcondello arcondello released this 05 Jun 21:09
5da1dd3

Bug Fixes

  • Fix an issue with ListVariables with a maximum size set to less than n, the size of the main set. In this case the underlying node's state was not initialized correctly causing some valid operations to later fail.
  • Fix MatrixMultiply symbol when multiplying non-contiguous arrays and/or arrays with size 1 in one dimension. See #553.
  • IsInNode previously did not clear cached state data during commit(), causing future propagation-and-reverts to encounter memory issues. The implementation has been fixed.

0.7.0

Choose a tag to compare

@arcondello arcondello released this 11 May 17:45

New Features

  • Make C++ BufferIterator always shaped.
  • Implicit sum constraints added to NumberNode.
    • Users may define a sum constraint over the entire array or along
      an single axis.
    • Enabled at the Python level for BinaryVariable and
      IntegerVariable. See #216.
    • Added NumberNode::sum_constraints() (returns sum constraint).
    • Added NumberNode::sum_constraints_lhs() (returns
      state-dependent sums associated with sum constraint).
    • Modified NumberNode::exchange() to accept optional slice
      arguments.
    • Modified NumberNode::clip_and_set_value() to accept optional
      slice argument.
    • Modified IntegerNode::set_value() to accept optional slice
      argument.
    • Modified BinaryNode::flip() to accept optional slice argument.
  • BinaryNode optionally tracks indices with buffer value 1 and 0.
    • Enabled when users define a sum constraint.
    • Added BinaryNode::num_true() (return # of indices with buffer
      value 1 in slice given sum constraint).
    • Added BinaryNode::num_false() (return # of indices with
      buffer value 0 in slice given sum constraint).
    • Added BinaryNode::ith_true_index() (returns ith index with
      buffer value 1 in slice given sum constraint).
    • Added BinaryNode::ith_false_index() (returns ith index with
      buffer value 0 in slice given sum constraint).
  • Add three methods to the model returned by the job-shop scheduling
    model generator: model.get_global_task_ordering(),
    model.get_start_times(), and model.get_end_times().

Upgrade Notes

  • Drop support for contiguous C++ BufferIterator. This means that
    one must always provide a shape and strides argument when
    constructing the iterator.
  • Change Array::view to use std::default_sentinel. This means
    Array::view is no longer a std::common_range.
  • Drop the Array::View type declaration.
  • Update job-shop scheduling generator to use a list variable for the
    global ordering of all tasks from which the model constructs a
    feasible schedule.

Deprecation Notes

  • Remove NumberNode and BinaryNode random state initialization.
  • Remove mutate methods set() and unset() from BinaryNode.

Bug Fixes

  • Add missing includes to dwave-optimization/functional.hpp

0.6.12

Choose a tag to compare

@wbernoudy wbernoudy released this 25 Mar 20:09
72faa63

New Features

  • Sub-lists are now supported.
    See #71.

  • Support numpy.newaxis and ... while indexing array symbols.

  • Add LinearProgram.feasible() and LinearProgram.objective_value()
    methods. These allow the user to access information about the state of the
    linear program without needing the associated symbols.
    See #475.

  • The symbols: All, Any, Max, Min, Prod, and Sum can infer
    their size from their predecessor's size.

  • Transpose symbol can infer its size from its predecessor's size.

Known Issues

  • In some cases, combined indexing operations on high dimensional arrays will
    not match the behavior of NumPy.
    See #465.

Bug Fixes

  • Fix an issue with advanced indexing when indexing a dynamic array with
    scalar indexers where the index on the first dimension is an empty slice,
    such as A[:, i, j, :] where i and j are scalar symbols. Previously,
    this may have resulted in a exception being raised when initializing a
    state on the model. This has now been fixed. A specific sub-case of this,
    when the scalar indexers are separated by an empty slice in at least one axis,
    (e.g. A[:, i, :, j]) is not supported and is now properly disallowed with
    an exception being raised at symbol/node construction time.

0.6.11

Choose a tag to compare

@arcondello arcondello released this 15 Jan 21:31
b034167

New Features

  • Add Tanh symbol to support hyperbolic tangent. See #445.
  • Add C++ TanhNode to support hyperbolic tangent.
  • Add Python broadcast_shapes() function.
  • Add subtract() function.
  • Add equal() function.
  • Add less_equal() function.
  • Automatically broadcast when using binary operators with array
    symbols.
  • Add dwave.optimization.typing module.
  • Allow array symbols to have a state-dependent shape while not having
    a state-dependent size. For example, an array with shape (n, 0)
    will always have a size of 0, but the shape is state-dependent.
    Arrays with a state-dependent size always have a state-depenent
    shape.
  • Add C++ is_contiguous() function.
  • Add predict() function to dwave.optimization.generators. The
    predict() function accepts a fitted
    sklearn.neural_network.MLPCLassifier or
    sklearn.neural_network.MLPRegressor and a symbol representing X,
    and returns a symbol encoding the prediction of the estimator.

Upgrade Notes

  • Rename C++ broadcast_shape() to broadcast_shapes() for
    consistency with NumPy.
  • Change the definition of ArrayNode::dynamic() to return true if
    ArrayNode::shape()[0] < 0. That is, if the shape is
    state-dependent. Previously ArrayNode::dynamic() returned true if
    the size was state-dependent.
  • Remove C++ Array::is_contiguous() protected method.

Bug Fixes

  • Disallow broadcasting a fixed size array to a dynamic shape with
    BroadcastTo symbol.
  • Support broadcasting arrays to a shape with a 0 in one or more
    dimensions with the BroadcastTo symbol.
  • Fix reductions over empty dynamic arrays.
  • Fix basic indexing that results in empty dynamic arrays.
  • Fix BroadcastToNode::contiguous() method, previously it would
    always report that the node was not contiguous.
  • Provide a meaningful error message when attempting to make a dynamic
    ConstantNode at the C++ level.
  • Provide a meaningful error message when attempting to make a dynamic
    NumberNode at the C++ level.

0.6.10

Choose a tag to compare

@arcondello arcondello released this 16 Dec 18:22
74f1426

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

Choose a tag to compare

@arcondello arcondello released this 27 Nov 20:21
4a2f4ed

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

Choose a tag to compare

@arcondello arcondello released this 19 Nov 22:28
641f262

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

Choose a tag to compare

@arcondello arcondello released this 01 Oct 22:50
42217b4

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

Choose a tag to compare

@arcondello arcondello released this 18 Sep 00:08
cc14092

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

Choose a tag to compare

@arcondello arcondello released this 12 Sep 16:59
5924f97

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.