Skip to content

Commit

Permalink
QSwitch driver with monitor support (#266)
Browse files Browse the repository at this point in the history
* QSwitch QCodes driver with monitor support

* Make compatible with 3.9

* More robust serial communication

* New API with auto-grounding
  • Loading branch information
jpsecher committed Nov 20, 2023
1 parent d840b5c commit 993cb5d
Show file tree
Hide file tree
Showing 19 changed files with 1,619 additions and 14 deletions.
4 changes: 2 additions & 2 deletions docs/examples/QDevil/QDAC2/Chaining.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "qcodespip311",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -332,7 +332,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.0 | packaged by conda-forge | (main, Jan 16 2023, 14:12:30) [MSC v.1916 64 bit (AMD64)]"
"version": "3.10.12"
},
"nbsphinx": {
"execute": "never"
Expand Down
160 changes: 160 additions & 0 deletions docs/examples/QDevil/QSwitch/Debugging.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "c08d6367",
"metadata": {},
"source": [
"# QSwitch debugging\n"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "85f2a1e0",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Connected to: Quantum Machines QSwitch (serial:5, firmware:0.160) in 0.11s\n"
]
}
],
"source": [
"import pprint\n",
"pp = pprint.PrettyPrinter()\n",
"from qcodes_contrib_drivers.drivers.QDevil import QSwitch\n",
"qswitch_addr = '192.168.8.18'\n",
"qswitch = QSwitch.QSwitch('switch', visalib='@py', address=f'TCPIP::{qswitch_addr}::5025::SOCKET')"
]
},
{
"cell_type": "markdown",
"id": "5c6c00b2",
"metadata": {},
"source": [
" You can record the underlying SCPI commands that are sent to the QSwitch:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "d0c7fc28",
"metadata": {},
"outputs": [],
"source": [
"qswitch.start_recording_scpi()"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "64f0cbe6",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'0,\"No error\"'"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"qswitch.reset()\n",
"qswitch.arrange(\n",
" breakouts={'DMM': 5, 'VNA': 7},\n",
" lines={'plunger': 23, 'sensor': 5})\n",
"qswitch.connect('sensor')\n",
"qswitch.breakout('sensor', 'DMM')\n",
"qswitch.errors()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "0d8a7693",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"['*rst', 'stat?', 'clos (@5!9)', 'open (@5!0)', 'clos (@5!5)', 'all?']\n"
]
}
],
"source": [
"pp.pprint(qswitch.get_recorded_scpi_commands())"
]
},
{
"cell_type": "markdown",
"id": "4a00d73e-88e0-439c-9b80-15aaffaf2064",
"metadata": {},
"source": [
"If you are connecting via USB, then you need `pyserial` installed."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "37ac76f2",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"('ASRL/dev/ttyS0::INSTR', 'ASRL/dev/ttyACM0::INSTR')"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"import pyvisa\n",
"rm = pyvisa.ResourceManager('@py')\n",
"rm.list_resources()"
]
},
{
"cell_type": "markdown",
"id": "d6bdb22e",
"metadata": {},
"source": [
"See https://github.com/QDevil/qdac2-tools for more debugging tools."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"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.10.12"
},
"nbsphinx": {
"execute": "never"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading

0 comments on commit 993cb5d

Please sign in to comment.