Exemplo n.º 1
0
def set_tau_procs(initial_state,
                  start=500,
                  stop=600,
                  skip=1,
                  all_state_skip=5):
    is_bools = separate_by_state(initial_state[..., 0, 0])

    tau_procedures = [
        sp.ReturnFinalState(),
        sp.ReturnInitialState(),
        sp.MeasureAllState(trial_request=slice(0, 50),
                           step_request=np.s_[::all_state_skip]),
        sp.MeasureAllState(trial_request=np.s_[:],
                           step_request=np.s_[start::skip],
                           output_name='final_state_array'),
        sp.MeasureMeanValue(rp.get_kinetic, output_name='kinetic'),
        sp.MeasureMeanValue(rp.get_potential, output_name='potential'),
        sp.MeasureMeanValue(rp.get_current_state,
                            output_name='zero_means',
                            trial_request=is_bools['0']),
        sp.MeasureMeanValue(rp.get_current_state,
                            output_name='one_means',
                            trial_request=is_bools['1']),
        tp.CountJumps(state_slice=np.s_[..., 0, 0],
                      step_request=np.s_[start::skip])
    ]
    return tau_procedures
Exemplo n.º 2
0
def set_mean_evolution_procs(info_state_means):
    mean_evo_procs = [
        sp.ReturnFinalState(),
        sp.ReturnInitialState(),
        sp.MeasureStepValue(rp.get_current_state,
                            trial_request=np.s_[0],
                            output_name='zero_means'),
        sp.MeasureStepValue(rp.get_current_state,
                            trial_request=np.s_[1],
                            output_name='one_means')
    ]
    return mean_evo_procs
Exemplo n.º 3
0
def set_mean_procs(initial_state):
    is_bools = separate_by_state(initial_state[..., 0, 0])
    mean_procs = [
        sp.ReturnInitialState(),
        sp.ReturnFinalState(),
        sp.MeasureMeanValue(rp.get_current_state,
                            output_name='zero_means',
                            trial_request=is_bools['0']),
        sp.MeasureMeanValue(rp.get_current_state,
                            output_name='one_means',
                            trial_request=is_bools['1'])
    ]
    return mean_procs
Exemplo n.º 4
0
def set_bundle_evo_procs(state_bundle, weights=None):
    is_bools = separate_by_state(state_bundle[..., 0, 0])
    w_z = weights[is_bools['0']]
    w_o = weights[is_bools['1']]

    bundle_evo_procs = [
        sp.ReturnFinalState(),
        sp.ReturnInitialState(),
        sp.MeasureMeanValue(rp.get_current_state,
                            trial_request=is_bools['0'],
                            output_name='zero_means',
                            weights=w_z),
        sp.MeasureMeanValue(rp.get_current_state,
                            trial_request=is_bools['1'],
                            output_name='one_means',
                            weights=w_o)
    ]
    return bundle_evo_procs