qudit_sim.apps.heff_fit

qudit_sim.apps.heff_fit(sim_result, hdiag=None, comp_dim=None, fit_start_time=None, optimizer='adam', optimizer_args=0.05, max_updates=10000, convergence=1.e-4, convergence_window=5, min_fidelity=0.9, save_result_to=None, log_level=logging.WARNING, logger_name=__name__)

Perform a fidelity-maximizing fit to the result of constant-drive simulation.

The function takes the result of a constant-drive (with ring-up) simulation and identifies the effective Hamiltonian that best describes the time evolution.

Parameters
  • sim_result (Union[PulseSimResult, str]) – Simulation result object or the name of the file that contains one.

  • hdiag (Optional[Qobj]) – The diagonal part of the Hamiltonian. If None, the identity component of the returned effective Hamiltonian is set to zero.

  • comp_dim (Optional[int]) – Dimensionality of the computational space.

  • fit_start_time (Optional[float]) – Time at which the drive pulses hit the plateau.

  • optimizer (str) – The name of the optax function to use as the optimizer.

  • optimizer_args (Any) – Arguments to the optimizer.

  • max_updates (int) – Maximum number of optimization iterations.

  • convergence (float) – The cutoff value for the change of fidelity within the last convergence_window iterations.

  • convergence_window (int) – The number of updates to use to compute the mean of change of fidelity.

  • min_fidelity (float) – Final fidelity threshold. If the unitary fidelity of the fit result goes below this value, the fit is repeated over a shortened interval.

  • save_result_to (Optional[str]) – File name (without the extension) to save the extraction results to.

  • log_level (int) – Log level.

Return type

numpy.ndarray

Returns

An array of Pauli components.