Exemplo n.º 1
0
        p_1 (tuple<double>) : point after the anticrossing, where the readout should happen.
        disable_trigger (bool) : disable triggerig for digitizer, only for debuggig.
    '''
    # pulse towards the window and stay for the measurment time
    add_ramp(segment, t_ramp, gates, p_0, p_1)
    if unmute is not None:
        getattr(segment, unmute).add_marker(0, t_read)
    if disable_trigger == False:
        getattr(segment, gates[0]).add_HVI_marker("dig_trigger_{}".format(int(nth_readout)))
        getattr(segment, gates[0]).add_HVI_variable("t_measure", t_read)

    add_block(segment, t_read, gates, p_1)
    add_ramp(segment, t_ramp, gates, p_1, p_0)

if __name__ == '__main__':
    from pulse_templates.utility.plotting import plot_seg
    from pulse_templates.demo_pulse_lib.virtual_awg import get_demo_lib
    
    pulse = get_demo_lib('quad')
    seg = pulse.mk_segment()

    gates = ('P1', 'P2')
    
    p_0 = (-1,  1)
    p_1 = ( 1, -1)
    PSB_read(seg, gates, 1e3, 5e3, p_0, p_1)
    p_2 = (2, 1)
    PSB_read_latched(seg, gates, 1e3, 5e3, p_0, p_1, p_2)

    plot_seg(seg)    
        repeat (int) : the number of time to repeat the allxy experiment =
    '''

    allXY_set, setpoint = get_allXY_specs(repeat)
    setpoint.axis = [axis]

    getattr(segment, gate_set.qubit).update_dim(setpoint)

    for i in range(setpoint.data.size):
        gate_set.load_std_gate(
            getattr(segment, gate_set.qubit)[i], allXY_set[i])


if __name__ == '__main__':
    from pulse_templates.coherent_control.single_qubit_gates.standard_set import single_qubit_std_set
    from pulse_templates.coherent_control.single_qubit_gates.single_qubit_gates import single_qubit_gate_spec
    from pulse_templates.demo_pulse_lib.virtual_awg import get_demo_lib
    from pulse_templates.utility.plotting import plot_seg
    from pulse_lib.segments.utility.looping import linspace
    pulse = get_demo_lib('six')
    seg = pulse.mk_segment()

    ss_set = single_qubit_std_set()
    ss_set.X = single_qubit_gate_spec('qubit4_MW', 1e9, 100, 120)
    # ss_set.X2 = single_qubit_gate_spec('qubit4_MW', 1e9, 200, 120)

    # ss_set.X.add(seg)
    print(seg)
    generate_all_XY(seg, ss_set)
    plot_seg(seg, 1)
            return np.sqrt(x) / np.sqrt(5e6) * amp

        return J_pulse

    def f_res(f_res, delta_fres):
        def f_res_relation(J):
            return f_res + J**2 / 5e6**2 * delta_fres

        return f_res_relation

    J_to_voltage_relation = (return_amp(-0.2), return_amp(1),
                             return_amp(-0.23))

    sweep = linspace(0, 2 * np.pi, 20, axis=1)

    import good_morning.static.J45 as J45

    iswap(seg, J45.gates, np.pi, 0, 6e6, 80e6, J45.gen_J_to_voltage(),
          J45.return_delta_B_J_relation())
    # iswap_cal(seg, gates, 5e6, 5e6, linspace(75e6, 85e6, 80, 'freq', 'Hz', 0), np.pi, J_to_voltage_relation, 20)
    # print(gates, J45.gates)
    # print(J_to_voltage_relation, J45.gen_J_to_voltage())
    # ratios =  J45.gen_J_to_voltage()
    # iswap_cal(seg, J45.gates, 5e6, 5e6, 80e6, 3.14, ratios, 20)

    # iswap_cal(seg, J45.gates, 5e6, 5e6, 80e6, linspace(3.14, 2.65, 80, 'freq', 'Hz', 0), ratios, 20)

    # plot_seg(seg, 0)
    # plot_seg(seg, 5)
    plot_seg(seg, 0)
    # plot_seg(seg, 15)
 def plot_sequence(self):
     plot_seg(self.segments())
if __name__ == '__main__':
    from pulse_templates.utility.measurement import measurement_manager
    from pulse_templates.psb_pulses.readout_pulses import PSB_read
    from pulse_templates.demo_pulse_lib.virtual_awg import get_demo_lib
    from pulse_templates.utility.plotting import plot_seg

    pulse = get_demo_lib('quad')

    ss = segment_mgr(pulse)
    mm = measurement_manager()

    m = measurement('PSB_12_init',
                    chan=[1, 2],
                    accept=0,
                    threshold=0.5,
                    phase=0.3)
    readout_kwargs = {
        'gates': ('vP1', 'vB1', 'vP2'),
        't_ramp': 2e3,
        't_read': 2e3,
        'p_0': (0, 0, 0),
        'p_1': (5.5, 0, -5.5)
    }
    rs = readout_spec(m, PSB_read, readout_kwargs)

    read_set = readout_std_set(rs, mm, ss)
    read_set.add()
    read_set.add()
    plot_seg(ss.segments)