From 0450bb288af55a47d10f549176fab50cc6dabb45 Mon Sep 17 00:00:00 2001 From: Paul Surrey Date: Fri, 1 Mar 2024 10:28:27 +0100 Subject: [PATCH] individual durations for each point. --- qupulse/examples/DecadacProgramBuilder.ipynb | 347 +++++++++++++++++-- qupulse/hardware/awgs/decadac.py | 50 ++- 2 files changed, 349 insertions(+), 48 deletions(-) diff --git a/qupulse/examples/DecadacProgramBuilder.ipynb b/qupulse/examples/DecadacProgramBuilder.ipynb index cfc59c5a..221cd3d6 100644 --- a/qupulse/examples/DecadacProgramBuilder.ipynb +++ b/qupulse/examples/DecadacProgramBuilder.ipynb @@ -2028,7 +2028,7 @@ }, { "cell_type": "code", - "execution_count": 1692, + "execution_count": 1748, "id": "ad9f158b", "metadata": {}, "outputs": [ @@ -2099,7 +2099,7 @@ }, { "cell_type": "code", - "execution_count": 1693, + "execution_count": 1749, "id": "5b634195", "metadata": {}, "outputs": [ @@ -2202,7 +2202,7 @@ " (1, 4, None)]" ] }, - "execution_count": 1693, + "execution_count": 1749, "metadata": {}, "output_type": "execute_result" } @@ -2215,7 +2215,7 @@ }, { "cell_type": "code", - "execution_count": 1725, + "execution_count": 1742, "id": "309c1eb7", "metadata": {}, "outputs": [ @@ -2545,7 +2545,7 @@ " LoopJmp(idx=13)]" ] }, - "execution_count": 1725, + "execution_count": 1742, "metadata": {}, "output_type": "execute_result" } @@ -2558,7 +2558,7 @@ }, { "cell_type": "code", - "execution_count": 1741, + "execution_count": 1743, "id": "85d82025", "metadata": {}, "outputs": [ @@ -2850,7 +2850,7 @@ " Wait(duration=6e-05)]" ] }, - "execution_count": 1741, + "execution_count": 1743, "metadata": {}, "output_type": "execute_result" } @@ -2864,52 +2864,329 @@ }, { "cell_type": "code", - "execution_count": 1722, - "id": "bcd70bc6", + "execution_count": 1767, + "id": "bdfcb758", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "> \u001b[1;32m\\\\janeway\\user ag bluhm\\surrey\\git\\qupulse\\qupulse\\program\\linspace.py\u001b[0m(468)\u001b[0;36mreduce_looped_waits\u001b[1;34m()\u001b[0m\n", - "\u001b[1;32m 466 \u001b[1;33m \u001b[0mnew_commands\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mWait\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mtotal_wait_time\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[1;32m 467 \u001b[1;33m \u001b[0mi\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mj\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m \u001b[1;31m# i should now point to the loop jump. The following assert does not cover it completely, but better than nothing.\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[1;32m--> 468 \u001b[1;33m \u001b[1;32massert\u001b[0m \u001b[0mcommands\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__class__\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m__name__\u001b[0m \u001b[1;33m==\u001b[0m \u001b[1;34m\"LoopJmp\"\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[1;32m 469 \u001b[1;33m \u001b[1;32melse\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[0m\u001b[1;32m 470 \u001b[1;33m \u001b[0mnew_commands\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcommands\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", - "\u001b[0m\n", - "*** Usage: commands [bnum]\n", - " ...\n", - " end\n", - "*** Usage: commands [bnum]\n", - " ...\n", - " end\n", - "*** SyntaxError: '[' was never closed\n", - "Wait(duration=1e-05)\n" + "[[5000000 0 0 0]\n", + " [5000000 0 0 0]\n", + " [5000000 0 -33 -65]\n", + " ...\n", + " [5000000 0 0 0]\n", + " [5000000 0 0 0]\n", + " [5000000 0 0 0]]\n", + "[(0, 0, array([5000000, 0, 0, 0])), (1, 1, array([5000000, 0, -33, -65])), (0, 0, array([5000000, 0, 0, 0])), (1, 3, array([5000000, 0, 0, -66])), (0, 0, array([5000000, 0, 0, 0])), (1, 8, array([5000000, -33, -317, 33])), (0, 0, array([5000000, 68, 40, -68])), (0, 0, array([5000000, 65, 51, -65])), (0, 0, array([5000000, 60, 60, -60])), (0, 0, array([5000000, 51, 65, -51])), (0, 0, array([5000000, 40, 68, -40])), (0, 0, array([5000000, 28, 68, -28])), (0, 0, array([5000000, 14, 65, -14])), (0, 0, array([5000000, 0, 60, 0])), (0, 0, array([5000000, -14, 51, 14])), (0, 0, array([5000000, -28, 40, 28])), (0, 0, array([5000000, -40, 28, 40])), (0, 0, array([5000000, -51, 14, 51])), (0, 0, array([5000000, -60, 0, 60])), (0, 0, array([5000000, -65, -14, 65])), (0, 0, array([5000000, -2, -214, -30])), (0, 0, array([5000000, 0, 0, 0])), (1, 1, array([5000000, -66, 99, 196])), (0, 0, array([5000000, 0, 0, 0])), (1, 3, array([5000000, -131, -99, 99])), (0, 0, array([5000000, 0, 0, 0])), (1, 8, array([5000000, 131, 186, -197])), (0, 0, array([5000000, -68, -40, 68])), (0, 0, array([5000000, -65, -51, 65])), (0, 0, array([5000000, -60, -60, 60])), (0, 0, array([5000000, -51, -65, 51])), (0, 0, array([5000000, -40, -68, 40])), (0, 0, array([5000000, -28, -68, 28])), (0, 0, array([5000000, -14, -65, 14])), (0, 0, array([5000000, 0, -60, 0])), (0, 0, array([5000000, 14, -51, -14])), (0, 0, array([5000000, 28, -40, -28])), (0, 0, array([5000000, 40, -28, -40])), (0, 0, array([5000000, 51, -14, -51])), (0, 0, array([5000000, 60, 0, -60])), (0, 0, array([5000000, 65, 14, -65])), (0, 0, array([5000000, 68, 28, -68])), (48, 384, array([5000000, 68, 40, -68])), (0, 0, array([5000000, 65, 51, -65])), (0, 0, array([5000000, 60, 60, -60])), (0, 0, array([5000000, 51, 65, -51])), (0, 0, array([5000000, 40, 68, -40])), (0, 0, array([5000000, 28, 68, -28])), (0, 0, array([5000000, 14, 65, -14])), (0, 0, array([5000000, 0, 60, 0])), (0, 0, array([5000000, -14, 51, 14])), (0, 0, array([5000000, -28, 40, 28])), (0, 0, array([5000000, -40, 28, 40])), (0, 0, array([5000000, -51, 14, 51])), (0, 0, array([5000000, -60, 0, 60])), (0, 0, array([5000000, -65, -14, 65])), (0, 0, array([5000000, -2, -214, -30])), (0, 0, array([5000000, 0, 0, 0])), (1, 1, array([5000000, -66, 99, 196])), (0, 0, array([5000000, 0, 0, 0])), (1, 3, array([5000000, -131, -99, 99])), (0, 0, array([5000000, 0, 0, 0])), (1, 8, array([5000000, 131, 186, -197])), (0, 0, array([5000000, -68, -40, 68])), (0, 0, array([5000000, -65, -51, 65])), (0, 0, array([5000000, -60, -60, 60])), (0, 0, array([5000000, -51, -65, 51])), (0, 0, array([5000000, -40, -68, 40])), (0, 0, array([5000000, -28, -68, 28])), (0, 0, array([5000000, -14, -65, 14])), (0, 0, array([5000000, 0, -60, 0])), (0, 0, array([5000000, 14, -51, -14])), (0, 0, array([5000000, 28, -40, -28])), (0, 0, array([5000000, 40, -28, -40])), (0, 0, array([5000000, 51, -14, -51])), (0, 0, array([5000000, 60, 0, -60])), (0, 0, array([5000000, 65, 14, -65])), (0, 0, array([5000000, 101, 345, -101])), (0, 0, array([5000000, 0, 0, 0])), (1, 8, array([5000000, 3, 0, 0])), (0, 0, array([5000000, 0, 0, 0])), (1, 3, array([5000000, 0, 33, 66])), (0, 0, array([5000000, 0, 0, 0])), (1, 8, array([5000000, 0, 32, 65])), (0, 0, array([5000000, 0, 0, 0])), (1, 4, None)]\n", + "[Set(channel=0, value=32800, key=None), Set(channel=1, value=32833, key=None), Set(channel=2, value=32865, key=None), Wait(duration=5000000)]\n", + "Set(channel=0, value=32800, key=None)\n", + "Set(channel=1, value=32833, key=None)\n", + "Set(channel=2, value=32865, key=None)\n", + "Wait(duration=15000000)\n", + "Increment(channel=1, value=-33, dependency_key=None)\n", + "Increment(channel=2, value=-65, dependency_key=None)\n", + "Wait(duration=25000000)\n", + "Increment(channel=2, value=-66, dependency_key=None)\n", + "Wait(duration=50000000)\n", + "Increment(channel=0, value=-33, dependency_key=None)\n", + "Increment(channel=1, value=-317, dependency_key=None)\n", + "Increment(channel=2, value=33, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "LoopLabel(idx=6, count=9)\n", + "Increment(channel=0, value=68, dependency_key=None)\n", + "Increment(channel=1, value=40, dependency_key=None)\n", + "Increment(channel=2, value=-68, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=65, dependency_key=None)\n", + "Increment(channel=1, value=51, dependency_key=None)\n", + "Increment(channel=2, value=-65, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=60, dependency_key=None)\n", + "Increment(channel=1, value=60, dependency_key=None)\n", + "Increment(channel=2, value=-60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=51, dependency_key=None)\n", + "Increment(channel=1, value=65, dependency_key=None)\n", + "Increment(channel=2, value=-51, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=40, dependency_key=None)\n", + "Increment(channel=1, value=68, dependency_key=None)\n", + "Increment(channel=2, value=-40, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=28, dependency_key=None)\n", + "Increment(channel=1, value=68, dependency_key=None)\n", + "Increment(channel=2, value=-28, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=14, dependency_key=None)\n", + "Increment(channel=1, value=65, dependency_key=None)\n", + "Increment(channel=2, value=-14, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=1, value=60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-14, dependency_key=None)\n", + "Increment(channel=1, value=51, dependency_key=None)\n", + "Increment(channel=2, value=14, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-28, dependency_key=None)\n", + "Increment(channel=1, value=40, dependency_key=None)\n", + "Increment(channel=2, value=28, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-40, dependency_key=None)\n", + "Increment(channel=1, value=28, dependency_key=None)\n", + "Increment(channel=2, value=40, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-51, dependency_key=None)\n", + "Increment(channel=1, value=14, dependency_key=None)\n", + "Increment(channel=2, value=51, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-60, dependency_key=None)\n", + "Increment(channel=2, value=60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-65, dependency_key=None)\n", + "Increment(channel=1, value=-14, dependency_key=None)\n", + "Increment(channel=2, value=65, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-2, dependency_key=None)\n", + "Increment(channel=1, value=-214, dependency_key=None)\n", + "Increment(channel=2, value=-30, dependency_key=None)\n", + "Wait(duration=15000000)\n", + "Increment(channel=0, value=-66, dependency_key=None)\n", + "Increment(channel=1, value=99, dependency_key=None)\n", + "Increment(channel=2, value=196, dependency_key=None)\n", + "Wait(duration=25000000)\n", + "Increment(channel=0, value=-131, dependency_key=None)\n", + "Increment(channel=1, value=-99, dependency_key=None)\n", + "Increment(channel=2, value=99, dependency_key=None)\n", + "Wait(duration=50000000)\n", + "Increment(channel=0, value=131, dependency_key=None)\n", + "Increment(channel=1, value=186, dependency_key=None)\n", + "Increment(channel=2, value=-197, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-68, dependency_key=None)\n", + "Increment(channel=1, value=-40, dependency_key=None)\n", + "Increment(channel=2, value=68, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-65, dependency_key=None)\n", + "Increment(channel=1, value=-51, dependency_key=None)\n", + "Increment(channel=2, value=65, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-60, dependency_key=None)\n", + "Increment(channel=1, value=-60, dependency_key=None)\n", + "Increment(channel=2, value=60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-51, dependency_key=None)\n", + "Increment(channel=1, value=-65, dependency_key=None)\n", + "Increment(channel=2, value=51, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-40, dependency_key=None)\n", + "Increment(channel=1, value=-68, dependency_key=None)\n", + "Increment(channel=2, value=40, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-28, dependency_key=None)\n", + "Increment(channel=1, value=-68, dependency_key=None)\n", + "Increment(channel=2, value=28, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-14, dependency_key=None)\n", + "Increment(channel=1, value=-65, dependency_key=None)\n", + "Increment(channel=2, value=14, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=1, value=-60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=14, dependency_key=None)\n", + "Increment(channel=1, value=-51, dependency_key=None)\n", + "Increment(channel=2, value=-14, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=28, dependency_key=None)\n", + "Increment(channel=1, value=-40, dependency_key=None)\n", + "Increment(channel=2, value=-28, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=40, dependency_key=None)\n", + "Increment(channel=1, value=-28, dependency_key=None)\n", + "Increment(channel=2, value=-40, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=51, dependency_key=None)\n", + "Increment(channel=1, value=-14, dependency_key=None)\n", + "Increment(channel=2, value=-51, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=60, dependency_key=None)\n", + "Increment(channel=2, value=-60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=65, dependency_key=None)\n", + "Increment(channel=1, value=14, dependency_key=None)\n", + "Increment(channel=2, value=-65, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=68, dependency_key=None)\n", + "Increment(channel=1, value=28, dependency_key=None)\n", + "Increment(channel=2, value=-68, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "LoopJmp(idx=6)\n", + "Increment(channel=0, value=68, dependency_key=None)\n", + "Increment(channel=1, value=40, dependency_key=None)\n", + "Increment(channel=2, value=-68, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=65, dependency_key=None)\n", + "Increment(channel=1, value=51, dependency_key=None)\n", + "Increment(channel=2, value=-65, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=60, dependency_key=None)\n", + "Increment(channel=1, value=60, dependency_key=None)\n", + "Increment(channel=2, value=-60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=51, dependency_key=None)\n", + "Increment(channel=1, value=65, dependency_key=None)\n", + "Increment(channel=2, value=-51, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=40, dependency_key=None)\n", + "Increment(channel=1, value=68, dependency_key=None)\n", + "Increment(channel=2, value=-40, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=28, dependency_key=None)\n", + "Increment(channel=1, value=68, dependency_key=None)\n", + "Increment(channel=2, value=-28, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=14, dependency_key=None)\n", + "Increment(channel=1, value=65, dependency_key=None)\n", + "Increment(channel=2, value=-14, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=1, value=60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-14, dependency_key=None)\n", + "Increment(channel=1, value=51, dependency_key=None)\n", + "Increment(channel=2, value=14, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-28, dependency_key=None)\n", + "Increment(channel=1, value=40, dependency_key=None)\n", + "Increment(channel=2, value=28, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-40, dependency_key=None)\n", + "Increment(channel=1, value=28, dependency_key=None)\n", + "Increment(channel=2, value=40, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-51, dependency_key=None)\n", + "Increment(channel=1, value=14, dependency_key=None)\n", + "Increment(channel=2, value=51, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-60, dependency_key=None)\n", + "Increment(channel=2, value=60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-65, dependency_key=None)\n", + "Increment(channel=1, value=-14, dependency_key=None)\n", + "Increment(channel=2, value=65, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-2, dependency_key=None)\n", + "Increment(channel=1, value=-214, dependency_key=None)\n", + "Increment(channel=2, value=-30, dependency_key=None)\n", + "Wait(duration=15000000)\n", + "Increment(channel=0, value=-66, dependency_key=None)\n", + "Increment(channel=1, value=99, dependency_key=None)\n", + "Increment(channel=2, value=196, dependency_key=None)\n", + "Wait(duration=25000000)\n", + "Increment(channel=0, value=-131, dependency_key=None)\n", + "Increment(channel=1, value=-99, dependency_key=None)\n", + "Increment(channel=2, value=99, dependency_key=None)\n", + "Wait(duration=50000000)\n", + "Increment(channel=0, value=131, dependency_key=None)\n", + "Increment(channel=1, value=186, dependency_key=None)\n", + "Increment(channel=2, value=-197, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-68, dependency_key=None)\n", + "Increment(channel=1, value=-40, dependency_key=None)\n", + "Increment(channel=2, value=68, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-65, dependency_key=None)\n", + "Increment(channel=1, value=-51, dependency_key=None)\n", + "Increment(channel=2, value=65, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-60, dependency_key=None)\n", + "Increment(channel=1, value=-60, dependency_key=None)\n", + "Increment(channel=2, value=60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-51, dependency_key=None)\n", + "Increment(channel=1, value=-65, dependency_key=None)\n", + "Increment(channel=2, value=51, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-40, dependency_key=None)\n", + "Increment(channel=1, value=-68, dependency_key=None)\n", + "Increment(channel=2, value=40, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-28, dependency_key=None)\n", + "Increment(channel=1, value=-68, dependency_key=None)\n", + "Increment(channel=2, value=28, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=-14, dependency_key=None)\n", + "Increment(channel=1, value=-65, dependency_key=None)\n", + "Increment(channel=2, value=14, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=1, value=-60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=14, dependency_key=None)\n", + "Increment(channel=1, value=-51, dependency_key=None)\n", + "Increment(channel=2, value=-14, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=28, dependency_key=None)\n", + "Increment(channel=1, value=-40, dependency_key=None)\n", + "Increment(channel=2, value=-28, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=40, dependency_key=None)\n", + "Increment(channel=1, value=-28, dependency_key=None)\n", + "Increment(channel=2, value=-40, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=51, dependency_key=None)\n", + "Increment(channel=1, value=-14, dependency_key=None)\n", + "Increment(channel=2, value=-51, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=60, dependency_key=None)\n", + "Increment(channel=2, value=-60, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=65, dependency_key=None)\n", + "Increment(channel=1, value=14, dependency_key=None)\n", + "Increment(channel=2, value=-65, dependency_key=None)\n", + "Wait(duration=5000000)\n", + "Increment(channel=0, value=101, dependency_key=None)\n", + "Increment(channel=1, value=345, dependency_key=None)\n", + "Increment(channel=2, value=-101, dependency_key=None)\n", + "Wait(duration=50000000)\n", + "Increment(channel=0, value=3, dependency_key=None)\n", + "Wait(duration=25000000)\n", + "Increment(channel=1, value=33, dependency_key=None)\n", + "Increment(channel=2, value=66, dependency_key=None)\n", + "Wait(duration=50000000)\n", + "Increment(channel=1, value=32, dependency_key=None)\n", + "Increment(channel=2, value=65, dependency_key=None)\n", + "Wait(duration=30000000)\n", + "*1:B0;M2;B1;M2;B2;M2;B3;M2;B4;M2;*2:X2050;A1545;P32800;A1538;P3;A1577;P32833;A1570;P3;A1609;P32865;A1602;P3;$15000;*3:X771;A1577;+-33;A1570;P3;A1609;+-65;A1602;P3;$25000;*4:X772;A1609;+-66;A1602;P3;$50000;*5:X773;A1545;+-33;A1538;P3;A1577;+-317;A1570;P3;A1609;+33;A1602;P3;$5000;*6:X774;A45057;P9;*7:A1545;+68;A1538;P3;A1577;+40;A1570;P3;A1609;+-68;A1602;P3;$5000;*8:X776;A1545;+65;A1538;P3;A1577;+51;A1570;P3;A1609;+-65;A1602;P3;$5000;*9:X777;A1545;+60;A1538;P3;A1577;+60;A1570;P3;A1609;+-60;A1602;P3;$5000;*10:X778;A1545;+51;A1538;P3;A1577;+65;A1570;P3;A1609;+-51;A1602;P3;$5000;*11:X779;A1545;+40;A1538;P3;A1577;+68;A1570;P3;A1609;+-40;A1602;P3;$5000;*12:X780;A1545;+28;A1538;P3;A1577;+68;A1570;P3;A1609;+-28;A1602;P3;$5000;*13:X781;A1545;+14;A1538;P3;A1577;+65;A1570;P3;A1609;+-14;A1602;P3;$5000;*14:X782;A1577;+60;A1570;P3;$5000;*15:X783;A1545;+-14;A1538;P3;A1577;+51;A1570;P3;A1609;+14;A1602;P3;$5000;*16:X784;A1545;+-28;A1538;P3;A1577;+40;A1570;P3;A1609;+28;A1602;P3;$5000;*17:X785;A1545;+-40;A1538;P3;A1577;+28;A1570;P3;A1609;+40;A1602;P3;$5000;*18:X786;A1545;+-51;A1538;P3;A1577;+14;A1570;P3;A1609;+51;A1602;P3;$5000;*19:X787;A1545;+-60;A1538;P3;A1609;+60;A1602;P3;$5000;*20:X788;A1545;+-65;A1538;P3;A1577;+-14;A1570;P3;A1609;+65;A1602;P3;$5000;*21:X789;A1545;+-2;A1538;P3;A1577;+-214;A1570;P3;A1609;+-30;A1602;P3;$15000;*22:X790;A1545;+-66;A1538;P3;A1577;+99;A1570;P3;A1609;+196;A1602;P3;$25000;*23:X791;A1545;+-131;A1538;P3;A1577;+-99;A1570;P3;A1609;+99;A1602;P3;$50000;*24:X792;A1545;+131;A1538;P3;A1577;+186;A1570;P3;A1609;+-197;A1602;P3;$5000;*25:X793;A1545;+-68;A1538;P3;A1577;+-40;A1570;P3;A1609;+68;A1602;P3;$5000;*26:X794;A1545;+-65;A1538;P3;A1577;+-51;A1570;P3;A1609;+65;A1602;P3;$5000;*27:X795;A1545;+-60;A1538;P3;A1577;+-60;A1570;P3;A1609;+60;A1602;P3;$5000;*28:X796;A1545;+-51;A1538;P3;A1577;+-65;A1570;P3;A1609;+51;A1602;P3;$5000;*29:X797;A1545;+-40;A1538;P3;A1577;+-68;A1570;P3;A1609;+40;A1602;P3;$5000;*30:X798;A1545;+-28;A1538;P3;A1577;+-68;A1570;P3;A1609;+28;A1602;P3;$5000;*31:X799;A1545;+-14;A1538;P3;A1577;+-65;A1570;P3;A1609;+14;A1602;P3;$5000;*32:X800;A1577;+-60;A1570;P3;$5000;*33:X801;A1545;+14;A1538;P3;A1577;+-51;A1570;P3;A1609;+-14;A1602;P3;$5000;*34:X802;A1545;+28;A1538;P3;A1577;+-40;A1570;P3;A1609;+-28;A1602;P3;$5000;*35:X803;A1545;+40;A1538;P3;A1577;+-28;A1570;P3;A1609;+-40;A1602;P3;$5000;*36:X804;A1545;+51;A1538;P3;A1577;+-14;A1570;P3;A1609;+-51;A1602;P3;$5000;*37:X805;A1545;+60;A1538;P3;A1609;+-60;A1602;P3;$5000;*38:X806;A1545;+65;A1538;P3;A1577;+14;A1570;P3;A1609;+-65;A1602;P3;$5000;*39:X807;A1545;+68;A1538;P3;A1577;+28;A1570;P3;A1609;+-68;A1602;P3;$5000;*40:X808;A45057;+-1;X1287;A1545;+68;A1538;P3;A1577;+40;A1570;P3;A1609;+-68;A1602;P3;$5000;*41:X809;A1545;+65;A1538;P3;A1577;+51;A1570;P3;A1609;+-65;A1602;P3;$5000;*42:X810;A1545;+60;A1538;P3;A1577;+60;A1570;P3;A1609;+-60;A1602;P3;$5000;*43:X811;A1545;+51;A1538;P3;A1577;+65;A1570;P3;A1609;+-51;A1602;P3;$5000;*44:X812;A1545;+40;A1538;P3;A1577;+68;A1570;P3;A1609;+-40;A1602;P3;$5000;*45:X813;A1545;+28;A1538;P3;A1577;+68;A1570;P3;A1609;+-28;A1602;P3;$5000;*46:X814;A1545;+14;A1538;P3;A1577;+65;A1570;P3;A1609;+-14;A1602;P3;$5000;*47:X815;A1577;+60;A1570;P3;$5000;*48:X816;A1545;+-14;A1538;P3;A1577;+51;A1570;P3;A1609;+14;A1602;P3;$5000;*49:X817;A1545;+-28;A1538;P3;A1577;+40;A1570;P3;A1609;+28;A1602;P3;$5000;*50:X818;A1545;+-40;A1538;P3;A1577;+28;A1570;P3;A1609;+40;A1602;P3;$5000;*51:X819;A1545;+-51;A1538;P3;A1577;+14;A1570;P3;A1609;+51;A1602;P3;$5000;*52:X820;A1545;+-60;A1538;P3;A1609;+60;A1602;P3;$5000;*53:X821;A1545;+-65;A1538;P3;A1577;+-14;A1570;P3;A1609;+65;A1602;P3;$5000;*54:X822;A1545;+-2;A1538;P3;A1577;+-214;A1570;P3;A1609;+-30;A1602;P3;$15000;*55:X823;A1545;+-66;A1538;P3;A1577;+99;A1570;P3;A1609;+196;A1602;P3;$25000;*56:X824;A1545;+-131;A1538;P3;A1577;+-99;A1570;P3;A1609;+99;A1602;P3;$50000;*57:X825;A1545;+131;A1538;P3;A1577;+186;A1570;P3;A1609;+-197;A1602;P3;$5000;*58:X826;A1545;+-68;A1538;P3;A1577;+-40;A1570;P3;A1609;+68;A1602;P3;$5000;*59:X827;A1545;+-65;A1538;P3;A1577;+-51;A1570;P3;A1609;+65;A1602;P3;$5000;*60:X828;A1545;+-60;A1538;P3;A1577;+-60;A1570;P3;A1609;+60;A1602;P3;$5000;*61:X829;A1545;+-51;A1538;P3;A1577;+-65;A1570;P3;A1609;+51;A1602;P3;$5000;*62:X830;A1545;+-40;A1538;P3;A1577;+-68;A1570;P3;A1609;+40;A1602;P3;$5000;*63:X831;A1545;+-28;A1538;P3;A1577;+-68;A1570;P3;A1609;+28;A1602;P3;$5000;*64:X832;A1545;+-14;A1538;P3;A1577;+-65;A1570;P3;A1609;+14;A1602;P3;$5000;*65:X833;A1577;+-60;A1570;P3;$5000;*66:X834;A1545;+14;A1538;P3;A1577;+-51;A1570;P3;A1609;+-14;A1602;P3;$5000;*67:X835;A1545;+28;A1538;P3;A1577;+-40;A1570;P3;A1609;+-28;A1602;P3;$5000;*68:X836;A1545;+40;A1538;P3;A1577;+-28;A1570;P3;A1609;+-40;A1602;P3;$5000;*69:X837;A1545;+51;A1538;P3;A1577;+-14;A1570;P3;A1609;+-51;A1602;P3;$5000;*70:X838;A1545;+60;A1538;P3;A1609;+-60;A1602;P3;$5000;*71:X839;A1545;+65;A1538;P3;A1577;+14;A1570;P3;A1609;+-65;A1602;P3;$5000;*72:X840;A1545;+101;A1538;P3;A1577;+345;A1570;P3;A1609;+-101;A1602;P3;$50000;*73:X841;A1545;+3;A1538;P3;$25000;*74:X842;A1577;+33;A1570;P3;A1609;+66;A1602;P3;$50000;*75:X843;A1577;+32;A1570;P3;A1609;+65;A1602;P3;$30000;*76:X844;X0;\n" ] } ], "source": [ - "%debug" + "DecaDACRep.upload_numpy_pulse(numpy_pulse=simple_numpy_pulse.T, dt=5e+6, channel_mapping={0:0, 1:2, 2:4})" ] }, { "cell_type": "code", - "execution_count": 1739, - "id": "bdfcb758", + "execution_count": 1755, + "id": "d2ef28cd", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ - "*1:B0;M2;B1;M2;B2;M2;B3;M2;B4;M2;*2:X2050;A1545;P32800;A1538;P3;A1577;P32833;A1570;P3;A1609;P32865;A1602;P3;$15000;*3:X771;A1577;+-33;A1570;P3;A1609;+-65;A1602;P3;$25000;*4:X772;A1609;+-66;A1602;P3;$50000;*5:X773;A1545;+-33;A1538;P3;A1577;+-317;A1570;P3;A1609;+33;A1602;P3;$5000;*6:X774;A45057;P9;*7:A1545;+68;A1538;P3;A1577;+40;A1570;P3;A1609;+-68;A1602;P3;$5000;*8:X776;A1545;+65;A1538;P3;A1577;+51;A1570;P3;A1609;+-65;A1602;P3;$5000;*9:X777;A1545;+60;A1538;P3;A1577;+60;A1570;P3;A1609;+-60;A1602;P3;$5000;*10:X778;A1545;+51;A1538;P3;A1577;+65;A1570;P3;A1609;+-51;A1602;P3;$5000;*11:X779;A1545;+40;A1538;P3;A1577;+68;A1570;P3;A1609;+-40;A1602;P3;$5000;*12:X780;A1545;+28;A1538;P3;A1577;+68;A1570;P3;A1609;+-28;A1602;P3;$5000;*13:X781;A1545;+14;A1538;P3;A1577;+65;A1570;P3;A1609;+-14;A1602;P3;$5000;*14:X782;A1577;+60;A1570;P3;$5000;*15:X783;A1545;+-14;A1538;P3;A1577;+51;A1570;P3;A1609;+14;A1602;P3;$5000;*16:X784;A1545;+-28;A1538;P3;A1577;+40;A1570;P3;A1609;+28;A1602;P3;$5000;*17:X785;A1545;+-40;A1538;P3;A1577;+28;A1570;P3;A1609;+40;A1602;P3;$5000;*18:X786;A1545;+-51;A1538;P3;A1577;+14;A1570;P3;A1609;+51;A1602;P3;$5000;*19:X787;A1545;+-60;A1538;P3;A1609;+60;A1602;P3;$5000;*20:X788;A1545;+-65;A1538;P3;A1577;+-14;A1570;P3;A1609;+65;A1602;P3;$5000;*21:X789;A1545;+-2;A1538;P3;A1577;+-214;A1570;P3;A1609;+-30;A1602;P3;$15000;*22:X790;A1545;+-66;A1538;P3;A1577;+99;A1570;P3;A1609;+196;A1602;P3;$25000;*23:X791;A1545;+-131;A1538;P3;A1577;+-99;A1570;P3;A1609;+99;A1602;P3;$50000;*24:X792;A1545;+131;A1538;P3;A1577;+186;A1570;P3;A1609;+-197;A1602;P3;$5000;*25:X793;A1545;+-68;A1538;P3;A1577;+-40;A1570;P3;A1609;+68;A1602;P3;$5000;*26:X794;A1545;+-65;A1538;P3;A1577;+-51;A1570;P3;A1609;+65;A1602;P3;$5000;*27:X795;A1545;+-60;A1538;P3;A1577;+-60;A1570;P3;A1609;+60;A1602;P3;$5000;*28:X796;A1545;+-51;A1538;P3;A1577;+-65;A1570;P3;A1609;+51;A1602;P3;$5000;*29:X797;A1545;+-40;A1538;P3;A1577;+-68;A1570;P3;A1609;+40;A1602;P3;$5000;*30:X798;A1545;+-28;A1538;P3;A1577;+-68;A1570;P3;A1609;+28;A1602;P3;$5000;*31:X799;A1545;+-14;A1538;P3;A1577;+-65;A1570;P3;A1609;+14;A1602;P3;$5000;*32:X800;A1577;+-60;A1570;P3;$5000;*33:X801;A1545;+14;A1538;P3;A1577;+-51;A1570;P3;A1609;+-14;A1602;P3;$5000;*34:X802;A1545;+28;A1538;P3;A1577;+-40;A1570;P3;A1609;+-28;A1602;P3;$5000;*35:X803;A1545;+40;A1538;P3;A1577;+-28;A1570;P3;A1609;+-40;A1602;P3;$5000;*36:X804;A1545;+51;A1538;P3;A1577;+-14;A1570;P3;A1609;+-51;A1602;P3;$5000;*37:X805;A1545;+60;A1538;P3;A1609;+-60;A1602;P3;$5000;*38:X806;A1545;+65;A1538;P3;A1577;+14;A1570;P3;A1609;+-65;A1602;P3;$5000;*39:X807;A1545;+68;A1538;P3;A1577;+28;A1570;P3;A1609;+-68;A1602;P3;$5000;*40:X808;A45057;+-1;X1287;A1545;+68;A1538;P3;A1577;+40;A1570;P3;A1609;+-68;A1602;P3;$5000;*41:X809;A1545;+65;A1538;P3;A1577;+51;A1570;P3;A1609;+-65;A1602;P3;$5000;*42:X810;A1545;+60;A1538;P3;A1577;+60;A1570;P3;A1609;+-60;A1602;P3;$5000;*43:X811;A1545;+51;A1538;P3;A1577;+65;A1570;P3;A1609;+-51;A1602;P3;$5000;*44:X812;A1545;+40;A1538;P3;A1577;+68;A1570;P3;A1609;+-40;A1602;P3;$5000;*45:X813;A1545;+28;A1538;P3;A1577;+68;A1570;P3;A1609;+-28;A1602;P3;$5000;*46:X814;A1545;+14;A1538;P3;A1577;+65;A1570;P3;A1609;+-14;A1602;P3;$5000;*47:X815;A1577;+60;A1570;P3;$5000;*48:X816;A1545;+-14;A1538;P3;A1577;+51;A1570;P3;A1609;+14;A1602;P3;$5000;*49:X817;A1545;+-28;A1538;P3;A1577;+40;A1570;P3;A1609;+28;A1602;P3;$5000;*50:X818;A1545;+-40;A1538;P3;A1577;+28;A1570;P3;A1609;+40;A1602;P3;$5000;*51:X819;A1545;+-51;A1538;P3;A1577;+14;A1570;P3;A1609;+51;A1602;P3;$5000;*52:X820;A1545;+-60;A1538;P3;A1609;+60;A1602;P3;$5000;*53:X821;A1545;+-65;A1538;P3;A1577;+-14;A1570;P3;A1609;+65;A1602;P3;$5000;*54:X822;A1545;+-2;A1538;P3;A1577;+-214;A1570;P3;A1609;+-30;A1602;P3;$15000;*55:X823;A1545;+-66;A1538;P3;A1577;+99;A1570;P3;A1609;+196;A1602;P3;$25000;*56:X824;A1545;+-131;A1538;P3;A1577;+-99;A1570;P3;A1609;+99;A1602;P3;$50000;*57:X825;A1545;+131;A1538;P3;A1577;+186;A1570;P3;A1609;+-197;A1602;P3;$5000;*58:X826;A1545;+-68;A1538;P3;A1577;+-40;A1570;P3;A1609;+68;A1602;P3;$5000;*59:X827;A1545;+-65;A1538;P3;A1577;+-51;A1570;P3;A1609;+65;A1602;P3;$5000;*60:X828;A1545;+-60;A1538;P3;A1577;+-60;A1570;P3;A1609;+60;A1602;P3;$5000;*61:X829;A1545;+-51;A1538;P3;A1577;+-65;A1570;P3;A1609;+51;A1602;P3;$5000;*62:X830;A1545;+-40;A1538;P3;A1577;+-68;A1570;P3;A1609;+40;A1602;P3;$5000;*63:X831;A1545;+-28;A1538;P3;A1577;+-68;A1570;P3;A1609;+28;A1602;P3;$5000;*64:X832;A1545;+-14;A1538;P3;A1577;+-65;A1570;P3;A1609;+14;A1602;P3;$5000;*65:X833;A1577;+-60;A1570;P3;$5000;*66:X834;A1545;+14;A1538;P3;A1577;+-51;A1570;P3;A1609;+-14;A1602;P3;$5000;*67:X835;A1545;+28;A1538;P3;A1577;+-40;A1570;P3;A1609;+-28;A1602;P3;$5000;*68:X836;A1545;+40;A1538;P3;A1577;+-28;A1570;P3;A1609;+-40;A1602;P3;$5000;*69:X837;A1545;+51;A1538;P3;A1577;+-14;A1570;P3;A1609;+-51;A1602;P3;$5000;*70:X838;A1545;+60;A1538;P3;A1609;+-60;A1602;P3;$5000;*71:X839;A1545;+65;A1538;P3;A1577;+14;A1570;P3;A1609;+-65;A1602;P3;$5000;*72:X840;A1545;+101;A1538;P3;A1577;+345;A1570;P3;A1609;+-101;A1602;P3;$50000;*73:X841;A1545;+3;A1538;P3;$25000;*74:X842;A1577;+33;A1570;P3;A1609;+66;A1602;P3;$50000;*75:X843;A1577;+32;A1570;P3;A1609;+65;A1602;P3;$30000;*76:X844;X0;\n" + "> \u001b[1;32m\\\\janeway\\user ag bluhm\\surrey\\git\\qupulse\\qupulse\\hardware\\awgs\\decadac.py\u001b[0m(304)\u001b[0;36mgenerate_linspace_commands_from_nparray_using_LZ77\u001b[1;34m()\u001b[0m\n", + "\u001b[1;32m 302 \u001b[1;33m \u001b[0mdiff_sets\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m-\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdt\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m1\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[1;32m 303 \u001b[1;33m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[1;32m--> 304 \u001b[1;33m \u001b[1;31m# calculate the LZ77 compression\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[1;32m 305 \u001b[1;33m \u001b[0mcomp\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mcompress_array_LZ77\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0marray\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mdiff_sets\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mallow_intermediates\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0musing_diffs\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mallow_reconstructions_using_reconstructions\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;32mFalse\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[0m\u001b[1;32m 306 \u001b[1;33m \u001b[0mprint\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mcomp\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", + "\u001b[0m\n", + "((529,), (529, 2))\n" ] } ], "source": [ - "DecaDACRep.upload_numpy_pulse(numpy_pulse=simple_numpy_pulse.T, dt=5e+6, channel_mapping={0:0, 1:2, 2:4})" + "%debug" ] }, { @@ -2945,7 +3222,7 @@ }, { "cell_type": "code", - "execution_count": 1740, + "execution_count": 1770, "id": "d13bc855", "metadata": {}, "outputs": [ @@ -2956,8 +3233,8 @@ "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mVisaIOError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[1;32mIn[1740], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m _ \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m10\u001b[39m):\n\u001b[1;32m----> 2\u001b[0m \u001b[43mDecaDACRep\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marm\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 3\u001b[0m time\u001b[38;5;241m.\u001b[39msleep(\u001b[38;5;241m20\u001b[39m)\n", - "File \u001b[1;32m\\\\Janeway\\User AG Bluhm\\Surrey\\git\\qupulse\\qupulse\\hardware\\awgs\\decadac.py:323\u001b[0m, in \u001b[0;36mDecaDACRepresentation.arm\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 322\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21marm\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m--> 323\u001b[0m \t\u001b[43mrun_script\u001b[49m\u001b[43m(\u001b[49m\u001b[43mserial_ask\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mserial_ask\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlabel\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n", + "Cell \u001b[1;32mIn[1770], line 2\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m _ \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m10\u001b[39m):\n\u001b[1;32m----> 2\u001b[0m \u001b[43mDecaDACRep\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43marm\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 3\u001b[0m time\u001b[38;5;241m.\u001b[39msleep(\u001b[38;5;241m20\u001b[39m)\n", + "File \u001b[1;32m\\\\Janeway\\User AG Bluhm\\Surrey\\git\\qupulse\\qupulse\\hardware\\awgs\\decadac.py:362\u001b[0m, in \u001b[0;36mDecaDACRepresentation.arm\u001b[1;34m(self)\u001b[0m\n\u001b[0;32m 361\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21marm\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m--> 362\u001b[0m \t\u001b[43mrun_script\u001b[49m\u001b[43m(\u001b[49m\u001b[43mserial_ask\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mserial_ask\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mlabel\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m)\u001b[49m\n", "File \u001b[1;32m\\\\Janeway\\User AG Bluhm\\Surrey\\git\\qupulse\\qupulse\\hardware\\awgs\\decadac.py:120\u001b[0m, in \u001b[0;36mrun_script\u001b[1;34m(serial_ask, label)\u001b[0m\n\u001b[0;32m 118\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mrun_script\u001b[39m(serial_ask, label:\u001b[38;5;28mint\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m1\u001b[39m):\n\u001b[1;32m--> 120\u001b[0m \tresp \u001b[38;5;241m=\u001b[39m \u001b[43mserial_ask\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43mf\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mX\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mlabel\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m;\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[0;32m 122\u001b[0m \t\u001b[38;5;28;01mreturn\u001b[39;00m resp\n", "File \u001b[1;32m\\\\Janeway\\User AG Bluhm\\Surrey\\git\\Qcodes\\qcodes\\instrument\\visa.py:235\u001b[0m, in \u001b[0;36mVisaInstrument.ask_raw\u001b[1;34m(self, cmd)\u001b[0m\n\u001b[0;32m 233\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m DelayedKeyboardInterrupt():\n\u001b[0;32m 234\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mvisa_log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mQuerying: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mcmd\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m--> 235\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mvisa_handle\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mquery\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcmd\u001b[49m\u001b[43m)\u001b[49m\n\u001b[0;32m 236\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mvisa_log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mResponse: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00mresponse\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 237\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m response\n", "File \u001b[1;32mc:\\Users\\Surrey\\Miniconda3\\envs\\ml4qworkshop\\lib\\site-packages\\pyvisa\\resources\\messagebased.py:644\u001b[0m, in \u001b[0;36mMessageBasedResource.query\u001b[1;34m(self, message, delay)\u001b[0m\n\u001b[0;32m 641\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m delay \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0.0\u001b[39m:\n\u001b[0;32m 642\u001b[0m time\u001b[38;5;241m.\u001b[39msleep(delay)\n\u001b[1;32m--> 644\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mread\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", @@ -2978,11 +3255,13 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1761, "id": "3220f600", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "for c in dac.channels: c.volt(0)" + ] }, { "cell_type": "code", diff --git a/qupulse/hardware/awgs/decadac.py b/qupulse/hardware/awgs/decadac.py index 7730622c..26d8d885 100644 --- a/qupulse/hardware/awgs/decadac.py +++ b/qupulse/hardware/awgs/decadac.py @@ -132,6 +132,10 @@ def LZ77_to_linspace_commands(lz77_compressed, dt=1e+5) -> List[Command]: print_intermediate_programs = False print_index_calculations = False + if isinstance(dt, (int, float)): + dt = np.ones(len(lz77_compressed))*dt + assert len(dt) == len(lz77_compressed) + loop_indecies = range(int(10_000_000_000_000)).__iter__() commands = [] @@ -145,7 +149,7 @@ def LZ77_to_linspace_commands(lz77_compressed, dt=1e+5) -> List[Command]: for i, a in enumerate(v): if a != 0: commands[-1].append(Increment(i, a, None)) - commands[-1].append(Wait(dt)) + commands[-1].append(Wait(dt[s])) if d != 0: lx = next(loop_indecies) r = d//o @@ -279,18 +283,45 @@ def generate_linspace_commands_from_nparray_using_LZ77(array:np.ndarray, dt:floa assert len(array.shape) == 2 assert array.shape[1] <= 20, "The last dimension should be the channel dimension. And our DecaDACs have only 20 channel." + if isinstance(dt, (float, int)): + dt = np.ones(array.shape[0])*dt + assert len(dt.shape) == 1 + assert dt.shape[0] == array.shape[0] + dt = dt.astype(int) + # translate the values into DecaDAC values array = volt_to_int(array).astype(int) + # add a time axis + timed_array = np.concatenate([dt[:, None], array], axis=1) + timed_array = timed_array.astype(int) + assert len(timed_array.shape) == 2 + assert timed_array.shape == (array.shape[0], array.shape[1]+1) + + # split off the first sets: + first_sets = timed_array[0, 1:] + diff_sets = np.diff(timed_array[:, :], axis=0) + diff_sets[:, 0] = dt[1:] + # calculate the LZ77 compression - comp = compress_array_LZ77(array=array, allow_intermediates=False, using_diffs=True, allow_reconstructions_using_reconstructions=False) + comp = compress_array_LZ77(array=diff_sets, allow_intermediates=False, using_diffs=False, allow_reconstructions_using_reconstructions=False) + + # splitting of the time axis + complz77 = [(o, d, (v[1:] if v is not None else None)) for o, d, v in comp] + compdt = [(v[0] if v is not None else 0) for o, d, v in comp] # generate the list of commands - comm = LZ77_to_linspace_commands(comp, dt=dt) + comm = LZ77_to_linspace_commands(complz77, dt=compdt) + + # adding the first Set commands and the first wait to the top of the command list + to_append = [ + _Set(channel=i, value=v, key=None) + for i, v in enumerate(first_sets) + ] + [Wait(dt[0])] + comm = to_append + comm # reduce unnecessary commands comm = reduce_commands(comm) - return comm class DecaDACRepresentation: @@ -303,19 +334,10 @@ def upload_command_list(self, commands:List[Command], channel_mapping:Union[Dict print(ascii_script) resp = upload_script(script=f"{{{ascii_script}}};", serial_ask=self.serial_ask) - def upload_numpy_pulse(self, numpy_pulse:np.ndarray, dt:float, channel_mapping:Union[Dict[int, int], None]=None, volt_in_dac_basis:bool=False): - - assert not volt_in_dac_basis, "That should not be implemented." + def upload_numpy_pulse(self, numpy_pulse:np.ndarray, dt:float, channel_mapping:Union[Dict[int, int], None]=None): comm = generate_linspace_commands_from_nparray_using_LZ77(numpy_pulse, dt=dt) - # translate the first Increments for each channel to Set commands. - updated_channels = [] - for i, c in enumerate(comm): - if c.__class__.__name__ == "Increment" and c.channel not in updated_channels: - comm[i] = _Set(channel=c.channel, value=c.value, key=c.dependency_key) - updated_channels.append(c.channel) - self.upload_command_list(commands=comm, channel_mapping=channel_mapping, volt_in_dac_basis=True)