dimod.AdjDictBQM.change_vartype

AdjDictBQM.change_vartype(vartype, inplace=True)[source]

Return a binary quadratic model with the specified vartype.

Parameters:
  • vartype (Vartype/str/set, optional) –

    Variable type for the changed model. Accepted input values:

    • Vartype.SPIN, 'SPIN', {-1, 1}
    • Vartype.BINARY, 'BINARY', {0, 1}
  • inplace (bool, optional, default=True) – If True, the binary quadratic model is updated in-place; otherwise, a new binary quadratic model is returned.
Returns:

A binary quadratic model with the specified vartype.

Return type:

AdjDictBQM