qudit_sim.apps.find_heff

qudit_sim.apps.find_heff(hgen, qudit, frequency, amplitude, comp_dim=2, cycles=1000., ramp_cycles=100., 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)

Determine the effective Hamiltonian from the result of constant-drive simulations.

The function first sets up one-sided GuassianSquare pulses according to the cycles and ramp_cycles parameters and runs the pulse simulation. The resulting time evolution operator in the plateau region of the pulse is then used to extract the effective Hamiltonian through the maximization of the unitary fidelity.

Multiple qudits can be driven simultaneously by passing tuples to qudit, frequency, and amplitude parameters.

To evaluate multiple drive specifications in parallel (e.g. when performing an amplitude scan), pass a list to either of frequency or amplitude. When both are lists, their lengths must match.

Parameters
  • hgen (HamiltonianBuilder) – Qudits and couplings specification.

  • qudit (Union[Hashable, Tuple[Hashable, ...]]) – The qudit(s) to apply the drive to.

  • frequency (Union[float, Tuple[float, ...], List[Union[float, Tuple[float, ...]]], numpy.ndarray]) – Drive frequency(ies).

  • amplitude (Union[float, complex, Tuple[Union[float, complex], ...], List[Union[float, complex, Tuple[Union[float, complex], ...]]], numpy.ndarray]) – Drive amplitude(s).

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

  • cycles (Union[float, List[float]]) – Number of drive signal cycles in the plateau of the GaussianSquare pulse.

  • ramp_cycles (Union[float, List[float]]) – Number of drive signal cycles to use for ramp-up.

  • 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

Union[numpy.ndarray, List[numpy.ndarray]]

Returns

An array of Pauli components or a list thereof (if a list is passed to frequency and/or amplitude).