Skip to content

Commit

Permalink
fix multimode plotting
Browse files Browse the repository at this point in the history
  • Loading branch information
a7b committed Aug 14, 2022
1 parent cc6208e commit fc564d6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 15 deletions.
4 changes: 2 additions & 2 deletions experiments/multimode/g0_to_g1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ prob = QuantumControlProblem(

plot_path = "plots/multimode/fixed_time/no_guess/g0_to_g1_T_$(T)_dt_$(Δt)_R_$(R)_iter_$(iter)" * (pin_first_qstate ? "_pinned" : "") * (phase_flip ? "_phase_flip" : "") * ".png"

plot_multimode_qubit(sys, prob.trajectory, plot_path)
plot_multimode(sys, prob.trajectory, plot_path)

save_path = "data/multimode/fixed_time/no_guess/g0_to_g1_T_$(T)_dt_$(Δt)_R_$(R)_iter_$(iter)" * (pin_first_qstate ? "_pinned" : "") * (phase_flip ? "_phase_flip" : "") * ".h5"

solve!(prob, save=true, path=save_path)

plot_multimode_qubit(sys, prob.trajectory, plot_path)
plot_multimode(sys, prob.trajectory, plot_path)
4 changes: 2 additions & 2 deletions experiments/multimode/g0_to_g1_from_init_guess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ plot_path = "plots/multimode/fixed_time/guess/g0_to_g1_init_traj_T_$(T)_R_$(R)_i

# test the plot

plot_multimode_qubit(system, prob.trajectory, plot_path)
plot_multimode(system, prob.trajectory, plot_path)


# solve multimode problem
Expand All @@ -75,7 +75,7 @@ solve!(prob)

# plot results

plot_multimode_qubit(system, prob.trajectory, plot_path)
plot_multimode(system, prob.trajectory, plot_path)


# save results if requested
Expand Down
4 changes: 2 additions & 2 deletions experiments/multimode/g0_to_g1_mintime_from_init_guess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ plot_path = "plots/multimode/mintime/g0_to_g1_init_traj_T_$(T)_R_$(R)_Ru_$(R_min

# test the plot

plot_multimode_qubit(system, prob.trajectory, plot_path)
plot_multimode(system, prob.trajectory, plot_path)


# solve multimode problem
Expand All @@ -90,7 +90,7 @@ solve!(mintime_prob)

# plot results

plot_multimode_qubit(system, prob.trajectory, plot_path)
plot_multimode(system, prob.trajectory, plot_path)


# save results if requested
Expand Down
9 changes: 2 additions & 7 deletions experiments/multimode/multimode.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,8 @@ data_dir = "data/multimode/fixed_time/no_guess/problems"

resolves = parse(Int, ARGS[end])

<<<<<<< HEAD
prob = QuantumControlProblem(
system,
=======
prob = QubitProblem(
sys,
>>>>>>> origin
T;
Δt=Δt,
R=R,
Expand All @@ -114,8 +109,8 @@ for i = 1:resolves
experiment * resolve,
data_dir
)
plot_multimode_qubit(sys, prob.trajectory, plot_path)
plot_multimode(sys, prob.trajectory, plot_path)
solve!(prob, save=true, path=data_path)
plot_multimode_qubit(sys, prob.trajectory, plot_path)
plot_multimode(sys, prob.trajectory, plot_path)
global prob = load_object(data_path)
end
4 changes: 2 additions & 2 deletions src/plotting_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module PlottingUtils
export plot_single_qubit_1_qstate_with_controls
export plot_single_qubit_2_qstate_with_controls
export plot_single_qubit_2_qstate_with_seperated_controls
export plot_multimode_qubit
export plot_multimode
export plot_single_qubit
export plot_transmon
export plot_transmon_population
Expand Down Expand Up @@ -258,7 +258,7 @@ function plot_single_qubit_2_qstate_with_seperated_controls(
save(filename, fig)
end

function plot_multimode_qubits(
function plot_multimode(
system::QuantumSystem,
traj::Trajectory,
path::String
Expand Down

0 comments on commit fc564d6

Please sign in to comment.