pyepr.hardware.BaseInterfaceClass.Interface

class pyepr.hardware.BaseInterfaceClass.Interface(config_file=None, log=None)[source]

Represents the interface connection from autoEPR to the spectrometer.

Parameters:
config_filedict or str or Path, optional

The configuration file or dict for the spectrometer interface, by default None. If None, a default configuration will be used.

loglogging.Logger, optional

The logger to be used, by default None. If None, a default logger will be created.

Parameters:

config_file (dict)

Attributes

config[source]
pulses[source]
savefolder = ''[source]
savename = ''[source]
resonator = None[source]
AWG = True[source]

Methods

connect()[source]
Return type:

None

acquire_dataset(data)[source]

Acquires the dataset.

launch(sequence, savename)[source]

Launches the experiment and initialises autosaving.

Parameters:
sequenceSequence

The sequence to be launched

savenamestr

The savename for this measurement. A timestamp will be added to the value.

Parameters:

savename (str)

isrunning()[source]
Return type:

bool

rescale(scale)[source]

Rescales the scale factor to account for applifier non-linearity.

Parameters:
scalefloat

The scale factor to be rescaled.

Returns:
float

The rescaled value.

Parameters:

scale (float)

Return type:

float

terminate()[source]

Terminates the experiment immediately.

Return type:

None

terminate_at(criterion, test_interval=2, keep_running=True, verbosity=0, autosave=True)[source]

Terminates the experiment upon a specific condition being satisified.

Parameters:
criterion_type_

The criteria to be tested.

test_intervalint, optional

How often should the criteria be tested in minutes, by default 10.

keep_runningbool, optional

If True, an error will not be raised if the experiment finishes before the criteria is met, by default True.

verbosityint, optional

The verbosity level, by default 0.

autosavebool, optional

If True, the data will be autosaved, by default True.

tune_RectPulse(freq, B, reptime, tp, offset_freq=0, shots=200, verbosity=0, **kwargs)[source]

Tunes a pair of equal power pi/2, pi rectangular pulses though an amplitude sweep.

Parameters:
freqfloat

The central frequency of the experiment in GHz.

Bfloat

The magnetic field in Gauss.

reptimefloat

The repetition time in us.

tpfloat

The length of the pi/2 pulse in ns. The pi pulse will be half this length. This will be rounded to the nearest 2*waveform_precision to ensure that the pi pulse is of the correct length.

offset_freqfloat, optional

The offset frequency of the rectangular pulse in GHz. This is used to shift the pulse away from the central frequency of the experiment. Default is 0.

shotsint, optional

The number of shots to be used for the frequency sweep, by default 200.

verbosityint, optional

The verbosity level, by default 0. If > 0, the scale values will be printed.

**kwargsdict
  • stepfloat, optional

    The step size for the amplitude parameter, by default 0.02.

  • dimint, optional

    The dimension of the amplitude parameter, by default 50.

  • taufloat, optional

    The delay between the pi/2 and pi pulses in ns, by default 500.

** Interface specific launch commands
Returns:
p90pulses.RectPulse

The tuned pi/2 pulse.

p180pulses.RectPulse

The tuned pi pulse.

tune_GaussianPulse(freq, B, reptime, tp, offset_freq=0, shots=200, verbosity=0, **kwargs)[source]

Tunes a pair of equal power pi/2, pi Gaussian pulses though an amplitude sweep.

Parameters:
freqfloat

The central frequency of the experiment in GHz.

Bfloat

The magnetic field in Gauss.

reptimefloat

The repetition time in us.

tpfloat

The length of the pi/2 pulse in ns. The pi pulse will be half this length. This will be rounded to the nearest 2*waveform_precision to ensure that the pi pulse is of the correct length.

offset_freqfloat, optional

The offset frequency of the Gaussian pulse in GHz. This is used to shift the pulse away from the central frequency of the experiment. Default is 0.

shotsint, optional

The number of shots to be used for the frequency sweep, by default 200.

verbosityint, optional

The verbosity level, by default 0. If > 0, the scale values will be printed.

**kwargsdict
  • stepfloat, optional

    The step size for the amplitude parameter, by default 0.02.

  • dimint, optional

    The dimension of the amplitude parameter, by default 50.

  • taufloat, optional

    The delay between the pi/2 and pi pulses in ns, by default 500.

** Interface specific launch commands
Returns:
p90pulses.GaussianPulse

The tuned pi/2 pulse.

p180pulses.GaussianPulse

The tuned pi pulse.

tune_KBBPulse(*, freq, B, reptime, tp, init_freq, final_freq, shots=200, verbosity=0, **kwargs)[source]

Tunes a Kutz-Boehlen-Bodenhausen linear chirp echo. This is a three step optimisation:

  1. Both pulses amplitudes are swept with a 1:2 ratio.

  2. Pulse 0 is fixed using the optimal amplitude from step 1 and pulse 1 is swept.

  3. Pulse 1 is fixed using the optimal amplitude from step 2 and pulse 0 is swept.

Parameters:
freqfloat

The central frequency of the experiment in GHz.

Bfloat

The magnetic field in Gauss.

reptimefloat

The repetition time in us.

tpfloat

The length of the pi/2 pulse in ns. The pi pulse will be half this length. This will be rounded to the nearest 2*waveform_precision to ensure that the pi pulse is of the correct length.

init_freqfloat

The initial frequency of the frequency sweep in GHz.

final_freqfloat

The final frequency of the frequency sweep in GHz.

shotsint, optional

The number of shots to be used for the frequency sweep, by default 200.

verbosityint, optional

The verbosity level, by default 0. If > 0, the scale values will be printed.

**kwargsdict
  • stepfloat, optional

    The step size for the amplitude parameter, by default 0.01.

  • dimint, optional

    The dimension of the amplitude parameter, by default 50.

  • taufloat, optional

    The delay between the pi/2 and pi pulses in ns, by default 500.

** Interface specific launch commands
Returns:
p90pulses.ChirpPulse

The tuned pi/2 pulse.

p180pulses.ChirpPulse

The tuned pi pulse.