diff --git a/dimod/core/sampler.py b/dimod/core/sampler.py
index 19a8d82f..6df4f0b8 100644
--- a/dimod/core/sampler.py
+++ b/dimod/core/sampler.py
@@ -135,16 +135,32 @@ class Sampler:
     def sample(self, bqm, **parameters):
         """Samples from a binary quadratic model using an implemented sample method.
         """
+
+        # we try to use the matching sample method if possible
         if bqm.vartype is Vartype.SPIN:
-            Q, offset = bqm.to_qubo()
-            response = self.sample_qubo(Q, **parameters)
-            response.change_vartype(Vartype.SPIN, energy_offset=offset)
-            return response
+            if not getattr(self.sample_ising, '__issamplemixin__', False):
+                # sample_ising is implemented
+                h, J, offset = bqm.to_ising()
+                sampleset = self.sample_ising(h, J, **parameters)
+                sampleset.record.energy += offset
+                return sampleset
+            else:
+                Q, offset = bqm.to_qubo()
+                sampleset = self.sample_qubo(Q, **parameters)
+                sampleset.change_vartype(Vartype.SPIN, energy_offset=offset)
+                return sampleset
         elif bqm.vartype is Vartype.BINARY:
-            h, J, offset = bqm.to_ising()
-            response = self.sample_ising(h, J, **parameters)
-            response.change_vartype(Vartype.BINARY, energy_offset=offset)
-            return response
+            if not getattr(self.sample_qubo, '__issamplemixin__', False):
+                # sample_qubo is implemented
+                Q, offset = bqm.to_qubo()
+                sampleset = self.sample_qubo(Q, **parameters)
+                sampleset.record.energy += offset
+                return sampleset
+            else:
+                h, J, offset = bqm.to_ising()
+                sampleset = self.sample_ising(h, J, **parameters)
+                sampleset.change_vartype(Vartype.BINARY, energy_offset=offset)
+                return sampleset
         else:
             raise RuntimeError("binary quadratic model has an unknown vartype")
 
@@ -153,13 +169,11 @@ class Sampler:
         """Samples from an Ising model using an implemented sample method.
         """
         bqm = BinaryQuadraticModel.from_ising(h, J)
-        response = self.sample(bqm, **parameters)
-        return response
+        return self.sample(bqm, **parameters)
 
     @samplemixinmethod
     def sample_qubo(self, Q, **parameters):
         """Samples from a QUBO using an implemented sample method.
         """
         bqm = BinaryQuadraticModel.from_qubo(Q)
-        response = self.sample(bqm, **parameters)
-        return response
+        return self.sample(bqm, **parameters)

Don't change vartype unnecessarily in Sampler.sample
**Application**
The dimod `Sampler` abc allows the user to implement one of `.sample`, `.sample_ising`, or `.sample_qubo` for it to work. It does this by using a figure-8 loop of sample calls, see:
https://github.com/dwavesystems/dimod/blob/378b03a1df067ae4c12249bfcebf939a5324f1c6/dimod/core/sampler.py#L135
However, this means that we're changing the vartype of the BQM always when `.sample` is not implemented. This is slow and violates the principle of least astonishment.

**Proposed Solution**

The way the `samplemixinmethod` decorator is implemented means we could 'target' the implemented sample method.


diff --git a/tests/test_sampler.py b/tests/test_sampler.py
index c3c64418..ce3692cd 100644
--- a/tests/test_sampler.py
+++ b/tests/test_sampler.py
@@ -264,3 +264,51 @@ class TestSamplerClass(unittest.TestCase):
         expected_resp = dimod.Response.from_samples([[1]], {"energy": [-3]}, {}, dimod.BINARY)
         np.testing.assert_almost_equal(resp.record.sample, expected_resp.record.sample)
         np.testing.assert_almost_equal(resp.record.energy, expected_resp.record.energy)
+
+    def test_spin_bqm_to_sample_ising(self):
+
+        class CountBQM(dimod.BinaryQuadraticModel):
+            # should never have vartype changed
+            def change_vartype(self, *args, **kwargs):
+                raise RuntimeError
+
+            def to_qubo(self):
+                raise RuntimeError
+
+        class Ising(dimod.Sampler):
+            parameters = None
+            properties = None
+
+            def sample_ising(self, h, J):
+                bqm = dimod.BinaryQuadraticModel.from_ising(h, J)
+                samples = [1]*len(bqm)
+                return dimod.SampleSet.from_samples_bqm(samples, bqm)
+
+        sampler = Ising()
+        cbqm = CountBQM.from_ising({0: -3}, {(0, 1): -1.5}, offset=1.3)
+        sampleset = sampler.sample(cbqm)
+        dimod.testing.assert_response_energies(sampleset, cbqm)
+
+    def test_binary_bqm_to_sample_qubo(self):
+
+        class CountBQM(dimod.BinaryQuadraticModel):
+            # should never have vartype changed
+            def change_vartype(self, *args, **kwargs):
+                raise RuntimeError
+
+            def to_ising(self):
+                raise RuntimeError
+
+        class Qubo(dimod.Sampler):
+            parameters = None
+            properties = None
+
+            def sample_qubo(self, Q):
+                bqm = dimod.BinaryQuadraticModel.from_qubo(Q)
+                samples = [1]*len(bqm)
+                return dimod.SampleSet.from_samples_bqm(samples, bqm)
+
+        sampler = Qubo()
+        cbqm = CountBQM.from_qubo({(0, 0): -3, (1, 0): 1.5}, offset=.5)
+        sampleset = sampler.sample(cbqm)
+        dimod.testing.assert_response_energies(sampleset, cbqm)

pip install -e .[all]
parse_log_pytest
requirements.txt
pytest
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@91938b74aac2dff4fdcc6dc55bf3b710465799ae#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_sampler.py::TestSamplerClass::test_binary_bqm_to_sample_qubo tests/test_sampler.py::TestSamplerClass::test_spin_bqm_to_sample_ising
tests/test_sampler.py::TestSamplerClass::test_instantiation_base_class tests/test_sampler.py::TestSamplerClass::test_instantiation_missing_parameters tests/test_sampler.py::TestSamplerClass::test_instantiation_missing_properties tests/test_sampler.py::TestSamplerClass::test_instantiation_missing_sample tests/test_sampler.py::TestSamplerClass::test_instantiation_overwrite_sample tests/test_sampler.py::TestSamplerClass::test_instantiation_overwrite_sample_ising tests/test_sampler.py::TestSamplerClass::test_instantiation_overwrite_sample_ising_and_call_sample tests/test_sampler.py::TestSamplerClass::test_instantiation_overwrite_sample_qubo tests/test_sampler.py::TestSamplerClass::test_instantiation_overwrite_sample_qubo_and_call_sample tests/test_sampler.py::TestSamplerClass::test_sampler_can_return_integer_energy_values
dimod/core/sampler.py
dimod/core/sampler.py