relabel_bqm_cqm_variables#
- iqm.applications.qubo.relabel_bqm_cqm_variables(bqm_or_cqm)[source]#
Map original variable names of the input quadratic model to consecutive integers starting from 0.
Creates two dictionaries that keep track of the mapping between the original variable names and the new variable names.
- Parameters:
bqm_or_cqm (T) – The BQM/CQM whose variable names should be changed.
- Returns:
A tuple containing the input BQM/CQM with renamed variables and two dictionaries containing the mapping from the old variable names to the new ones and vice versa.
- Return type: