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

[Feature]: Convert objectives to constraints #145

Open
1 of 10 tasks
andgoldschmidt opened this issue Aug 14, 2024 · 1 comment
Open
1 of 10 tasks

[Feature]: Convert objectives to constraints #145

andgoldschmidt opened this issue Aug 14, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@andgoldschmidt
Copy link
Member

Feature Description

Background

There should be utilities that turn any objective into some appropriate constraint. The constraint should take in an objective and a value as arguments, and the output should be a constraint satisfying the desired condition.

For example,

function ObjectiveEqualityConstraint(objective::Objective, value::Float64) 
     objective - value = 0
end
function ObjectiveInequalityConstraint(objective::Objective, value::Float64) 
     objective - value > 0
end

This functionality has already been implemented in FinalUnitaryFidelityConstraint, which follows the format of UnitaryInfidelityObjective; the point of this issue is to generalize and abstract this concept.

Suggested checklist

  • Pick a specific objective (e.g. UnitaryInfidelityObjective objective). Write a routine that creates a constraint from this objective. Compare to the existing constraint (e.g. FinalUnitaryFidelityConstraint).

Importance

1 (lowest)

What does this feature affect?

  • quantum system construction
  • problem setup
  • problem solution
  • problem performance
  • solution analysis
  • plotting
  • documentation
  • tests
  • other (please specify below)

Other information

No response

@andgoldschmidt andgoldschmidt added enhancement New feature or request qnumerics Issue for qnumerics hackathon and removed qnumerics Issue for qnumerics hackathon labels Aug 14, 2024
@andgoldschmidt
Copy link
Member Author

andgoldschmidt commented Nov 9, 2024

This would allow for a much simpler implementation of the constraint class of problem templates like minimum time and robustness. Those problems could extract the existing fidelity objective from the problem params, which by default already "pops" from this list. Then, the constraint could be constructed from this objective using the existing gradients.

The code that computes fidelity and sets up the fidelity constraint in these methods could be mostly replaced.

@andgoldschmidt andgoldschmidt self-assigned this Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant