diff --git a/dimod/binary_quadratic_model.py b/dimod/binary_quadratic_model.py
index 47a6c83b..80397f47 100644
--- a/dimod/binary_quadratic_model.py
+++ b/dimod/binary_quadratic_model.py
@@ -5,6 +5,7 @@ todo - describe Ising, QUBO and BQM
 """
 from __future__ import absolute_import, division
 
+from collections import Sized, Container, Iterable
 from numbers import Number
 
 from six import itervalues, iteritems, iterkeys
@@ -15,7 +16,7 @@ from dimod.utilities import resolve_label_conflict
 from dimod.vartypes import Vartype
 
 
-class BinaryQuadraticModel(object):
+class BinaryQuadraticModel(Sized, Container, Iterable):
     """Encodes a binary quadratic model.
 
     Binary quadratic model is the superclass that contains the `Ising model`_ and the QUBO_.
@@ -60,12 +61,23 @@ class BinaryQuadraticModel(object):
         class assume that they are numeric.
 
     Examples:
-        This example creates a model with three spin variables.
+        This example creates a binary quadratic model with three spin variables.
 
-        >>> model = dimod.BinaryQuadraticModel({0: 1, 1: -1, 2: .5},
-        ...                                    {(0, 1): .5, (1, 2): 1.5},
-        ...                                    1.4,
-        ...                                    dimod.SPIN)
+        >>> bqm = dimod.BinaryQuadraticModel({0: 1, 1: -1, 2: .5},
+        ...                                  {(0, 1): .5, (1, 2): 1.5},
+        ...                                  1.4,
+        ...                                  dimod.SPIN)
+
+        Variables can be any hashable object
+
+        >>> bqm = dimod.BinaryQuadraticModel({'a': 0.0, 'b': -1.0, 'c': 0.5},
+        ...                                  {('a', 'b'): -1.0, ('b', 'c'): 1.5},
+        ...                                  1.4,
+        ...                                  dimod.SPIN)
+        >>> len(bqm)
+        3
+        >>> 'b' in bqm
+        True
 
     Attributes:
         linear (dict[variable, bias]):
@@ -195,7 +207,14 @@ class BinaryQuadraticModel(object):
 
     def __len__(self):
         """The length is number of variables."""
-        return len(self.linear)
+        return self.adj.__len__()
+
+    def __contains__(self, v):
+        """The variables"""
+        return self.adj.__contains__(v)
+
+    def __iter__(self):
+        return self.adj.__iter__()
 
 ##################################################################################################
 # vartype properties
diff --git a/dimod/embedding/transforms.py b/dimod/embedding/transforms.py
index 332e0ec2..2b2d3b52 100644
--- a/dimod/embedding/transforms.py
+++ b/dimod/embedding/transforms.py
@@ -386,8 +386,11 @@ def unembed_response(target_response, embedding, source_bqm, chain_break_method=
         chain_break_method (function, optional, default=:func:`.majority_vote`):
             The method used to resolve chain breaks.
 
+    Returns:
+        :obj:`.Response`
+
     """
-    if any(v not in source_bqm.linear for v in embedding):
+    if any(v not in embedding for v in source_bqm):
         raise ValueError("given bqm does not match the embedding")
 
     energies = []

BinaryQuadraticModel should have a correct abstract base class
Should be `collections.abc.Sized` as currently implemented.
Also could be `collections.abc.Container` or even `collections.abc.Collection`.
diff --git a/tests/test_binary_quadratic_model.py b/tests/test_binary_quadratic_model.py
index b8593fa0..72f9793d 100644
--- a/tests/test_binary_quadratic_model.py
+++ b/tests/test_binary_quadratic_model.py
@@ -191,6 +191,25 @@ class TestBinaryQuadraticModel(unittest.TestCase):
 
         self.assertEqual(len(bqm), len(linear))
 
+    def test__contains__(self):
+        bqm = dimod.BinaryQuadraticModel({'a': -1}, {}, 0.0, dimod.SPIN)
+
+        self.assertIn('a', bqm)
+        self.assertNotIn('b', bqm)
+
+        bqm.add_interaction('a', 'b', .5)
+
+        self.assertIn('b', bqm)
+
+    def test__iter__(self):
+        bqm = dimod.BinaryQuadraticModel.empty(dimod.BINARY)
+
+        self.assertEqual(set(bqm), set())
+
+        bqm.add_interaction('a', 'b', -1)
+
+        self.assertEqual(set(bqm), {'a', 'b'})
+
     def test_add_variable(self):
         bqm = dimod.BinaryQuadraticModel({}, {('a', 'b'): -1}, 0.0, dimod.SPIN)
         bqm.add_variable('a', .5)

pip install -e .[all]
parse_log_pytest
requirements.txt
mock coverage coveralls pytest
apt-get update apt-get install -y gcc
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
coverage==6.2
coveralls==3.3.1
decorator==4.4.2
-e git+https://github.com/dwavesystems/dimod.git@2859c969a064fb2b7053919c8f1b50977a408511#egg=dimod
docopt==0.6.2
enum34==1.1.6
idna==3.10
importlib-metadata==4.8.3
iniconfig==1.1.1
jsonschema==2.6.0
mock==5.2.0
networkx==2.5.1
numpy==1.11.3
packaging==21.3
pandas==0.22.0
pluggy==1.0.0
py==1.11.0
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
      - coverage==6.2
      - coveralls==3.3.1
      - decorator==4.4.2
      - docopt==0.6.2
      - enum34==1.1.6
      - idna==3.10
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - jsonschema==2.6.0
      - mock==5.2.0
      - networkx==2.5.1
      - numpy==1.11.3
      - packaging==21.3
      - pandas==0.22.0
      - pluggy==1.0.0
      - py==1.11.0
      - 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__contains__ tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test__iter__
tests/test_binary_quadratic_model.py::TestBinaryQuadraticModel::test__eq__ 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_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::TestConvert::test_empty 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_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_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_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
dimod/binary_quadratic_model.py dimod/embedding/transforms.py
dimod/binary_quadratic_model.py dimod/embedding/transforms.py