GOAT.ControllableSystem — TypeInstantiate a ControllableSystem struct.
GOAT.ControllableSystem — MethodControllableSystem(drift_op, basis_ops, c_func, ∂c_func)Instantiate a ControllableSystem struct from input operators and functions.
The basis_ops is a vector of basis operators which will be weighted by the coefficient functions c_func. ∂c_func computes the first derivative of c_func evaluated at an input.
GOAT.ControllableSystem — MethodControllableSystem(drift_op, basis_ops, RF_generator::Eigen, c_func, ∂c_func; <keyword arguments>)Instantiate a ControllableSystem struct with a specified RF_generator.
The RF_generator is a specification of the time-independent generator of the rotating reference frame. i.e., if $∂V(t)=A*V(t)$ where A is the generator of type $LinearAlgebra.Diagonal$.
Keyword Arguments
sparse_tol::Float: A tolerance which defines a threshold to discard matrix elements
GOAT.ControllableSystem — MethodControllableSystem(drift_op, basis_ops, RF_generator::Eigen, c_func, ∂c_func; <keyword arguments>)Instantiate a ControllableSystem struct with a specified RF_generator.
The RF_generator is a specification of the time-independent generator of the rotating reference frame. i.e., if $∂V(t)=A*V(t)$ where A is the generator of type $Eigen$.
Keyword Arguments
sparse_tol::Float: A tolerance which defines a threshold to discard matrix elements
GOAT.ControllableSystem — MethodControllableSystem(drift_op, basis_ops, RF_generator::Matrix, c_func, ∂c_func; <keyword arguments>)Instantiate a ControllableSystem struct with a specified RF_generator.
The RF_generator is a specification of the time-independent generator of the rotating reference frame. i.e., if $∂V(t)=A*V(t)$ where A is the generator of type $Matrix$.
Keyword Arguments
sparse_tol::Float: A tolerance which defines a threshold to discard matrix elements
GOAT.QOCParameters — TypeInstantiate a QOCParameters struct.
GOAT.QOCParameters — MethodQOCParameters(ODE_options,SE_reduce_map, GOAT_reduce_map, optim_alg, optim_options; <keyword arguments> )Instantiate a QOCParameters struct with specified parameters.
Arguments
ODE_options::NamedTuple: The settings that will be input to the ODE solver.SE_reduce_map::Function: A function mapping the output from the Schrodinger equation to the objective value.GOAT_reduce_map::Function: A function mapping the output from the GOAT E.O.M.s to the objective value and gradient.optim_alg::Optim Algorithm: The specific optimization algorithm specified via Optim.jloptim_options::Optim options: The optimization algorithm options specified via Optim.jl
GOAT.QOCProblem — TypeInstantiate a QOCProblem struct.
GOAT.QOCProblem — MethodQOCProblem(target, control_time, Pc, Pa)Instantiate a QOCProblem struct with specified input operators and control time.
Arguments
target::Array{ComplexF64}: the target unitary operator in the computational subspace.control_time::Float64: The duration of the control.Pc::Array{ComplexF64}: A projector from the full unitary operator on the system to the computational subspacePa::Array{ComplexF64}: A projector from the full unitary operator on the system to any ancillary subspace
GOAT.GOAT_action! — MethodGOAT_action!(du, u, p, t, d_ms, d_ls, d_vs, c_ms, c_ls, c_vs, opt_param_inds, c_func, ∂c_func)Compute the action of the GOAT equation of motions on a matrix u and place in du.
Arguments
du::Array{ComplexF64}: The array for the derivativetu::Array{ComplexF64}: The array for the state at timetp::Vector{Float64}: The parameter vector defining the evolution.t::Float64: The time.d_ms::Vector{Vector{Int64}}: The sparse representation of the drift operator's first index.d_ls::Vector{Vector{Int64}}: The sparse representation of the drift operators's second index.d_vs::Vector{Vector{ComplexF64}}: The sparse representation of the mtrix element of the drift operator.c_ms::Vector{Vector{Int64}}: The sparse representation of the control operators' first index.c_ls::Vector{Vector{Int64}}: The sparse representation of the control operators' second index.c_vs::Vector{Vector{ComplexF64}}: The sparse representation of the mtrix element of the control operators.opt_param_inds::Vector{Int64}: The indices of the parameter vectorpto propogate a derivative forc_func::Function: The function that computes the time-dependent coefficients of the control operators.∂c_func::Function: The function that computes the derivative of the time-dependent coefficients of the control operators.
GOAT.GOAT_infidelity_reduce_map — MethodGOAT_infidelity_reduce_map(sys, prob, goat_sol)Maps the GOAT ODE solution to the objective function and gradient vector using an infidelity measure.
Arguments
sys::ControllableSystem: The controllable system.prob::QOCProblem: The QOCProblemgoat_sol::OrdinaryDiffEq.solution: The solution to the GOAT equations of motion.
GOAT.L1 — MethodL1(U, P1, P2)Computes the instantaneous population transferred from between two subspaces.
P1 and P2 are projectors onto subspaces 1 and 2.
GOAT.LO — MethodLO(t,w)Simulates a local oscillator with frequency w.
GOAT.NoDiffControllableSystem — MethodNoDiffControllableSystem(drift_op, basis_ops, c_func)Instantiate a ControllableSystem struct with no specified ∂c_func.
The basis_ops is a vector of basis operators which will be weighted by the coefficient functions c_func.
GOAT.S — MethodS(x, lower, upper ; gradient=1)A saturation function that limits amplitudes to a particular range specified by [lower,upper].
GOAT.SE_action! — MethodSE_action!(du, u, p, t, d_ms, d_ls, d_vs, c_ms, c_ls, c_vs, c_func)Compute the action of the Schrodinger equation on a matrix u and place in du.
Arguments
du::Array{ComplexF64}: The array for the derivativetu::Array{ComplexF64}: The array for the state at timetp::Vector{Float64}: The parameter vector defining the evolution.t::Float64: The time.d_ms::Vector{Vector{Int64}}: The sparse representation of the drift operator's first index.d_ls::Vector{Vector{Int64}}: The sparse representation of the drift operators's second index.d_vs::Vector{Vector{ComplexF64}}: The sparse representation of the mtrix element of the drift operator.c_ms::Vector{Vector{Int64}}: The sparse representation of the control operators' first index.c_ls::Vector{Vector{Int64}}: The sparse representation of the control operators' second index.c_vs::Vector{Vector{ComplexF64}}: The sparse representation of the mtrix element of the control operators.c_func::Function: The function that computes the time-dependent coefficients of the control operators.
GOAT.SE_infidelity_reduce_map — MethodSE_infidelity_reduce_map(sys, prob, SE_sol)Maps Schrodinger ODE solution to the objective function using an infidelity measure.
Arguments
sys::ControllableSystem: The controllable system.prob::QOCProblem: The QOCProblemSE_sol::OrdinaryDiffEq.solution: The solution to the Schrodinger equation.
GOAT.colored_noise — Methodcolored_noise(lf, hf, n, alpha, seed)Generate a set of amplitude, frequencies, and phases for randomly generated colored noise.
Specifically, generates colored noise with P(ω) ∝ ωᵅ
Arguments
lf: The low frequency cutoff.hf: The high frequency cutoff.n: The number of frequncy components.alpha: The color of the noise.
GOAT.dSdx — MethoddSdx(x, lower, upper; gradient=1)Calculates the partial derivative of the saturation function w.r.t the independent variable x.
GOAT.evaluate_objective — Methodevaluate_objective(p, sys, prob, params)Evaluate the objective function at p.
Arguments:
p: The optimal control parameters at which to evalute the objective.sys::ControllableSystem: The controllable system.prob::QOCProblem: The quantum optimal control problem.param::QOCParameters: The quantum optimal control parameters.
GOAT.evaluate_objective — Methodevaluate_objective(ps, sys, prob, params)Parallelized evaluation the objective function at multiple control parameters.
Arguments:
ps::Vector{Vector{Float64}}: The optimal control parameters at which to evalute the objective.sys::ControllableSystem: The controllable system.prob::QOCProblem: The quantum optimal control problem.param::QOCParameters: The quantum optimal control parameters.
GOAT.find_optimal_controls — Methodfind_optimal_controls(p0, opt_param_inds, sys, prob, params)Run the GOAT algorithm and find optimal controls.
Arguments:
p0: The initial guess of the optimal control parameters.opt_param_inds: Indices of p0 which specify which parameters to hold constant and which to optimize.sys::ControllableSystem: The controllable system.prob::QOCProblem: The quantum optimal control problem.param::QOCParameters: The quantum optimal control parameters.
GOAT.find_optimal_controls — Methodfind_optimal_controls(p0, sys, prob, params)Run the GOAT algorithm and find optimal controls.
Arguments:
p0: The initial guess of the optimal control parameters.sys::ControllableSystem: The controllable system.prob::QOCProblem: The quantum optimal control problem.param::QOCParameters: The quantum optimal control parameters.
GOAT.flat_top_cosine — Methodflat_top_cosine(t, A, T, tr)A flat-top cosine function kernel.
Arguments
A: The amplitude of the function.T: Duration of the function.tr: The rise and fall time.
GOAT.fourier_coefficient — Methodfourier_coefficient(p,t,i,N)Compute the time dependent coefficient for a control basis operator given by a Fourier ansatze.
Arguments
p: The vector of control parameters.t: The time at which to evaluate the coefficient function.i: The index of the control basis operator.N: The total number of basis functions used to define the coefficient function.
GOAT.g_abs — Methodg_abs(V, U)Computes the norm of the difference between V and U.
GOAT.g_real — Methodg_real(V, ∂U)Computes infidelity based on the real component of the overlap between V and U.
GOAT.g_sm — Methodg_sm(V, ∂U)Computes infidelity via the squared modulus of the overlap between V and U.
This definition is perhaps the most standard used for quantum optimal control of unitaries.
GOAT.gaussian_coefficient — Methodgaussian_coefficient(p,t,i,N)Compute the time dependent coefficient for a control basis operator given by a gaussian ansatze.
Arguments
p: The vector of control parameters.t: The time at which to evaluate the coefficient function.i: The index of the control basis operator.N: The total number of basis functions used to define the coefficient function.
GOAT.gaussian_kernel — Methodgaussian_kernel(t, a, mu,sigma)Computes the value of a gaussian.
GOAT.general_logistic — Functiongeneral_logistic(t, lower, upper, slope, start, nu)A version of a generalized logistic function found on wikipedia: https://en.wikipedia.org/wiki/Generalisedlogisticfunction.
Arguments
t: The time.lower: The lower asymptote.upper: The upper asymptote.slope: The slope of the function.start = 1e3: A shift of the logistic function to adjustgeneral_logistic(t=0).nu = 1.0: A parameter to set where the maximum derivative is located.
GOAT.get_sinusoidal_basis_parameters — Methodget_sinusoidal_basis_parameters(ts, s)Compute the sinusoidal amplitude, frequencies, and phases of a signal.
Outputs a triplet of: Amps, freqs, phases via the decomposition: $s(t) = ∑ᵢ aᵢ sin(ωᵢt+ϕᵢ)$.
Arguments
ts: the sampling timess: the signal at each sampling time
GOAT.h_sm — Methodh_sm(Us,Pc,Pd,ts)Computes the total population transferred from between two subspaces during the control time.
GOAT.make_GOAT_initial_state — Methodmake_GOAT_initial_state(d,opt_param_inds)Generate the initial state of the coupled equations of motion for the GOAT method.
GOAT.make_GOAT_update_function — Methodmake_GOAT_update_function(sys,opt_param_inds)Generate an in-place update function f!(du,u,p,t) for the GOAT equations of motion equation.
Arguments
sys::ControllableSystem: The controllable system.opt_param_inds::Vector{Int64}: A vector of indices that specifies which control derivatives will be propogated.
GOAT.make_SE_update_function — Methodmake_SE_update_function(sys)Generate an in-place update function f!(du,u,p,t) for the Schrodinger equation based on sys.
Arguments
sys::ControllableSystem: The controllable system
GOAT.morlet_kernel — Methodmorlet_kernel(t, a, mu, sigma, w, phi)Morlet wavelet kernel (although not a true wavelet because it is not normalized).
Effectively a gaussian-windowed sinusoid function.
GOAT.parallel_GOAT_fg! — Methodparallel_GOAT_fg!(F, G, p, p_storage, opt_param_inds, sys, prob, params)Parallelized computation of the objective and gradient for QOC with GOAT.
Arguments
F: The objective valueG: The vector of gradients w.r.t. the control parametersp.p: The control parameter vector.p_storage: A pre-allocated storage vector for currentpvalues.opt_param_inds: The vector of parameter indices which determines which gradients are calculated.sys::ControllableSystem: The controllable system.prob::QOCProblem: The QOCProblemparam::QOCParameters: The QOCParameters.
GOAT.parallel_GOAT_fg! — Methodparallel_GOAT_fg!(F, G, p, sys, prob, params)Parallelized computation of the objective and gradient for QOC with GOAT.
Arguments
F: The objective valueG: The vector of gradients w.r.t. the control parametersp.p: The control parameter vector.sys::ControllableSystem: The controllable system.prob::QOCProblem: The QOCProblemparam::QOCParameters: The QOCParameters.
GOAT.poly_coefficient — Methodpoly_coefficient(p,t,i,N)Compute the time dependent coefficient for a control basis operator given by a polynomial ansatze.
Arguments
p: The vector of control parameters.t: The time at which to evaluate the coefficient function.i: The index of the control basis operator.N: The total number of basis functions used to define the coefficient function.
GOAT.sinusoid_kernel — Methodsinusoid_kernel(t, a, w, phi)Computes the value of a sine function.
GOAT.solve_GOAT_eoms — Methodsolve_GOAT_eoms(sys, opt_param_inds, Tmax, p; <keyword arguments>)Integrate the Schrodinger equation for a specified time and control parameter set.
Arguments
sys::ControllableSystem: The controllable system.opt_param_inds::Vector{Int64}: The vector of parameter indices specifying which gradients will be propogated.Tmax::Float64: The total contorl time.p::Vector{Float64}: The parameters which define the controlled evolution.ODE_options: The specification of the integrator settings from OrdinaryDiffEq.jl
GOAT.solve_GOAT_eoms_reduce — Methodsolve_GOAT_eoms_reduce(p, sys, prob, opt_param_inds, params::QOCParameters)Solves the GOAT eoms and outputs a objective function and gradient vector.
Arguments
p: The control parameter vector at which the objective and gradient is being calculated.sys::ControllableSystem: The controllable system.opt_param_inds: The vector of parameter indices which determines which gradients are calculated.param::QOCParameters: The QOCParameters which provides the ODE_options.
GOAT.solve_SE — Methodsolve_SE(sys, Tmax, p; <keyword arguments>)Integrate the Schrodinger equation for a specified time and control parameter set.
Arguments
sys::ControllableSystem: The controllable system.Tmax::Float64: The total contorl time.p::Vector{Float64}: The parameters which define the controlled evolution.ODE_options: The specification of the integrator settings from OrdinaryDiffEq.jl
GOAT.test_derivatives — Methodtest_derivatives(sys, prob, params, opt_param_inds, p_test; <keyword arguments>)Uses a finite difference method to confirm that gradients are calculated correctly.
If only_coefficeint_funcs=true then only the coefficient functions are checked. If only_coefficeint_funcs=false then the GOAT equations of motion are solved and unitary gradients are checked too.
Arguments
sys: TheControllableSystem.prob: TheQOCProblem.params: TheQOCParameters.dh=1e-8: The finite-difference step size of each parameter.tol=1e-5: The tolerance that determines whether an error is raised.only_coefficeint_funcs=true: Specifies if checking gradients of coefficients or unitaries.
GOAT.time_domain_signal — Methodtime_domain_signal(t::Float64, amps, freqs, phases, N)Compute a truncated inverse fourier transform at time t.
The signal $s(t)$ is reconstructed via the function $s(t) = ∑ᵢ aᵢ cos(ωᵢt+ϕᵢ)$
Arguments
t: The time to evaluate the inverse FFT.amps: The amplitudes.freqs: The frequencies.phases: The phases.N: The number of components to keep when reconstructing the signal.
GOAT.time_domain_signal — Methodtime_domain_signal(t::Float64, amps, freqs, phases)Compute a truncated inverse fourier transform at time t.
The signal $s(t)$ is reconstructed via the function $s(t) = ∑ᵢ aᵢ sin(ωᵢt+ϕᵢ)$
Arguments
t: The time to evaluate the inverse FFT.Aks: The amplitudes.freqs: The frequencies.phi_ks: The phases.
GOAT.window — Functionwindow(x,lower,upper,gradient)A windowing function based on a product of two generalized logistic functions.
See general_logistic for additional details.
Arguments
lower: The location of the left tail.right: The location of the right tail.gradient: The maximum gradient of the logistic functions
GOAT.∂fourier_coefficient — Method∂fourier_coefficient(p,t,i,l,N)Computes the partial derivative of fourier_coefficient w.r.t p[l] evaluated at (p,t).
Arguments
p: The vector of control parameters.t: The time at which to evaluate the coefficient function.i: The index of the control basis operator.l: The index of thepwith which to compute the partial derivative to.N: The total number of basis functions used to define the coefficient function.
GOAT.∂g_abs — Method∂g_abs(V, ∂U)Computes the partial derivative of g_abs w.r.t U evaluated at ∂U
GOAT.∂g_real — Method∂g_real(V, ∂U)Computes the partial derivative of g_real w.r.t U evaluated at ∂U.
GOAT.∂g_sm — Method∂g_sm(V, ∂U)Computes the partial derivative of g_sm w.r.t U evaluated at ∂U.
GOAT.∂gaussian_coefficient — Method∂gaussian_coefficient(p,t,i,l,N::Int64)Computes the partial derivative of fourier_coefficient w.r.t p[l] evaluated at (p,t).
Arguments
p: The vector of control parameters.t: The time at which to evaluate the coefficient function.i: The index of the control basis operator.l: The index of thepwith which to compute the partial derivative to.N: The total number of basis functions used to define the coefficient function.
GOAT.∂h_sm — Method∂h_sm(Us,∂Us,I1,I2,ts)Computes the partial derivative of h_sm w.r.t. U evaluated at ∂U
GOAT.∂poly_coefficient — Method∂poly_coefficient(p,t,i,l,N)Computes the partial derivative of fourier_coefficient w.r.t p[l] evaluated at (p,t).
Arguments
p: The vector of control parameters.t: The time at which to evaluate the coefficient function.i: The index of the control basis operator.l: The index of thepwith which to compute the partial derivative to.N: The total number of basis functions used to define the coefficient function.