Dwave-ocean-sdk

Latest version: v6.10.0

Safety actively analyzes 631274 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 16 of 27

0.11.3

New Features

- Add `dimod::QuadraticModelBase::energy()` method to `dimod/libcpp.pxd` for Cython access.

- Randomly generated variable and constraint labels now begin with a letter and do not contain dashes. This ensures that they can be serialized to LP files. See [1206](https://github.com/dwavesystems/dimod/issues/1206).

Bug Fixes

- Fix `dimod.lp.dump()` and `dimod.lp.dumps()` to output bounds for REAL variables.

0.11.2

New Features

- Add `dimod.lp.dump()` and `dimod.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](https://github.com/scipy/oldest-supported-numpy) for compatibility. See [#208](https://github.com/dwavesystems/dwave-ocean-sdk/issues/208).

<!-- -->

- Add `plant_solution` keyword argument to `dimod.generators.random_nae3sat()`, `dimod.generators.random_2in4sat()` and `dimod.generators.frustrated_loop` functions.

<!-- -->

- Add `dimod::QuadraticModel::add_quadratic_back()` and `dimod::BinaryQuadraticModel::add_quadratic_back()` methods in C++ code.

<!-- -->

- Improve the performance of `QuadraticModel.from_file()`, which also improves the performance of `ConstrainedQuadraticModel.from_file()`.

Deprecation Notes

- Deprecated `planted_solution` keyword argument in `dimod.generators.frustrated_loop()`.

Bug Fixes

- Fix a performance regression to `QuadraticModel.add_linear_from()` introduced by [1170](https://github.com/dwavesystems/dimod/pull/1170) as part of the [0.11.0](https://github.com/dwavesystems/dimod/releases/tag/0.11.0) release.
-

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 <span class="title-ref">pyparsing</span> dependency. The functionality that required it was removed in version 0.11.0.

- Added missing import of `BinaryQuadraticModel` required by `dimod.serialization.json.DimodDecoder`

0.11.0

Prelude

Add support for real-valued variables.

New Features

- Improved deprecation warnings and documentation. See [192](https://github.com/dwavesystems/dwave-ocean-sdk/issues/192).

- Add C++ `Vartype::REAL`, a new variable type for real-valued variables.

- Support variables with `Vartype::REAL` in C++ `QuadraticModel`.

- Add `Vartype.REAL`, a new variable type for real-valued variables.

- Add `Real()` and `Reals()` functions for creating quadratic models with a single real-valued variable.

- Support variables with `Vartype.REAL` in `QuadraticModel`.

- `ConstrainedQuadraticModel.to_file()` now uses serialization format 1.2. This format is backwards compatibile.

- Add `vartype` and `linear_only` arguments to `ConstrainedQuadraticModel.num_biases()`.

- Add `vartype` and `include_objective` arguments to `ConstrainedQuadraticModel.num_quadratic_variables()`.

- Add `check_header` keyword-only argument to `ConstrainedQuadraticModel.from_file()`.

- Add a global flag `dimod.REAL_INTERACTIONS`. When this flag is set to `False`, variables with variable type `Vartype.REAL` cannot have interactions. `dimod.REAL_INTERACTIONS` is set to `False` by default.

- Add the ability to specify a default variable type and bounds for missing variables when calling `QuadraticModel.add_linear()` and `QuadraticModel.add_linear_from()`.

- Add `QuadraticModel::swap()` and `BinaryQuadraticModel::swap()` methods to the C++ code. See [928](https://github.com/dwavesystems/dimod/issues/928).

- Add `lp.loads()` and `lp.load()` functions.

- Improve the performance of the `ConstrainedQuadraticModel.from_lp_file()` method.

- Improve the performance of iteration over `Variables` objects.

Upgrade Notes

- Remove `.vartypes`, `.lower_bounds`, and `.upper_bounds` attributes from `ConstrainedQuadraticModel.variables`. These were previously deprecated in dimod 0.10.6.

- Remove `.vartype()` method from `ConstrainedQuadraticModel.variables`. It was previously deprecated in dimod 0.10.6.

- Remove `bqm_index_labelled_input` decorator. It was previously deprecated in dimod 0.10.8.

- Remove `SampleSet.is_writeable` attribute.

- Remove `dimod.generators.knapsack()`. It was previously deprecated in dimod 0.10.6.

- Remove `dimod.generators.multi_knapsack()`. It was previously deprecated in dimod 0.10.6.

- Remove `dimod.generators.bin_packing()`. It was previously deprecated in dimod 0.10.6.

- Remove `HigherOrderComposite.sample_ising()` method. It was previously scheduled to be removed in dimod 0.10.0.

- Remove `PolySampler.sample()`, `PolySampler.sample_ising()`, and `PolySampler.sample_qubo()` methods. These were previously scheduled to be removed in dimod 0.10.0.

- `AdjVectorBQM` and `AdjDictBQM` are now aliases for `BinaryQuadraticModel` and `DictBQM` respectively rather than having their own implementation with a slightly different API. They were previously deprecated in dimod 0.10.0.

- The `dimod.bqm` namespace has been removed.

- The `dimod.core.bqm` namespace has been removed.

- `dimod::AdjVectorBQM` has been removed from the C++ code.

- Some composites were migrated to [dwave-preprocessing](https://github.com/dwavesystems/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](https://github.com/dwavesystems/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 `manylinux2014` wheels for Python 3.10 rather than `manylinux2010`.

Deprecation Notes

- Deprecate support for the `ConstrainedQuadraticModel.add_variable(v, vartype)` argument order. Use `ConstrainedQuadraticModel.add_variable(vartype, v)` instead. See [969](https://github.com/dwavesystems/dimod/issues/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 explicit `lp.loads()` and `lp.load()` functions instead. The `ConstrainedQuadraticModel.from_lp_file()` will be removed in dimod 0.13.0.

- The `default_lower_bounds` and `default_upper_bounds` keyword arguments for `ConstrainedQuadraticModel.from_lp_file()` are deprecated and do nothing.

Bug Fixes

- Fixes performance regression on energy calculations introduced in 0.10.0. See [1025](https://github.com/dwavesystems/dimod/issues/1025)

- In the <span class="title-ref">cqm_to_bqm</span> function, set the Lagrange multiplier to one if the maximum absolute bias is zero.

- `dimod.variables.Variables` objects now correctly raise an `IndexError` when given negative indices that are out of range.

0.10.17

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](https://github.com/dwavesystems/dimod/issues/543).

- Add `SamplesLike` and `SampleLike` to `dimod.typing`. See [1008](https://github.com/dwavesystems/dimod/issues/1008).

- Add `dimod::vartype_limits` to C++ code for compile-time information about variable types.

- Add `dimod::vartype_info` to 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](https://github.com/dwavesystems/dimod/issues/1091)

- Add `BinaryQuadraticModel.maximum_energy_delta()` method.

- Add `ConstrainedQuadraticModel.set_lower_bound()` method. See [1105](https://github.com/dwavesystems/dimod/issues/1105).

- Add `ConstrainedQuadraticModel.set_upper_bound()` method. See [1105](https://github.com/dwavesystems/dimod/issues/1105).

- Add `Polynomial` to `dimod.typing`.

- Add `Comparison.to_polystring()` method.

- Printing `Comparison` objects now returns an equation representation of the comparison as a string.

- Add `ConstrainedQuadraticModel.relabel_constraints()` method. See [1066](https://github.com/dwavesystems/dimod/issues/1066).

- Add `ConstrainedQuadraticModel.remove_constraint()` method. See [1104](https://github.com/dwavesystems/dimod/issues/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](https://github.com/dwavesystems/dimod/issues/668)

- Add `SampleSet.from_samples_cqm()` method.

- Add `BinaryQuadraticModel::lower_bound()` and `BinaryQuadraticModel::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](https://github.com/dwavesystems/dimod/issues/1157).

Upgrade Notes

- `as_samples()` no longer always casts input sample values to integers.

- `QuadraticModel.energies()` and `BinaryQuadraticModel.energies()` now return a NumPy array with dtype `np.float64` be default. Previously they defaulted to match the dtype of the model.

- Bounds for integer variables are no longer rounded to the nearest int in `QuadraticModel` and `ConstrainedQuadraticModel`.

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.

- Deprecate `cls` parameter in `dimod.generators.random.gnm_random_bqm()`, `dimod.generators.random.gnp_random_bqm()`, `dimod.generators.random.uniform()`, `dimod.generators.random.ran_r()`, `dimod.generators.random.randint()`, and `dimod.generators.random.doped()`.

- Deprecate `cls` parameter in `dimod.serialization.coo.load()` and `dimod.serialization.coo.loads()`.

Bug Fixes

- `QuadraticModel.energies()` and `BinaryQuadraticModel.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 a `ValueError`.

- `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.

- `Comparison.__repr__()` now correctly returns a representation that can be passed to `eval()`.

- Fix `dimod.typing.Bias` to correctly exclude `numpy.complexfloating`.

- Attempting to relabel two model variables to the same target will now correctly raise a `ValueError`. See [1110](https://github.com/dwavesystems/dimod/issues/1110).

- Fix energy calculations for quadratic models with squared terms. See [1136](https://github.com/dwavesystems/dimod/issues/1136).

- `dimod.serialization.fileview.load()` now correctly propagates `KeyError` from the loading function.

- `ExactCQMSolver.sample_cqm` now uses `SampleSet.from_samples_cqm`. This corrects a small error in the calculation of constraint satisfaction.

- `dimod.generators.random_knapsack()` and `dimod.generators.random_bin_packing()` no longer use a fixed seed by default.

- `ConstrainedQuadraticModel.add_discrete()`, `ConstrainedQuadraticModel.add_constraint_from_iterable()`, and `ConstrainedQuadraticModel.add_discrete_from_model()` now correctly raise an error when given a binary variable that overlaps with an existing discrete constraint. See [1149](https://github.com/dwavesystems/dimod/issues/1149).

- `SampleSet.from_samples_bqm` now handles empty list input correctly.

0.10.12

New Features

- Add `cascade` keyword argument to `ConstrainedQuadraticModel.fix_variable()` and `ConstrainedQuadraticModel.fix_variables()`. These methods also now return any variables fixed using the <span class="title-ref">cascade</span> keyword argument.

<!-- -->

- Add `QuadraticModel::swap_variables()` and `BinaryQuadraticModel::swap_variables()` methods to the C++ code.

<!-- -->

- Reintroduce `BinaryQuadraticModel.to_serializable()` and `BinaryQuadraticModel.from_serializable()` methods that were previously removed in dimod 0.10.0, see [847](https://github.com/dwavesystems/dimod/pull/847).

- Add `.fix_variable()` and `.fix_variables()` methods to `ConstrainedQuadraticModel`.

<!-- -->

- Add `.fix_variable()` and `.fix_variables()` methods to `QuadraticModel`.

<!-- -->

- Add `QuadraticModel::resize()` method in C++ code.

<!-- -->

- Speed up printing sample sets with a large number of variables. See [1068](https://github.com/dwavesystems/dimod/issues/1068).

<!-- -->

- Add ability to pass a slice to `Variables.__getitem__`. This allows for syntax like `variables[:5]` which will return a new `Variables` object. See [1069](https://github.com/dwavesystems/dimod/issues/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`, and `dimod.IntegerArray`. These methods build numpy object arrays from their respective generator methods `dimod.Binaries`, `dimod.Spins` and `dimod.Integers`.


Upgrade Notes

- `ConstrainedQuadraticModel.fix_variable()` and `ConstrainedQuadraticModel.fix_variables()` now raise a `ValueError` if given a variable not in the model.

<!-- -->

- Make `use_bytes` and `bytes_type` keyword-only arguments in `BinaryQuadraticModel.to_serializable()`. Note that `BinaryQuadraticModel.to_serializable()` was removed in 0.10.0 but restored in 0.10.12.

<!-- -->

- The `bias_dtype` keyword-only argument in `BinaryQuadraticModel.to_serializable()` now does nothing. Note that `BinaryQuadraticModel.to_serializable()` was removed in 0.10.0 but restored in 0.10.12.

- `QuadraticViewsMixin` now has `.add_linear()` as an abstract method.

<!-- -->

- `BinaryQuadraticModel.fix_variable()` no longer raises a `ValueError` when 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.QuadraticModelMixin` now has an abstract property `.offset`.

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 an `AttributeError`.


- Fix setting linear and quadratic biases on vartype views when the relevant variable or interaction does not already exist.

<!-- -->

- `multiplcation_circuit` now adds the carry from the most significant column in a row into the most significant column of the next row.

Page 16 of 27

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.