doped(p: float, graph: Union[int, Tuple[Collection[Hashable], Collection[Tuple[Hashable, Hashable]]], Collection[Tuple[Hashable, Hashable]], networkx.classes.graph.Graph], cls: type = <class 'dimod.binary.binary_quadratic_model.BinaryQuadraticModel'>, seed: Optional[int] = None, fm: bool = True)[source]

Generate a BQM for a doped ferromagnetic (FM) or antiferromagnetic (AFM) problem.

In a doped FM problem, p, the doping parameter, determines the probability of couplers set to AFM (flipped to 1). The remaining couplers remain FM (-1). In a doped AFM problem, the opposite is true.

  • p – Doping parameter [0,1] determines the probability of couplers flipped.

  • graph – The graph to build the bqm on. Either an integer n, interpreted as a complete graph of size n, a nodes/edges pair, a list of edges or a NetworkX graph.

  • cls – Binary quadratic model class to build from. Default is BinaryQuadraticModel.

  • seed – Random seed.

  • fm – If True, the default undoped graph is FM. If False, it is AFM.


A binary quadratic model.