kestrelquantum / QuantumCollocation.jl

Quantum Optimal Control with Direct Collocation
MIT License
29 stars 7 forks source link

[Feature]: Convert objectives to constraints #145

Open andgoldschmidt opened 1 month ago

andgoldschmidt commented 1 month ago

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

Importance

1 (lowest)

What does this feature affect?

Other information

No response