Skip to content

Commit

Permalink
Revert "Redefining martinis pulse in terms of freqs and anharmoninict…
Browse files Browse the repository at this point in the history
…ies"

This reverts commit bf0de42.
  • Loading branch information
FKMalino committed Aug 28, 2018
1 parent bf0de42 commit cfe9c4d
Showing 1 changed file with 39 additions and 40 deletions.
79 changes: 39 additions & 40 deletions pycqed/instrument_drivers/meta_instrument/LutMans/flux_lutman.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,23 +323,19 @@ def _add_waveform_parameters(self):
initial_value=np.nan,
parameter_class=ManualParameter)

self.add_parameter('cz_f_q0', vals=vals.Numbers(),
self.add_parameter('cz_freq_01_max', vals=vals.Numbers(),
# initial value is chosen to not raise errors
initial_value=6e9,
unit='Hz', parameter_class=ManualParameter)
self.add_parameter('cz_f_q1', vals=vals.Numbers(),
# initial value is chosen to not raise errors
initial_value=6e9,
unit='Hz', parameter_class=ManualParameter)
self.add_parameter('cz_anharmonicity_q0', vals=vals.Numbers(),
# initial value is chosen to not raise errors
initial_value=-300e6,
unit='Hz', parameter_class=ManualParameter)

self.add_parameter('cz_J2', vals=vals.Numbers(), unit='Hz',
# initial value is chosen to not raise errors
initial_value=15e6,
parameter_class=ManualParameter)
self.add_parameter('cz_freq_interaction', vals=vals.Numbers(),
# initial value is chosen to not raise errors
initial_value=5e9,
unit='Hz',
parameter_class=ManualParameter)

self.add_parameter('cz_phase_corr_length', unit='s',
initial_value=5e-9, vals=vals.Numbers(),
Expand Down Expand Up @@ -454,11 +450,11 @@ def _gen_cz(self):
lambda_2=self.cz_lambda_2(),
lambda_3=self.cz_lambda_3(),
theta_f=self.cz_theta_f(),
f_q0=self.cz_f_q0(),
f_q1=self.cz_f_q1(),
anharmonicity_q0=self.cz_anharmonicity_q0(),
f_01_max=self.cz_freq_01_max(),
J2=self.cz_J2(),
sampling_rate=self.sampling_rate())
f_interaction=self.cz_freq_interaction(),
sampling_rate=self.sampling_rate(),
return_unit='f01')
return dac_scale_factor*self.detuning_to_amp(
self.cz_freq_01_max() - CZ)
else:
Expand All @@ -469,11 +465,13 @@ def _gen_cz(self):
lambda_2=self.cz_lambda_2(),
lambda_3=self.cz_lambda_3(),
theta_f=self.cz_theta_f(),
f_q0=self.cz_f_q0(),
f_q1=self.cz_f_q1(),
anharmonicity_q0=self.cz_anharmonicity_q0(),
f_01_max=self.cz_freq_01_max(),
# V_per_phi0=self.cz_V_per_phi0(),
J2=self.cz_J2(),
sampling_rate=self.sampling_rate())
# E_c=self.cz_E_c(),
f_interaction=self.cz_freq_interaction(),
sampling_rate=self.sampling_rate(),
return_unit='f01')
half_CZ_A = dac_scale_factor*self.detuning_to_amp(
self.cz_freq_01_max() - half_CZ_A)

Expand All @@ -495,14 +493,16 @@ def _gen_cz(self):

half_CZ_B = wf.martinis_flux_pulse(
length=self.cz_length()*(1-self.czd_length_ratio()),
lambda_2=self.cz_lambda_2(),
lambda_3=self.cz_lambda_3(),
theta_f=self.cz_theta_f(),
f_q0=self.cz_f_q0(),
f_q1=self.cz_f_q1(),
anharmonicity_q0=self.cz_anharmonicity_q0(),
lambda_2=d_lambda_2,
lambda_3=d_lambda_3,
theta_f=d_theta_f,
f_01_max=self.cz_freq_01_max(),
# V_per_phi0=self.cz_V_per_phi0(),
J2=self.cz_J2(),
sampling_rate=self.sampling_rate())
# E_c=self.cz_E_c(),
f_interaction=self.cz_freq_interaction(),
sampling_rate=self.sampling_rate(),
return_unit='f01')
half_CZ_B = dac_scale_factor*self.detuning_to_amp(
self.cz_freq_01_max() - half_CZ_B, positive_branch=False)

Expand Down Expand Up @@ -850,8 +850,8 @@ def load_waveform_onto_AWG_lookuptable(self, waveform_name: str,
self.AWG.get_instr().set(codeword, waveform)

def load_waveforms_onto_AWG_lookuptable(
self, regenerate_waveforms: bool=True, stop_start: bool = True,
force_load_sequencer_program: bool=False):
self, regenerate_waveforms: bool=True, stop_start: bool = True,
force_load_sequencer_program: bool=False):
"""
Loads all waveforms specified in the LutMap to an AWG for both this
LutMap and the partner LutMap.
Expand Down Expand Up @@ -1135,7 +1135,7 @@ def plot_cz_trajectory(self, ax=None, show=True):
samples = np.arange(len(dac_amps))
amps = dac_amps*self.get_dac_val_to_amp_scalefactor()
deltas = self.amp_to_detuning(amps)
freqs = self.cz_f_q0()+self.cz_f_q1()-deltas
freqs = self.cz_freq_01_max()-deltas
ax.scatter(amps, freqs, c=samples, label='CZ trajectory')
if show:
plt.show()
Expand All @@ -1152,20 +1152,19 @@ def plot_flux_arc(self, ax=None, show=True,
f, ax = plt.subplots()
amps = np.linspace(-2.5, 2.5, 101) # maximum voltage of AWG amp mode
deltas = self.amp_to_detuning(amps)
freqs_11 = self.cz_f_q0()+self.cz_f_q1()-deltas
freqs_20 = 2*self.cz_f_q0()-self.cz_anharmonicity_q0()-2*deltas
freqs = self.cz_freq_01_max()-deltas

ax.plot(amps, freqs_11, label='$f_{01}$')
ax.plot(amps, freqs_20,
label='$f_{\mathrm{int.}}$:'+' {:.3f} GHz'.format(
(self.cz_f_q1()*2-self.cz_anharmonicity_q0())*1e-9),
c='C1')
ax.plot(amps, freqs, label='$f_{01}$')
ax.axhline(self.cz_freq_interaction(), -5, 5,
label='$f_{\mathrm{int.}}$:'+' {:.3f} GHz'.format(
self.cz_freq_interaction()*1e-9),
c='C1')

ax.axvline(0, 0, 2e10, linestyle='dotted', c='grey')
ax.axvline(0, 0, 1e10, linestyle='dotted', c='grey')
ax.fill_between(
x=amps,
y1=freqs_20-self.cz_J2(),
y2=freqs_20+self.cz_J2(),
x=[-5, 5],
y1=[self.cz_freq_interaction()-self.cz_J2()]*2,
y2=[self.cz_freq_interaction()+self.cz_J2()]*2,
label='$J_{\mathrm{2}}/2\pi$:'+' {:.3f} MHz'.format(
self.cz_J2()*1e-6),
color='C1', alpha=0.25)
Expand All @@ -1179,7 +1178,7 @@ def plot_flux_arc(self, ax=None, show=True,
set_xlabel(ax, 'AWG amplitude', 'V')
set_ylabel(ax, 'Frequency', 'Hz')
ax.set_xlim(-2.5, 2.5)
ax.set_ylim(np.min(freqs_20)+500e6, np.max(freqs_20)+500e6)
ax.set_ylim(3e9, np.max(freqs)+500e6)

dac_val_axis = ax.twiny()
dac_ax_lims = np.array(ax.get_xlim()) * \
Expand Down

0 comments on commit cfe9c4d

Please sign in to comment.