_all_equal fails for empty iterables
https://github.com/dwavesystems/dimod/blob/0f439633046acdf1162936ff694127b367c42a15/dimod/embedding/chain_breaks.py#L231

This should be fixed or at least the docstring should state the limitation.
diff --git a/dimod/__init__.py b/dimod/__init__.py
index 2a8a9bd9..9ee41609 100644
--- a/dimod/__init__.py
+++ b/dimod/__init__.py
@@ -14,7 +14,7 @@ import dimod.binary_quadratic_model
 import dimod.decorators
 
 # for now, let's just import the most important embedding functions
-from dimod.embedding import embed_bqm, embed_ising, embed_qubo, iter_unembed, chain_break_frequency
+from dimod.embedding import embed_bqm, embed_ising, embed_qubo, iter_unembed, chain_break_frequency, unembed_response
 import dimod.embedding
 
 from dimod.exceptions import *
diff --git a/dimod/embedding/chain_breaks.py b/dimod/embedding/chain_breaks.py
index ab4608c2..34fca00a 100644
--- a/dimod/embedding/chain_breaks.py
+++ b/dimod/embedding/chain_breaks.py
@@ -231,11 +231,19 @@ class MinimizeEnergy(Callable):
 def _all_equal(iterable):
     """True if all values in `iterable` are equal, else False."""
     iterator = iter(iterable)
-    first = next(iterator)
+    try:
+        first = next(iterator)
+    except StopIteration:
+        # empty iterable is all equal
+        return True
     return all(first == rest for rest in iterator)
 
 
 def _most_common(iterable):
     """Returns the most common element in `iterable`."""
-    (val, __), = Counter(iterable).most_common(1)
-    return val
+    counts = Counter(iterable)
+    if counts:
+        (val, __), = counts.most_common(1)
+        return val
+    else:
+        raise ValueError("iterable must contain at least one value")
diff --git a/dimod/embedding/transforms.py b/dimod/embedding/transforms.py
index 1351dc92..332e0ec2 100644
--- a/dimod/embedding/transforms.py
+++ b/dimod/embedding/transforms.py
@@ -10,7 +10,7 @@ from dimod.embedding.utils import chain_to_quadratic
 from dimod.response import Response
 from dimod.vartypes import Vartype
 
-__all__ = ['embed_bqm', 'embed_ising', 'embed_qubo', 'iter_unembed']
+__all__ = ['embed_bqm', 'embed_ising', 'embed_qubo', 'iter_unembed', 'unembed_response']
 
 
 def embed_bqm(source_bqm, embedding, target_adjacency, chain_strength=1.0, embed_singleton_variables=True):
@@ -366,3 +366,43 @@ def iter_unembed(target_samples, embedding, chain_break_method=None):
     for target_sample in target_samples:
         for source_sample in chain_break_method(target_sample, embedding):
             yield source_sample
+
+
+def unembed_response(target_response, embedding, source_bqm, chain_break_method=None):
+    """Unembed the response to construct a response for the source bqm.
+
+    Args:
+        target_response (:obj:`.Response`):
+            A response from the target bqm
+
+        embedding (dict):
+            Mapping from the source graph to the target graph.
+            Should be of the form {v: {s, ...}, ...} where v is a variable in the
+            source model and s is a variable in the target model.
+
+        source_bqm (:obj:`.BinaryQuadraticModel`):
+            The source binary quadratic model.
+
+        chain_break_method (function, optional, default=:func:`.majority_vote`):
+            The method used to resolve chain breaks.
+
+    """
+    if any(v not in source_bqm.linear for v in embedding):
+        raise ValueError("given bqm does not match the embedding")
+
+    energies = []
+
+    def _samples():
+        # populate energies as the samples are resolved one-at-a-time
+        for sample in iter_unembed(target_response, embedding, chain_break_method):
+            energies.append(source_bqm.energy(sample))
+            yield sample
+
+    # overwrite energy with the new values
+    data_vectors = target_response.data_vectors.copy()
+    data_vectors['energy'] = energies
+
+    # NB: this works because response.from_dict does not resolve the energies until AFTER the samples
+    return target_response.from_dicts(_samples(), data_vectors,
+                                      vartype=target_response.vartype,
+                                      info=target_response.info)
diff --git a/dimod/response.py b/dimod/response.py
index 3cbf96f2..d3b2c38d 100644
--- a/dimod/response.py
+++ b/dimod/response.py
@@ -98,8 +98,8 @@ class Response(Iterable, Sized):
             # todo - check that is a vector and that has the right length
             if isinstance(vector, (np.ndarray, list)):
                 if len(vector) != num_samples:
-                    raise ValueError(("expected data vector {} to be a vector of length {}"
-                                      "").format(vector, num_samples))
+                    raise ValueError(("expected data vector {} (length {}) to be a vector of length {}"
+                                      "").format(vector, len(vector), num_samples))
             else:
                 raise TypeError("expected data vector {} to be a list of NumPy array".format(vector))
         self._data_vectors = data_vectors
diff --git a/docs/reference/embedding.rst b/docs/reference/embedding.rst
index e193343f..148cff5c 100644
--- a/docs/reference/embedding.rst
+++ b/docs/reference/embedding.rst
@@ -48,6 +48,7 @@ Functions
    embed_ising
    embed_qubo
    iter_unembed
+   unembed_response
    chain_break_frequency
 
 Chain Break Resolution
diff --git a/tests/test_embedding.py b/tests/test_embedding.py
index e69d49c7..f0abb893 100644
--- a/tests/test_embedding.py
+++ b/tests/test_embedding.py
@@ -507,6 +507,46 @@ class TestIterUnembed(unittest.TestCase):
         self.assertEqual(source, {'b': -1, 'c': +1, 'a': -1})
 
 
+class TestUnembedResponse(unittest.TestCase):
+    @unittest.skipUnless(_networkx, "No networkx installed")
+    def test_energies_functional(self):
+        h = {'a': .1, 'b': 0, 'c': 0}
+        J = {('a', 'b'): 1, ('b', 'c'): 1.3, ('a', 'c'): -1}
+        bqm = dimod.BinaryQuadraticModel.from_ising(h, J, offset=1.3)
+
+        embedding = {'a': {0}, 'b': {1}, 'c': {2, 3}}
+
+        embedded_bqm = dimod.embed_bqm(bqm, embedding, nx.cycle_graph(4), chain_strength=1)
+
+        embedded_response = dimod.ExactSolver().sample(embedded_bqm)
+
+        response = dimod.unembed_response(embedded_response, embedding, bqm)
+
+        for sample, energy in response.data(['sample', 'energy']):
+            self.assertEqual(bqm.energy(sample), energy)
+
+    @unittest.skipUnless(_networkx, "No networkx installed")
+    def test_energies_discard(self):
+        h = {'a': .1, 'b': 0, 'c': 0}
+        J = {('a', 'b'): 1, ('b', 'c'): 1.3, ('a', 'c'): -1}
+        bqm = dimod.BinaryQuadraticModel.from_ising(h, J, offset=1.3)
+
+        embedding = {'a': {0}, 'b': {1}, 'c': {2, 3}}
+
+        embedded_bqm = dimod.embed_bqm(bqm, embedding, nx.cycle_graph(4), chain_strength=1)
+
+        embedded_response = dimod.ExactSolver().sample(embedded_bqm)
+
+        chain_break_method = dimod.embedding.discard
+        response = dimod.unembed_response(embedded_response, embedding, bqm,
+                                          chain_break_method=chain_break_method)
+
+        self.assertEqual(len(embedded_response) / 2, len(response))  # half chains should be broken
+
+        for sample, energy in response.data(['sample', 'energy']):
+            self.assertEqual(bqm.energy(sample), energy)
+
+
 class TestEmbeddingChainBreaks(unittest.TestCase):
     def test_discard_no_breaks_all_ones_identity_embedding(self):
         from dimod.embedding.chain_breaks import discard_matrix
@@ -541,3 +581,24 @@ class TestEmbeddingChainBreaks(unittest.TestCase):
 
         npt.assert_equal(new_matrix, [[+1, +1],
                                       [-1, +1]])
+
+    def test__most_common(self):
+        from dimod.embedding.chain_breaks import _most_common
+
+        self.assertEqual(_most_common([-1, +1, +1]), +1)
+        self.assertEqual(_most_common([+1, -1, -1]), -1)
+        self.assertEqual(_most_common([0, 1, 1]), 1)
+        self.assertEqual(_most_common([1, 0, 0]), 0)
+
+        with self.assertRaises(ValueError):
+            _most_common([])
+
+    def test_all_equal(self):
+        from dimod.embedding.chain_breaks import _all_equal
+
+        self.assertTrue(_all_equal([1, 1]))
+        self.assertTrue(_all_equal([-1, -1]))
+        self.assertTrue(_all_equal([0, 0]))
+        self.assertFalse(_all_equal([+1, -1]))
+        self.assertFalse(_all_equal([1, 0]))
+        self.assertTrue(_all_equal([]))
['dimod/embedding/transforms.py', 'dimod/response.py', 'dimod/embedding/chain_breaks.py', 'docs/reference/embedding.rst', 'tests/test_embedding.py', 'dimod/__init__.py']