
# Single QUA script generated at 2026-03-28 05:10:54.432098
# QUA library version: 1.2.5


from qm import CompilerOptionArguments
from qm.qua import *

with program() as prog:
    v1 = declare(int, )
    v2 = declare(int, value=0)
    v3 = declare(int, )
    input_stream_mock_measurement_int_input_stream = declare_input_stream(int, 'mock_measurement_int_input_stream', size=1)
    v4 = declare(fixed, )
    input_stream_mock_measurement_fixed_input_stream = declare_input_stream(fixed, 'mock_measurement_fixed_input_stream', size=1)
    v5 = declare(fixed, )
    v6 = declare(fixed, )
    v7 = declare(fixed, )
    v8 = declare(fixed, )
    v9 = declare(fixed, )
    v10 = declare(fixed, )
    v11 = declare(bool, )
    v12 = declare(bool, )
    v13 = declare(fixed, )
    v14 = declare(fixed, )
    v15 = declare(fixed, )
    v16 = declare(fixed, )
    v17 = declare(fixed, )
    v18 = declare(fixed, )
    v19 = declare(bool, )
    v20 = declare(bool, )
    v21 = declare(int, )
    with infinite_loop_():
        pause()
        assign(v2, 0)
        advance_input_stream(input_stream_mock_measurement_int_input_stream)
        assign(v3, input_stream_mock_measurement_int_input_stream[0])
        advance_input_stream(input_stream_mock_measurement_fixed_input_stream)
        assign(v4, input_stream_mock_measurement_fixed_input_stream[0])
        assign(v21, 0)
        with while_((v21<100)):
            assign(v1, (0+(1*v21)))
            align()
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp(0.06), "P1", duration=250)
            play("unit_ramp"*amp(-0.085), "J1", duration=250)
            play("unit_ramp"*amp(-0.06), "P2", duration=250)
            play("unit_ramp"*amp(-0.07), "P7", duration=250)
            play("unit_ramp"*amp(-0.05), "J7", duration=250)
            play("unit_ramp"*amp(0.07), "P8", duration=250)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(50000, "P1", "J1", "P2", "P7", "J7", "P8")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp(-0.0165), "P1", duration=250)
            play("unit_ramp"*amp(0.035), "J1", duration=250)
            play("unit_ramp"*amp(0.0165), "P2", duration=250)
            play("unit_ramp"*amp(0.099), "P7", duration=250)
            play("unit_ramp"*amp(0.117), "J7", duration=250)
            play("unit_ramp"*amp(-0.099), "P8", duration=250)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(9571, "P1", "J1", "P2", "P7", "J7", "P8")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp(-0.03), "P1", duration=141)
            play("unit_ramp"*amp(0.03), "P2", duration=141)
            play("unit_ramp"*amp(-0.02), "P7", duration=141)
            play("unit_ramp"*amp(0.02), "P8", duration=141)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(250, "P1", "J1", "P2", "P7", "J7", "P8")
            ramp_to_zero("P1")
            ramp_to_zero("J1")
            ramp_to_zero("P2")
            ramp_to_zero("P7")
            ramp_to_zero("J7")
            ramp_to_zero("P8")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            align()
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            wait(25000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp(0.023), "P1", duration=6250)
            play("unit_ramp"*amp(-0.02), "J1", duration=6250)
            play("unit_ramp"*amp(-0.023), "P2", duration=6250)
            play("unit_ramp"*amp(-0.0325), "P7", duration=6250)
            play("unit_ramp"*amp(0.005), "J7", duration=6250)
            play("unit_ramp"*amp(0.0325), "P8", duration=6250)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(25000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            measure("measure", "SET1", integration.full("x_const", v5, ""))
            measure("measure", "SET2", integration.full("x_const", v6, ""))
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            wait(5000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp((v4-0.023)), "P1", duration=250)
            play("unit_ramp"*amp(((v4*-1)--0.023)), "P2", duration=250)
            play("unit_ramp"*amp(-0.0025000000000000022), "P7", duration=250)
            play("unit_ramp"*amp(0.0025000000000000022), "P8", duration=250)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(25000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            measure("measure", "SET1", integration.full("x_const", v7, ""))
            measure("measure", "SET2", integration.full("x_const", v8, ""))
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align()
            assign(v9, (v5-v7))
            assign(v10, (v6-v8))
            assign(v11, (v9>0.001))
            assign(v12, (v10>-0.001))
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            wait(5000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            ramp_to_zero("P1")
            ramp_to_zero("J1")
            ramp_to_zero("P2")
            ramp_to_zero("P7")
            ramp_to_zero("J7")
            ramp_to_zero("P8")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(1000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align()
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp(0.06), "P1", duration=250)
            play("unit_ramp"*amp(-0.085), "J1", duration=250)
            play("unit_ramp"*amp(-0.06), "P2", duration=250)
            play("unit_ramp"*amp(-0.07), "P7", duration=250)
            play("unit_ramp"*amp(-0.05), "J7", duration=250)
            play("unit_ramp"*amp(0.07), "P8", duration=250)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(50000, "P1", "J1", "P2", "P7", "J7", "P8")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp(-0.0165), "P1", duration=250)
            play("unit_ramp"*amp(0.035), "J1", duration=250)
            play("unit_ramp"*amp(0.0165), "P2", duration=250)
            play("unit_ramp"*amp(0.099), "P7", duration=250)
            play("unit_ramp"*amp(0.117), "J7", duration=250)
            play("unit_ramp"*amp(-0.099), "P8", duration=250)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(9571, "P1", "J1", "P2", "P7", "J7", "P8")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp(-0.03), "P1", duration=v3)
            play("unit_ramp"*amp(0.03), "P2", duration=v3)
            play("unit_ramp"*amp(-0.02), "P7", duration=v3)
            play("unit_ramp"*amp(0.02), "P8", duration=v3)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(250, "P1", "J1", "P2", "P7", "J7", "P8")
            ramp_to_zero("P1")
            ramp_to_zero("J1")
            ramp_to_zero("P2")
            ramp_to_zero("P7")
            ramp_to_zero("J7")
            ramp_to_zero("P8")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            align()
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            wait(25000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp(0.023), "P1", duration=6250)
            play("unit_ramp"*amp(-0.02), "J1", duration=6250)
            play("unit_ramp"*amp(-0.023), "P2", duration=6250)
            play("unit_ramp"*amp(-0.0325), "P7", duration=6250)
            play("unit_ramp"*amp(0.005), "J7", duration=6250)
            play("unit_ramp"*amp(0.0325), "P8", duration=6250)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(25000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            measure("measure", "SET1", integration.full("x_const", v13, ""))
            measure("measure", "SET2", integration.full("x_const", v14, ""))
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            wait(5000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            play("unit_ramp"*amp((v4-0.023)), "P1", duration=250)
            play("unit_ramp"*amp(((v4*-1)--0.023)), "P2", duration=250)
            play("unit_ramp"*amp(-0.0025000000000000022), "P7", duration=250)
            play("unit_ramp"*amp(0.0025000000000000022), "P8", duration=250)
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(25000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            measure("measure", "SET1", integration.full("x_const", v15, ""))
            measure("measure", "SET2", integration.full("x_const", v16, ""))
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align()
            assign(v17, (v13-v15))
            assign(v18, (v14-v16))
            assign(v19, (v17>0.001))
            assign(v20, (v18>-0.001))
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            wait(5000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            ramp_to_zero("P1")
            ramp_to_zero("J1")
            ramp_to_zero("P2")
            ramp_to_zero("P7")
            ramp_to_zero("J7")
            ramp_to_zero("P8")
            align("P1", "J1", "P2", "P7", "J7", "P8")
            wait(1000, "P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align("P1", "J1", "P2", "P7", "J7", "P8", "SET1", "SET2")
            align()
            r2 = declare_stream()
            save(v5, r2)
            r3 = declare_stream()
            save(v6, r3)
            r4 = declare_stream()
            save(v7, r4)
            r5 = declare_stream()
            save(v8, r5)
            r6 = declare_stream()
            save(v9, r6)
            r7 = declare_stream()
            save(v10, r7)
            r8 = declare_stream()
            save(v11, r8)
            r9 = declare_stream()
            save(v12, r9)
            r10 = declare_stream()
            save(v13, r10)
            r11 = declare_stream()
            save(v14, r11)
            r12 = declare_stream()
            save(v15, r12)
            r13 = declare_stream()
            save(v16, r13)
            r14 = declare_stream()
            save(v17, r14)
            r15 = declare_stream()
            save(v18, r15)
            r16 = declare_stream()
            save(v19, r16)
            r17 = declare_stream()
            save(v20, r17)
            align()
            assign(v2, (v2+1))
            r1 = declare_stream()
            save(v2, r1)
            align()
            assign(v21, (v21+1))
    with stream_processing():
        r1.buffer(1).save("qm_driver_mock_measurement_shots")
        r2.buffer(100).save("qm_driver_mock_measurement_parity_read_even_ref__p1p2")
        r3.buffer(100).save("qm_driver_mock_measurement_parity_read_even_ref__p7p8")
        r4.buffer(100).save("qm_driver_mock_measurement_parity_read_even_read__p1p2")
        r5.buffer(100).save("qm_driver_mock_measurement_parity_read_even_read__p7p8")
        r6.buffer(100).save("qm_driver_mock_measurement_parity_read_even_diff__p1p2")
        r7.buffer(100).save("qm_driver_mock_measurement_parity_read_even_diff__p7p8")
        r8.buffer(100).save("qm_driver_mock_measurement_parity_read_even_state__p1p2")
        r9.buffer(100).save("qm_driver_mock_measurement_parity_read_even_state__p7p8")
        r10.buffer(100).save("qm_driver_mock_measurement_parity_read_odd_ref__p1p2")
        r11.buffer(100).save("qm_driver_mock_measurement_parity_read_odd_ref__p7p8")
        r12.buffer(100).save("qm_driver_mock_measurement_parity_read_odd_read__p1p2")
        r13.buffer(100).save("qm_driver_mock_measurement_parity_read_odd_read__p7p8")
        r14.buffer(100).save("qm_driver_mock_measurement_parity_read_odd_diff__p1p2")
        r15.buffer(100).save("qm_driver_mock_measurement_parity_read_odd_diff__p7p8")
        r16.buffer(100).save("qm_driver_mock_measurement_parity_read_odd_state__p1p2")
        r17.buffer(100).save("qm_driver_mock_measurement_parity_read_odd_state__p7p8")

config = None

loaded_config = None

