dimod.Structured.nodelist

Structured.nodelist

list – Nodes/variables allowed by the sampler formatted as a list.

Examples

This example defines the nodelist for a structured sampler that can only sample from a binary quadratic model with two variables.

class TwoVariablesSampler(dimod.Sampler, dimod.Structured):
    @property
    def nodelist(self):
        return [0, 1]

    # Remaining properties and code for the sampler