C. State preparation from a thermal state with Jaynes-Cummings controls#
from feedback_grape.fgrape import optimize_pulse
from feedback_grape.utils.operators import (
sigmap,
sigmam,
create,
destroy,
identity,
cosm,
sinm,
)
from feedback_grape.utils.states import basis, fock
from feedback_grape.utils.tensor import tensor
import jax.numpy as jnp
import jax
from jax.scipy.linalg import expm
defining parameterized operations that are repeated num_time_steps times#
N_cav = 20
def qubit_unitary(alphas):
alpha_re, alpha_im = alphas
alpha = alpha_re + 1j * alpha_im
return tensor(
identity(N_cav),
expm(-1j * (alpha * sigmap() + alpha.conjugate() * sigmam()) / 2),
)
def qubit_cavity_unitary(betas):
beta_re, beta_im = betas
beta = beta_re + 1j * beta_im
return expm(
-1j
* (
beta * (tensor(destroy(N_cav), sigmap()))
+ beta.conjugate() * (tensor(create(N_cav), sigmam()))
)
/ 2
)
povm_measure_operator (callable):
#
- It should take a measurement outcome and list of params as input
- The measurement outcome options are either 1 or -1
from feedback_grape.utils.operators import create, destroy
def povm_measure_operator(measurement_outcome, params):
"""
POVM for the measurement of the cavity state.
returns Mm ( NOT the POVM element Em = Mm_dag @ Mm ), given measurement_outcome m, gamma and delta
"""
gamma, delta = params
cav_operator = gamma * create(N_cav) @ destroy(N_cav) + delta / 2 * identity(N_cav)
angle = tensor(cav_operator, identity(2))
meas_op = jnp.where(
measurement_outcome == 1,
cosm(angle),
sinm(angle),
)
return meas_op
defining initial (thermal) state#
# initial state is a thermal state coupled to a qubit in the ground state?
n_average = 1
# natural logarithm
beta = jnp.log((1 / n_average) + 1)
diags = jnp.exp(-beta * jnp.arange(N_cav))
normalized_diags = diags / jnp.sum(diags, axis=0)
rho_cav = jnp.diag(normalized_diags)
rho_cav.shape
(20, 20)
rho0 = tensor(rho_cav, basis(2, 0) @ basis(2, 0).conj().T)
from feedback_grape.utils.povm import (
_probability_of_a_measurement_outcome_given_a_certain_state,
)
_probability_of_a_measurement_outcome_given_a_certain_state(
rho0,
+1,
povm_measure_operator(+1, params=[0.1, -3 * jnp.pi / 2]),
povm_measure_operator(-1, params=[0.1, -3 * jnp.pi / 2]),
evo_type="density"
)
Array(0.40800029, dtype=float64)
defining target state#
psi_target = tensor(
(fock(N_cav, 1) + fock(N_cav, 2) + fock(N_cav, 3)) / jnp.sqrt(3), basis(2)
)
psi_target = psi_target / jnp.linalg.norm(psi_target)
rho_target = psi_target @ psi_target.conj().T
rho_target.shape
(40, 40)
from feedback_grape.utils.fidelity import fidelity
print(fidelity(U_final=rho0, C_target=rho_target, evo_type="density"))
0.14583347658746756
# Print the eigenvalues of rho0
eigenvalues = jnp.linalg.eigvalsh(rho_target)
print("Eigenvalues of rho0:", eigenvalues)
Eigenvalues of rho0: [-2.72829216e-16 -6.02376918e-17 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
0.00000000e+00 0.00000000e+00 0.00000000e+00 1.00000000e+00]
initialize random params#
import jax
print(
jax.random.uniform(
jax.random.PRNGKey(0),
shape=(1, 2), # 2 for gamma and delta
minval=-jax.numpy.pi,
maxval=jax.numpy.pi,
).tolist()
)
[[-0.5123490775685872, -1.782568231202715]]
import jax
from feedback_grape.fgrape import Gate
num_time_steps = 5
num_of_iterations = 1000
learning_rate = 0.02
# avg_photon_numer = 2 When testing kitten state
# If you provide param_constraints for only one parameter, the current behavior throws an error if you don't provide param_constraints for all parameters for all gates
key1, key2, key3 = jax.random.split(jax.random.PRNGKey(42), 3)
measure = Gate(
gate=povm_measure_operator,
initial_params=jax.random.uniform(
key1,
shape=(2,), # 2 for gamma and delta
minval=-2 * jnp.pi,
maxval=2 * jnp.pi,
),
measurement_flag=True,
# param_constraints=[[0, jnp.pi], [-2*jnp.pi, 2*jnp.pi]],
)
qub_unitary = Gate(
gate=qubit_unitary,
initial_params=jax.random.uniform(
key2,
shape=(2,), # 2 for gamma and delta
minval=-2 * jnp.pi,
maxval=2 * jnp.pi,
),
measurement_flag=False,
# param_constraints=[[-2*jnp.pi, 2*jnp.pi], [-2*jnp.pi, 2*jnp.pi]],
)
qub_cav = Gate(
gate=qubit_cavity_unitary,
initial_params=jax.random.uniform(
key3,
shape=(2,), # 2 for gamma and delta
minval=-2 * jnp.pi,
maxval=2 * jnp.pi,
),
measurement_flag=False,
# param_constraints=[[-jnp.pi, jnp.pi], [-jnp.pi, jnp.pi]],
)
system_params = [measure, qub_unitary, qub_cav]
result = optimize_pulse(
U_0=rho0,
C_target=rho_target,
system_params=system_params,
num_time_steps=num_time_steps,
mode="lookup",
goal="fidelity",
max_iter=num_of_iterations,
convergence_threshold=1e-6,
learning_rate=learning_rate,
evo_type="density",
batch_size=10,
eval_time_steps=2*num_time_steps,
progress=True
)
Iteration 10, Loss: 0.619694, T=4s, eta=378s
Iteration 20, Loss: 0.559191, T=8s, eta=395s
Iteration 30, Loss: 0.654462, T=12s, eta=397s
Iteration 40, Loss: 0.690517, T=16s, eta=396s
Iteration 50, Loss: 0.606377, T=21s, eta=393s
Iteration 60, Loss: 0.688028, T=25s, eta=390s
Iteration 70, Loss: 0.736810, T=29s, eta=386s
Iteration 80, Loss: 0.865780, T=33s, eta=383s
Iteration 90, Loss: 0.895460, T=37s, eta=379s
Iteration 100, Loss: 1.038856, T=42s, eta=375s
Iteration 110, Loss: 1.158938, T=46s, eta=371s
Iteration 120, Loss: 1.002144, T=50s, eta=367s
Iteration 130, Loss: 0.755226, T=54s, eta=362s
Iteration 140, Loss: 0.877550, T=58s, eta=358s
Iteration 150, Loss: 1.289478, T=62s, eta=354s
Iteration 160, Loss: 0.713522, T=67s, eta=350s
Iteration 170, Loss: 1.031733, T=71s, eta=346s
Iteration 180, Loss: 1.096958, T=75s, eta=342s
Iteration 190, Loss: 1.128355, T=80s, eta=341s
Iteration 200, Loss: 0.994936, T=84s, eta=337s
Iteration 210, Loss: 1.328315, T=88s, eta=333s
Iteration 220, Loss: 1.221216, T=93s, eta=328s
Iteration 230, Loss: 1.432585, T=97s, eta=324s
Iteration 240, Loss: 1.133908, T=101s, eta=320s
Iteration 250, Loss: 1.102304, T=105s, eta=315s
Iteration 260, Loss: 1.132769, T=109s, eta=311s
Iteration 270, Loss: 1.355787, T=113s, eta=307s
Iteration 280, Loss: 1.338066, T=118s, eta=303s
Iteration 290, Loss: 0.966542, T=122s, eta=298s
Iteration 300, Loss: 1.274787, T=126s, eta=294s
Iteration 310, Loss: 1.058685, T=130s, eta=290s
Iteration 320, Loss: 1.207421, T=135s, eta=287s
Iteration 330, Loss: 1.172191, T=139s, eta=283s
Iteration 340, Loss: 0.795724, T=143s, eta=278s
Iteration 350, Loss: 0.934282, T=148s, eta=275s
Iteration 360, Loss: 0.876481, T=152s, eta=271s
Iteration 370, Loss: 0.976145, T=157s, eta=267s
Iteration 380, Loss: 0.924414, T=161s, eta=263s
Iteration 390, Loss: 1.057730, T=166s, eta=259s
Iteration 400, Loss: 1.177117, T=170s, eta=255s
Iteration 410, Loss: 1.000935, T=174s, eta=251s
Iteration 420, Loss: 1.092715, T=179s, eta=247s
Iteration 430, Loss: 1.275729, T=183s, eta=243s
Iteration 440, Loss: 0.881080, T=187s, eta=238s
Iteration 450, Loss: 1.116680, T=192s, eta=234s
Iteration 460, Loss: 0.993254, T=196s, eta=230s
Iteration 470, Loss: 1.205236, T=200s, eta=226s
Iteration 480, Loss: 0.983353, T=205s, eta=222s
Iteration 490, Loss: 1.001311, T=210s, eta=218s
Iteration 500, Loss: 0.760013, T=214s, eta=214s
Iteration 510, Loss: 0.938240, T=219s, eta=210s
Iteration 520, Loss: 1.165332, T=223s, eta=206s
Iteration 530, Loss: 0.697886, T=227s, eta=202s
Iteration 540, Loss: 0.815341, T=231s, eta=197s
Iteration 550, Loss: 1.022481, T=236s, eta=193s
Iteration 560, Loss: 1.295882, T=240s, eta=188s
Iteration 570, Loss: 1.107453, T=244s, eta=184s
Iteration 580, Loss: 1.334991, T=248s, eta=180s
Iteration 590, Loss: 1.032411, T=252s, eta=175s
Iteration 600, Loss: 1.406894, T=257s, eta=171s
Iteration 610, Loss: 1.069118, T=261s, eta=167s
Iteration 620, Loss: 0.852647, T=265s, eta=163s
Iteration 630, Loss: 0.854603, T=270s, eta=159s
Iteration 640, Loss: 0.750465, T=275s, eta=154s
Iteration 650, Loss: 1.008479, T=279s, eta=150s
Iteration 660, Loss: 1.044224, T=283s, eta=146s
Iteration 670, Loss: 0.986411, T=287s, eta=141s
Iteration 680, Loss: 0.951330, T=292s, eta=137s
Iteration 690, Loss: 0.928892, T=296s, eta=133s
Iteration 700, Loss: 0.823969, T=300s, eta=129s
Iteration 710, Loss: 0.972161, T=305s, eta=124s
Iteration 720, Loss: 0.963577, T=309s, eta=120s
Iteration 730, Loss: 0.908438, T=313s, eta=116s
Iteration 740, Loss: 0.970509, T=318s, eta=112s
Iteration 750, Loss: 0.639997, T=322s, eta=107s
Iteration 760, Loss: 0.391344, T=327s, eta=103s
Iteration 770, Loss: 0.332063, T=332s, eta=99s
Iteration 780, Loss: 0.670616, T=337s, eta=95s
Iteration 790, Loss: 0.698595, T=342s, eta=91s
Iteration 800, Loss: 0.777868, T=346s, eta=86s
Iteration 810, Loss: 0.466033, T=351s, eta=82s
Iteration 820, Loss: 0.809262, T=356s, eta=78s
Iteration 830, Loss: 0.826512, T=360s, eta=74s
Iteration 840, Loss: 0.377342, T=364s, eta=69s
Iteration 850, Loss: 1.004175, T=368s, eta=65s
Iteration 860, Loss: 0.861286, T=373s, eta=61s
Iteration 870, Loss: 1.018144, T=378s, eta=56s
Iteration 880, Loss: 0.685582, T=382s, eta=52s
Iteration 890, Loss: 0.949865, T=387s, eta=48s
Iteration 900, Loss: 0.805573, T=391s, eta=43s
Iteration 910, Loss: 0.566245, T=396s, eta=39s
Iteration 920, Loss: 0.672480, T=400s, eta=35s
Iteration 930, Loss: 0.746733, T=404s, eta=30s
Iteration 940, Loss: 0.909315, T=408s, eta=26s
Iteration 950, Loss: 0.814764, T=413s, eta=22s
Iteration 960, Loss: 0.745597, T=417s, eta=17s
Iteration 970, Loss: 0.746876, T=422s, eta=13s
Iteration 980, Loss: 0.852009, T=427s, eta=9s
Iteration 990, Loss: 0.779454, T=432s, eta=4s
print(result.final_purity)
None
print(
"initial fidelity:",
result.fidelity_each_timestep[0].mean(),
)
print(f"fidelities at timestep {num_time_steps}")
for i, fid in enumerate(result.fidelity_each_timestep[num_time_steps]):
print(f" state {i}: {fid}")
print(f"\n Mean fidelity over timesteps: {jnp.mean(jnp.array(result.fidelity_each_timestep), axis=1)}")
initial fidelity: 0.14583347658746756
fidelities at timestep 5
state 0: 0.7190750808173118
state 1: 0.917003625211918
state 2: 0.9295003122417098
state 3: 0.9375320038909892
state 4: 0.7190750808173118
state 5: 0.874843872577817
state 6: 0.917003625211918
state 7: 0.9295003122417098
state 8: 0.9295003122417098
state 9: 0.917003625211918
Mean fidelity over timesteps: [0.14583348 0.00673346 0.00997865 0.07396142 0.04396785 0.87900379
0.03969353 0.43266916 0.03205135 0.24069604 0.0412832 ]
result.returned_params
[[Array([[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17],
[-4.71238898e+00, 6.35591071e-17]], dtype=float64),
Array([[2.96891996, 1.37845761],
[3.90586008, 1.40552025],
[2.96891996, 1.37845761],
[3.90586008, 1.40552025],
[2.96891996, 1.37845761],
[3.90586008, 1.40552025],
[3.90586008, 1.40552025],
[2.96891996, 1.37845761],
[2.96891996, 1.37845761],
[3.90586008, 1.40552025]], dtype=float64),
Array([[-2.91079602, -1.61227631],
[-0.30017879, -0.01681758],
[-2.91079602, -1.61227631],
[-0.30017879, -0.01681758],
[-2.91079602, -1.61227631],
[-0.30017879, -0.01681758],
[-0.30017879, -0.01681758],
[-2.91079602, -1.61227631],
[-2.91079602, -1.61227631],
[-0.30017879, -0.01681758]], dtype=float64)],
[Array([[-3.66622114e+00, -1.43809827e-02],
[-3.90362441e+00, -1.00727052e-03],
[-3.66622114e+00, -1.43809827e-02],
[-3.90362441e+00, -1.00727052e-03],
[-3.66622114e+00, -1.43809827e-02],
[-3.90362441e+00, -1.00727052e-03],
[-3.90362441e+00, -1.00727052e-03],
[-3.66622114e+00, -1.43809827e-02],
[-3.66622114e+00, -1.43809827e-02],
[-3.90362441e+00, -1.00727052e-03]], dtype=float64),
Array([[ 4.20815593, 5.55423072],
[ 3.2311455 , -0.93475914],
[ 2.69581822, 3.94111249],
[ 3.2311455 , -0.93475914],
[ 4.20815593, 5.55423072],
[ 3.71753401, -1.43044031],
[ 3.2311455 , -0.93475914],
[ 2.69581822, 3.94111249],
[ 2.69581822, 3.94111249],
[ 3.2311455 , -0.93475914]], dtype=float64),
Array([[ 2.97048096, 2.46761535],
[-1.78296028, 2.01290936],
[ 1.6958974 , 2.45914982],
[-1.78296028, 2.01290936],
[ 2.97048096, 2.46761535],
[-4.59779892, 4.09005049],
[-1.78296028, 2.01290936],
[ 1.6958974 , 2.45914982],
[ 1.6958974 , 2.45914982],
[-1.78296028, 2.01290936]], dtype=float64)],
[Array([[-3.58639531, -0.34723289],
[-3.3248564 , -2.57517342],
[-3.0536391 , -0.14210875],
[-3.3248564 , -2.57517342],
[-3.58639531, -0.34723289],
[-2.96159919, -0.94803533],
[-3.3248564 , -2.57517342],
[-3.0536391 , -0.14210875],
[-3.0536391 , -0.14210875],
[-3.3248564 , -2.57517342]], dtype=float64),
Array([[ 0.8140144 , -1.55271413],
[ 1.916774 , -1.44314599],
[ 2.10561735, -1.35505586],
[ 1.916774 , -1.44314599],
[ 0.8140144 , -1.55271413],
[ 0.93983621, 2.83963086],
[ 1.916774 , -1.44314599],
[ 2.10561735, -1.35505586],
[ 2.10561735, -1.35505586],
[ 1.916774 , -1.44314599]], dtype=float64),
Array([[-2.69586134, 1.79307532],
[-1.49393037, 0.94362187],
[-2.2191152 , 1.34252448],
[-1.49393037, 0.94362187],
[-2.69586134, 1.79307532],
[ 0.21115566, 0.49994208],
[-1.49393037, 0.94362187],
[-2.2191152 , 1.34252448],
[-2.2191152 , 1.34252448],
[-1.49393037, 0.94362187]], dtype=float64)],
[Array([[-3.33733055, -1.89771446],
[-3.07061799, -1.28961328],
[-3.32053409, -2.59498129],
[-3.07061799, -1.28961328],
[-3.33733055, -1.89771446],
[-3.51715922, -1.77660688],
[-3.07061799, -1.28961328],
[-3.32053409, -2.59498129],
[-3.32053409, -2.59498129],
[-3.07061799, -1.28961328]], dtype=float64),
Array([[ 4.2295204 , -2.7982212 ],
[ 1.85264822, -1.97525276],
[ 3.19026583, -0.90479784],
[ 1.76990141, -2.10108699],
[ 4.2295204 , -2.7982212 ],
[-0.03526403, -4.4753804 ],
[ 1.85264822, -1.97525276],
[ 3.19026583, -0.90479784],
[ 3.19026583, -0.90479784],
[ 1.85264822, -1.97525276]], dtype=float64),
Array([[-3.4313605 , 2.63065224],
[-0.90581694, 2.38061388],
[ 2.0840457 , -0.11634591],
[-0.5912054 , 2.43401751],
[-3.4313605 , 2.63065224],
[ 0.4806107 , 1.07056426],
[-0.90581694, 2.38061388],
[ 2.0840457 , -0.11634591],
[ 2.0840457 , -0.11634591],
[-0.90581694, 2.38061388]], dtype=float64)],
[Array([[-3.50668708, -3.33386341],
[-2.96761219, -0.94223148],
[-3.42187989, -0.85643214],
[-3.1703018 , -3.00725455],
[-3.50668708, -3.33386341],
[-3.23596443, -1.62521644],
[-2.96761219, -0.94223148],
[-3.42187989, -0.85643214],
[-3.42187989, -0.85643214],
[-2.96761219, -0.94223148]], dtype=float64),
Array([[ 2.09672798, 2.15771818],
[ 2.35892242, 1.64603852],
[ 1.78561631, -1.02876097],
[ 2.5192854 , 1.3635625 ],
[ 2.09672798, 2.15771818],
[ 1.16930764, 2.19826285],
[ 2.35892242, 1.64603852],
[ 1.78561631, -1.02876097],
[ 1.78561631, -1.02876097],
[ 2.35892242, 1.64603852]], dtype=float64),
Array([[-1.34456023, 2.28951293],
[-2.7170164 , 1.79908615],
[-2.34800273, 1.82955614],
[-2.63368741, 2.01874185],
[-1.34456023, 2.28951293],
[-3.00124324, 1.16946771],
[-2.7170164 , 1.79908615],
[-2.34800273, 1.82955614],
[-2.34800273, 1.82955614],
[-2.7170164 , 1.79908615]], dtype=float64)],
[Array([[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487]], dtype=float64),
Array([[2.76704661, 0.48096551],
[2.96156055, 3.43476073],
[2.30337218, 1.22416254],
[3.28481513, 1.16398946],
[2.76704661, 0.48096551],
[2.59835072, 1.28657678],
[2.96156055, 3.43476073],
[2.5192854 , 1.3635625 ],
[2.30337218, 1.22416254],
[2.96156055, 3.43476073]], dtype=float64),
Array([[-2.1806338 , 2.58539335],
[-2.77492483, 3.83313711],
[-2.44627676, 3.57203483],
[-3.06128741, 3.48343835],
[-2.1806338 , 2.58539335],
[-2.43482183, 2.8285301 ],
[-2.77492483, 3.83313711],
[-2.63368741, 2.01874185],
[-2.44627676, 3.57203483],
[-2.77492483, 3.83313711]], dtype=float64)],
[Array([[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487]], dtype=float64),
Array([[ 2.6563094 , 0.75808451],
[ 1.78561631, -1.02876097],
[ 2.04811833, 3.28970463],
[ 2.76704661, 0.48096551],
[ 2.6563094 , 0.75808451],
[ 2.66045937, 1.22568547],
[ 2.23439007, 0.38757307],
[ 2.66045937, 1.22568547],
[ 2.04811833, 3.28970463],
[ 1.78561631, -1.02876097]], dtype=float64),
Array([[-2.3755671 , 2.69663332],
[-2.34800273, 1.82955614],
[-1.92393329, 2.95643515],
[-2.1806338 , 2.58539335],
[-2.3755671 , 2.69663332],
[-2.07077294, 2.70297674],
[-3.12007362, -0.81745875],
[-2.07077294, 2.70297674],
[-1.92393329, 2.95643515],
[-2.34800273, 1.82955614]], dtype=float64)],
[Array([[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487]], dtype=float64),
Array([[2.59835072, 1.28657678],
[2.5192854 , 1.3635625 ],
[2.6563094 , 0.75808451],
[2.88907271, 0.30838979],
[2.91823688, 0.9173124 ],
[2.09672798, 2.15771818],
[2.59431005, 1.37542471],
[2.11971166, 1.90113969],
[2.6563094 , 0.75808451],
[2.30337218, 1.22416254]], dtype=float64),
Array([[-2.43482183, 2.8285301 ],
[-2.63368741, 2.01874185],
[-2.3755671 , 2.69663332],
[-2.93573447, 3.39166092],
[-1.28906794, 3.32550151],
[-1.34456023, 2.28951293],
[-2.20115251, 2.59472174],
[-0.92441744, 2.48606357],
[-2.3755671 , 2.69663332],
[-2.44627676, 3.57203483]], dtype=float64)],
[Array([[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487]], dtype=float64),
Array([[2.66045937, 1.22568547],
[2.66045937, 1.22568547],
[2.91823688, 0.9173124 ],
[2.73953537, 0.63422184],
[2.04811833, 3.28970463],
[2.76704661, 0.48096551],
[1.7261568 , 1.84280832],
[2.11971166, 1.90113969],
[2.59835072, 1.28657678],
[2.04811833, 3.28970463]], dtype=float64),
Array([[-2.07077294, 2.70297674],
[-2.07077294, 2.70297674],
[-1.28906794, 3.32550151],
[-2.54734306, 2.56759678],
[-1.92393329, 2.95643515],
[-2.1806338 , 2.58539335],
[-1.94933422, 2.69113747],
[-0.92441744, 2.48606357],
[-2.43482183, 2.8285301 ],
[-1.92393329, 2.95643515]], dtype=float64)],
[Array([[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487],
[-3.32166965, -1.29192487]], dtype=float64),
Array([[2.09672798, 2.15771818],
[2.11971166, 1.90113969],
[2.76440654, 1.01077497],
[2.96156055, 3.43476073],
[2.6563094 , 0.75808451],
[2.6563094 , 0.75808451],
[2.73953537, 0.63422184],
[2.11971166, 1.90113969],
[2.66045937, 1.22568547],
[2.6563094 , 0.75808451]], dtype=float64),
Array([[-1.34456023, 2.28951293],
[-0.92441744, 2.48606357],
[-2.26482247, 2.64246405],
[-2.77492483, 3.83313711],
[-2.3755671 , 2.69663332],
[-2.3755671 , 2.69663332],
[-2.54734306, 2.56759678],
[-0.92441744, 2.48606357],
[-2.07077294, 2.70297674],
[-2.3755671 , 2.69663332]], dtype=float64)]]
print(result.iterations)
1000