Skip to content

Commit

Permalink
Merge branch 'master' into param_mapping_class
Browse files Browse the repository at this point in the history
  • Loading branch information
lumip committed Jul 8, 2016
2 parents d09169e + 09075e4 commit b244d95
Show file tree
Hide file tree
Showing 23 changed files with 905 additions and 331 deletions.
1 change: 0 additions & 1 deletion .travis.yml
@@ -1,6 +1,5 @@
language: python
python:
- "3.3"
- "3.4"
- "3.5"

Expand Down
13 changes: 11 additions & 2 deletions doc/source/examples/00SimpleTablePulse.ipynb
Expand Up @@ -894,7 +894,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{'va', 'ta', 'tb', 'tend', 'vb'}\n"
"{'tb', 'ta', 'va', 'vb', 'tend'}\n"
]
}
],
Expand Down Expand Up @@ -2503,6 +2503,15 @@
" 'tend': 8}\n",
"plot(param_template, parameters, sample_rate=100)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -2521,7 +2530,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
13 changes: 11 additions & 2 deletions doc/source/examples/01SequencePulse.ipynb
Expand Up @@ -82,7 +82,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"frozenset({'tend', 'va', 'ta', 'tc', 'vb', 'tb', 'td'})\n"
"frozenset({'tend', 'ta', 'tc', 'vb', 'va', 'td', 'tb'})\n"
]
}
],
Expand Down Expand Up @@ -897,6 +897,15 @@
" 'tend': 6}\n",
"plot(sequence, parameters, sample_rate=100)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -915,7 +924,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
11 changes: 10 additions & 1 deletion doc/source/examples/02FunctionPulse.ipynb
Expand Up @@ -1608,6 +1608,15 @@
"\n",
"plot(param_template, {'lambda': 4, 'phi': 8, 'duration': 4*3.1415}, sample_rate=100)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -1626,7 +1635,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
11 changes: 10 additions & 1 deletion doc/source/examples/03Serialization.ipynb
Expand Up @@ -927,6 +927,15 @@
"from qctoolkit.serialization import CachingBackend\n",
"cached_serializer = Serializer(CachingBackend(FilesystemBackend(\"./serialized_pulses\")))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -945,7 +954,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
17 changes: 13 additions & 4 deletions doc/source/examples/04Sequencing.ipynb
Expand Up @@ -845,7 +845,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[<qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007D6CB00>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007EDC9B0>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x0000000007EDC550>]\n"
"[<qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007721BE0>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x00000000077218D0>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x00000000077219E8>]\n"
]
}
],
Expand All @@ -855,8 +855,8 @@
"sequencer = Sequencer()\n",
"\n",
"sequencer.push(sequence_template, {'lambda': 4, 'phi': 8, 'duration': 4*3.1415, 'ta': 1, 'va': 2})\n",
"instruction_sequence = sequencer.build()\n",
"print(instruction_sequence)"
"instruction_block = sequencer.build()\n",
"print([instruction for instruction in instruction_block])"
]
},
{
Expand Down Expand Up @@ -884,6 +884,15 @@
"The latter two will only be generated when hardware-based conditional branching is used in `LoopPulseTemplate` and `BranchPulseTemplate`. This was the main motivator for the usage of such an instruction sequence rather than just compling one large waveform.\n",
"Using only the `PulseTemplate`s discussed so far, only `EXECInstruction`s and a final `STOPInstruction` will be output by the `Sequencer`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -902,7 +911,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
23 changes: 16 additions & 7 deletions doc/source/examples/05Parameters.ipynb
Expand Up @@ -924,13 +924,13 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[<qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007D381D0>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007D382B0>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x0000000007D38390>]\n"
"[<qctoolkit.pulses.instructions.EXECInstruction object at 0x000000000772A400>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x000000000772A470>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x000000000772A3C8>]\n"
]
}
],
"source": [
"first_sequence = sequencer.build()\n",
"print(first_sequence)"
"first_block = sequencer.build()\n",
"print([instruction for instruction in first_block])"
]
},
{
Expand All @@ -951,14 +951,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[<qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007D381D0>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007D382B0>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007D38908>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007D38898>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x0000000007D38940>]\n"
"[<qctoolkit.pulses.instructions.EXECInstruction object at 0x000000000772A400>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x000000000772A470>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x000000000772A630>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x000000000772A6A0>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x000000000772A5F8>]\n"
]
}
],
"source": [
"measurement_manager.is_available = True\n",
"second_sequence = sequencer.build()\n",
"print(second_sequence)"
"second_block = sequencer.build()\n",
"print([instruction for instruction in second_block])"
]
},
{
Expand All @@ -968,6 +968,15 @@
"We have now obtained the complete sequence with one execution instruction for each `TablePulseTemplate`.\n",
"*Attention/Broken: Currently this is incorrect behavior: We would want to only get the remainder of the pulse in the second call since we wouldn't want to execute the first part of the pulse again. Needs fixing ([issue 105](https://github.com/qutech/qc-toolkit/issues/105)).*"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -986,7 +995,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
19 changes: 14 additions & 5 deletions doc/source/examples/06ConditionalExecution.ipynb
Expand Up @@ -62,7 +62,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[<qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007870C50>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007870DA0>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007870E10>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007870E80>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x0000000007870EF0>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x0000000007870F28>]\n"
"[<qctoolkit.pulses.instructions.EXECInstruction object at 0x00000000077A60F0>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x00000000077A6240>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x00000000077A62B0>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x00000000077A6320>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x00000000077A6390>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x00000000077A61D0>]\n"
]
}
],
Expand All @@ -76,7 +76,7 @@
"parameters = {}\n",
"s.push(loop_template, parameters, conditions)\n",
"instructions = s.build()\n",
"print(instructions)"
"print([instruction for instruction in instructions])"
]
},
{
Expand Down Expand Up @@ -107,7 +107,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[<qctoolkit.pulses.instructions.CJMPInstruction object at 0x000000000787F080>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x000000000787F160>, <qctoolkit.pulses.instructions.EXECInstruction object at 0x000000000787F128>, <qctoolkit.pulses.instructions.GOTOInstruction object at 0x000000000787F1D0>]\n"
"[<qctoolkit.pulses.instructions.CJMPInstruction object at 0x00000000077A66D8>, <qctoolkit.pulses.instructions.STOPInstruction object at 0x00000000077A61D0>]\n"
]
}
],
Expand All @@ -124,7 +124,7 @@
"parameters = {}\n",
"s.push(loop_template, parameters, conditions)\n",
"instructions = s.build()\n",
"print(instructions)"
"print([instruction for instruction in instructions])"
]
},
{
Expand All @@ -133,6 +133,15 @@
"source": [
"As you can see in the output, the sequencing process now procudes instructions that perform conditional jumps and returns with goto instructions. The details are omitted here, suffice it to say that the trigger is embedded in the conditional jump instruction and this sequence will loop on the hardware as long as the trigger fires."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
Expand All @@ -151,7 +160,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.4"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion doc/source/examples/07PulseControl.ipynb
Expand Up @@ -33,7 +33,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
"version": "3.5.1"
}
},
"nbformat": 4,
Expand Down

0 comments on commit b244d95

Please sign in to comment.