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(
    init_state=rho0,
    target_state=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=375s
Iteration 20, Loss: 0.559191, T=7s, eta=350s
Iteration 30, Loss: 0.654462, T=10s, eta=337s
Iteration 40, Loss: 0.690517, T=14s, eta=332s
Iteration 50, Loss: 0.606377, T=17s, eta=329s
Iteration 60, Loss: 0.688028, T=21s, eta=335s
Iteration 70, Loss: 0.736810, T=25s, eta=333s
Iteration 80, Loss: 0.865780, T=28s, eta=324s
Iteration 90, Loss: 0.895460, T=31s, eta=317s
Iteration 100, Loss: 1.038856, T=34s, eta=311s
Iteration 110, Loss: 1.158938, T=38s, eta=305s
Iteration 120, Loss: 1.002144, T=41s, eta=300s
Iteration 130, Loss: 0.755226, T=44s, eta=296s
Iteration 140, Loss: 0.877550, T=48s, eta=293s
Iteration 150, Loss: 1.289478, T=51s, eta=289s
Iteration 160, Loss: 0.713522, T=54s, eta=285s
Iteration 170, Loss: 1.031733, T=57s, eta=281s
Iteration 180, Loss: 1.096958, T=61s, eta=277s
Iteration 190, Loss: 1.128355, T=64s, eta=272s
Iteration 200, Loss: 0.994936, T=67s, eta=268s
Iteration 210, Loss: 1.328315, T=71s, eta=266s
Iteration 220, Loss: 1.221207, T=74s, eta=262s
Iteration 230, Loss: 1.432580, T=77s, eta=258s
Iteration 240, Loss: 1.133913, T=80s, eta=254s
Iteration 250, Loss: 1.102306, T=83s, eta=250s
Iteration 260, Loss: 1.132770, T=86s, eta=246s
Iteration 270, Loss: 1.355784, T=90s, eta=243s
Iteration 280, Loss: 1.338068, T=93s, eta=239s
Iteration 290, Loss: 0.966543, T=97s, eta=237s
Iteration 300, Loss: 1.274789, T=100s, eta=233s
Iteration 310, Loss: 1.058684, T=103s, eta=230s
Iteration 320, Loss: 1.207416, T=106s, eta=226s
Iteration 330, Loss: 1.172187, T=109s, eta=222s
Iteration 340, Loss: 0.795722, T=113s, eta=219s
Iteration 350, Loss: 0.934281, T=116s, eta=215s
Iteration 360, Loss: 0.876484, T=119s, eta=212s
Iteration 370, Loss: 0.976146, T=122s, eta=208s
Iteration 380, Loss: 0.924410, T=125s, eta=205s
Iteration 390, Loss: 1.057753, T=129s, eta=201s
Iteration 400, Loss: 1.177116, T=132s, eta=198s
Iteration 410, Loss: 1.000939, T=135s, eta=194s
Iteration 420, Loss: 1.092718, T=138s, eta=191s
Iteration 430, Loss: 1.275725, T=142s, eta=188s
Iteration 440, Loss: 0.881084, T=145s, eta=185s
Iteration 450, Loss: 1.116676, T=148s, eta=181s
Iteration 460, Loss: 0.993254, T=152s, eta=178s
Iteration 470, Loss: 1.205236, T=155s, eta=175s
Iteration 480, Loss: 0.983355, T=158s, eta=171s
Iteration 490, Loss: 1.001310, T=161s, eta=168s
Iteration 500, Loss: 0.760032, T=164s, eta=164s
Iteration 510, Loss: 0.938214, T=168s, eta=161s
Iteration 520, Loss: 1.165753, T=171s, eta=158s
Iteration 530, Loss: 0.697868, T=175s, eta=155s
Iteration 540, Loss: 0.815368, T=178s, eta=151s
Iteration 550, Loss: 1.022441, T=181s, eta=148s
Iteration 560, Loss: 1.295912, T=185s, eta=145s
Iteration 570, Loss: 1.107398, T=188s, eta=142s
Iteration 580, Loss: 1.335107, T=192s, eta=139s
Iteration 590, Loss: 1.032403, T=195s, eta=135s
Iteration 600, Loss: 1.406895, T=198s, eta=132s
Iteration 610, Loss: 1.069001, T=202s, eta=129s
Iteration 620, Loss: 0.852598, T=205s, eta=126s
Iteration 630, Loss: 0.854650, T=209s, eta=123s
Iteration 640, Loss: 0.750477, T=212s, eta=119s
Iteration 650, Loss: 1.008557, T=215s, eta=116s
Iteration 660, Loss: 1.044254, T=219s, eta=113s
Iteration 670, Loss: 0.986450, T=222s, eta=109s
Iteration 680, Loss: 0.951353, T=225s, eta=106s
Iteration 690, Loss: 0.928878, T=229s, eta=103s
Iteration 700, Loss: 0.824319, T=232s, eta=99s
Iteration 710, Loss: 0.972151, T=235s, eta=96s
Iteration 720, Loss: 0.963490, T=239s, eta=93s
Iteration 730, Loss: 0.908401, T=242s, eta=89s
Iteration 740, Loss: 0.970608, T=246s, eta=86s
Iteration 750, Loss: 0.639949, T=250s, eta=83s
Iteration 760, Loss: 0.391333, T=253s, eta=80s
Iteration 770, Loss: 0.332053, T=256s, eta=76s
Iteration 780, Loss: 0.670661, T=259s, eta=73s
Iteration 790, Loss: 0.698586, T=263s, eta=70s
Iteration 800, Loss: 0.777814, T=268s, eta=67s
Iteration 810, Loss: 0.466045, T=272s, eta=64s
Iteration 820, Loss: 0.809259, T=275s, eta=60s
Iteration 830, Loss: 0.826517, T=278s, eta=57s
Iteration 840, Loss: 0.377347, T=282s, eta=54s
Iteration 850, Loss: 1.004180, T=285s, eta=50s
Iteration 860, Loss: 0.861270, T=288s, eta=47s
Iteration 870, Loss: 1.018132, T=291s, eta=43s
Iteration 880, Loss: 0.685581, T=295s, eta=40s
Iteration 890, Loss: 0.949864, T=298s, eta=37s
Iteration 900, Loss: 0.805575, T=302s, eta=33s
Iteration 910, Loss: 0.566240, T=306s, eta=30s
Iteration 920, Loss: 0.672469, T=309s, eta=27s
Iteration 930, Loss: 0.746736, T=313s, eta=23s
Iteration 940, Loss: 0.909266, T=316s, eta=20s
Iteration 950, Loss: 0.814764, T=319s, eta=17s
Iteration 960, Loss: 0.745589, T=322s, eta=13s
Iteration 970, Loss: 0.746876, T=326s, eta=10s
Iteration 980, Loss: 0.851863, T=329s, eta=7s
Iteration 990, Loss: 0.779292, T=332s, eta=3s
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.7194102725324175
  state 1: 0.917003732820672
  state 2: 0.9293042738075619
  state 3: 0.9375323434789816
  state 4: 0.7194102725324175
  state 5: 0.8748438040793716
  state 6: 0.917003732820672
  state 7: 0.9293042738075619
  state 8: 0.9293042738075619
  state 9: 0.917003732820672

 Mean fidelity over timesteps: [0.14583348 0.00675967 0.00995889 0.07404844 0.04403262 0.87901207
 0.03969455 0.43256288 0.03206519 0.24084545 0.04127536]
result.returned_params
[[Array([[-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16],
         [-4.71238898e+00,  3.36106277e-16]], dtype=float64),
  Array([[2.9691256 , 1.37871057],
         [3.90586387, 1.40552022],
         [2.9691256 , 1.37871057],
         [3.90586387, 1.40552022],
         [2.9691256 , 1.37871057],
         [3.90586387, 1.40552022],
         [3.90586387, 1.40552022],
         [2.9691256 , 1.37871057],
         [2.9691256 , 1.37871057],
         [3.90586387, 1.40552022]], dtype=float64),
  Array([[-2.90869411, -1.61331713],
         [-0.30017949, -0.01681701],
         [-2.90869411, -1.61331713],
         [-0.30017949, -0.01681701],
         [-2.90869411, -1.61331713],
         [-0.30017949, -0.01681701],
         [-0.30017949, -0.01681701],
         [-2.90869411, -1.61331713],
         [-2.90869411, -1.61331713],
         [-0.30017949, -0.01681701]], dtype=float64)],
 [Array([[-3.66674334e+00, -1.42839032e-02],
         [-3.90362417e+00, -1.00727929e-03],
         [-3.66674334e+00, -1.42839032e-02],
         [-3.90362417e+00, -1.00727929e-03],
         [-3.66674334e+00, -1.42839032e-02],
         [-3.90362417e+00, -1.00727929e-03],
         [-3.90362417e+00, -1.00727929e-03],
         [-3.66674334e+00, -1.42839032e-02],
         [-3.66674334e+00, -1.42839032e-02],
         [-3.90362417e+00, -1.00727929e-03]], dtype=float64),
  Array([[ 4.20867933,  5.55271537],
         [ 3.23114167, -0.93475474],
         [ 2.69726098,  3.94245224],
         [ 3.23114167, -0.93475474],
         [ 4.20867933,  5.55271537],
         [ 3.71753595, -1.4304324 ],
         [ 3.23114167, -0.93475474],
         [ 2.69726098,  3.94245224],
         [ 2.69726098,  3.94245224],
         [ 3.23114167, -0.93475474]], dtype=float64),
  Array([[ 2.97100818,  2.46893057],
         [-1.78296066,  2.01290947],
         [ 1.69782804,  2.46019311],
         [-1.78296066,  2.01290947],
         [ 2.97100818,  2.46893057],
         [-4.59779512,  4.09005064],
         [-1.78296066,  2.01290947],
         [ 1.69782804,  2.46019311],
         [ 1.69782804,  2.46019311],
         [-1.78296066,  2.01290947]], dtype=float64)],
 [Array([[-3.58629457, -0.34751164],
         [-3.32485769, -2.57517181],
         [-3.05387078, -0.14219135],
         [-3.32485769, -2.57517181],
         [-3.58629457, -0.34751164],
         [-2.96159936, -0.94803477],
         [-3.32485769, -2.57517181],
         [-3.05387078, -0.14219135],
         [-3.05387078, -0.14219135],
         [-3.32485769, -2.57517181]], dtype=float64),
  Array([[ 0.81435863, -1.55143555],
         [ 1.91677899, -1.44313808],
         [ 2.10722953, -1.35314996],
         [ 1.91677899, -1.44313808],
         [ 0.81435863, -1.55143555],
         [ 0.93982217,  2.83962395],
         [ 1.91677899, -1.44313808],
         [ 2.10722953, -1.35314996],
         [ 2.10722953, -1.35314996],
         [ 1.91677899, -1.44313808]], dtype=float64),
  Array([[-2.6949575 ,  1.79298485],
         [-1.49393389,  0.94361304],
         [-2.22010603,  1.34230254],
         [-1.49393389,  0.94361304],
         [-2.6949575 ,  1.79298485],
         [ 0.21115467,  0.49994575],
         [-1.49393389,  0.94361304],
         [-2.22010603,  1.34230254],
         [-2.22010603,  1.34230254],
         [-1.49393389,  0.94361304]], dtype=float64)],
 [Array([[-3.33738487, -1.89751052],
         [-3.07061691, -1.28961672],
         [-3.32029117, -2.59503273],
         [-3.07061691, -1.28961672],
         [-3.33738487, -1.89751052],
         [-3.51715905, -1.77660659],
         [-3.07061691, -1.28961672],
         [-3.32029117, -2.59503273],
         [-3.32029117, -2.59503273],
         [-3.07061691, -1.28961672]], dtype=float64),
  Array([[ 4.22935229, -2.79754046],
         [ 1.85265297, -1.9752448 ],
         [ 3.1921227 , -0.90706609],
         [ 1.76992003, -2.10108568],
         [ 4.22935229, -2.79754046],
         [-0.03525098, -4.47538246],
         [ 1.85265297, -1.9752448 ],
         [ 3.1921227 , -0.90706609],
         [ 3.1921227 , -0.90706609],
         [ 1.85265297, -1.9752448 ]], dtype=float64),
  Array([[-3.43064627,  2.63094399],
         [-0.90581831,  2.38061408],
         [ 2.08645207, -0.11765821],
         [-0.59121086,  2.43401043],
         [-3.43064627,  2.63094399],
         [ 0.48060166,  1.07056246],
         [-0.90581831,  2.38061408],
         [ 2.08645207, -0.11765821],
         [ 2.08645207, -0.11765821],
         [-0.90581831,  2.38061408]], dtype=float64)],
 [Array([[-3.50669978, -3.33381557],
         [-2.96761546, -0.94221841],
         [-3.42181766, -0.85628622],
         [-3.1703016 , -3.00725554],
         [-3.50669978, -3.33381557],
         [-3.23596439, -1.62521713],
         [-2.96761546, -0.94221841],
         [-3.42181766, -0.85628622],
         [-3.42181766, -0.85628622],
         [-2.96761546, -0.94221841]], dtype=float64),
  Array([[ 2.09674318,  2.15815973],
         [ 2.35890339,  1.64604467],
         [ 1.78591974, -1.02782378],
         [ 2.51928901,  1.36356427],
         [ 2.09674318,  2.15815973],
         [ 1.16929332,  2.19826794],
         [ 2.35890339,  1.64604467],
         [ 1.78591974, -1.02782378],
         [ 1.78591974, -1.02782378],
         [ 2.35890339,  1.64604467]], dtype=float64),
  Array([[-1.34493269,  2.28960236],
         [-2.71702843,  1.79906331],
         [-2.34812635,  1.82992484],
         [-2.63369401,  2.01873721],
         [-1.34493269,  2.28960236],
         [-3.00124022,  1.16948004],
         [-2.71702843,  1.79906331],
         [-2.34812635,  1.82992484],
         [-2.34812635,  1.82992484],
         [-2.71702843,  1.79906331]], 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.76708315, 0.48123403],
         [2.96155498, 3.43476071],
         [2.30337215, 1.22416252],
         [3.28481501, 1.16398892],
         [2.76708315, 0.48123403],
         [2.59847912, 1.28536899],
         [2.96155498, 3.43476071],
         [2.51928901, 1.36356427],
         [2.30337215, 1.22416252],
         [2.96155498, 3.43476071]], dtype=float64),
  Array([[-2.18042252,  2.5851866 ],
         [-2.77492441,  3.8331377 ],
         [-2.44627684,  3.57203484],
         [-3.06128734,  3.48343822],
         [-2.18042252,  2.5851866 ],
         [-2.43553881,  2.8284392 ],
         [-2.77492441,  3.8331377 ],
         [-2.63369401,  2.01873721],
         [-2.44627684,  3.57203484],
         [-2.77492441,  3.8331377 ]], 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.65630515,  0.75808467],
         [ 1.78591974, -1.02782378],
         [ 2.04811262,  3.2897024 ],
         [ 2.76708315,  0.48123403],
         [ 2.65630515,  0.75808467],
         [ 2.66045762,  1.22569333],
         [ 2.23997867,  0.38932321],
         [ 2.66045762,  1.22569333],
         [ 2.04811262,  3.2897024 ],
         [ 1.78591974, -1.02782378]], dtype=float64),
  Array([[-2.37551672,  2.69659584],
         [-2.34812635,  1.82992484],
         [-1.92393166,  2.95643325],
         [-2.18042252,  2.5851866 ],
         [-2.37551672,  2.69659584],
         [-2.07077223,  2.70297908],
         [-3.12068514, -0.81738863],
         [-2.07077223,  2.70297908],
         [-1.92393166,  2.95643325],
         [-2.34812635,  1.82992484]], 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.59847912, 1.28536899],
         [2.51928901, 1.36356427],
         [2.65630515, 0.75808467],
         [2.88874417, 0.30828026],
         [2.91830017, 0.9171571 ],
         [2.09674318, 2.15815973],
         [2.59431839, 1.37541847],
         [2.12022319, 1.90158275],
         [2.65630515, 0.75808467],
         [2.30337215, 1.22416252]], dtype=float64),
  Array([[-2.43553881,  2.8284392 ],
         [-2.63369401,  2.01873721],
         [-2.37551672,  2.69659584],
         [-2.93594635,  3.39189121],
         [-1.28914466,  3.32553057],
         [-1.34493269,  2.28960236],
         [-2.20114012,  2.59472681],
         [-0.9248274 ,  2.48595711],
         [-2.37551672,  2.69659584],
         [-2.44627684,  3.57203484]], 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.66045762, 1.22569333],
         [2.66045762, 1.22569333],
         [2.91830017, 0.9171571 ],
         [2.73915365, 0.63449692],
         [2.04811262, 3.2897024 ],
         [2.76708315, 0.48123403],
         [1.72614227, 1.84281944],
         [2.12022319, 1.90158275],
         [2.59847912, 1.28536899],
         [2.04811262, 3.2897024 ]], dtype=float64),
  Array([[-2.07077223,  2.70297908],
         [-2.07077223,  2.70297908],
         [-1.28914466,  3.32553057],
         [-2.54670468,  2.56801675],
         [-1.92393166,  2.95643325],
         [-2.18042252,  2.5851866 ],
         [-1.94932674,  2.6911449 ],
         [-0.9248274 ,  2.48595711],
         [-2.43553881,  2.8284392 ],
         [-1.92393166,  2.95643325]], 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.09674318, 2.15815973],
         [2.12022319, 1.90158275],
         [2.76440674, 1.0107749 ],
         [2.96155498, 3.43476071],
         [2.65630515, 0.75808467],
         [2.65630515, 0.75808467],
         [2.73915365, 0.63449692],
         [2.12022319, 1.90158275],
         [2.66045762, 1.22569333],
         [2.65630515, 0.75808467]], dtype=float64),
  Array([[-1.34493269,  2.28960236],
         [-0.9248274 ,  2.48595711],
         [-2.26482251,  2.64246411],
         [-2.77492441,  3.8331377 ],
         [-2.37551672,  2.69659584],
         [-2.37551672,  2.69659584],
         [-2.54670468,  2.56801675],
         [-0.9248274 ,  2.48595711],
         [-2.07077223,  2.70297908],
         [-2.37551672,  2.69659584]], dtype=float64)]]
print(result.iterations)
1000