Skip to content

MOI.get on attribute where is_set_by_optimizer = true and TerminationStatus = OPTIMIZE_NOT_CALLED #2352

@pedromxavier

Description

@pedromxavier

On the series of querying attributes with our meta-solver/reformulator I encountered a corner case when retrieving attributes after reformulation without an inner optimizer.

Basically, we have an operation mode in psrenergy/ToQUBO.jl where a call to optimize! without an optimizer will just reformulate the problem to the QUBO form, e.g.,

model = Model(ToQUBO.Optimizer)
...
optimize!(model)

instead of the usual

model = Model(
    () -> ToQUBO.Optimizer(QuantumSolver.Optimizer)
)
...
optimize!(model) # Returns termination status from `QuantumSolver`

The problem is that the OPTIMIZE_NOT_CALLED status prevents attribute retrieval for cases where is_set_by_optimizer = true.

I couldn't find any other suitable status for this case besides OTHER_ERROR which is kind of misleading since there was no error to begin with.

Note: Using optimize! is not necessary, we could be using something like reformulate! or compile! but this makes no big difference in the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions