VirtualGraphComposite

Class

The D-Wave virtual graph tools simplify the process of minor-embedding by enabling you to more easily create, optimize, use, and reuse an embedding for a given working graph. When you submit an embedding and specify a chain strength using these tools, they automatically calibrate the qubits in a chain to compensate for the effects of biases that may be introduced as a result of strong couplings.

class VirtualGraphComposite(sampler, embedding, chain_strength=None, flux_biases=None, flux_bias_num_reads=1000, flux_bias_max_age=3600)[source]

Apply the VirtualGraph composite layer to the given solver.

Parameters:
  • sampler (DWaveSampler) – A dimod dimod.Sampler. Normally DWaveSampler, or a derived composite sampler. Other samplers in general will not work or will not make sense with this composite layer.
  • embedding (dict[hashable, iterable]) – A mapping from a source graph to the given sampler’s graph (the target graph).
  • chain_strength (float, optional, default=None) – The desired chain strength. If None, will use the maximum available from the processor.
  • flux_biases (list/False/None, optional, default=None) – The per-qubit flux bias offsets. If given, should be a list of lists. Each sublist should be of length 2 and is the variable and the flux bias offset associated with the variable. If flux_biases evaluates False, then no flux bias is applied or calculated. If None if given, the flux biases are pulled from the database or calculated empirically.
  • flux_bias_num_reads (int, optional, default=1000) – The number of samples to collect per flux bias value.
  • flux_bias_max_age (int, optional, default=3600) – The maximum age (in seconds) allowed for a previously calculated flux bias offset.

Sampler Properties

VirtualGraphComposite.properties dict – Contains one key 'child_properties' which has a copy of the child sampler’s properties.
VirtualGraphComposite.parameters The same parameters as are accepted by the child sampler with an additional parameter ‘apply_flux_bias_offsets’.

Composite Properties

VirtualGraphComposite.children list – A list containig the wrapped sampler.
VirtualGraphComposite.child The first child in children.

Structure Properties

VirtualGraphComposite.nodelist list – The nodes available to the sampler.
VirtualGraphComposite.edgelist list – The edges available to the sampler.
VirtualGraphComposite.adjacency dict[variable, set] – The adjacency structure.
VirtualGraphComposite.structure A namedtuple Structure(nodelist, edgelist, adjacency)

Methods

VirtualGraphComposite.sample(bqm, **parameters) Samples from the given bqm using the instantiated sample method.
VirtualGraphComposite.sample_ising(h, J[, …]) Sample from the given Ising model.
VirtualGraphComposite.sample_qubo(Q, …) Samples from the given QUBO using the instantiated sample method.