arcondello: Specifically looking for feedback on the parameter name
m3ller: Perhaps `ignored_variables` and `ignored_interactions`? I like "ignore" more than "exclude" because "exclude" seems like an active thing you're doing to the list, while "ignore" just means you won't be touching that list.
arcondello: `skip_*` sounds boolean to me. I'll go with `ignored_*`
diff --git a/dimod/binary_quadratic_model.py b/dimod/binary_quadratic_model.py
index 27118b1c..c8e57ec2 100644
--- a/dimod/binary_quadratic_model.py
+++ b/dimod/binary_quadratic_model.py
@@ -844,13 +844,19 @@ class BinaryQuadraticModel(Sized, Container, Iterable):
         """
         self.add_offset(-self.offset)
 
-    def scale(self, scalar):
+    def scale(self, scalar, ignored_variables=None, ignored_interactions=None):
         """Multiply by the specified scalar all the biases and offset of a binary quadratic model.
 
         Args:
             scalar (number):
                 Value by which to scale the energy range of the binary quadratic model.
 
+            ignored_variables (iterable, optional):
+                Biases associated with these variables are not scaled.
+
+            ignored_interactions (iterable[tuple], optional):
+                As an iterable of 2-tuples. Biases associated with these interactions are not scaled.
+
         Examples:
 
             This example creates a binary quadratic model and then scales it to half
@@ -871,23 +877,40 @@ class BinaryQuadraticModel(Sized, Container, Iterable):
         if not isinstance(scalar, Number):
             raise TypeError("expected scalar to be a Number")
 
+        if ignored_variables is None:
+            ignored_variables = set()
+        elif not isinstance(ignored_variables, Container):
+            ignored_variables = set(ignored_variables)
+
+        if ignored_interactions is None:
+            ignored_interactions = set()
+        elif not isinstance(ignored_interactions, Container):
+            ignored_interactions = set(ignored_interactions)
+
         linear = self.linear
         for v in linear:
+            if v in ignored_variables:
+                continue
             linear[v] *= scalar
 
         quadratic = self.quadratic
-        for edge in quadratic:
-            quadratic[edge] *= scalar
+        for u, v in quadratic:
+            if (u, v) in ignored_interactions or (v, u) in ignored_interactions:
+                continue
+            quadratic[(u, v)] *= scalar
 
         adj = self.adj
         for u in adj:
             for v in adj[u]:
+                if (u, v) in ignored_interactions or (v, u) in ignored_interactions:
+                    continue
                 adj[u][v] *= scalar
 
         self.offset *= scalar
 
         try:
-            self._counterpart.scale(scalar)
+            self._counterpart.scale(scalar, ignored_variables=ignored_variables,
+                                    ignored_interactions=ignored_interactions)
         except AttributeError:
             pass
 

Allow scaling of subset of bqm biases
**Application**
In the case of embedded bqm's, it would be useful to be able to scale the original biases without scaling the chain biases

**Proposed Solution/Alternatives Considered**
Pattern A:
```
bqm.lock_interactions([('a', 'b'), ('b', 'c')])
bqm.scale(.5)
```

Pattern B:
```
bqm.scale(.5, exclude_interactions=[('a', 'b'), ('b', 'c')])
```

@conta877 
diff --git a/tests/test_binary_quadratic_model.py b/tests/test_binary_quadratic_model.py
index 16278de4..a64f6b76 100644
--- a/tests/test_binary_quadratic_model.py
+++ b/tests/test_binary_quadratic_model.py
@@ -746,6 +746,17 @@ class TestBinaryQuadraticModel(unittest.TestCase):
         with self.assertRaises(TypeError):
             bqm.scale('a')
 
+    def test_scale_exclusions(self):
+        bqm = dimod.BinaryQuadraticModel({0: -2, 1: 2}, {(0, 1): -1}, 1., dimod.SPIN)
+        bqm.scale(.5, ignored_variables=[0])
+        self.assertConsistentBQM(bqm)
+        self.assertEqual(bqm, dimod.BinaryQuadraticModel({0: -2, 1: 1}, {(0, 1): -.5}, .5, dimod.SPIN))
+
+        bqm = dimod.BinaryQuadraticModel({0: -2, 1: 2}, {(0, 1): -1}, 1., dimod.SPIN)
+        bqm.scale(.5, ignored_interactions=[(1, 0)])
+        self.assertConsistentBQM(bqm)
+        self.assertEqual(bqm, dimod.BinaryQuadraticModel({0: -1, 1: 1}, {(0, 1): -1.}, .5, dimod.SPIN))
+
     def test_fix_variable(self):
         # spin model, fix variable to +1
         bqm = dimod.BinaryQuadraticModel({'a': .3}, {('a', 'b'): -1}, 1.2, dimod.SPIN)

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest coverage
apt-get update apt-get install -y libboost-dev
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
certifi==2021.5.30
charset-normalizer==2.0.12
codecov==2.1.13
coverage==6.2
Cython==3.0.12
decorator==5.1.1
-e git+https://github.com/dwavesystems/dimod.git@680b0434b77e17e211e74f84503b05a476b9ec64#egg=dimod
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
jsonschema==2.6.0
mock==2.0.0
networkx==2.0
numpy==1.15.0
packaging==21.3
pandas==0.22.0
pbr==6.1.1
pluggy==1.0.0
py==1.11.0
pymongo==3.7.1
pyparsing==3.1.4
pytest==7.0.1
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.27.1
six==1.11.0
tomli==1.2.3
typing_extensions==4.1.1
urllib3==1.26.20
zipp==3.6.0

name: dimod
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - codecov==2.1.13
      - coverage==6.2
      - cython==3.0.12
      - decorator==5.1.1
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jsonschema==2.6.0
      - mock==2.0.0
      - networkx==2.0
      - numpy==1.15.0
      - packaging==21.3
      - pandas==0.22.0
      - pbr==6.1.1
      - pluggy==1.0.0
      - py==1.11.0
      - pymongo==3.7.1
      - pyparsing==3.1.4
      - pytest==7.0.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.27.1
      - six==1.11.0
      - tomli==1.2.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - zipp==3.6.0
prefix: /opt/conda/envs/dimod

tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_scale_exclusions
tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test__contains__ tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test__eq__ tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test__iter__ tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test__len__ tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test__repr__ tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_add_interaction tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_add_interaction_counterpart tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_add_interactions_from tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_add_offset tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_add_variable tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_add_variable_counterpart tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_add_variables_from tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_binary_property tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_binary_property_relabel tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_change_vartype tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_constract_variables tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_construction tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_construction_quadratic tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_construction_vartype tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_copy tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_fix_variable tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_flip_variable tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_normalize tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_partial_relabel_copy tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_partial_relabel_inplace tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_relabel_typical tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_relabel_typical_copy tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_relabel_typical_inplace tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_relabel_with_identity tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_relabel_with_overlap tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_remove_interaction tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_remove_interactions_from tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_remove_offset tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_remove_variable tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_remove_variables_from tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_scale tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_spin_property tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_spin_property_relabel tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_update tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test_variables tests/test_binary_quadratic_model.py::TestConvert::test_bson_dense tests/test_binary_quadratic_model.py::TestConvert::test_bson_sparse tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_file_BINARY tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_file_SPIN tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_file_empty_BINARY tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_file_empty_SPIN tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_string_BINARY tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_string_SPIN tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_string_empty_BINARY tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_string_empty_SPIN tests/test_binary_quadratic_model.py::TestConvert::test_coo_functional_two_digit_integers_string tests/test_binary_quadratic_model.py::TestConvert::test_empty tests/test_binary_quadratic_model.py::TestConvert::test_from_coo_file tests/test_binary_quadratic_model.py::TestConvert::test_from_coo_string tests/test_binary_quadratic_model.py::TestConvert::test_from_ising tests/test_binary_quadratic_model.py::TestConvert::test_from_numpy_matrix tests/test_binary_quadratic_model.py::TestConvert::test_from_numpy_vectors tests/test_binary_quadratic_model.py::TestConvert::test_from_numpy_vectors_labels tests/test_binary_quadratic_model.py::TestConvert::test_from_qubo tests/test_binary_quadratic_model.py::TestConvert::test_functional_to_and_from_json tests/test_binary_quadratic_model.py::TestConvert::test_functional_to_and_from_json_empty tests/test_binary_quadratic_model.py::TestConvert::test_functional_to_and_from_json_with_info tests/test_binary_quadratic_model.py::TestConvert::test_info tests/test_binary_quadratic_model.py::TestConvert::test_to_coo_string_empty_BINARY tests/test_binary_quadratic_model.py::TestConvert::test_to_coo_string_empty_SPIN tests/test_binary_quadratic_model.py::TestConvert::test_to_coo_string_typical_BINARY tests/test_binary_quadratic_model.py::TestConvert::test_to_coo_string_typical_SPIN tests/test_binary_quadratic_model.py::TestConvert::test_to_ising_binary_to_ising tests/test_binary_quadratic_model.py::TestConvert::test_to_ising_spin_to_ising tests/test_binary_quadratic_model.py::TestConvert::test_to_json_file tests/test_binary_quadratic_model.py::TestConvert::test_to_json_file_empty tests/test_binary_quadratic_model.py::TestConvert::test_to_json_string tests/test_binary_quadratic_model.py::TestConvert::test_to_json_string_empty tests/test_binary_quadratic_model.py::TestConvert::test_to_networkx_graph tests/test_binary_quadratic_model.py::TestConvert::test_to_numpy_matrix tests/test_binary_quadratic_model.py::TestConvert::test_to_numpy_vectors tests/test_binary_quadratic_model.py::TestConvert::test_to_numpy_vectors_labels_sorted tests/test_binary_quadratic_model.py::TestConvert::test_to_numpy_vectors_sorted tests/test_binary_quadratic_model.py::TestConvert::test_to_pandas_dataframe tests/test_binary_quadratic_model.py::TestConvert::test_to_qubo_binary_to_qubo tests/test_binary_quadratic_model.py::TestConvert::test_to_qubo_spin_to_qubo tests/test_binary_quadratic_model.py::TestOrderedBQM::test_construction
dimod/binary_quadratic_model.py
dimod/binary_quadratic_model.py