Skip to content

Commit

Permalink
Merge 7643f24 into bfb46f8
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Ristè committed Sep 24, 2019
2 parents bfb46f8 + 7643f24 commit 3af3bed
Show file tree
Hide file tree
Showing 8 changed files with 236 additions and 2,234 deletions.
1 change: 0 additions & 1 deletion QGL/PulseSequencePlotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ def extract_waveforms(fileNames, nameDecorator='', time=False):

translator = resolve_translator(fileName, translators)
wfs = translator.read_sequence_file(fileName)
print(f"Sampling rate from extract_waveforms {translator.SAMPLING_RATE}")
sample_time = 1.0/translator.SAMPLING_RATE if time else 1
for (k, seqs) in sorted(wfs.items()):
if all_zero_seqs(seqs):
Expand Down
70 changes: 70 additions & 0 deletions doc/Generate channel library.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Channel library\n",
"\n",
"This code to generate a sample channel library and stores it in the database `example.sqlite`. This channel library is used in the examples in this directory. See Auspex [example notebooks](https://github.com/BBN-Q/Auspex/tree/develop/doc/examples) for documentation. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from QGL import *\n",
"\n",
"cl = ChannelLibrary(db_resource_name=\"./example.sqlite\")\n",
"q1 = cl.new_qubit(\"q1\")\n",
"q2 = cl.new_qubit(\"q2\")\n",
"CNOT12 = cl.new_edge(q1, q2)\n",
"aps2_1 = cl.new_APS2(\"BBNAPS1\", address=\"192.168.5.101\") \n",
"aps2_2 = cl.new_APS2(\"BBNAPS2\", address=\"192.168.5.102\")\n",
"aps2_3 = cl.new_APS2(\"BBNAPS3\", address=\"192.168.5.103\") \n",
"aps2_4 = cl.new_APS2(\"BBNAPS4\", address=\"192.168.5.104\")\n",
"dig_1 = cl.new_X6(\"X6_1\", address=0)\n",
"h1 = cl.new_source(\"Holz1\", \"HolzworthHS9000\", \"HS9004A-009-1\", power=-30)\n",
"h2 = cl.new_source(\"Holz2\", \"HolzworthHS9000\", \"HS9004A-009-2\", power=-30) \n",
"cl.set_control(q1, aps2_1, generator=h1)\n",
"cl.set_measure(q1, aps2_2, dig_1.ch(1), generator=h2)\n",
"cl.set_control(q2, aps2_3, generator=h1)\n",
"cl.set_measure(q2, aps2_4, dig_1.ch(2), generator=h2)\n",
"cl.set_master(aps2_1, aps2_1.ch(\"m2\"))\n",
"cl.set_control(CNOT12, aps2_1, generator=h1)\n",
"cl[\"q1\"].measure_chan.frequency = 0e6\n",
"cl.commit()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"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.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 3af3bed

Please sign in to comment.