Skip to content

optimize: make the optimization objective a pluggable function object #558

Description

@evaleev

Follow-up from review of #556.

Currently sequant::OptimizeOptions::objective_function selects the single-term/top-level optimization cost model from a fixed enum class ObjectiveFunction { DenseFLOPs, DenseSize }. @Krzmbrzl suggested making the objective a passed-in function object instead, with named default implementations corresponding to today's enum values. That would let downstream users supply custom cost models without modifying SeQuant source.

Scope (separate from the #556 terminology rename):

  • Replace the enum dispatch in single_term.hpp / optimize.cpp with a callable cost interface.
  • Provide named default objective objects for the current DenseFLOPs / DenseSize models.
  • Decide how the volatile/footprint weighting (currently gated on objective_function == DenseFLOPs) composes with a custom objective.
  • Keep the enum as a convenience or remove it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions