Coder Social home page Coder Social logo

dwavesystems / dwave-samplers Goto Github PK

View Code? Open in Web Editor NEW
8.0 7.0 11.0 1.56 MB

Classical algorithms for solving binary quadratic models

License: Apache License 2.0

Python 42.15% Cython 7.49% C++ 49.72% Makefile 0.10% C 0.36% CMake 0.19%
bqm qubo

dwave-samplers's Issues

Build breaks on some systems: Error compiling Cython file

===>  Configuring for py39-dwave-samplers-1.0.0.d1

Error compiling Cython file:
------------------------------------------------------------
..

cimport numpy as np
from dimod cimport cyBQM_float64
from dimod.libcpp cimport cppBinaryQuadraticModel

from dwave.samplers.tree.orang cimport samples_type, PyArray_ENABLEFLAGS
^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:31:0: 'dwave/samplers/tree/orang.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
..

cimport numpy as np
from dimod cimport cyBQM_float64
from dimod.libcpp cimport cppBinaryQuadraticModel

from dwave.samplers.tree.orang cimport samples_type, PyArray_ENABLEFLAGS
^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:31:0: 'dwave/samplers/tree/orang/samples_type.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
..

cimport numpy as np
from dimod cimport cyBQM_float64
from dimod.libcpp cimport cppBinaryQuadraticModel

from dwave.samplers.tree.orang cimport samples_type, PyArray_ENABLEFLAGS
^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:31:0: 'dwave/samplers/tree/orang/PyArray_ENABLEFLAGS.pxd' not found

Error compiling Cython file:
------------------------------------------------------------
..
    # pass in pointers so that sample_bqm can fill things in
    cdef double logpf

    # samples
    cdef int srows, scols
    cdef samples_type* samples_pointer
        ^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:110:9: 'samples_type' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
..
              &pair_marginals_pointer, &pmrows, &pmcols,
              &pair_pointer, &prows, &pcols)

    # create a numpy array without making a copy then tell numpy it needs to
    # free the memory
    samples = np.asarray(<samples_type[:srows, :scols]> samples_pointer)
                         ^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:138:26: 'samples_type' is not a type identifier

Error compiling Cython file:
------------------------------------------------------------
..
              &pair_marginals_pointer, &pmrows, &pmcols,
              &pair_pointer, &prows, &pcols)

    # create a numpy array without making a copy then tell numpy it needs to
    # free the memory
    samples = np.asarray(<samples_type[:srows, :scols]> samples_pointer)
                                                       ^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:138:56: Can only create cython.array from pointer or array

Error compiling Cython file:
------------------------------------------------------------
..
              &pair_pointer, &prows, &pcols)

    # create a numpy array without making a copy then tell numpy it needs to
    # free the memory
    samples = np.asarray(<samples_type[:srows, :scols]> samples_pointer)
    PyArray_ENABLEFLAGS(samples, np.NPY_OWNDATA)
   ^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:139:4: 'PyArray_ENABLEFLAGS' is not a constant, variable or function identifier

Error compiling Cython file:
------------------------------------------------------------
..
                if samples[i, j] == 0:
                    samples[i, j] = -1

    if marginals:
        variable_marginals = np.asarray(<double[:smlen]> single_marginals_pointer)
        PyArray_ENABLEFLAGS(variable_marginals, np.NPY_OWNDATA)
       ^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:151:8: 'PyArray_ENABLEFLAGS' is not a constant, variable or function identifier

Error compiling Cython file:
------------------------------------------------------------
..
        variable_marginals = np.asarray(<double[:smlen]> single_marginals_pointer)
        PyArray_ENABLEFLAGS(variable_marginals, np.NPY_OWNDATA)

        if pmrows * pmcols:
            interaction_marginals = np.asarray(<double[:pmrows, :pmcols]> pair_marginals_pointer)
            PyArray_ENABLEFLAGS(interaction_marginals, np.NPY_OWNDATA)
           ^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:155:12: 'PyArray_ENABLEFLAGS' is not a constant, variable or function identifier

Error compiling Cython file:
------------------------------------------------------------
..
        else:
            interaction_marginals = np.empty(shape=(pmrows, pmcols), dtype=np.double)

        if prows * pcols:
            interactions = np.asarray(<int[:prows, :pcols]> pair_pointer)
            PyArray_ENABLEFLAGS(interactions, np.NPY_OWNDATA)
           ^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:161:12: 'PyArray_ENABLEFLAGS' is not a constant, variable or function identifier
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 53, in <module>
    ext_modules=cythonize(
  File "/usr/local/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1127, in cythonize
    cythonize_one(*args)
  File "/usr/local/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1250, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: dwave/samplers/tree/sample.pyx
Compiling dwave/samplers/random/cyrandom.pyx because it depends on /usr/local/lib/python3.9/site-packages/dimod/quadratic/cyqm/cyqm_template.pxd.pxi.
Compiling dwave/samplers/tree/sample.pyx because it depends on /usr/local/lib/python3.9/site-packages/dimod/quadratic/cyqm/cyqm_template.pxd.pxi.
Compiling dwave/samplers/tree/solve.pyx because it depends on /usr/local/lib/python3.9/site-packages/dimod/quadratic/cyqm/cyqm_template.pxd.pxi.
Compiling dwave/samplers/tree/utilities.pyx because it depends on /usr/local/lib/python3.9/site-packages/dimod/quadratic/cyqm/cyqm_template.pxd.pxi.
[1/4] Cythonizing dwave/samplers/random/cyrandom.pyx
[2/4] Cythonizing dwave/samplers/tree/sample.pyx
*** Error code 1

Version: 1.0.0.dev1
OS: FreeBSD 13.1

Build fails on python3.11

Hi,

I added this package to conda-forge as well and am having trouble building it under python 3.11 and numpy 1.23.

Not sure if this is something you have seen before, as it could be due to conda-forge infrastructure, but I wanted to open the issue in case someone knows why this is happening. :)

Log: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=619683&view=logs&jobId=e9afaa34-1a0f-534e-78fc-fae528ccd915&j=e9afaa34-1a0f-534e-78fc-fae528ccd915&t=48395e60-bc5f-5e45-7455-d404f0c95f3a

Compilation fails: Error compiling Cython file

Compiling dwave/samplers/tree/sample.pyx because it changed.
Compiling dwave/samplers/tree/solve.pyx because it changed.
Compiling dwave/samplers/tree/utilities.pyx because it changed.
[1/3] Cythonizing dwave/samplers/tree/sample.pyx

Error compiling Cython file:
------------------------------------------------------------
...
                         double** single_mrg_data, int* single_mrg_len,
                         double** pair_mrg_data, int* pair_mrg_rows, int* pair_mrg_cols,
                         int** pair_data, int* pair_rows, int* pair_cols) except +

@cython.annotation_typing(False)  # maintain Cython2 behavior
def sample_bqm_wrapper(bqm: BinaryQuadraticModel,
^
------------------------------------------------------------

dwave/samplers/tree/sample.pyx:52:0: The annotation_typing compiler directive is not allowed in function scope
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 53, in <module>
    ext_modules=cythonize(
  File "/usr/local/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1115, in cythonize
    cythonize_one(*args)
  File "/usr/local/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1238, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: dwave/samplers/tree/sample.pyx
*** Error code 1

Version: 1.2.0

FreeBSD 13.2

Test

This is a test

Timing info

Need timing info that separates IO and sampling times.

Example with Neal:

PlanarGraphSolver().sample has zero for energy fields

Energy is zero in samplesets returned by the solver:

from dwave.samplers.planar import PlanarGraphSolver
ss = PlanarGraphSolver().sample_ising({},{(0,1): 1,(1,2) : 1})
print(ss.first)
Sample(sample={0: 1, 1: -1, 2: 1}, energy=0, num_occurrences=1)

Expected -2

invalid escape sequences

Your code presents some invalid escape sequences that are considered errors from python 11. Please check: https://docs.astral.sh/ruff/rules/invalid-escape-sequence/.

Steps To Reproduce
With CI workflow for analyzing the code, errors like:

E SyntaxError: invalid escape sequence '?'

rises in the comment lines

Expected Behavior
A clear and concise description of what you expected to happen.

Environment

  • for all the OS
  • for python in range 3.9 to 3.12

Configure breaks: TypeError: entry_points() got an unexpected keyword argument 'group'

===>  Configuring for py39-dwave-samplers-1.2.0
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 19, in <module>
    import dimod
  File "/usr/local/lib/python3.9/site-packages/dimod/__init__.py", line 18, in <module>
    from dimod.constrained import *
  File "/usr/local/lib/python3.9/site-packages/dimod/constrained/__init__.py", line 15, in <module>
    from dimod.constrained.constrained import *
  File "/usr/local/lib/python3.9/site-packages/dimod/constrained/constrained.py", line 65, in <module>
    from dimod.binary.binary_quadratic_model import BinaryQuadraticModel, Binary
  File "/usr/local/lib/python3.9/site-packages/dimod/binary/__init__.py", line 15, in <module>
    from dimod.binary.binary_quadratic_model import *
  File "/usr/local/lib/python3.9/site-packages/dimod/binary/binary_quadratic_model.py", line 54, in <module>
    from dimod.binary.cybqm import cyBQM_float32, cyBQM_float64
  File "/usr/local/lib/python3.9/site-packages/dimod/binary/cybqm/__init__.py", line 15, in <module>
    from dimod.binary.cybqm.cybqm_float32 import cyBQM_float32
  File "dimod/binary/cybqm/cybqm_float32.pyx", line 1, in init dimod.binary.cybqm.cybqm_float32
  File "dimod/cyqmbase/cyqmbase_float32.pyx", line 1, in init dimod.cyqmbase.cyqmbase_float32
  File "dimod/cyvariables.pyx", line 26, in init dimod.cyvariables
  File "/usr/local/lib/python3.9/site-packages/dimod/utilities.py", line 25, in <module>
    from dimod.typing import Variable
  File "/usr/local/lib/python3.9/site-packages/dimod/typing.py", line 93, in <module>
    import networkx as nx
  File "/usr/local/lib/python3.9/site-packages/networkx/__init__.py", line 19, in <module>
    from networkx import utils
  File "/usr/local/lib/python3.9/site-packages/networkx/utils/__init__.py", line 7, in <module>
    from networkx.utils.backends import *
  File "/usr/local/lib/python3.9/site-packages/networkx/utils/backends.py", line 258, in <module>
    backends = _get_backends("networkx.backends")
  File "/usr/local/lib/python3.9/site-packages/networkx/utils/backends.py", line 234, in _get_backends
    items = entry_points(group=group)
TypeError: entry_points() got an unexpected keyword argument 'group'
*** Error code 1

See the log.

Version: 1.2.0
networkx-3.3
Python-3.9
FreeBSD 14.0

2 tests fail

======================================================================
FAIL: test_time_limit (test_random_sampler.TestRandomSampler.test_time_limit)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/science/py-dwave-samplers/work-py311/dwave-samplers-1.3.0/tests/test_random_sampler.py", line 62, in test_time_limit
    self.assertTrue(.01 < runtime < .04)
AssertionError: False is not true

======================================================================
FAIL: test_concurrency (test_tabu.TestTabuSearch.test_concurrency)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/ports/science/py-dwave-samplers/work-py311/dwave-samplers-1.3.0/tests/test_tabu.py", line 69, in test_concurrency
    self.assertTrue(0.4 < tt.dt < 1.6)
AssertionError: False is not true

----------------------------------------------------------------------
Ran 455 tests in 65.388s

FAILED (failures=2)

Version: 1.3.0
Python-3.11
FreeBSD 14.1

Example from the README fails: No module named 'dwave.samplers.greedy.descent'

$ cat x.py 
from dwave.samplers import RandomSampler
sampler = RandomSampler()

$ python3.9 x.py 
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/x.py", line 1, in <module>
    from dwave.samplers import RandomSampler
  File "/usr/local/lib/python3.9/site-packages/dwave/samplers/__init__.py", line 17, in <module>
    from dwave.samplers.greedy import *
  File "/usr/local/lib/python3.9/site-packages/dwave/samplers/greedy/__init__.py", line 15, in <module>
    from dwave.samplers.greedy.sampler import *
  File "/usr/local/lib/python3.9/site-packages/dwave/samplers/greedy/sampler.py", line 25, in <module>
    from dwave.samplers.greedy.descent import steepest_gradient_descent
ModuleNotFoundError: No module named 'dwave.samplers.greedy.descent'

Version: 1.0.0.dev1

75 tests fail

======================================================================
FAIL: test_graphs (test_tree.TestTreewidth)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 135, in test_graphs
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 6

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (n=5)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 159, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 1, 2, 3, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 1, 2, 4, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 1, 3, 2, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 1, 3, 4, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 1, 4, 2, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 1, 4, 3, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 2, 1, 3, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 2, 1, 4, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 2, 3, 1, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 2, 3, 4, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 2, 4, 1, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 2, 4, 3, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 3, 1, 2, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 3, 1, 4, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 3, 2, 1, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 3, 2, 4, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 3, 4, 1, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(0, 3, 4, 2, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 2, 0, 3, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 2, 0, 4, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 2, 3, 0, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 2, 3, 4, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 2, 4, 0, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 2, 4, 3, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 3, 0, 2, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 3, 0, 4, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 3, 2, 0, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 3, 2, 4, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 3, 4, 0, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(1, 3, 4, 2, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 1, 0, 3, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 1, 0, 4, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 1, 3, 0, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 1, 3, 4, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 1, 4, 0, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 1, 4, 3, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 3, 0, 1, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 3, 0, 4, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 3, 1, 0, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 3, 1, 4, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 3, 4, 0, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(2, 3, 4, 1, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 1, 0, 2, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 1, 0, 4, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 1, 2, 0, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 1, 2, 4, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 1, 4, 0, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 1, 4, 2, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 2, 0, 1, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 2, 0, 4, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 2, 1, 0, 4))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 2, 1, 4, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 2, 4, 0, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(3, 2, 4, 1, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 1, 0, 2, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 1, 0, 3, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 1, 2, 0, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 1, 2, 3, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 1, 3, 0, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 1, 3, 2, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 2, 0, 1, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 2, 0, 3, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 2, 1, 0, 3))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 2, 1, 3, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 2, 3, 0, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 2, 3, 1, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 3, 0, 1, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 3, 0, 2, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 3, 1, 0, 2))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 3, 1, 2, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 3, 2, 0, 1))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path=(4, 3, 2, 1, 0))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 171, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

======================================================================
FAIL: test_path (test_tree.TestTreewidth) (path='edbde')
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 180, in test_path
    self.check_order(bqm, tw, order)
  File "/disk-samsung/freebsd-ports/science/py-dwave-samplers/work-py39/dwave-samplers-1.0.0.dev1/tests/test_tree.py", line 87, in check_order
    self.assertEqual(treewidth, elimination_order_width(bqm, order))
AssertionError: 1 != 2

----------------------------------------------------------------------
Ran 391 tests in 23.425s

FAILED (failures=75)

Python-3.9
FreeBSD 13.1

Error for building from source

Description
Building from source terminates with an error:

writing manifest file 'dwave_samplers.egg-info\SOURCES.txt'
error: each element of 'ext_modules' option must be an Extension instance or 2-tuple

Steps To Reproduce

dwave-samplers>python setup.py develop install

Expected Behavior
Build with no errors

Environment

  • OS: Win10
  • Python version: 3.10.2

Additional Context
Clean environment and install

Tabu documentation of timeout and num_reads inaccurate, not clear what is happening.

samples = tabu_sampler.sample_ising(h = {'a': -0.5, 'b': 1.0}, J = {'ab ': -1},num_restarts = 0,num_reads=100,timeout=1000)

We anticipate the runtime of this algorithm to be close to timeout*num_reads according to the MST2 reference (no restarts - STS(), which should run until a timeout condition is met). However, it seems to be more than 2 orders of magnitude shorter and basically independent of timeout.

Perhaps a max number of iterations (z) is silently hardcoded per restart? I've varied, num_restarts, tenure, num_reads and complexity (size and level of frustration) of the ising model without recovering the expected behavior.

question about the optimization in simulated_annealing

May I ask what optimization method is used in the simulated_annealing method? As far as I know, the simulated annealing algorithm should randomly add disturbance to the current solution to generate a new solution.
I set num_reads=1 and nun_sweeps=1. So only one sample should be randomly generated and a simulated annealing should be performed. In theory, the solution of this simulated annealing should be relatively poor, because the solution is randomly generated. But it seems that the effect is still very good. This seems to be quite different from the principle of the simulated annealing algorithm I understand.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.