Skip to content

Commit

Permalink
edit
Browse files Browse the repository at this point in the history
  • Loading branch information
aarontrowbridge committed Jul 10, 2023
1 parent 9f6a1be commit b605816
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/objectives.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,8 @@ end
"""
function UnitaryInfidelityObjective(;
names::Union{Nothing,Tuple{Vararg{Symbol}}}=nothing,
name::Union{Nothing,Symbol}=nothing,
goals::Union{Nothing,AbstractVector{<:Real},Tuple{Vararg{AbstractVector{<:Real}}}}=nothing,
goal::Union{Nothing,AbstractVector{<:Real}}=nothing,
Q::Union{Float64, Vector{Float64}}=100.0,
eval_hessian::Bool=true
)
Expand All @@ -199,7 +198,7 @@ function UnitaryInfidelityObjective(;
end

if goals isa AbstractVector
goals = (goals,)
goals = (goal,)
end

if Q isa Float64
Expand All @@ -211,7 +210,7 @@ function UnitaryInfidelityObjective(;
params = Dict(
:type => :QuantumObjective,
:names => names,
:goals => goals,
:goals => goal,
:loss => loss,
:Q => Q,
:eval_hessian => eval_hessian,
Expand Down Expand Up @@ -254,6 +253,14 @@ function QuantumObjective(
return QuantumObjective(name=name, goals=goal, loss=loss, Q=Q)
end

function UnitaryInfidelityObjective(
name::Symbol,
traj::NamedTrajectory,
Q::Float64
)
return UnitaryInfidelityObjective(name=name, goal=traj.goal[name], Q=Q)
end

function QuantumObjective(
names::Tuple{Vararg{Symbol}},
traj::NamedTrajectory,
Expand Down

0 comments on commit b605816

Please sign in to comment.