Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues during pulse playback at low sample rates and long pulses at the start and end of the pulse #770

Open
maxbeer99 opened this issue Jun 22, 2023 · 2 comments

Comments

@maxbeer99
Copy link

The following pulse (sample rate = 24.41 kHz):

timescale = 1000e-03

measurements = []
measurements.append((f"M1", 0, qupulse_inst.awg1.make_properly_quantized_time(6*timescale*1e09)))
    
entries = {  
    "S4": [(0,0), (qupulse_inst.awg1.make_properly_quantized_time(1*timescale*1e09), 0, "hold"), (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), .3, "linear"), (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), 0, "jump")],
    #"marker_A": [(0, 1), (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), 0, "hold")]
}

pulse_1d = qupulse.pulses.TablePT(
    entries=entries,
    measurements=measurements
)

physical_pulse_1d = sample.scale_and_rename_pulse_template(pulse_1d)

where qupulse_inst.awg1.make_properly_quantized_time(time) finds the next largest whole ns to comply with the 16-sample quantization and sample.scale_and_rename_pulse_template() just scales the pulse should result in the following:
image
But it actually plays back this:
image
Note the plateau at the end of the pulse.

After a lot of playing around I am now sure that something goes wrong in the qupulse waveform generation whenever nothing significant does not happen before or after the relevant pulse segment. I.e. the pulse gets corrupted at the first and last significant pulse segment.

This can be seen by the fact that both extending the final jump operation as well as the marker yields the following:

timescale = 1000e-03

measurements = []
measurements.append((f"M1", 0, qupulse_inst.awg1.make_properly_quantized_time(6*timescale*1e09)))
    
entries = {  
    "S4": [(0,0), (qupulse_inst.awg1.make_properly_quantized_time(1*timescale*1e09), 0, "hold"), (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), .3, "linear"), (qupulse_inst.awg1.make_properly_quantized_time(6*timescale*1e09), 0, "jump")],
    #"marker_A": [(0, 1), (qupulse_inst.awg1.make_properly_quantized_time(6*timescale*1e09), 0, "hold")]
}

pulse_1d = qupulse.pulses.TablePT(
    entries=entries,
    measurements=measurements
)

physical_pulse_1d = sample.scale_and_rename_pulse_template(pulse_1d)
timescale = 1000e-03

measurements = []
measurements.append((f"M1", 0, qupulse_inst.awg1.make_properly_quantized_time(6*timescale*1e09)))
    
entries = {  
    "S4": [(0,0), (qupulse_inst.awg1.make_properly_quantized_time(1*timescale*1e09), 0, "hold"), (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), .3, "linear"), (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), 0, "jump")],
    "marker_A": [(0, 1), (qupulse_inst.awg1.make_properly_quantized_time(6*timescale*1e09), 0, "hold")]
}

pulse_1d = qupulse.pulses.TablePT(
    entries=entries,
    measurements=measurements
)

physical_pulse_1d = sample.scale_and_rename_pulse_template(pulse_1d)

image
image
image

This is especially visible when concatenating a pulse manually. Note that this issue also appears at the start of the pulse if I do not include a significant hold there:

timescale = 1000e-03

measurements = []
measurements.append((f"M1", 0, qupulse_inst.awg1.make_properly_quantized_time(6*timescale*1e09)))
    
entries = {  
    "S4": [
        (0,0),
        (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), .3, "linear"),
        (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), 0, "jump"),
        (qupulse_inst.awg1.make_properly_quantized_time((4+4)*timescale*1e09), .3, "linear"),
        (qupulse_inst.awg1.make_properly_quantized_time((4+4)*timescale*1e09), 0, "jump")
    
    ],
    #"marker_A": [(0, 1), (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), 0, "hold")]
}

pulse_1d = qupulse.pulses.TablePT(
    entries=entries,
    measurements=measurements
)

physical_pulse_1d = sample.scale_and_rename_pulse_template(pulse_1d)

image
image

Also note that the linear ramps are always as long as they should be, it just seems like the waveform "catches up" with the ramp in the beginning or the jump to 0 in the end.

The Problem also gets worse for lower sample rates even though the sample rate is still much larger than what would be required for the pulse.

At 12.2 kHz:
image

At 97.65 kHz:
image

Changing the timescale of the pulse to 1ms at 24.41 kHz:

timescale = 1e-03

measurements = []
measurements.append((f"M1", 0, qupulse_inst.awg1.make_properly_quantized_time(6*timescale*1e09)))
    
entries = {  
    "S4": [
        (0,0),
        (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), .3, "linear"),
        (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), 0, "jump"),
        (qupulse_inst.awg1.make_properly_quantized_time((4+4)*timescale*1e09), .3, "linear"),
        (qupulse_inst.awg1.make_properly_quantized_time((4+4)*timescale*1e09), 0, "jump")
    
    ],
    #"marker_A": [(0, 1), (qupulse_inst.awg1.make_properly_quantized_time(4*timescale*1e09), 0, "hold")]
}

pulse_1d = qupulse.pulses.TablePT(
    entries=entries,
    measurements=measurements
)

physical_pulse_1d = sample.scale_and_rename_pulse_template(pulse_1d)

image
This causes a slower ramp for the first triangle but otherwise looks better.
image

At 48.82 kHz it looks better:
image

And at 390.62 kHz it is completely broken:
image

Interestingly at 292.96 kHz and 4.68 MHz (Base frequency 2.4 GHz) it looks perfect:
image
image

@maxbeer99
Copy link
Author

The timescale = 1s pulse looks also fine at 292.96 kHz (2.4 GHz base)
image

@terrorfisch
Copy link
Member

How do the waveform files that get generated by this look like?

The hdawg driver should create one big waveform and write this to a textfile in pathlib.Path(self.api_session.awgModule().getString('directory'), 'awg', 'waves').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants