Skip to content
New issue

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

Solution refinement using ReverseAnnealingAutoEmbeddingSampler #265

Open
quosta opened this issue Feb 10, 2022 · 0 comments
Open

Solution refinement using ReverseAnnealingAutoEmbeddingSampler #265

quosta opened this issue Feb 10, 2022 · 0 comments

Comments

@quosta
Copy link

quosta commented Feb 10, 2022

I have a problem with an unembeddable number of variables. I can obtain a solution with SimulatedAnnealingSampler and I would like to start from that final state and execute reverse annealing on smaller sub-QUBO rolling.
It seems that I am wrongly feeding the initial_state, because I am getting the error described in issue #177 and #178
I provide the simplest example I can think of, if anyone can point out the error I will be very thankful:

from dimod.generators import gnm_random_bqm
from neal import SimulatedAnnealingSampler
from hybrid import EnergyImpactDecomposer, SplatComposer
from hybrid import State, ReverseAnnealingAutoEmbeddingSampler

bqm = gnm_random_bqm(variables=200,num_interactions=40000,vartype='BINARY')

sampler = SimulatedAnnealingSampler()        
sa_sample = sampler.sample(bqm).first.sample

decomposer = EnergyImpactDecomposer(size=50)
sampler =  ReverseAnnealingAutoEmbeddingSampler(sampling_params={'initial_state':sa_sample})        
subsampler =  decomposer | sampler | SplatComposer()

state = State.from_sample(sa_sample,bqm)
solution = subsampler.run(state).result()

The output that I get is:

StateTraitMissingError: input state is missing 'subsamples' on ReverseAnnealingAutoEmbeddingSampler
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant