dwavesystems / dwavebinarycsp

Map constraint satisfaction problems with binary variables to binary quadratic models.
https://docs.ocean.dwavesys.com/projects/binarycsp/en/latest
Apache License 2.0
20 stars 27 forks source link

version problem? #46

Closed conta877 closed 6 years ago

conta877 commented 6 years ago

after pip install dwave_ocean_sdk

import dwavebinarycsp as dbc

and_gate = dbc.factories.and_gate(["x1", "x2", "y1"])
and_csp = dbc.ConstraintSatisfactionProblem('BINARY')
and_csp.add_constraint(and_gate)
and_bqm = dbc.stitch(and_csp)
and_bqm.remove_offset()

and_bqm

gives the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-18-2e6477ca2e14> in <module>()
      4 and_csp = dbc.ConstraintSatisfactionProblem('BINARY')
      5 and_csp.add_constraint(and_gate)
----> 6 and_bqm = dbc.stitch(and_csp)
      7 and_bqm.remove_offset()
      8 

/opt/conda/lib/python3.6/site-packages/dwavebinarycsp/compilers/stitcher.py in stitch(csp, min_classical_gap, max_graph_size)
    167                 continue
    168 
--> 169             if pmodel.classical_gap >= min_classical_gap:
    170                 break
    171 

AttributeError: 'NoneType' object has no attribute 'classical_gap'
conta877 commented 6 years ago

Successfully installed dimod-0.6.11 dwave-cloud-client-0.4.4 dwave-neal-0.3.1 dwave-networkx-0.6.3 dwave-ocean-sdk-1.0.0 dwave-qbsolv-0.2.7 dwave-system-0.3.2 dwavebinarycsp-0.0.2 enum34-1.1.6 homebase-1.0.0 minorminer-0.1.4 penaltymodel-0.14.0 penaltymodel-cache-0.2.1 penaltymodel-maxgap-0.3.2 pysmt-0.7.0

so the version here is 0.0.2

conta877 commented 6 years ago

Also this is copy paste from the factoring demo. runs on leap jupy