def test_ParameterSweep(self, num_cpus): sweep = self.initialize(num_cpus) specdata = absorption_spectrum( generate_diffspec_sweep(sweep, initial_state_ind=0)) calculated_energies = specdata.energy_table[5] reference_energies = np.array([ 0.0, 4.74135372, 5.6773522, 5.98902462, 7.72420838, 10.72273595, 11.65962582, 11.97802377, 12.46554431, 13.40154194, 13.71041554, 15.24359501, 16.70439594, 17.01076356, 17.64202619, ]) assert np.allclose(reference_energies, calculated_energies)
def difference_spectrum(sweep: 'ParameterSweep', initial_state_ind: int = 0, **kwargs) -> Tuple[Figure, Axes]: """ Plots a transition energy spectrum with reference to the given initial_state_ind, obtained by taking energy differences of the eigenenergy spectrum. Parameters ---------- sweep: initial_state_ind: **kwargs: standard plotting option (see separate documentation) """ return sweep_gen.generate_diffspec_sweep( sweep, initial_state_ind).plot_evals_vs_paramvals(**kwargs)
def difference_spectrum(sweep, initial_state_ind=0, **kwargs): """ Plots a transition energy spectrum with reference to the given initial_state_ind, obtained by taking energy differences of the eigenenergy spectrum. Parameters ---------- sweep: ParameterSweep initial_state_ind: int **kwargs: dict standard plotting option (see separate documentation) Returns ------- Figure, Axes """ return generate_diffspec_sweep( sweep, initial_state_ind).plot_evals_vs_paramvals(**kwargs)