<jupyter_start><jupyter_text>Signal Mode PSS<jupyter_code># ramp up on resonance
f_a = 1
f_delta = 0.5
omega_a = 2*np.pi*f_a
delta = 2*np.pi*f_delta
A_in = lambda t: np.exp(1j*(omega_a +delta)*t) #default A_in is used
system = SingleModeSystem(params={"omega_a": omega_a, "kappa_a": 2*np.pi*0.1}, A_in = A_in)
x_0 = np.array([0,0])
ts = np.linspace(0, 20, 1001)
X = system.trapezoidal(x_0, ts)
fig, ax = plot_full_evolution(X, ts, labels=["$q_a$","$p_a$"])
ax.legend()
time_func(system.trapezoidal, x_0, ts, n=100)
t_points = 1001
T = 1/(f_a+f_delta)
ts_shooting = np.linspace(0,T*3, t_points)

def solve_w_shooting():
    x_0_shooting = system.eval_solve_shooting_newton(np.array([0,0]),ts_shooting)
    return system.trapezoidal(x_0_shooting, ts)
    
X = solve_w_shooting()
fig, ax = plot_full_evolution(X, ts, labels=["$q_a$","$p_a$"])
ax.legend()
time_func(solve_w_shooting, n=10)<jupyter_output>100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 10/10 [00:29<00:00,  3.00s/it]<jupyter_text>In this case, it is not worth using the shooting method to reach PSS.  Multi Mode PSS (WIP)<jupyter_code># Params
fs = np.array([1,1])
omegas = 2*np.pi*fs
kappas = 2*np.pi*np.array([0.1,0.1])
gammas = 2*np.pi*np.array([0.001,0.001])
kerrs = 2*np.pi*np.array([0.000,0.000])
couplings = np.array([[0,1,2*np.pi*0.00]])

# Drives
f_drives = fs*1
drives = {0: lambda t: np.exp(1j*f_drives[0]*t), 1: lambda t: np.exp(1j*f_drives[1]*t)}
# Set up system and solve
sys = MultiModeSystem(params={"omegas":omegas, "kappas":kappas, "gammas":gammas, "kerrs":kerrs, "couplings":couplings, "drives":drives})
x_0 = np.array([0,0,0,0])
ts = np.linspace(0, 100, 10001)
X = sys.trapezoidal(x_0, ts)
start_indx = 1000
end_indx = 2000
fig, ax = plot_full_evolution(X[:2, start_indx:end_indx], ts[start_indx:end_indx], labels=["$q_a$","$p_a$"])
ax.legend()
fig, ax = plot_full_evolution(X[2:, start_indx:end_indx], ts[start_indx:end_indx], labels=["$q_b$","$p_b$"])
ax.legend()
t_points = 1001
T = 12 # UNSURE ABOUT PERIOD
ts_shooting = np.linspace(0,T, t_points)
x_0_shooting = sys.eval_solve_shooting_newton(np.array([0,0,0,0]),ts_shooting)
X = sys.trapezoidal(x_0_shooting, ts)
fig, ax = plot_full_evolution(X, ts, labels=["$q_a$","$p_a$","$q_b$","$p_b$"])
ax.legend()
fig, ax = plot_full_evolution(X[:2], ts, labels=["$q_a$","$p_a$"])
ax.legend()
fig, ax = plot_full_evolution(X[2:], ts, labels=["$q_b$","$p_b$"])
ax.legend()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2591297591297591, 'fraction_numerical': 0.052059052059052056, 'mean_word_length': 7.470394736842105, 'pattern_counts': {'":': 8, '<': 9, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '366199', 'license': 'MIT', 'n_tokens_mistral': 1427, 'n_tokens_neox': 1230, 'n_words': 191, 'path': 'demos/analysis/PreiodicSteadyState.ipynb', 'repo_name': 'Phionx/quantumnetworks', 'size': '2574'}