Utilities

Methods

bqm_edges_between_variables(bqm, variables) Return edges connecting specified variables of a binary quadratic model.
bqm_induced_by(bqm, variables, sample) Induce a binary quadratic model by fixing values of boundary variables.
bqm_reduced_to(bqm, variables, sample[, …]) Reduce a binary quadratic model by fixing values of some variables.
chimera_tiles(bqm, m, n, t) Map a binary quadratic model to a set of Chimera tiles.
flip_energy_gains(bqm, sample[, variables, …]) Order variable flips by descending contribution to energy changes in a BQM.
max_sample(bqm) Return a sample with all variables set to the maximal value for a binary quadratic model.
min_sample(bqm) Return a sample with all variables set to the minimal value for a binary quadratic model.
random_sample(bqm) Return a random sample for a binary quadratic model.
random_sample_seq(size, vartype) Return a random sample.
sample_as_dict(sample) Return sample object in dict format.
sample_as_list(sample) Return sample object in list format.
select_localsearch_adversaries(bqm, sample) Find variable flips that contribute high energy changes to a BQM.
select_random_subgraph(bqm, n) Select randomly n variables of the specified binary quadratic model.
updated_sample(sample, replacements) Update a copy of a sample with replacement values.