Recent Releases of dimod

dimod - 0.12.21

New Features

  • Add support for Python 3.14.

Bug Fixes

  • Fix Variables._relabel() method. Previously when given a superset of labels that happen to correspond to valid indices the wrong relabelling would sometimes be applied. See also #1408.

- Python
Published by arcondello 11 months ago

dimod - 0.12.20

Bug Fixes

  • Fix inheritance in ComposedSampler and ComposedPolySampler so that composite attributes override sampler attributes.

See #1402.

- Python
Published by arcondello over 1 year ago

dimod - 0.12.19

New Features

  • Use dict rather than collections.OrderedDict to capture the inputs in TrackingComposite. See also #1395.
  • Add dimod.Scoped abstract base class for components that allocate scope-bound resources.
  • Implement dimod.Scoped interface on dimod.Sampler and dimod.Composite. See dwave-system#555.
  • Add quadratic_multi_knapsack generator function to dimod.generators.

- Python
Published by arcondello over 1 year ago

dimod - 0.12.18

New Features

  • Add SampleSet.wait_id() as a proxy to the underlying QPU result future, when sample set is constructed from such a future. See #1392.
  • Add multi_knapsack() generator function to dimod.generators.
  • Add quadratic_knapsack() generator function to dimod.generators.

Upgrade Notes

  • Drop support for Python 3.8.

Bug Fixes

  • Fix warnings caused by using deprecated type aliases.

- Python
Published by arcondello over 1 year ago

dimod - 0.12.17

New Features

  • Allow BinaryQuadraticModel.contract_variables() to contract variables without an interaction. Previously it raised a ValueError.
  • Add power_r() generator function to dimod.generators. The weights of the generated Ising problems follow a power-law distribution with respect to their magnitude.
  • Add bin_packing generator function to dimod.generators.
  • Add labels keyword argument to ConstrainedQuadraticModel.iter_constraint_data() and ConstrainedQuadraticModel.iter_violations() methods. The labels keyword argument allows a user to generate the data/violations for a subset of the constraints. See #1381.
  • Add knapsack generator function to dimod.generators.
  • Support Python 3.13.
  • Add quadratic_assignment generator function to dimod.generators.

- Python
Published by arcondello almost 2 years ago

dimod - 0.12.16

New Features

  • Add dimod/typing.pdx. This allows users to cimport common C types into other namespaces.
  • Support NumPy 2.0. Also, no longer require NumPy at build-time.
  • Reduce the size of manylinux wheels.

Upgrade Notes

  • Remove Cython fused types dimod.cyutilities.SignedInteger, dimod.cyutilities.UnsignedInteger, dimod.cyutilities.Integer, and dimod.cyutilities.ConstInteger, dimod.cyutilities.Numeric, and dimod.cyutilities.ConstNumeric. Use the types in dimod.typing instead.
  • Remove Cython fused types dimod.discrete.cydiscrete_quadratic_model.Unsigned, dimod.discrete.cydiscrete_quadratic_model.Integral32plus, dimod.discrete.cydiscrete_quadratic_model.Numeric, and dimod.discrete.cydiscrete_quadratic_model.Numeric32plus. Use the types in dimod.typing instead.
  • Don\'t include debug info in built .so files.

- Python
Published by arcondello about 2 years ago

dimod - 0.12.15

New Features

  • Add C++ QuadraticModelBase::remove_interactions() method.
  • Add dimod.generators.random_binary_paint_shop_problem() binary paint shop problem generator.
  • Add an abstract method QuadraticViewsMixin.add_quadratic().
  • Add a method QuadraticViewsMixin.add_quadratic_from() to add quadratic interactions. This method is intended to be used as follows: ConstrainedQuadraticModel.objective.add_quadratic_from(), similarly to ConstrainedQuadraticModel.objective.add_linear_from().
  • Add check_overlaps keyword argument to ConstrainedQuadraticModel.add_discrete(), see #1364.

Upgrade Notes

  • All sublcasses of QuadraticViewsMixin, including ObjectiveView, QuadraticModel and BinaryQuadraticModel, now require to have the method add_quadratic().

- Python
Published by arcondello about 2 years ago

dimod - 0.12.14

New Features

  • Add C++ dimod::abc::QuadraticModelBase::remove_variables() method and accompanying overloads.
  • Speed up C++ dimod::Expression::remove_variables() method.

- Python
Published by arcondello over 2 years ago

dimod - 0.12.13

New Features

  • Build wheels for Python 3.12.
  • Build C++ extensions with Cython 3.

- Python
Published by arcondello over 2 years ago

dimod - 0.12.12

New Features

  • Add mimo() function for generating a multi-input multiple-output (MIMO) channel-decoding problem.
  • Add coordinated_multipoint() function for generating a coordinated multi-point (CoMP) decoding problem.

- Python
Published by arcondello almost 3 years ago

dimod - 0.12.11

New Features

  • Make SampleSet.relabel_variables() non-blocking in all cases. Previously it would block when inplace=False.

  • Implement SampleSet serialization schema version 3.2.0.

    Version 3.2.0 replaces float values that represent integers with int in the "data" field of any arrays returned by SampleSet.to_serializable(). In some pathological cases this can result in a much smaller representation when the data dictionaries are json-serialized by avoiding the redundant .0 appended to every value.

    This is a backwards-compatible change.

  • Add penalization_method parameter to BinaryQuadraticModel.add_linear_inequality_constraint(). It allows the use of unbalanced penalization https://arxiv.org/abs/2211.13914 instead of the slack variables method for the inequality constraints.

Bug Fixes

  • Fix the behavior of SampleSet.relabel_variables() when inplace=True. Previously the method incorrectly returned a copy when the sample set was unresolved.

- Python
Published by arcondello almost 3 years ago

dimod - 0.12.10

Bug Fixes

  • Fix dimod::ConstrainedQuadraticModel::fix_variables() C++ method to work correctly with quadratic objectives and constraints. This fixes a bug introduced in dimod 0.12.5. See #1351.

- Python
Published by arcondello almost 3 years ago

dimod - 0.12.9

New Features

  • Add Constraint.is_onehot() method.
  • Add dimod::Expression::remove_variables() C++ method. This method is useful for removing variables in bulk from the objective or constraints of a constrained quadratic model.

- Python
Published by arcondello almost 3 years ago

dimod - 0.12.8

New Features

  • Add dimod.generators.magic_square() which allows for the generation of a constrained quadratic model whose feasible solutions are normal magic squares. The function also generates magic squares of squares when passed power=2 as a keyword argument.
  • Implement version 2.0 of constrained quadratic model serialization. See ConstrainedQuadraticModel.to_file() for details.
  • Improve LP file reading by wrapping HiGHS LP file parser.
  • Add C++ ConstrainedQuadraticModel::remove_constraints_if() method.

Upgrade Notes

  • Remove the ObjectView.to_file() method.
  • Remove the ConstraintView.to_file() method.
  • Remove dimod::lp C++ namespace.
  • Drop support for Python 3.7.

Bug Fixes

  • Fix ConstrainedQuadraticModel.from_discrete_quadratic_model() incorrectly formulating the discrete constraints. This bug was introduced in version 0.12.7.
  • Fix dimod.generators.frustrated_loop() to correctly handle graphs with tuple labels. See #1342.

- Python
Published by arcondello about 3 years ago

dimod - 0.12.8rc2

Bug Fixes

  • Fix loading constrained quadratic models that are serialized with CQM serialization version 2.0 and that have tuple labels.
  • Support serializing constraints that need more than 2GB to save.

- Python
Published by arcondello about 3 years ago

dimod - 0.12.8rc1

Fixes

  • Fix ConstrainedQuadraticModel.from_discrete_quadratic_model() incorrectly formulating the discrete constraints. This bug was introduced in version 0.12.7.

- Python
Published by arcondello about 3 years ago

dimod - 0.12.8rc0

New Features

  • Implement version 2.0 of constrained quadratic model serialization. See ConstrainedQuadraticModel.to_file() for details.

Upgrade Notes

  • Remove the ObjectView.to_file() method.
  • Remove the ConstraintView.to_file() method.

- Python
Published by arcondello about 3 years ago

dimod - 0.12.7

New Features

  • Implement CaseLabelDQM.to_file() when the keyword argument ignore_labels is true. Also make the error message clearer in the case that ignore_labels is false.
  • Improve the performance of ConstrainedQuadraticModel.from_discrete_quadratic_model().

Upgrade Notes

  • Make the arguments of DiscreteQuadraticModel.to_file() keyword-only.

- Python
Published by arcondello about 3 years ago

dimod - 0.12.6

New Features

  • Add dimod::Constraint::clear() C++ method.

- Python
Published by arcondello about 3 years ago

dimod - 0.12.5

New Features

  • Add dimod::ConstrainedQuadraticModel::constraints() method that returns a view of the constraints that is easily iterated over.

  • Improve the performance of fixing and removing variables from constrained quadratic model expressions.

  • Implement the Expression::fix_variable() C++ method. Previously it would throw std::logic_error("not implemented - fix_variable").

  • Improve the performance of ConstrainedQuadraticModel.fix_variable() and ConstrainedQuadraticModel.fix_variables().

  • Add inplace keyword argument to ConstrainedQuadraticModel.fix_variables().

Upgrade Notes

  • Add an overload to the C++ QuadraticModel::remove_variable() method. This is binary compatible, but it makes &remove_variable ambiguous.

  • The ConstrainedQuadraticModel.fix_variables() function now returns a ConstrainedQuadraticModel rather than an empty dictionary.

  • Change lp.load() and lp.loads() to raise a ValueErrorr rather than a RuntimeError when given an invalid file format.

  • Make beta_range, num_reads, and num_sweeps keyword-only arguments for SimulatedAnnealingSampler.sample().

  • Make num_reads and seed keyword-only arguments for RandomSampler.sample().

  • Make initial_states, initial_states_generator, num_reads and seed keyword-only arguments for IdentitySampler.sample().

  • Make rtol and atol keyword-only arguments for ExactCQMSolver.sample_cqm().

Bug Fixes

  • Fix lp.load() and lp.loads() functions to correctly handle maximization objectives. See #1321.

- Python
Published by arcondello about 3 years ago

dimod - 0.12.4

New Features

  • Improve the performance of the ConstrainedQuadraticModel.add_variables() method.
  • Allow discrete constraints added by ConstrainedQuadraticModel.add_discrete() to have zero or one variables.

Upgrade Notes

  • Remove the undocumented cyConstrainedQuadraticModel.add_variable() method.

Bug Fixes

  • Fix ConstrainedQuadraticModel.add_variable() to raise a ValueError when given an inconsistent variable type. Previously it incorrectly raised a TypeError.
  • Fix ConstrainedQuadraticModel.add_variable() to raise a ValueError when given invalid variable bounds.

- Python
Published by arcondello over 3 years ago

dimod - 0.12.3

New Features

  • Add compress keyword argument to ConstrainedQuadraticModel.to_file().
  • Add ConstraintView.set_weight() method. This allows users to set the weight of existing constraints.

Upgrade Notes

  • When the constraint is hard, ConstraintView.penalty() now returns None. Previously it would return either 'linear' or 'quadratic'.

Bug Fixes

  • Fix the copy keyword argument of ConstrainedQuadraticModel.add_constraint_from_model(). Previously it would always make a copy.
  • Add missing #include in dimod/include/dimod/abc.h.
  • Fix ConstrainedQuadraticModel.add_constraint_from_iterable() to no longer raise a NotImplementedError when given a weight.
  • Fix ConstrainedQuadraticModel.add_constraint() to raise a ValueError rather than a NotImplementedError when given an invalid penalty.

- Python
Published by arcondello over 3 years ago

dimod - 0.12.2

New Features

  • Implement Expression::remove_variable() method in the C++ code.
  • Implement Expression.remove_variable() method in the Python code.
  • Add dimod/libcpp/expression.pxd and dimod/libcpp/constraint.pxd.

- Python
Published by arcondello over 3 years ago

dimod - 0.12.1

Bug Fixes

  • Add the ability to set offsets on ObjectiveView and ConstraintView. This was previously removed in dimod 0.12.0. See #1287
  • Add ObjectiveView.add_linear_from() and ConstraintView.add_linear_from() methods. These were previously removed in dimod 0.12.0.
  • Add ObjectiveView.add_variable() and ConstraintView.add_variable() methods. These were previously removed in dimod 0.12.0.

- Python
Published by arcondello over 3 years ago

dimod - 0.12.0

Prelude

The entire C++ library has been rewritten for performance and consistency.

New Features

  • New dimod::abc::QuadraticModelBase abstract base class.
  • Better performance for linear models.
  • Add dimod.cyqmbase.cyQMBase_template Cython class to serve as an abstract base class for Cython quadratic models.
  • Break dimod/libcpp.pxd into a full Cython subpackage to mirror the structure under dimod/include/. This allows for better organization, and less need to recompile all Cython files when changing parts of the C++ library. Packages that depend on dimod are still encouraged to use the from dimod.libcpp cimport ... syntax.
  • Build wheels for Python 3.11.

  • Add C++ dimod::ConstrainedQuadraticModel class.

  • Add C++ ConstrainedQuadraticModel.add_constraint() overload that allows a user to move a binary quadratic model or quadratic model as a constraint.
  • Add C++ ConstrainedQuadraticModel.constraint_weak_ptr() method.
  • Make BinaryQuadraticModel.vartype callable. This allows for more uniform syntax between binary quadratic models, quadratic models and constrained quadratic models.
  • Replace current ConstrainedQuadraticModel implementation with one implemented in Cython.
  • Add ConstrainedQuadraticModel.clear() method.

Bug Fixes

  • Fix a performance regression introduced in 0.10.0 when loading linear binary quadratic models from files.
  • Fix the handling of self-loops in dimod::Expression::add_quadratic() and similar methods.
  • Fix C++ ConstrainedQuadraticModel.remove_variable() method. Previously it would segmentation fault.

Upgrade Notes

  • Rewrite dimod::QuadraticModelBase and move it to dimod::abc::QuadraticModelBase in abc.h.
  • Move dimod::Vartype, dimod::vartype_info, and dimod::vartype_limits` tovartypes.h``.
  • Remove the dimod::Neighborhood class.
  • Remove iterators.h.
  • Move dimod::BinaryQuadraticModel to binary_quadratic_model.h.
  • Remove dimod.binary.cybqm.cyBQMBase class.
  • Remove dimod.quadratic.cyqm.cyQMBase class.
  • Build manylinux2014 wheels. Previously we built manylinux2010.
  • Build arm64 and x86_64 wheels for macos. Previously we built x86_64 and universal2.

Deprecation Notes

  • Deprecate the cascade keyword argument in ConstrainedQuadraticModel.fix_variable().
  • Deprecate the cascade keyword argument in ConstrainedQuadraticModel.fix_variables().

- Python
Published by arcondello over 3 years ago

dimod - 0.12.0rc1

- Python
Published by arcondello over 3 years ago

dimod - 0.12.0.dev3

Fixes

  • Fix C++ ConstrainedQuadraticModel.remove_variable() method. Previously it would segmentation fault.

- Python
Published by arcondello over 3 years ago

dimod - 0.12.0.dev2

- Python
Published by arcondello over 3 years ago

dimod - 0.12.0.dev1

New Features

  • Add C++ dimod::ConstrainedQuadraticModel class.
  • Make BinaryQuadraticModel.vartype callable. This allows for more uniform syntax between binary quadratic models, quadratic models and constrained quadratic models.
  • Replace current ConstrainedQuadraticModel implementation with one implemented in Cython.

- Python
Published by arcondello over 3 years ago

dimod - 0.11.6

New Features

  • Add Variables._remove() method.
  • Added weight and penalty parameters on ConstrainedQuadraticModel.add_constraint methods to encoded weighted constraints.
  • Add constrained quadratic model serialization version 1.3 to support soft constraints.

- Python
Published by arcondello over 3 years ago

dimod - 0.12.0.dev0

Prelude

The entire C++ library has been rewritten for performance and consistency.

New Features

  • New dimod::abc::QuadraticModelBase abstract base class.
  • Better performance for linear models.
  • Add dimod.cyqmbase.cyQMBase_template Cython class to serve as an abstract base class for Cython quadratic models.
  • Break dimod/libcpp.pxd into a full Cython subpackage to mirror the structure under dimod/include/. This allows for better organization, and less need to recompile all Cython files when changing parts of the C++ library. Packages that depend on dimod are still encouraged to use the from dimod.libcpp cimport ... syntax.
  • Build wheels for Python 3.11.

Upgrade Notes

  • Rewrite dimod::QuadraticModelBase and move it to dimod::abc::QuadraticModelBase in abc.h.
  • Move dimod::Vartype, dimod::vartype_info, and dimod::vartype_limits` tovartypes.h``.
  • Remove the dimod::Neighborhood class.
  • Remove iterators.h.
  • Move dimod::BinaryQuadraticModel to binary_quadratic_model.h.
  • Remove dimod.binary.cybqm.cyBQMBase class.
  • Remove dimod.quadratic.cyqm.cyQMBase class.
  • Build manylinux2014 wheels. Previously we built manylinux2010.
  • Build arm64 and x86_64 wheels for macos. Previously we built x86_64 and universal2.

- Python
Published by arcondello over 3 years ago

dimod - 0.11.6rc1

- Python
Published by arcondello over 3 years ago

dimod - 0.11.6.dev2

Bug Fixes

  • Fix the type of soft constraint weights when loaded from files. The issue was introduced in 0.11.6.dev1.

- Python
Published by arcondello almost 4 years ago

dimod - 0.11.6.dev1

Bug Fixes

  • Fix the performance of ConstrainedQuadraticModel.from_file() for constrained quadratic models with a large number of constraints. The poor performanc was accidentally introduced in 0.11.6.dev0.

- Python
Published by arcondello almost 4 years ago

dimod - 0.11.6.dev0

New Features

  • Add Variables._remove() method.
  • Added weight and penalty parameters on ConstrainedQuadraticModel.add_constraint methods to encoded weighted constraints.
  • Add constrained quadratic model serialization version 1.3 to support soft constraints.

- Python
Published by arcondello almost 4 years ago

dimod - 0.11.5

New Features

  • Add ConstrainedQuadraticModel.is_linear() method.
  • Add ConstrainedQuadraticModel.spin_to_binary() method.
  • Add Variables._clear() method for use by classes that have Variables as an attribute.
  • Add C++ dimod::QuadraticModel::clear() method.
  • Add C++ dimod::BinaryQuadraticModel::clear() method.
  • Add QuadraticModel.clear() method.
  • Add BinaryQuadraticModel.clear() method.
  • Add typing support for the dimod.variables.Variables class. See #1221.

Bug Fixes

  • Fix as_samples() when given a SampleSet and using the labels_type keyword argument. Previously it would raise a TypeError. This fix allows constructions like bqm.energies(sampleset) to function correctly.
  • Refactor dimod.typing.SamplesLike and dimod.typing.SampleLike. SampleLike now correctly includes constructions like ([0, 1], 'ab').
  • Make Vartype.INTEGER and Vartype.REAL pickleable. This fixes the pickling of many downstream objects like QuadraticModel and SampleSet.

- Python
Published by arcondello almost 4 years ago

dimod - 0.11.4

New Features

  • Add ConstrainedQuadraticModel.__str__() method. See #1188.
  • Speed up the construction of Variables objects from a range or another Variables.
  • Add optional keyword argument labels_type to the as_samples() function.
  • Speed up BinaryQuadraticModel.energies() and QuadraticModel.energies() in cases where the model has a small subset of the variables in the samples.
  • Speed up SampleSet.from_samples_cqm() in cases where there are constraints with a small number of variables relative to the objective.

- Python
Published by arcondello almost 4 years ago

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

Bug Fixes

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

- Python
Published by arcondello about 4 years ago

dimod - 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
  • 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 as part of the 0.11.0 release.

- Python
Published by arcondello about 4 years ago

dimod - 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 pyparsing dependency. The functionality that required it was removed in version 0.11.0.
  • Added missing import of BinaryQuadraticModel required by dimod.serialization.json.DimodDecoder

- Python
Published by arcondello about 4 years ago

dimod - 0.11.0

Prelude

Add support for real-valued variables.

New Features

  • Improved deprecation warnings and documentation. See #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.
  • 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 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 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.
  • 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
  • In the cqmtobqm 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.

- Python
Published by arcondello about 4 years ago

dimod - 0.10.17

New Features

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

- Python
Published by arcondello about 4 years ago

dimod - 0.11.0rc1

Prelude

Add support for real-valued variables.

New Features

  • Improved deprecation warnings and documentation. See #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 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 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.
  • 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

- Python
Published by arcondello over 4 years ago

dimod - 0.10.16

New Features

  • Add SampleSet.from_samples_cqm() method.

Bug Fixes

  • 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.
  • SampleSet.from_samples_bqm now handles empty list input correctly.

- Python
Published by arcondello over 4 years ago

dimod - 0.11.0rc0

Prelude

Add support for real-valued variables.

New Features

  • Improved deprecation warnings and documentation. See #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 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 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

- Python
Published by arcondello over 4 years ago

dimod - 0.10.15

Deprecation Notes

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

Bug Fixes

  • Fix energy calculations for quadratic models with squared terms. See #1136.
  • dimod.serialization.fileview.load() now correctly propagates KeyError from the loading function.

- Python
Published by arcondello over 4 years ago

dimod - 0.11.0.dev0

Prelude

Add support for real-valued variables.

New Features

  • 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().

Deprecation Notes

  • In the future, ConstrainedQuadraticModel.num_quadratic_variables() will also include the objective towards the count by default.

- Python
Published by arcondello over 4 years ago

dimod - 0.10.14

New Features

  • 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.
  • Add ConstrainedQuadraticModel.remove_constraint() method. See #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

Deprecation Notes

  • 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().

Bug Fixes

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

- Python
Published by arcondello over 4 years ago

dimod - 0.10.13

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.
  • Add SamplesLike and SampleLike to dimod.typing. See #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
  • Add BinaryQuadraticModel.maximum_energy_delta() method.
  • Add ConstrainedQuadraticModel.set_lower_bound() method. See #1105.
  • Add ConstrainedQuadraticModel.set_upper_bound() method. See #1105.

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.

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.

- Python
Published by arcondello over 4 years ago

dimod - 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 cascade 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.

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.

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.

- Python
Published by arcondello over 4 years ago

dimod - 0.10.11

New Features

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

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

- Python
Published by arcondello over 4 years ago

dimod - 0.10.10

Bug Fixes

  • Fix energy calculation in binary quadratic models and quadratic models with no variables. Previously an empty sample would incorrectly raise an error.
  • bqm_structured decorator now correctly raises a BinaryQuadraticModelStructureError error in cases where nodes of the structured sampler do not include all BQM variables.

- Python
Published by arcondello over 4 years ago

dimod - 0.10.9

New Features

  • You can now install dwave-preprocessing as part of the dimod install with pip install dimod[all]
  • Add ConstrainedQuadraticModel.relabel_variables() method to relabel the variables in the objective and constraints.
  • Add drop_variables() and keep_variables() functions that allow the user to create a new sample set from an old one, retaining only a subset of the variables.
  • Backport the use of dimod.views.quadratic.Adjacency, dimod.views.quadratic.Linear, and dimod.views.quadratic.Quadratic for use with the deprecated AdjVectorBQM and AdjDictBQM binary quadratic model classes.
  • Backport iter_neighborhood(), reduce_linear(), reduce_neighborhood(), and reduce_quadratic() methods for use with the deprecated AdjVectorBQM and AdjDictBQM binary quadratic model classes.

Upgrade Notes

  • dwave-preprocessing is no longer a direct dependency. It can still be installed with pip install dimod[all].

Bug Fixes

  • Fix instance and subclass testing between deprecated and modern binary quadratic model views. For example instance(bqm.quadratic, dimod.core.bqm.BQMView) now returns True for modern binary quadratic models.

- Python
Published by arcondello over 4 years ago

dimod - 0.10.8

New Features

  • Add ExactCQMSolver class with solve_cqm method to reference solvers.
  • Add multiplication_circuit(), a binary quadratic model generator for multiplication circuits.
  • Add optional second parameter to multiplication_circuit() enabling the multiplying arguments of different sizes.
  • dimod.testing.load_sampler_bqm_tests() now also tests the deprecated BQM subclasses, namely AdjVectorBQM and AdjDictBQM.
  • Return a named tuple from BinaryQuadraticModel.to_numpy_vectors().
  • Added make_quadratic_cqm() - like make quadratic, but returns a CQM treating auxillary variable constraints as proper constraints instead of adding them to the objective.
  • Add independent_set, maximum_independent_set, and maximum_weight_independent_set functions to dimod.generators.
  • Add official support for Python 3.10.
  • Add aarch64 wheels for linux and universal wheels for osx.
  • Added reduce_binary_polynomial() that factors out a common basis for make_quadratic() and a future make_quadratic_cqm(). Given a BinaryPolynomial it return a list of reduced terms using auxillary variables and a list of constraints on them.

Deprecation Notes

  • Deprecate dimod.decorators.bqm_index_labelled_input() decorator.

Bug Fixes

  • Fix ConstrainedQuadraticModel.add_discrete() to correctly accept an iterator of variables as documented rather than instead requiring a collection.
  • Fixed edge case bug when determining dtype in as_sample().
  • No longer throw a TypeError from ConstrainedQuadraticModel.from_lp_file when adding a integer quadratic term from constraints.
  • Binary quadratic models with object data type now correctly support energy calculations where the given samples contain a superset of the variables in the model. This makes them consistent with binary quadratic models with np.float32 and np.float64 data types.
  • Fix BinaryQuadraticModel.add_linear_from to work correctly with iterables. Before linear had to be a mapping or (incorrectly) an iterator.

- Python
Published by arcondello over 4 years ago

dimod - 0.10.7

New Features

  • Add ConstrainedQuadraticModel.is_equal() and ConstrainedQuadraticModel.is_almost_equal() methods. See #1012
  • Add QuadraticModel.is_almost_equal() method
  • Support equality checks between quadratic models and binary quadratic models in BinaryQuadraticModel.is_equal(), BinaryQuadraticModel.is_almost_equal(), QuadraticModel.is_equal(), and QuadraticModel.is_almost_equal() methods.
  • Add GraphLike type hint to dimod.typing.
  • Add ConstrainedQuadraticModel.iter_constraint_data(), ConstrainedQuadraticModel.iter_violations() and ConstrainedQuadraticModel.violations() methods. See 971.
  • Added from_lp_file classmethod to ConstrainedQuadraticModel that reads input LP file and converts it to CQM instance.
  • ConstrainedQuadraticModel.set_objective now accepts an iterable.
  • Add ConstrainedQuadraticModel.check_feasible method.
  • Add random_bin_packing function with the same functionality as the (now deprecated) bin_packing.
  • Allow BinaryQuadraticModel and QuadraticModel to be divided by a scalar or squared. See #864, #984.
  • Add SampleSet.filter() method that returns a sample set with data rows filtered by a given predicate.
  • Add .to_dict() and .from_dict() methods to the sample inverter returned by the cqm_to_bqm function. The methods return a json serializable representation of the inversion for storage if needed. See 977.
  • Add random_multi_knapsack function with the same functionality as the (now deprecated) multi_knapsack.
  • Add random_knapsack function with the same functionality as the (now deprecated) knapsack.
  • Allow the offset of a BinaryQuadraticModel to be specified as a keyword argument.
  • Add PEP 561 compatibility to allow tools like mypy to auto-detect typing hints. See #980.

Upgrade Notes

  • The cls keyword argument of the chimera_anticluster function now does nothing.

Deprecation Notes

  • Deprecate cls keyword argument of the chimera_anticluster function.
  • Deprecate bin_packing function in favour of random_bin_packing.
  • Deprecate multi_knapsack function in favour of random_multi_knapsack.
  • Deprecate knapsack function in favour of random_knapsack.

Bug Fixes

  • QuadraticModel can now be multiplied by a number in place.
  • Fix energy calculations for integer variables with large values. See #982.
  • Make dimod.BinaryQuadraticModel a virtual subclass of dimod.core.bqm.BQM.

- Python
Published by arcondello almost 5 years ago

dimod - 0.9.16

Fixes

  • Backport docs build fix for Sphinx 4. https://github.com/dwavesystems/dimod/pull/983
  • Backport Python 3.5 support removal. https://github.com/dwavesystems/dimod/pull/985
  • Backport dependence on dwave-preprocessing to fix dwave-system (>1.7.0) support of both dimod 0.9 and 0.10. https://github.com/dwavesystems/dimod/pull/981

- Python
Published by randomir almost 5 years ago

dimod - 0.10.6

New Features

  • Add Binaries, Spins and Integers functions. See #918.
  • Add DiscreteQuadraticModel.get_cases method to match CaseLabelDQM.get_cases.
  • Implement QuadraticModel.remove_interaction method, previously it raised a NotImplementedError error.
  • Add linear option as a new slack_method for DiscreteQuadraticModel.add_linear_inequality_constraint method. This will add only one discrete variable to an inequality constraint with linear number of cases, according to right hand side value of the constraint.
  • Add quicksum function for faster summation of QuadraticModel and BinaryQuadraticModel. Python's built-in sum continues to work, but quicksum will generally be faster when adding many objects.
  • Add a generator, dimod.generators.binary_encoding, to create a binary quadratic model that encodes an integer.
  • Add methods to construct a constrained quadratic model from other model types:

    • ConstrainedQuadraticModel.from_discrete_quadratic_model with an alias ConstrainedQuadraticModel.from_dqm
    • ConstrainedQuadraticModel.from_quadratic_model with two aliases ConstrainedQuadraticModel.from_qm and ConstrainedQuadraticModel.from_bqm

    See #866.

  • Add QuadraticModel.add_quadratic_from() method.
  • Add QuadraticModel.add_linear_from() method.
  • Add ConstrainedQuadraticModel.lower_bound() and ConstrainedQuadraticModel.upper_bound() methods.
  • Add cqm_to_bqm function.
  • Add ConstrainedQuadraticModel.substitute_self_loops method that replaces integer self-loops by introducing a new variable and adding a constraint.
  • Add copy_always parameter to Initialized.parse_initial_states.
  • Add new binary quadratic model generators for simple logic gates:

    • dimod.generators.and_gate
    • dimod.generators.fulladder_gate
    • dimod.generators.halfadder_gate
    • dimod.generators.or_gate
    • dimod.generators.xor_gate

    See #951.

  • QuadraticModel.energies, QuadraticModel.energy, BinaryQuadraticModel.energies, and BinaryQuadraticModel.energy now all support samples containing a superset of the variables in the model. Any variables not in the model are ignored when calculating the energy.
  • Labels for dimod.Spin, dimod.Binary, and dimod.Integer are no longer required positional arguments. By default, unique labels are applied via the uuid module.

Upgrade Notes

  • ConstrainedQuadraticModel.objective is now always a QuadraticModel. Previously it could either be a BinaryQuadraticModel or a QuadraticModel.
  • ConstrainedQuadraticModel.objective now contains all variables in the constrained quadratic model. Previously it could contain a subset of the variables.

Deprecation Notes

  • Deprecate ConstrainedQuadraticModel.variables.vartypes, ConstrainedQuadraticModel.variables.lower_bounds, and ConstrainedQuadraticModel.variables.upper_bounds attributes.
  • Deprecate ConstrainedQuadraticModel.variables.vartype() method.

Bug Fixes

  • dimod::QuadraticModelBase.remove_interaction now correctly returns true when removing a self-loop.
  • Return bool rather than numpy.bool_ from QuadraticModel.is_equal and BinaryQuadraticModel.is_equal when comparing empty models to numbers.
  • Fix as_samples and Initialized.parse_initial_states by ensuring that the copy argument is not ignored in as_samples and Initialized.parse_initial_states does not modify any input data. See #861.
  • Remove unused ConstrainedQuadraticModel.labels instance variable.
  • Fix adding constraints with integer variables via ConstrainedQuadraticModel.add_constraint_from_iterable when those integer variables have pre-existing lower or upper bounds. See #943.
  • Correctly account for the offset when multiplying binary quadratic models
  • BinaryQuadraticModel.energies now has consistent behaviour accross all data types when given samples containing a superset of the variables in the model. Previously binary quadratic models with object data type would allow a superset of variables, while float64 and float32 would not.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.5

New Features

  • Add QuadraticModel.set_upper_bound and QuadraticModel.set_lower_bound methods.

Upgrade Notes

  • The preprocessing extra install argument has been removed.
  • Remove dimod.meta namespace. Its functionality, SamplerABCMeta and samplemixinmethod, has been migrated to the dimod.core.sampler namespace.

Bug Fixes

  • Fix QuadraticModel.energies when given samples with values greater than the maximum value representable by an 8 bit integer. Previously samples were incorrectly cast to 8 bit integers.
  • When a QuadraticModel already has an integer variable, adding it with QuadraticModel.add_variable with different lower or upper bounds now correctly raises an exception. Likewise, adding or multiplying the same variable symbolically with different bounds will also raise an exception.
  • When a ConstrainedQuadraticModel already has an integer variable, adding it as part of a constraint or objective with different lower or upper bounds now correctly raises an exception.
  • Make dimod.INTEGER correctly deepcopy-able.
  • Fix (deprecated) AdjVectorBQM.to_file and AdjVectorBQM.from_file. See #898.
  • Fix BinaryQuadraticModel.energies for a BQM with dtype=object and a single variable with an integer bias. Previously it would raise a numpy.core._exceptions._UFuncOutputCastingError.
  • Fix energy calculation when the lower bound (lb) equals the upper bound (lb) in DiscreteQuadraticModel.add_linear_inequality_constraint and BinaryQuadraticModel.add_linear_inequality_constraint.
  • Promote dwave-preprocessing to a full dependency of dimod to avoid issues that occur when dimod is a required package but dwave-preprocessing is not.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.4

Bug Fixes

  • Fix QuadraticModel.energies when given samples with values greater than the maximum value representable by an 8 bit integer. Previously samples were incorrectly cast to 8 bit integers.
  • Fix energy calculation when the lower bound (lb) equals the upper bound (lb) in DiscreteQuadraticModel.add_linear_inequality_constraint and BinaryQuadraticModel.add_linear_inequality_constraint.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.3

New Features

  • Add QuadraticModel.change_vartype() method.
  • Add C++ dimod::QuadraticModel::change_vartype() method. Also add non-const versions of dimod::QuadraticModel::vartype(), dimod::QuadraticModel::lower_bound(), and dimod::QuadraticModel::upper_bound().

Bug Fixes

  • Fix QuadraticModel.spin_to_binary not correctly updating the variable type of the changed variables.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.2

Bug Fixes

  • Fix case where adding linear and quadratic biases whose class requires arguments on construction to a BinaryQuadraticModel with object dtype could fail.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.1

New Features

  • Add an optional label keyword argument to ConstrainedQuadraticModel.add_discrete. The method also now returns the assigned label, whether supplied or generated. This is consistent with ConstrainedQuadraticModel.add_constraint.
  • cyBQM and cyQM fused types can now be cimported from the dimod namespace.
  • Add .data() method to cyQM_template and cyBQM_template that returns a const pointer to the underlying C++ QuadraticModel and BinaryQuadraticModel respectively.

Upgrade Notes

  • BinaryQuadraticModel.data.vartype() is now accessed as a method rather than as an attribute. This is consistent with QuadraticModel.data.vartype(). BinaryQuadraticModel.vartype is still an attribute.
  • from dimod cimport cyBQM now is a fused type containing cyBQM_float32 and cyBQM_float64. You can use the cyBQM containing cyAdjVectorBQM with from dimod.bqm cimport cyBQM.

Bug Fixes

  • Fix wrong behaviour when the lower bound (lb) equals the upper bound (lb) in add_linear_equality_constraint. Correct behaviour is to add constraint as eqaulity when lb is equal ub.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.0

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.0rc1

Release Notes

0.10.0rc1

New Features

  • Add num_quadratic_variables to the header of the file created by ConstrainedQuadraticModel.to_file. This increments the version to 1.1.
  • You can now install preprocessing as part of the dimod install with pip install dimod[preprocessing]

Deprecation Notes

  • Some composites have been migrated to dwave-preprocessing. The affected composites:

    • ClipComposite
    • ConnectedComponentsComposite
    • FixedVariableComposite
    • RoofDualityComposite
    • ScaleComposite
    • SpinReversalTransformComposite

    you no longer can use the composites without having dwave-preprocessing installed. Using them with it installed results in a deprecation warning.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.0.dev9

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.0.dev8

Release Notes

0.10.0.dev8

New Features

  • Add binpacking, knapsack and multiknapsack constrained quadratic model generators.
  • Add BinaryQuadraticModel.is_almost_equal method for testing approximate equality to other binary quadratic models.
  • Add Variables.copy method, implemented as a cpdef method for Cython and Python access.
  • Support specifying lower and upper bounds for integer variables in quadratic models:

    • Add lower_bound and upper_bound keyword arguments to QuadraticModel.add_variable.
    • Add QuadraticModel.lower_bound and QuadraticModel.upper_bound methods.

Upgrade Notes

  • Remove dimod.utils.LockableDict and dimod.decorators.lockable_method. Also SampleSet.is_writeable can no longer be set to False.

Deprecation Notes

  • AdjVectorBQM and AdjDictBQM are deprecated and will be removed in dimod 0.11.0. Use BinaryQuadraticModel with dtype=np.float64 and dtype=object respectively.
  • SampleSet.is_writeable is deprecated and now always returns True.

Bug Fixes

  • Add support for AdjVectorBQM and AdjDictBQM in ConstrainedQuadraticModel.
  • Fix shallow copies of Variables objects when using copy.copy.
  • Implement rule of five for dimod::NeighborhoodIterator, dimod::ConstNeighborhoodIterator, and dimod::ConstQuadraticIterator. This fixes double frees caused by the default copy constructor copying information that is not intended to be shared.
  • Fix shallow copies of BinaryQuadraticModel with object dtype when using copy.copy.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.0.dev7

Release Notes

0.10.0.dev7

Prelude

Add QuadraticModel implementation to Python, Cython and C++. Quadratic models can be represented by a degree 2 polynomial over binary, spin and integer variables.

We began using Reno as a changelog tool after the release of 0.10.0.dev6. Content added before that release is not included. See releases for previous release notes.

New Features

  • Add ConstrainedQuadraticModel.add_discrete method. This allows users to create a discrete variable via a one-hot constraint. A disjoint set of discrete variables are tracked by the CQM and serialized.
  • Add support for quadratic model objectives and constraints in constrained quadratic models. Previously CQMs only supported binary quadratic models.
  • Add new QuadraticModel class for creating quadratic models.
  • Add CaseLabelDQM class. Provides means of labeling cases of discrete variables.
  • Begin using reno for changelog.
  • Add BinaryQuadraticModel.addlinearinequalityconstraint and DiscreteQuadraticModel.addlinearinequalityconstraint methods.
  • Create dimod/libcpp.pxd Cython header file. This allows user to cimport C++ classes and functions defined in dimod/include/
  • Use C++ BinaryQuadraticModel rather than AdjVectorBQM as the underlying object in cyDiscreteQuadraticModel. This means that the underlying implementation is now version controlled.
  • Add new Vartype.INTEGER variable type.
  • Add QuadraticModelBase::scale method. Scales offset, linear biases, and quadratic biases by a provided scale factor.

Upgrade Notes

  • Symbolically multiplying, subtracting and adding BinaryQuadraticModel`s with different vartypes now creates a `QuadraticModel rather than raising an error.
  • Use C++ BinaryQuadraticModel rather than AdjVectorBQM as the underlying object in cyDiscreteQuadraticModel. Any code that relied on the old AdjVectorBQM implementation will need to be upgraded.
  • Make dimod.vartypes.ExtendedVartype an alias for dimod.vartypes.Vartype. Also remove ExtendedVartypeLike from dimod.vartypes and dimod.typing.

Bug Fixes

  • Fix subtracting a BinaryQuadraticModel from a number. Before it would return bqm - 1 rather than correctly returning 1 - bqm.
  • Stop using deprecated numpy aliases like np.int, np.float, and np.complex.

- Python
Published by arcondello almost 5 years ago

dimod - 0.10.0.dev6

Changes

  • Promote dimod.binary.binary_quadratic_model.BinaryQuadraticModek to the top-level dimod namespace and remove dimod.binary_quadratic_model.BinaryQuadraticModel #847

Fixes

  • Fix issue where Variables._relabel mislabeled other variables a0791b0

- Python
Published by arcondello about 5 years ago

dimod - 0.10.0.dev5

New Features

  • Add add_bqm method to C++ BinaryQuadraticModel https://github.com/dwavesystems/dimod/pull/821, https://github.com/dwavesystems/dimod/pull/823
  • Add Structured.valid_bqm_graph method for verifying input problem structure https://github.com/dwavesystems/dimod/pull/832
  • Reimplement BinaryQuadraticModel to use new C++ code https://github.com/dwavesystems/dimod/pull/828
  • BinaryQuadraticModel can now be manipulated symbolically https://github.com/dwavesystems/dimod/pull/834
  • load function can now load all model types https://github.com/dwavesystems/dimod/pull/841, https://github.com/dwavesystems/dimod/pull/843
  • DiscreteQuadraticModel now has an .offset attribute https://github.com/dwavesystems/dimod/pull/838
  • Add ConstrainedQuadraticModel class https://github.com/dwavesystems/dimod/pull/839
  • Add make_header, read_header and write_header utility functions https://github.com/dwavesystems/dimod/pull/842
  • Add ExactDQMSampler https://github.com/dwavesystems/dimod/pull/820

Fix

  • Fix type promotions in binary quadratic models with object biases https://github.com/dwavesystems/dimod/pull/836

- Python
Published by arcondello about 5 years ago

dimod - 0.9.15

Fixes

  • Windows wheels now correctly include .pxd files. #826

- Python
Published by hhtong about 5 years ago

dimod - 0.10.0.dev4

New Features

  • Support PEP518 for building the package https://github.com/dwavesystems/dimod/pull/814
  • Add cyVariables.size() and .at(..) to improve cython access to the Variables object
  • Add new QuadraticModelBase and BinaryQuadraticModel implementation in c++ https://github.com/dwavesystems/dimod/pull/818, https://github.com/dwavesystems/dimod/pull/819

Fixes

  • Fix broken documentation links https://github.com/dwavesystems/dimod/pull/815

- Python
Published by arcondello about 5 years ago

dimod - 0.10.0.dev3

Changes

  • Drop AdjMapBQM and AdjArrayBQM #788

New Features

  • gnm_random_bqm generator #808
  • Allow sample methods decorated by nonblockingsamplemethod to return sample sets that can indicate their doneness. This allows ScaleComposite to be properly non-blocking even when there is a vartype change #805
  • DiscreteQuadraticModel.degree() method

Improvements

  • DiscreteQuadraticModel.adj is no longer constructed each time on the fly #807
  • Cython implementation of the Variables object https://github.com/dwavesystems/dimod/pull/812

Fixes

  • Windows wheels now correctly include .pxd files.

- Python
Published by arcondello over 5 years ago

dimod - 0.10.0.dev2

Changes

  • Drop AdjMapBQM and AdjArrayBQM #788

New Features

  • gnm_random_bqm generator #808
  • Allow sample methods decorated by nonblockingsamplemethod to return sample sets that can indicate their doneness. This allows ScaleComposite to be properly non-blocking even when there is a vartype change #805
  • DiscreteQuadraticModel.degree() method

Improvements

  • DiscreteQuadraticModel.adj is no longer constructed each time on the fly #807

Fixes

  • Windows wheels now correctly include .pxd files.

- Python
Published by arcondello over 5 years ago

dimod - 0.10.0.dev1

Changes

  • Drop AdjMapBQM and AdjArrayBQM #788

New Features

  • gnm_random_bqm generator #808
  • Allow sample methods decorated by nonblockingsamplemethod to return sample sets that can indicate their doneness. This allows ScaleComposite to be properly non-blocking even when there is a vartype change #805
  • DiscreteQuadraticModel.degree() method

Improvements

  • DiscreteQuadraticModel.adj is no longer constructed each time on the fly #807

- Python
Published by arcondello over 5 years ago

dimod - 0.10.0.dev0

Development Release

- Python
Published by arcondello over 5 years ago

dimod - 0.9.14

New Features

  • DiscreteQuadraticModel and SampleSet now use the same underlying variable representation. #772, #779
  • DiscreteQuadraticModel.add_linear_equality_constraint method. #774, #787, #798
  • AdjVectorBQM.add_linear_equality_constraint method. #784
  • Samplers now swallow unknown keyword arguments. #796, #799
  • SpinReversalTransformComposite no longer requires a structured sampler. #802

Fixes

  • Stopped using deprecated methods and functions to reduce the number of deprecation warnings. #773
  • DiscreteQuadraticModel.copy() now works correctly. #777
  • Fix handling of integer-valued floats in Variables. #779
  • Fix the cyDiscreteQuadraticModel.dtype setting. #783

- Python
Published by arcondello over 5 years ago

dimod - 0.9.13

Fixes

  • DQM.from_numpy_vectors, .set_quadratic and .set_quadratic_case now correctly raise a ValueError when the user attempts to create an interaction between cases in a variable
  • BQM.from_numpy_vectors now maintains the correct variable order
  • AdjDictBQM biases are no longer 0 dimensional arrays when constructed from a numpy matrix
  • Fixed column alignment issue when printing sample sets

New Features

  • C++ AdjVectorBQM and AdjMapBQM can now be constructed from COO-formatted arrays
  • Python AdjVectorBQM.from_numpy_vectors and AdjMapBQM.from_numpy_vectors is now much more performant
  • Cython DiscreteQuadrataticModel object now uses C++ COO constructors rather than an ad hoc implementation
  • gnp_random_bqm generator for randomly connected BQMs

- Python
Published by arcondello over 5 years ago

dimod - 0.9.12

New Features

  • Documentation improvements
  • Improved error messages and variable names in DQM.from_numpy_vectors
  • .clang-format file for C++ formatting

Fixes

  • DQM.from_numpy_vectors no longer segfaults when given inconsistent inputs

- Python
Published by arcondello over 5 years ago

dimod - 0.9.11

Changes

  • Deprecated SampleSet.append_variables

New Features

  • append_variables function, replacing the funcionality of SampleSet.append_variables
  • append_vectors function, to add more data vactors to a sample set
  • Documentation improvements
  • Support for python 3.9

Fixes

  • Fix c++ target for windows build

- Python
Published by arcondello over 5 years ago

dimod - 0.9.10

Fixes

  • Fix the behavior of the file-like returned by DQM.to_file

- Python
Published by arcondello over 5 years ago

dimod - 0.9.9

New Features

  • New parallel constructor for c++ AdjMapBQM
  • DQM.to_file now returns a seekable file-like
  • DQM.from_numpy_vectors now reserves the quadratic vectors which should reduce memory and speed up construction

Fixes

  • DQM.from_file now correctly accepts bytes-like objects

Changes

  • DQM.to_file's compressed kwarg has been deprecated in favor of compress

- Python
Published by arcondello over 5 years ago

dimod - 0.9.8

Fixes

  • Support printing sample sets with discrete variables

- Python
Published by arcondello almost 6 years ago

dimod - 0.9.7

New Features

  • New DISCRETE vartype for sample sets
  • DiscreteQuadraticModel class
  • New parallel constructor for dense c++ BQMs

- Python
Published by arcondello almost 6 years ago

dimod - 0.9.7.dev1

New Features

  • New DISCRETE vartype for sample sets

- Python
Published by arcondello almost 6 years ago

dimod - 0.9.7.dev0

New Features

  • DiscreteQuadraticModel class
  • New parallel constructor for dense c++ BQMs

- Python
Published by arcondello almost 6 years ago

dimod - 0.9.6

New Features

  • Structured.to_networkx_graph mixin method
  • .min, .max, and .sum methods on BQM views
  • nonblocking_sample_method decorators for asynchronous samplers
  • anti_crossing_loops, anti_crossing_clique, and doped problem generators
  • BQM.to_file and BQM.from_file methods for cyBQMs

Fixes

  • VartypeView.relabel_variables no longer sometimes returnes models with the wrong vartype
  • BQM.relabel_variables_as_integers now works correctly when inplace=False

- Python
Published by arcondello almost 6 years ago

dimod - 0.9.5

New Features

  • BQM.normalize now returns the value the BQM was scaled by
  • SampleSet.relabel_variables no longer blocks for unresolved sample sets
  • FileView has a new parameter, ignore_variables that treats the BQM as integer-labelled
  • ScaleComposite no longer blocks

Fixes

  • FileView.seek now works correctly with io.SEEK_END

Changes

  • BinaryPolynomial support in ScaleComposite has been removed

- Python
Published by arcondello almost 6 years ago

dimod - 0.9.4

New Features

assert_consistent_bqm to dimod.testing for testing different BQM implementations • Testing is now done with parameterized package - this does not affect installed packages • FileView version 2.0 with improved docs

- Python
Published by arcondello almost 6 years ago

dimod - 0.9.3

New Features

  • pack_samples kwarg for SampleSet.to_serializable() method that allows the user to not pack samples. This means bumping the sample set serialization version to 3.1.0

Fixes

  • SampleSet.info is now correctly propagated through the ClipComposite
  • All .pyx and .pxd files are included in the MANIFEST which means that cimport dimod will now work correctly

- Python
Published by arcondello about 6 years ago

dimod - 0.9.2

New Features

  • BQM C++ headers are now in dimod/include/dimod/. Packages that need access to the headers can get the path using the new get_dimod_headers() function. Note that the C++ code is still considered unstable and does not respect semantic versioning.
  • Initialized ABC and accompanying parse_initial_states method for samplers that accept initial states.
  • IdentitySampler that returns passed-in initial states.
  • ising_to_qubo function now accepts an underspecified h arg.

Fixes

  • General performance and structural improvements to C++ bqms.
  • cyBQMs are now pickleable and deepcopyable.

- Python
Published by arcondello about 6 years ago

dimod - 0.9.1

Changes

  • Removed deprecated kwarg in SpinReversalTransformComposite

Fixes

  • RoofDualityComposite, ConnectedComponentComposite and FixedVariableComposite now all work with the new BQM types

New Features

  • A sample method testing framework for Samplers
  • Significant documentation update
  • A unified location for header files

- Python
Published by arcondello over 6 years ago

dimod - 0.9.0

- Python
Published by arcondello over 6 years ago

dimod - 0.9.0.dev6

Fixes

  • Fix numpy version range
  • BQM.get_quadratic now has consistent/correct behaviour when a default is provided
  • Restored some removed methods, BQM.to_coo, .from_coo, .to_numpy_matrix, .from_numpy_matrix, .to_networkx_graph, .from_networkx_graph
  • BQM.energies now raises the correct exception when given bad samples

New Features

  • Binary quadratic models can now be constructed from linear/quadratic iterators
  • BQM.base attribute to help when constructing from views
  • BQM.energies mixin now uses a faster numpy-based energy calculation

- Python
Published by arcondello over 6 years ago

dimod - 0.9.0.dev5

Changes

  • BinaryQuadraticModel now subclasses AdjDictBQM
  • Remove BinaryQuadraticModel.to_coo and BinaryQuadraticModel.from_coo
  • Remove BinaryQuadraticModel.to_numpy_matrix and BinaryQuadraticModel.from_numpy_matrix
  • Remove BinaryQuadraticModel.SPIN and BinaryQuadraticModel.BINARY
  • Remove vartype keyword argument from BinaryQuadraticModel.add_variable, BinaryQuadraticModel.add_variables, BinaryQuadraticModel.add_interaction and BinaryQuadraticModel.add_interactions
  • The .spin and .binary properties of binary quadratic models are now views rather than copies

New Features

  • as_bqm function for constructing binary quadratic models
  • Most BinaryQuadraticModel methods and properties have been added to AdjArrayBQM, AdjDictBQM, AdjMapBQM and AdjVectorBQM

- Python
Published by arcondello over 6 years ago

dimod - 0.9.0.dev4

Fixes

  • Fix deserialization of variables that are nested tuples
  • Include shapeablebqm.pyx.src in the manifest.ini

- Python
Published by arcondello over 6 years ago

dimod - 0.8.21

New Features

  • SampleSet objects can now have additional attributes assigned to them

Fixes

  • Fix float/int issues in deprecated deserialization format

- Python
Published by arcondello over 6 years ago

dimod - 0.8.20

Fixes

  • LockableDict methods that have return values no longer always return None

- Python
Published by arcondello over 6 years ago

dimod - 0.9.0.dev3

Fixes

  • Python 3.5+ wheels are now installable on Windows machines that don't have FH4 exception handling
  • cyBQMs now correctly use the linear biases when constructed with a linear sequence (rather than dict)
  • Install now correctly requires NumPy>=1.16.0

New Features

  • Simpler implementation of the FileView
  • FileView supports additional whence values for FileView.seek

- Python
Published by arcondello over 6 years ago

dimod - 0.9.0.dev2

Fixes

  • as_samples now respects the provided dtype for SampleSet inputs
  • cyBQM views now raise the correct exception

New Features

  • BQM.relabel_variables for the cyBQMs
  • iter_safe_relabels decorator
  • The legacy BinaryQuadraticModel is now a registered subclass of the BQM ABC

- Python
Published by arcondello over 6 years ago

dimod - 0.9.0.dev1

Development Release

New Features

  • New BQM types: AdjArrayBQM, AdjDictBQM, AdjMapBQM and AdjVectorBQM

Changes

  • Drops support for Python 2.7 and 3.4

- Python
Published by arcondello over 6 years ago