Dimod

Latest version: v0.12.14

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

Scan your dependencies

Page 7 of 26

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.11.0rc1

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.

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.

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.

Bug Fixes

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

0.11.0rc0

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.3. 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()`.

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.

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

Page 7 of 26

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.