auspex.qubit package
Submodules
auspex.qubit.pipeline module
- class auspex.qubit.pipeline.PipelineManager(force_new=False)
Create and run Qubit Experiments.
- add_correlator(input_stream1, input_stream2)
- add_qubit_pipeline(qubit_label, stream_type, auto_create=True, buffers=False)
- clear_pipelines()
- commit()
- create_default_pipeline(qubits=None, buffers=False)
Look at the QGL channel library and create our pipeline from the current qubits.
- get_connections_by_name(pipeline_name, index=1)
- get_current_stream_selectors()
- get_stream_selector(pipeline_name)
- load(pipeline_name, index=1)
Load the latest instance for a particular name. Specifying index = 2 will select the second most recent instance
- ls()
- print(pipeline_name=None)
- recreate_pipeline(qubits=None, buffers=False)
- reset_pipelines()
- rollback()
- save_as(name)
- show_pipeline(subgraph=None, pipeline_name=None)
If a pipeline name is specified query the database, otherwise show the current pipeline.
- auspex.qubit.pipeline.check_session_dirty(f)
Since we can’t mix db objects from separate sessions, re-fetch entities by their unique IDs
auspex.qubit.qubit_exp module
- class auspex.qubit.qubit_exp.QubitExperiment(meta_file, averages=100, exp_name=None, save_chandb=True, **kwargs)
Create an Experiment with specialized config and run methods for qubit experiments.
- Parameters:
meta_file (string) – The filename of the QGL metainfo (*.json) corresponding to the desired experiment.
averages (int) – The number of shots to take. Results are only actually averaged if an Averager node is present in the processing pipeline.
exp_name (string) – Name of experiment. Used by any writers in pipeline to pick a data container name.
kwargs – Additional keyword arguments passed to the base Auspex Experiment class.
- Returns:
- experiment instance (Experiment)
Returns the initialized Auspex Experiment.
Examples
Creating a simple experiment.
>>> mf = RabiAmp(q1, [-1,0,1]) >>> exp = QubitExperiment(mf, averages=500)
- add_avg_sweep(num_averages)
- add_connector(stream_selector)
- add_instrument_sweep(instrument_name, attribute, values, channel=None)
- add_manual_sweep(label, prompt, values, channel=None)
- add_qubit_sweep(qubit, measure_or_control, attribute, values)
Add a ParameterSweep to the experiment. Users specify a qubit property that auspex will try to link back to the relevant instrument. For example:
exp = QubitExpFactory.create(PulsedSpec(q1)) self.add_qubit_sweep(q1, "measure", "frequency", np.linspace(6e9, 6.5e9, 500)) self.run_sweeps()
- Parameters:
sweep (attribute the attribute to)
channel (measure_or_control measure or control)
sweep
through (values the values to sweep)
- clear_fake_data(digitizer_proxy)
Disable using fake data interface for a digitizer. Take note that dummy mode may still be active.
- Parameters:
digitizer_proxy (bbndb Receiver instance) – The digitizer instrument proxy to be used for fake data generation.
- create_from_meta(meta_file, averages)
Method called during creation. Implementing a subclass of QubitExperiment this method may be overridden to provide additional functionality. However, this is a complex method, and it is recommended that the user instead override the modify_graph method to provide custom subclass behavior.
- final_init()
- init_instruments()
Gets run before a sweep starts
- init_progress_bars()
initialize the progress bars.
- instantiate_filters(graph)
- is_in_measured_qubit_names(qubit_name)
- modify_graph(graph)
Method called near the end of create_from_meta to allow custom manipulation of the filter pipeline. For example, CalibrationExperiment implements a version of modify_graph that selectively removes portions of the graph and creates buffers as needed to perform the desired calibrations on specific qubits.
- run()
This is the inner measurement loop, which is the smallest unit that is repeated across various sweep variables. For more complicated run control than can be provided by the automatic sweeping, the full experimental operation should be defined here
- set_fake_data(digitizer_proxy, ideal_data, increment=False, random_mag=0.1)
Enabled and use the fake data interface for digitizers in order that auspex can be run without hardware.
- Parameters:
digitizer_proxy (bbndb Receiver instance) – The digitizer instrument proxy to be used for fake data generation.
ideal_data (numpy array) – The actual data to be used. If increment is False, a 1D array with a single value per segment is used. The digitizer drivers automatical convert to a integrated, demodulated, or raw signal depending on the stream type being used. If increment is True, then this may be a 2D array, which is incremented through to emulate sweeps such a qubit measurement frequency sweep.
increment (boolean) – Whether or not to step through a 2D data array after to incorporate extra sweeps. The behavior is defined above.
Examples
Make sure to set auspex dummy mode at import time.
>>> import auspex.config as config >>> config.auspex_dummy_mode = True >>> # Configure channels and pipelines here >>> amps = np.linspace(-1,1,51) >>> exp = QubitExperiment(RabiAmp(q1,amps),averages=50) >>> exp.set_fake_data(digitizer_1, np.cos(np.linspace(0, 2*np.pi,51))) >>> exp.run_sweeps()
- shutdown_instruments()
Gets run after a sweep ends, or when the program is terminated.
auspex.qubit.mixer_calibration module
- class auspex.qubit.mixer_calibration.MixerCalibration(channel, spectrum_analyzer, mixer='control', first_cal='phase', offset_range=(-0.2, 0.2), amp_range=(0.4, 0.8), phase_range=(-1.5707963267948966, 1.5707963267948966), nsteps=101, use_fit=True, plot=True)
A calibration experiment that determines the optimal I and Q offsets, amplitude imbalance and phase imbalance for single-sideband modulation of a mixer. Please see Analog Devices Application Note AN-1039 for an explanation of the optimization of a mixer for maximum sideband supression.
- MAX_AMPLITUDE = 1.5
- MAX_OFFSET = 0.4
- MAX_PHASE = 0.7
- MIN_AMPLITUDE = 0.2
- MIN_OFFSET = -0.4
- MIN_PHASE = -0.7
- init_plots()
Initialize manual plotters for the mixer calibration. Three plot tabs open, one for I,Q offset, one for phase skew, one for amplitude imbalance.
- run_sweeps(sweep_parameter, pts, config_dict)
Run the calibration sweeps.
- update_settings()
Update the channel library settings to those found by calibration routine.
- class auspex.qubit.mixer_calibration.MixerCalibrationExperiment(channel, spectrum_analyzer, config_dict, mixer='control')
A mixer calibration experiment, using an APS1 or APS2 unit to calibrate the mixer offsets. Pulls sideband modulation frequency (IF) and LO frequency from the channel library.
- I_offset = <FloatParameter(name='I_offset',value=0.0,unit='V')>
- Q_offset = <FloatParameter(name='Q_offset',value=0.0,unit='V')>
- SSB_FREQ = 10000000.0
- amplitude = <OutputConnector(name=)>
- amplitude_factor = <FloatParameter(name='amplitude_factor',value=1.0)>
- connect_instruments()
Connect instruments, resetting all mixer offsets to default values.
- init_instruments()
Initialize instruments for mixer calibration.
- init_streams()
Establish the base descriptors for any internal data streams and connectors.
- phase_skew = <FloatParameter(name='phase_skew',value=0.0,unit='rad')>
- reset_calibration()
Set calibration back to default values.
- run()
This is the inner measurement loop, which is the smallest unit that is repeated across various sweep variables. For more complicated run control than can be provided by the automatic sweeping, the full experimental operation should be defined here
- shutdown_instruments()
Gets run after a sweep ends, or when the program is terminated.
- sideband_modulation = True
- auspex.qubit.mixer_calibration.find_null_offset(xpts, powers, default=0.0, use_fit=True)
Finds the offset corresponding to minimum power in a mixer calibration. Optionally will fit a quadratic to the linearized power and use the minimum of the fit to set the offset.
- Parameters:
xpts (numpy.ndarray) – Swept axis.
powers (numpy.ndarray) – Measured powers, in logarithmic scale.
default (float, optional) – Value to return if fit fails. Defaults to 0.0.
use_fit (bool, optional) – If true, use a fit to data. If false, return minimum value of data. Defaults to True.
- Returns:
A tuple containing the offset with minumum power, a finer x points array, and the fit points.
auspex.qubit.pulse_calibration module
- class auspex.qubit.pulse_calibration.CLEARCalibration(qubit, kappa=12566370.614359172, chi=-6283185.307179586, t_empty=4e-07, ramsey_delays=array([0.00e+00, 4.00e-08, 8.00e-08, 1.20e-07, 1.60e-07, 2.00e-07, 2.40e-07, 2.80e-07, 3.20e-07, 3.60e-07, 4.00e-07, 4.40e-07, 4.80e-07, 5.20e-07, 5.60e-07, 6.00e-07, 6.40e-07, 6.80e-07, 7.20e-07, 7.60e-07, 8.00e-07, 8.40e-07, 8.80e-07, 9.20e-07, 9.60e-07, 1.00e-06, 1.04e-06, 1.08e-06, 1.12e-06, 1.16e-06, 1.20e-06, 1.24e-06, 1.28e-06, 1.32e-06, 1.36e-06, 1.40e-06, 1.44e-06, 1.48e-06, 1.52e-06, 1.56e-06, 1.60e-06, 1.64e-06, 1.68e-06, 1.72e-06, 1.76e-06, 1.80e-06, 1.84e-06, 1.88e-06, 1.92e-06, 1.96e-06, 2.00e-06]), ramsey_freq=2000000.0, meas_delay=0, preramsey_delay=0, alpha=1, T1factor=1, T2=3e-05, nsteps=5, eps1=None, eps2=None, cal_steps=(1, 1, 1), **kwargs)
Calibration of cavity reset pulse.
- Parameters:
kappa – Cavity linewith (angular frequency: 1/s).
chi – Half of the dispersive shift (anguler frequency: 1/s).
t_empty – Time for active depletion (s).
alpha – Scaling factor.
T1factor – decay due to T1 between end of measurement and start of Ramsey.
T2 – Measured T2*
nsteps – number of calibration steps
ramsey_delays – List of times to use for Ramsey experiment.
ramsey_freq – Ramsey offset frequency.
meas_delay – Delay after end of measurement pulse
preramsey_delay – Delay before start of Ramsey sequence.
eps1 – 1st CLEAR parameter. if set to None will use theory values as default for eps1 and eps2.
eps2 (the second) – 2nd CLEAR parameter.
cal_steps (bool, bool, bool) – Calibration steps to execute. Currently, the first step sweeps eps1,
eps2
range. (and the third eps1 again in a smaller)
- descriptor()
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- sequence()
Returns the sequence for the given calibration, must be overridden
- update_settings()
- class auspex.qubit.pulse_calibration.CRAmpCalibration(edge, amp_range=0.4, amp=0.8, rise_fall=4e-08, num_CR=1, **kwargs)
- cal_type = 3
- descriptor()
- sequence()
Returns the sequence for the given calibration, must be overridden
- class auspex.qubit.pulse_calibration.CRAmpCalibration_PhEst(edge, num_pulses=5, **kwargs)
- update_settings()
- class auspex.qubit.pulse_calibration.CRCalibration(edge, lengths=array([2.00e-08, 7.00e-08, 1.20e-07, 1.70e-07, 2.20e-07, 2.70e-07, 3.20e-07, 3.70e-07, 4.20e-07, 4.70e-07, 5.20e-07, 5.70e-07, 6.20e-07, 6.70e-07, 7.20e-07, 7.70e-07, 8.20e-07, 8.70e-07, 9.20e-07, 9.70e-07, 1.02e-06]), phases=[0], amps=[0.8], rise_fall=4e-08, meas_qubits=None, **kwargs)
Template for CR calibrations. Currently available steps: length, phase, amplitude
- Parameters:
edge – Edge in the channel library defining the connection between control and target qubit
lengths (array) – CR pulse length(s). Longer than 1 for CRLenCalibration
phases (array) – CR pulse phase(s). Longer than 1 for CRPhaseCalibration
amps (array) – CR pulse amp(s). Longer than 1 for CRAmpCalibration
rise_fall (float) – length of rise/fall of CR pulses
meas_qubits (list) – specifies a subset of qubits to be measured (both by default)
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- update_settings()
- class auspex.qubit.pulse_calibration.CRLenCalibration(edge, lengths=array([2.00e-08, 7.00e-08, 1.20e-07, 1.70e-07, 2.20e-07, 2.70e-07, 3.20e-07, 3.70e-07, 4.20e-07, 4.70e-07, 5.20e-07, 5.70e-07, 6.20e-07, 6.70e-07, 7.20e-07, 7.70e-07, 8.20e-07, 8.70e-07, 9.20e-07, 9.70e-07, 1.02e-06]), phase=0, amp=0.8, rise_fall=4e-08, meas_qubits=None, **kwargs)
- cal_type = 1
- descriptor()
- sequence()
Returns the sequence for the given calibration, must be overridden
- class auspex.qubit.pulse_calibration.CRPhaseCalibration(edge, length=None, phases=array([0., 0.31415927, 0.62831853, 0.9424778, 1.25663706, 1.57079633, 1.88495559, 2.19911486, 2.51327412, 2.82743339, 3.14159265, 3.45575192, 3.76991118, 4.08407045, 4.39822972, 4.71238898, 5.02654825, 5.34070751, 5.65486678, 5.96902604, 6.28318531]), amp=0.8, rise_fall=4e-08, **kwargs)
- cal_type = 2
- descriptor()
- sequence()
Returns the sequence for the given calibration, must be overridden
- class auspex.qubit.pulse_calibration.Calibration
- calibrate()
- descriptor()
- exp_config(exp)
Any final experiment configuration before it gets run.
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- start_plots()
- stop_plots()
- update_settings()
- class auspex.qubit.pulse_calibration.CalibrationExperiment(qubits, output_nodes, stream_selectors, *args, **kwargs)
- add_cal_sweep(method, values)
- guess_output_nodes(graph)
- modify_graph(graph)
Change the graph as needed. By default we changes all writers to buffers
- class auspex.qubit.pulse_calibration.CavityTuneup(qubit, frequencies, averages=750, **kwargs)
- exp_config(exp)
Any final experiment configuration before it gets run.
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- sequence()
Returns the sequence for the given calibration, must be overridden
- class auspex.qubit.pulse_calibration.CustomCalibration(qubits, metafile=None, fit_name=None, fit_param=[], set_param=None, **kwargs)
- update_settings()
- class auspex.qubit.pulse_calibration.DRAGCalibration(qubit, deltas=array([-1., -0.9, -0.8, -0.7, -0.6, -0.5, -0.4, -0.3, -0.2, -0.1, 0., 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.]), num_pulses=array([8, 12, 16, 20, 24, 28, 32, 36, 40, 44]), **kwargs)
- exp_config(exp)
Any final experiment configuration before it gets run.
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- sequence()
Returns the sequence for the given calibration, must be overridden
- update_settings()
- class auspex.qubit.pulse_calibration.PhaseEstimation(channel, num_pulses=1, amplitude=0.1, direction='X', target=1.5707963267948966, epsilon=0.01, max_iter=5, **kwargs)
- amp2offset = 0.5
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- sequence()
Returns the sequence for the given calibration, must be overridden
- update_settings()
- class auspex.qubit.pulse_calibration.Pi2Calibration(qubit, num_pulses=1, direction='X', epsilon=0.01, max_iter=5, **kwargs)
- update_settings()
- class auspex.qubit.pulse_calibration.PiCalibration(qubit, num_pulses=1, direction='X', epsilon=0.01, max_iter=5, **kwargs)
- update_settings()
- class auspex.qubit.pulse_calibration.QubitCalibration(qubits, sample_name=None, output_nodes=None, stream_selectors=None, quad='real', auto_rollback=True, do_plotting=True, **kwargs)
- calibration_experiment = None
- run_sweeps()
- sequence()
Returns the sequence for the given calibration, must be overridden
- set_fake_data(*args, **kwargs)
- class auspex.qubit.pulse_calibration.QubitTuneup(qubit, f_start=5000000000.0, f_stop=6000000000.0, coarse_step=100000000.0, fine_step=1000000.0, averages=500, amp=1.0, **kwargs)
- exp_config(exp)
Any final experiment configuration before it gets run.
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- sequence()
Returns the sequence for the given calibration, must be overridden
- class auspex.qubit.pulse_calibration.RabiAmpCalibration(qubit, num_steps=40, **kwargs)
- amp2offset = 0.5
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- sequence()
Returns the sequence for the given calibration, must be overridden
- update_settings()
- class auspex.qubit.pulse_calibration.RamseyCalibration(qubit, delays=array([0.00e+00, 5.00e-07, 1.00e-06, 1.50e-06, 2.00e-06, 2.50e-06, 3.00e-06, 3.50e-06, 4.00e-06, 4.50e-06, 5.00e-06, 5.50e-06, 6.00e-06, 6.50e-06, 7.00e-06, 7.50e-06, 8.00e-06, 8.50e-06, 9.00e-06, 9.50e-06, 1.00e-05, 1.05e-05, 1.10e-05, 1.15e-05, 1.20e-05, 1.25e-05, 1.30e-05, 1.35e-05, 1.40e-05, 1.45e-05, 1.50e-05, 1.55e-05, 1.60e-05, 1.65e-05, 1.70e-05, 1.75e-05, 1.80e-05, 1.85e-05, 1.90e-05, 1.95e-05, 2.00e-05]), two_freqs=False, added_detuning=150000.0, set_source=True, AIC=True, **kwargs)
- descriptor()
- exp_config(exp)
Any final experiment configuration before it gets run.
- init_plots()
Return a ManualPlotter object so we can plot calibrations. All plot lines, glyphs, etc. must be declared up front!
- sequence()
Returns the sequence for the given calibration, must be overridden
- update_settings()
- auspex.qubit.pulse_calibration.phase_estimation(data_in, vardata_in, verbose=False)
Estimates pulse rotation angle from a sequence of P^k experiments, where k is of the form 2^n. Uses the modified phase estimation algorithm from Kimmel et al, quant-ph/1502.02677 (2015). Every experiment i doubled. vardata should be the variance of the mean
- auspex.qubit.pulse_calibration.phase_to_amplitude(phase, sigma, amp, target, epsilon=0.01)
- auspex.qubit.pulse_calibration.quick_norm_data(data)
- auspex.qubit.pulse_calibration.restrict(phase)
auspex.qubit.single_shot_fidelity module
- class auspex.qubit.single_shot_fidelity.SingleShotFidelityExperiment(qubit, sample_name=None, output_nodes=None, meta_file=None, optimize=True, set_threshold=True, **kwargs)
Experiment to measure single-shot measurement fidelity of a qubit.
- Parameters:
qubit – qubit object
output_nodes (optional) – the output node of the filter pipeline to use for single-shot readout. The default is choses, if single output.
meta_file (string, optional) – path to the QGL sequence meta_file. Default to standard SingleShot sequence
optimize (bool, optional) – if True and a qubit_sweep is added, set the parameter corresponding to the maximum measured fidelity at the end of the sweep
- find_single_shot_filter()
Make sure there is one single shot measurement filter in the pipeline.
- get_fidelity()
- get_results()
Get the PDF and fidelity numbers from the filters. Returns a dictionary of PDF data with the filter names as keys.
- get_threshold()
- guess_output_nodes(graph)
- init_plots()
- run_sweeps()