We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description DQM's adj property only works when all interactions are zero.
Steps To Reproduce
>>> dqm = dimod.DiscreteQuadraticModel() >>> dqm.add_variable(2) >>> dqm.add_variable(2) >>> dqm.set_linear(0, [1, -1]) # optional >>> dqm.set_linear(1, [0.5, -0.5]) # optional >>> dqm.adj {0: {}, 1: {}} >>> dqm.set_quadratic(0, 1, [[2, 3], [0, 0]]) >>> dqm.adj TypeError: cannot convert dictionary update sequence element #0 to a sequence
>>> provinces = ["AB", "BC", "ON", "MB", "NB", "NL", "NS", "NT", "NU", "PE", "QC", "SK", "YT"] >>> borders = [("BC", "AB"), ("BC", "NT"), ("BC", "YT"), ("AB", "SK"), ("AB", "NT"), ("SK", "MB"), ("SK", "NT"), ("MB", "ON"), ("MB", "NU"), ("ON", "QC"), ("QC", "NB"), ("QC", "NL"), ("NB", "NS"), ("YT", "NT"), ("NT", "NU")] >>> colors = [0, 1, 2, 3] >>> dqm = dimod.DiscreteQuadraticModel() >>>for p in provinces: ... _ = dqm.add_variable(4, label=p) >>> for p0, p1 in borders: ... dqm.set_quadratic(p0, p1, {(c, c): 1 for c in colors}) >>> dqm.adj {'AB': {'B': 'C', 'N': 'T', 'S': 'K'}, 'BC': {'A': 'B', 'N': 'T', 'Y': 'T'}, 'ON': {'M': 'B', 'Q': 'C'}, 'MB': {'O': 'N', 'N': 'U', 'S': 'K'}, 'NB': {'N': 'S', 'Q': 'C'}, 'NL': {'Q': 'C'}, 'NS': {'N': 'B'}, 'NT': {'A': 'B', 'B': 'C', 'N': 'U', 'S': 'K', 'Y': 'T'}, 'NU': {'M': 'B', 'N': 'T'}, 'PE': {}, 'QC': {'O': 'N', 'N': 'L'}, 'SK': {'A': 'B', 'M': 'B', 'N': 'T'}, 'YT': {'B': 'C', 'N': 'T'}}
Expected Behavior If we don't support printing adj for DQM, remove the property
adj
Environment
Additional Context I don't remember if this worked in the past or not
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
DQM's adj property only works when all interactions are zero.
Steps To Reproduce
Expected Behavior
If we don't support printing
adj
for DQM, remove the propertyEnvironment
Additional Context
I don't remember if this worked in the past or not
The text was updated successfully, but these errors were encountered: