Alexander Condello

Results 257 comments of Alexander Condello

Agree. Or even `new = bqm + 2 * other_bqm` Could even allow `bqm ** 2` when there are no quadratic biases...

Yes, of course. `+` should always make a new one, `+=` modifies an existing. Did I imply otherwise?

Makes sense, I think merge would look something like ``` def merge(bqms): merged_bqm = bqms[0].copy() for bqm in bqms[1:]: merged_bqm += bqm return merged_bqm ``` Obviously with input checking and...

Unless it's urgent, I would not make any PRs on this. There are some fundamental decisions about structure and API that need to be worked out. In the case that...

Do we also want to negate cases? Something like `dqm.fix_variable_case('a', 4, 0)`

I am not sure I understand what you mean?

Yeah, I was thinking about it more and upon reflection I think a separate method like `dqm.exclude_case('a', 0)` would be a lot clearer. Rather than making is a switching behavior...

Example usage (tested with [dwave-ocean-sdk==3.4.1](https://github.com/dwavesystems/dwave-ocean-sdk/releases/tag/3.4.1)): ```python import dimod import numpy as np from dwave.system import LeapHybridDQMSampler # make simple tsp num_cities = 5 distances = np.triu(np.random.uniform(size=(num_cities, num_cities)), 1) penalty_strength =...

Also the reverse `bqm.to_sparse()` or similar.

Another approach would be to make a `Spin`, `Binary`, `Integer` full subclasses that promote themselves to `QM` and `BQM`. I think that might also lead to lots of confusing behavior.