Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
312a892
Fix typo and check git push works
lillian542 Mar 5, 2019
b266423
test
lillian542 Mar 11, 2019
414faac
Test
lillian542 Mar 21, 2019
d68cd82
Merge branch '4dsp' of github.com-lillian:lillian542/Qcodes into 4dsp
lillian542 Mar 21, 2019
c7812d3
Change from IPInstrument to VisaInstrument
lillian542 Mar 22, 2019
da1da2b
Make IP instrument again, add functions for basic commands
lillian542 Apr 10, 2019
e9df979
Change AWG file-writing functions to take forged sequence from loment…
lillian542 Apr 10, 2019
2e19023
Reorganize sligthly to make easier to read
lillian542 Apr 10, 2019
5149d71
Add function to convert forged sequence arrays to twos complement dat…
lillian542 Apr 10, 2019
0af0520
Remove bug plus small cosmetic changes to make the PEP8 warning tabs …
lillian542 Apr 10, 2019
c91693d
Fix bugs found in testing
lillian542 Apr 11, 2019
eb5a344
Fix merge conflict
lillian542 Apr 12, 2019
eaa291c
Add path to save waveform files to 4DSP waveform folder
lillian542 Apr 12, 2019
de92eb8
Fix bugs in writing to binary files
lillian542 Apr 12, 2019
6cf7101
Add a couple of ToDo tasks
lillian542 Apr 12, 2019
a86d997
Merge branch '4dsp' of github.com:lillian542/Qcodes into 4dsp
lillian542 Apr 12, 2019
cc6584d
Remove bugs
lillian542 Apr 12, 2019
7820895
Add channel mapping for cards 0 and 1
lillian542 Apr 12, 2019
2bbf684
Fix typo
lillian542 Apr 12, 2019
137f85c
Add warning if channels with incorrect names are provided - fx 1M1
lillian542 Apr 12, 2019
aa452a6
Typos
lillian542 Apr 12, 2019
014bfd9
Monitor instrument state, deal with disallowed state transitions
lillian542 Apr 15, 2019
fdf8790
Add function to get waveform shape from file
lillian542 Apr 15, 2019
09dfa68
Add function to specify waveform mask
lillian542 Apr 15, 2019
747a807
Add max trigger frequency function
lillian542 Apr 15, 2019
babde5a
Fix typos, bugs
lillian542 Apr 15, 2019
7ec0ca1
Small changes
lillian542 Apr 15, 2019
7ebccfe
Add commands that change folder, file mask and file extension from py…
lillian542 Apr 15, 2019
79140a1
Fix bugs
lillian542 Apr 15, 2019
791a6ba
Fix factor 10 error in max trigger rate
lillian542 Apr 15, 2019
72c8df5
Remove voltage setting - set voltage and offset in lomentum
lillian542 Apr 17, 2019
cd203b1
Make small changes to appease the PEP8 warning tags
lillian542 Apr 17, 2019
0ff4413
Make dformat (operation in TXT or BIN) instrument parameter
lillian542 Apr 17, 2019
d2b7548
Debugging changes to dformat parameter
lillian542 Apr 17, 2019
49e1460
Rename dformat to data_format, finish debugging
lillian542 Apr 18, 2019
7326f70
Speed up file writing for txt files
lillian542 Apr 18, 2019
3e33be0
Speed up file writing
lillian542 Apr 24, 2019
8b124f1
Tidy up
lillian542 Apr 24, 2019
9e0c879
Update to use new instrument commands, get_state functions
lillian542 Apr 24, 2019
85559a0
Fix get-state functions so they actually return a response
lillian542 Apr 25, 2019
1ef48d9
Fix typo
lillian542 May 1, 2019
2ea71b8
Fix bugs found in testing
lillian542 May 1, 2019
3449648
Add small wait time after as function to speed up instrument response…
lillian542 May 10, 2019
f0bc886
Specify buffer size in shutil.copyfileobj to speed up file saving
lillian542 May 14, 2019
b47fbed
Remove unnecessary configuration from setting file type
lillian542 May 16, 2019
4321a4b
Remove reconfiguration when changing waveform shape - this is now man…
lillian542 May 16, 2019
b716dda
Add limitations on waveform shape to avoid uploading waveforms with u…
lillian542 May 16, 2019
210f866
Add option to adjust buffer length to improve file saving speed
lillian542 Jul 18, 2019
76e4d4d
Remove extra timing measurements from testing phase
lillian542 Jul 18, 2019
edd94fd
Docstring and cosmetic changes
lillian542 Jul 22, 2019
01e5e84
Add test and example files
lillian542 Oct 14, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,284 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Abaco4DSP & Tektronix5014C for MIDAS\n",
"\n",
"## Table of contents\n",
"* [Imports setup and initialisation](#init)\n",
"* [Pulse sequence for MIDAS](#MIDAS_sequence)\n",
" * [Create a suitable template element](#template)\n",
" * [Uploading the sequence](#uploading) \n",
" \n",
"For information on basic setup and function of the Abaco4DSP system, see 'Abaco4DSP example'. This assumes you have turned the Abaco4DSP system on and connected the computer to the waveform file folder, and have the correct port number for initialization."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Imports and Initialization <a class=\"anchor\" id=\"init\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# both AWGs\n",
"from qcodes.instrument_drivers.Abaco import Abaco4DSP\n",
"from qcodes.instrument_drivers.tektronix.AWG5014 import Tektronix_AWG5014\n",
"\n",
"# parametric sequencer + joint Tektronix5014C/Abaco4DSP AWG interface\n",
"from qdev_wrappers.customised_instruments.parametric_sequencer import ParametricSequencer\n",
"from qdev_wrappers.customised_instruments.AWGinterface import AbacoTektronixInterface\n",
"\n",
"# for pulse sequence templates and parametric sequencer\n",
"import yaml\n",
"import sys\n",
"\n",
"scriptfolder = 'A:\\Scripts'\n",
"sys.path.append(scriptfolder)\n",
"with open(scriptfolder + 'pulse_building/pulse_building_defaults.yaml') as f:\n",
" initial_sequence_settings = yaml.safe_load(f)\n",
" \n",
"from pulse_building.readout_template_element import create_readout_template_element"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"#initialize - initialize interface, Abaco and ps\n",
"\n",
"abaco = Abaco4DSP('Abaco4DSP', 192.168.20.117, port=27015)\n",
"tektronix = Tektronix_AWG5014('textronix_awg', 'TCPIP0::192.168.15.104::inst0::INSTR')\n",
"\n",
"# for parametric sequencer\n",
"awg_interface = AbacoTektronixInterface(abaco, tektronix)\n",
"initial_template_element = create_readout_template_element()\n",
"ps = ParametricSequencer('parametric_sequencer',\n",
" awg=awg_interface,\n",
" template_element=initial_template_element,\n",
" inner_setpoints='dummy_param', [1],\n",
" context=initial_sequence_settings['context'],\n",
" labels=initial_sequence_settings['labels'],\n",
" units=initial_sequence_settings['units'])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Pulse sequence for MIDAS <a class=\"anchor\" id=\"MIDAS_sequence\"></a>\n",
"\n",
"As long as MIDAS does not have the option of double-buffering, such that it can flush one buffer while using the other, and measure continuously, it is neccessary to pause measuring once every 2048 measurements, and give the system time to flush the buffer. 10ms seems to work. Much less, and funny things start happening.\n",
"\n",
"**Note:** The current state of the MIDAS box at T5 is that it has the pre-update patch, but not the full latest update (v1.03). If you choose to venture into the uncharted territory of the new update, make sure to take the correct version - flashing the 085 version of MIDAS with the 115 update will \"probably break the whole thing\", according to Niel and Jonathan in Sydney.\n",
"\n",
"\n",
"In order to do this, we will give the sequencer a template element that contains information for the Abaco4DSP channels (named 1, 2, 3, 4 ...) and the Tektronix5014C marker channes ('1M1', '1M2', '2M1'...). \n",
"\n",
"The ***Tektronix5014C*** will need to produce a trigger indicating that the Abaco4DSP should output its next sequence element. It will also need to produce a trigger telling MIDAS to measure, because the trigger threshhold for MIDAS is higher than the maximum output of the Abaco4DSP.\n",
"\n",
"The ***Abaco4DSP*** system will in this example be producing I and Q pulses to drive the two qubits through the mixers, as well as a square pulse for the pulsemod port of the SGS100A RF source used for the readout signal. The pulsemod port has a nominal trigger threshhold of 1 V, but behaves more reliably if you go up to around 1.5 V.\n",
"\n",
"We will create a single template element containing both the numbered (4DSP) channels and the marker (Tektronix) channels, and the Abaco/Tektronix AWG interface will separate them out and upload both places, as well as add a 10ms break every 2048 measurement pulses, by doing a horrible ugly roundabout after-the-fact maniuplation of the forged pulse sequence, before giving it to the AWGs to upload. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Creating a template element <a class=\"anchor\" id=\"template\"></a>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from lomentum import SegmentGroup, Element\n",
"from lomentum.atoms import flat, sine, zero, marker_on, marker_off\n",
"from qdev_wrappers.pulse_building.atoms_ext import sine_multi, gaussianDRAG\n",
"\n",
"\n",
"def create_midas_rabi_template_element():\n",
"\n",
" # mixer sidebanding pulses for qubit control\n",
" qubit1_I_segment_list = []\n",
" qubit1_Q_segment_list = []\n",
" qubit2_I_segment_list = []\n",
" qubit2_Q_segment_list = []\n",
" \n",
" qubit_signals = [qubit1_I_segment_list, \n",
" qubit1_Q_segment_list,\n",
" qubit2_I_segment_list,\n",
" qubit2_Q_segment_list]\n",
" \n",
" for signal in qubit_signals:\n",
" signal.append(zero(duration='flex_time')) \n",
"\n",
" qubit1_I_segment_list.append(sine(duration='pulse_duration', \n",
" amplitude='mixer1_amplitude_I', \n",
" frequency = 'mixer1_frequency', \n",
" phase=0, \n",
" offset='mixer1_offset_I'))\n",
" qubit1_Q_segment_list.append(zero(duration='pulse_duration', \n",
" amplitude='mixer1_amplitude', \n",
" frequency = 'mixer1_frequency', \n",
" phase='mixer1_phase', \n",
" offset='mixer1_offset_Q'))\n",
" qubit1_I_segment_list.append(sine(duration='pulse_duration', \n",
" amplitude='mixer2_amplitude_I', \n",
" frequency = 'mixer2_frequency', \n",
" phase=0, \n",
" offset='mixer2_offset_I'))\n",
" qubit1_Q_segment_list.append(zero(duration='pulse_duration', \n",
" amplitude='mixer2_amplitude', \n",
" frequency = 'mixer2_frequency', \n",
" phase='mixer2_phase', \n",
" offset='mixer2_offset_Q'))\n",
" \n",
" for signal in qubit_signals:\n",
" signal.append(zero(duration='drive_readout_delay'))\n",
" signal.append(zero(duration='readout_stage_duration'))\n",
"\n",
" qubit1_pulse_I = SegmentGroup(*qubit1_I_segment_list,\n",
" duration='total_duration')\n",
" qubit1_pulse_Q = SegmentGroup(*qubit1_Q_segment_list,\n",
" duration='total_duration')\n",
" qubit2_pulse_I = SegmentGroup(*qubit2_I_segment_list,\n",
" duration='total_duration')\n",
" qubit2_pulse_Q = SegmentGroup(*qubit2_Q_segment_list,\n",
" duration='total_duration')\n",
"\n",
" # readout pulse for pulsemod input on SGS100A\n",
" seg1 = zero(duration='drive_stage_duration')\n",
" # amplitude scaling factor 0.9 --> output voltage 0.9*1.7 = 1.53 V\n",
" seg2 = flat(duration='readout_duration', amplitude=0.9) \n",
" seg3 = zero(duration='after_readout_duration')\n",
" readout_pulse = SegmentGroup(seg1, seg2, seg3,\n",
" duration='total_duration')\n",
" \n",
" # MIDAS measurement trigger\n",
" m1 = marker_off(duration='pre_marker_duration')\n",
" m2 = marker_on(duration='marker_duration')\n",
" m3 = marker_off(duration='post_marker_duration')\n",
" measurement_triggers = SegmentGroup(m1, m2, m3,\n",
" duration='total_duration')\n",
" \n",
" # 4DSP output trigger\n",
" m1 = marker_on(duration='4DSP_marker_duration')\n",
" m2 = marker_off(duration='post_4DSP_marker_duration')\n",
" m3 = marker_off(duration='readout_stage_duration')\n",
" abaco_triggers = SegmentGroup(m1, m2, m3,\n",
" duration='total_duration')\n",
" \n",
" # test channel (to confirm Abaco is outputting)\n",
" test = readout_pulse\n",
"\n",
" def mytransformation(context):\n",
" context['readout_stage_duration'] = context['total_duration'] - \\\n",
" context['drive_stage_duration']\n",
" context['pre_qubit_marker_duration'] = context['drive_stage_duration'] - context['qubit_marker_duration']\n",
" context['after_readout_duration'] = context['total_duration'] - \\\n",
" context['drive_stage_duration'] - context['readout_duration']\n",
" context['flex_time'] = context['drive_stage_duration'] - \\\n",
" context['pulse_duration'] - context['drive_readout_delay']\n",
" context['pre_marker_duration'] = context['drive_stage_duration'] - \\\n",
" context['marker_readout_delay']\n",
" context['post_marker_duration'] = context['total_duration'] - \\\n",
" context['marker_duration'] - context['pre_marker_duration']\n",
" context['post_4DSP_marker_duration'] = context['drive_stage_duration'] - \\\n",
" context['4DSP_marker_duration']\n",
"\n",
" template_element = Element(segments={1: test,\n",
" 2: readout_pulse,\n",
" 3: qubit1_pulse_I,\n",
" 4: qubit1_pulse_Q,\n",
" 5: qubit2_pulse_I,\n",
" 6: qubit2_pulse_Q,\n",
" '3M1': abaco_triggers, \n",
" '3M2': measurement_triggers},\n",
" sequencing={'nrep': 1},\n",
" transformation=mytransformation)\n",
"\n",
" return template_element"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Uploading the sequence <a class=\"anchor\" id=\"uploading\"></a>\n",
"\n",
"If I haven't messed up, and your template element has all the things it needs, it should be as simple as giving it the extra context items it needs, and proceeding as normal:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"context = {\n",
" 'total_duration':20e-6,\n",
" 'drive_stage_duration': 10e-6,\n",
" 'readout_duration': 4e-6, \n",
" 'pulse_duration': 1e-06,\n",
" 'marker_duration': 5e-08,\n",
" '4DSP_marker_duration' : 5e-08,\n",
" 'marker_readout_delay' : 5e-09,\n",
" 'drive_readout_delay' : 1e-08,\n",
" 'mixer1_amplitude': 0.162,\n",
" 'mixer2_amplitude': 0.189,\n",
" 'mixer1_relative_amplitude_I': 1,\n",
" 'mixer2_relative_amplitude_I': 1,\n",
" 'mixer1_frequency' : 75e6,\n",
" 'mixer2_frequency' : 100e6,\n",
" 'mixer1_offset_I': 0,\n",
" 'mixer1_offset_Q': 0,\n",
" 'mixer2_offset_I': 0,\n",
" 'mixer2_offset_Q': 0,\n",
" 'mixer1_phase': -np.pi/2,\n",
" 'mixer2_phase': -np.pi/2}\n",
"\n",
"template_element = create_midas_rabi_template_element()\n",
"pulse_durations = np.linspace(0, 512e-9, num=512)\n",
"\n",
"ps.set_template(template_element,\n",
" inner_setpoints=('pulse_duration', pulse_durations),\n",
" context=context)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading