diff --git a/docs/_build/doctrees/autodoc/base_pulse.doctree b/docs/_build/doctrees/autodoc/base_pulse.doctree new file mode 100644 index 0000000000000000000000000000000000000000..bf28d537a5c39cf09f5904154909fe9ec7ace1e6 Binary files /dev/null and b/docs/_build/doctrees/autodoc/base_pulse.doctree differ diff --git a/docs/_build/doctrees/autodoc/segment.doctree b/docs/_build/doctrees/autodoc/segment.doctree new file mode 100644 index 0000000000000000000000000000000000000000..7a3e8f1c4ad9336014e78c966e4bde96c922bf94 Binary files /dev/null and b/docs/_build/doctrees/autodoc/segment.doctree differ diff --git a/docs/_build/doctrees/autodoc/segment_IQ.doctree b/docs/_build/doctrees/autodoc/segment_IQ.doctree new file mode 100644 index 0000000000000000000000000000000000000000..c214c81ede41ee9ea9c3ec4cce9e5d592794ad01 Binary files /dev/null and b/docs/_build/doctrees/autodoc/segment_IQ.doctree differ diff --git a/docs/_build/doctrees/autodoc/segment_base.doctree b/docs/_build/doctrees/autodoc/segment_base.doctree new file mode 100644 index 0000000000000000000000000000000000000000..5bdffb0119b065da8c3ab233d506fd144b9211b2 Binary files /dev/null and b/docs/_build/doctrees/autodoc/segment_base.doctree differ diff --git a/docs/_build/doctrees/channel_delays.doctree b/docs/_build/doctrees/channel_delays.doctree new file mode 100644 index 0000000000000000000000000000000000000000..44ab6164e353479c5f3f0b44bf22b3c83b91c85d Binary files /dev/null and b/docs/_build/doctrees/channel_delays.doctree differ diff --git a/docs/_build/doctrees/environment.pickle b/docs/_build/doctrees/environment.pickle index 41fb4bdbf64442396d4c8615f4771afd27e77014..6f0221542d2986c3410f7ce53c2bfa05355c59a6 100644 Binary files a/docs/_build/doctrees/environment.pickle and b/docs/_build/doctrees/environment.pickle differ diff --git a/docs/_build/doctrees/struct.doctree b/docs/_build/doctrees/struct.doctree index 16826207b3dd3d99fbcd811b9ad1a39c68d2d930..980219714ca1bb164047ee6b06c9cd18e2cbfdaf 100644 Binary files a/docs/_build/doctrees/struct.doctree and b/docs/_build/doctrees/struct.doctree differ diff --git a/docs/_build/doctrees/tutorials/init_lib.doctree b/docs/_build/doctrees/tutorials/init_lib.doctree index 49d18348bdc45ed8fc1174c927eab9b29a01637c..d23b3b17e3b93106ca0e5fa7e42a2b8005d3ecee 100644 Binary files a/docs/_build/doctrees/tutorials/init_lib.doctree and b/docs/_build/doctrees/tutorials/init_lib.doctree differ diff --git a/docs/_build/doctrees/tutorials/simple_pulse.doctree b/docs/_build/doctrees/tutorials/simple_pulse.doctree index 6286fde0ccd54bd9aa298126e7eca85ef92e52b0..b7afbaadf5a5cef72482b4db3ea58a64e1dc8323 100644 Binary files a/docs/_build/doctrees/tutorials/simple_pulse.doctree and b/docs/_build/doctrees/tutorials/simple_pulse.doctree differ diff --git a/docs/_build/html/_images/channel_delays.png b/docs/_build/html/_images/channel_delays.png new file mode 100644 index 0000000000000000000000000000000000000000..63f13cdc97dd471adff1ff89e642e0cfd3d3ef56 Binary files /dev/null and b/docs/_build/html/_images/channel_delays.png differ diff --git a/docs/_build/html/_modules/base_pulse.html b/docs/_build/html/_modules/base_pulse.html index 1b48c53aa464d6f56cc1997609d616ee1b5f1c84..01e53a4588ac209fc658798bb3c59e3ad48bc093 100644 --- a/docs/_build/html/_modules/base_pulse.html +++ b/docs/_build/html/_modules/base_pulse.html @@ -159,7 +159,7 @@ <span class="sd">'''</span> -<div class="viewcode-block" id="pulselib"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib">[docs]</a><span class="k">class</span> <span class="nc">pulselib</span><span class="p">:</span> +<div class="viewcode-block" id="pulselib"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib">[docs]</a><span class="k">class</span> <span class="nc">pulselib</span><span class="p">:</span> <span class="sd">'''</span> <span class="sd"> Global class that is an organisational element in making the pulses.</span> <span class="sd"> The idea is that you first make individula segments,</span> @@ -188,7 +188,7 @@ <span class="bp">self</span><span class="o">.</span><span class="n">segments_bin</span> <span class="o">=</span> <span class="kc">None</span> <span class="bp">self</span><span class="o">.</span><span class="n">sequencer</span> <span class="o">=</span> <span class="kc">None</span> -<div class="viewcode-block" id="pulselib.define_channels"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib.define_channels">[docs]</a> <span class="k">def</span> <span class="nf">define_channels</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">my_input</span><span class="p">):</span> +<div class="viewcode-block" id="pulselib.define_channels"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib.define_channels">[docs]</a> <span class="k">def</span> <span class="nf">define_channels</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">my_input</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> define the channels and their location </span> <span class="sd"> Args:</span> @@ -201,7 +201,7 @@ <span class="bp">self</span><span class="o">.</span><span class="n">channel_delays_computed</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">)</span> <span class="bp">self</span><span class="o">.</span><span class="n">channel_compenstation_limits</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">1500</span><span class="p">,</span><span class="mi">1500</span><span class="p">)</span></div> -<div class="viewcode-block" id="pulselib.add_channel_delay"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib.add_channel_delay">[docs]</a> <span class="k">def</span> <span class="nf">add_channel_delay</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">delays</span><span class="p">):</span> +<div class="viewcode-block" id="pulselib.add_channel_delay"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib.add_channel_delay">[docs]</a> <span class="k">def</span> <span class="nf">add_channel_delay</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">delays</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> Adds to a channel a delay. </span> <span class="sd"> The delay is added by adding points in front of the first sequence/or </span> @@ -223,7 +223,7 @@ <span class="bp">self</span><span class="o">.</span><span class="n">__process_channel_delays</span><span class="p">()</span> <span class="k">return</span> <span class="mi">0</span></div> -<div class="viewcode-block" id="pulselib.add_channel_compenstation_limits"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib.add_channel_compenstation_limits">[docs]</a> <span class="k">def</span> <span class="nf">add_channel_compenstation_limits</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">limits</span><span class="p">):</span> +<div class="viewcode-block" id="pulselib.add_channel_compenstation_limits"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib.add_channel_compenstation_limits">[docs]</a> <span class="k">def</span> <span class="nf">add_channel_compenstation_limits</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">limits</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> add voltage limitations per channnel that can be used to make sure that the intragral of the total voltages is 0.</span> <span class="sd"> Args:</span> @@ -238,7 +238,7 @@ <span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"Channel voltage compenstation error: Channel '</span><span class="si">{}</span><span class="s2">' does not exist. Please provide valid input"</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">i</span><span class="p">[</span><span class="mi">0</span><span class="p">]))</span></div> -<div class="viewcode-block" id="pulselib.add_awgs"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib.add_awgs">[docs]</a> <span class="k">def</span> <span class="nf">add_awgs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">awg</span><span class="p">):</span> +<div class="viewcode-block" id="pulselib.add_awgs"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib.add_awgs">[docs]</a> <span class="k">def</span> <span class="nf">add_awgs</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">awg</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> add a awg to the library</span> <span class="sd"> Args:</span> @@ -248,7 +248,7 @@ <span class="bp">self</span><span class="o">.</span><span class="n">awg_devices</span><span class="p">[</span><span class="n">name</span><span class="p">]</span> <span class="o">=</span><span class="n">awg</span></div> <span class="c1"># self.cpp_uploader.add_awg_module(name, awg)</span> -<div class="viewcode-block" id="pulselib.add_virtual_gates"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib.add_virtual_gates">[docs]</a> <span class="k">def</span> <span class="nf">add_virtual_gates</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">virtual_gates</span><span class="p">):</span> +<div class="viewcode-block" id="pulselib.add_virtual_gates"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib.add_virtual_gates">[docs]</a> <span class="k">def</span> <span class="nf">add_virtual_gates</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">virtual_gates</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> define virtual gates for the gate set.</span> <span class="sd"> Args:</span> @@ -262,7 +262,7 @@ <span class="k">def</span> <span class="nf">update_virtual_gate_matrix</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">new_matrix</span><span class="p">):</span> <span class="k">raise</span> <span class="bp">NotImplemented</span> -<div class="viewcode-block" id="pulselib.add_IQ_virt_channels"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib.add_IQ_virt_channels">[docs]</a> <span class="k">def</span> <span class="nf">add_IQ_virt_channels</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">IQ_virt_channels</span><span class="p">):</span> +<div class="viewcode-block" id="pulselib.add_IQ_virt_channels"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib.add_IQ_virt_channels">[docs]</a> <span class="k">def</span> <span class="nf">add_IQ_virt_channels</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">IQ_virt_channels</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> function to define virtual IQ channels (a channel that combined the I and Q channel for MW applications):</span> <span class="sd"> Args:</span> @@ -278,7 +278,7 @@ <span class="c1"># TODO rewrite, so this function is embedded in the other ones.</span> <span class="bp">self</span><span class="o">.</span><span class="n">uploader</span> <span class="o">=</span> <span class="n">keysight_uploader</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">awg_devices</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">cpp_uploader</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">awg_channels</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">awg_channels_to_physical_locations</span> <span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">channel_delays_computed</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">channel_compenstation_limits</span><span class="p">)</span> -<div class="viewcode-block" id="pulselib.mk_segment"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib.mk_segment">[docs]</a> <span class="k">def</span> <span class="nf">mk_segment</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +<div class="viewcode-block" id="pulselib.mk_segment"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib.mk_segment">[docs]</a> <span class="k">def</span> <span class="nf">mk_segment</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> generate a new segment.</span> <span class="sd"> Returns:</span> @@ -286,7 +286,7 @@ <span class="sd"> '''</span> <span class="k">return</span> <span class="n">segment_container</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">awg_channels</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">awg_virtual_channels</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">awg_IQ_channels</span><span class="p">)</span></div> -<div class="viewcode-block" id="pulselib.mk_sequence"><a class="viewcode-back" href="../intro.html#base_pulse.pulselib.mk_sequence">[docs]</a> <span class="k">def</span> <span class="nf">mk_sequence</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">seq</span><span class="p">):</span> +<div class="viewcode-block" id="pulselib.mk_sequence"><a class="viewcode-back" href="../autodoc/base_pulse.html#base_pulse.pulselib.mk_sequence">[docs]</a> <span class="k">def</span> <span class="nf">mk_sequence</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">seq</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> seq: list of list, </span> <span class="sd"> e.g. [ ['name segment 1' (str), number of times to play (int), prescale (int)] ]</span> diff --git a/docs/_build/html/_modules/index.html b/docs/_build/html/_modules/index.html index 5e41b2433dc5a260f29d9cc91b039de7558bea46..5aa5de35203d5a06b97ce272da44100a366ffa47 100644 --- a/docs/_build/html/_modules/index.html +++ b/docs/_build/html/_modules/index.html @@ -141,6 +141,7 @@ <li><a href="segments/data_classes.html">segments.data_classes</a></li> <li><a href="segments/segments.html">segments.segments</a></li> <li><a href="segments/segments_IQ.html">segments.segments_IQ</a></li> +<li><a href="segments/segments_base.html">segments.segments_base</a></li> </ul> </div> diff --git a/docs/_build/html/_modules/segments/segments.html b/docs/_build/html/_modules/segments/segments.html index 30764319ed842a16864115a8da77ec043bcc8cfb..138fdc45c0ce55e72986621e739edd0db0826687 100644 --- a/docs/_build/html/_modules/segments/segments.html +++ b/docs/_build/html/_modules/segments/segments.html @@ -156,7 +156,7 @@ <span class="sd">"""</span> -<div class="viewcode-block" id="segment_container"><a class="viewcode-back" href="../../intro.html#segments.segments.segment_container">[docs]</a><span class="k">class</span> <span class="nc">segment_container</span><span class="p">():</span> +<div class="viewcode-block" id="segment_container"><a class="viewcode-back" href="../../autodoc/segment.html#segments.segments.segment_container">[docs]</a><span class="k">class</span> <span class="nc">segment_container</span><span class="p">():</span> <span class="sd">'''</span> <span class="sd"> Class containing all the single segments for for a series of channels.</span> <span class="sd"> This is a organisational class.</span> @@ -268,7 +268,7 @@ <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_Vmin_max_data</span> -<div class="viewcode-block" id="segment_container.append"><a class="viewcode-back" href="../../intro.html#segments.segments.segment_container.append">[docs]</a> <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">time</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> +<div class="viewcode-block" id="segment_container.append"><a class="viewcode-back" href="../../autodoc/segment.html#segments.segments.segment_container.append">[docs]</a> <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">time</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> append other segments the the current ones in the container.</span> <span class="sd"> Args:</span> @@ -286,7 +286,7 @@ <span class="n">segment</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span> <span class="n">segment</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">i</span><span class="p">),</span> <span class="n">time</span><span class="p">)</span></div> -<div class="viewcode-block" id="segment_container.slice_time"><a class="viewcode-back" href="../../intro.html#segments.segments.segment_container.slice_time">[docs]</a> <span class="k">def</span> <span class="nf">slice_time</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">):</span> +<div class="viewcode-block" id="segment_container.slice_time"><a class="viewcode-back" href="../../autodoc/segment.html#segments.segments.segment_container.slice_time">[docs]</a> <span class="k">def</span> <span class="nf">slice_time</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">):</span> <span class="sd">"""</span> <span class="sd"> slice time in a segment container</span> <span class="sd"> Args:</span> @@ -306,7 +306,7 @@ <span class="n">segment</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span> <span class="n">segment</span><span class="o">.</span><span class="n">slice_time</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">)</span></div> -<div class="viewcode-block" id="segment_container.reset_time"><a class="viewcode-back" href="../../intro.html#segments.segments.segment_container.reset_time">[docs]</a> <span class="k">def</span> <span class="nf">reset_time</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">extend_only</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span> +<div class="viewcode-block" id="segment_container.reset_time"><a class="viewcode-back" href="../../autodoc/segment.html#segments.segments.segment_container.reset_time">[docs]</a> <span class="k">def</span> <span class="nf">reset_time</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">extend_only</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> Args:</span> <span class="sd"> extend_only (bool) : will just extend the time in the segment and not reset it if set to true [do not use when composing wavoforms...].</span> @@ -328,7 +328,7 @@ <span class="n">segment</span> <span class="o">=</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span> <span class="n">segment</span><span class="o">.</span><span class="n">reset_time</span><span class="p">(</span><span class="n">loop_obj</span><span class="p">,</span> <span class="n">extend_only</span><span class="p">)</span></div> -<div class="viewcode-block" id="segment_container.get_waveform"><a class="viewcode-back" href="../../intro.html#segments.segments.segment_container.get_waveform">[docs]</a> <span class="k">def</span> <span class="nf">get_waveform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">channel</span><span class="p">,</span> <span class="n">index</span> <span class="o">=</span> <span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">pre_delay</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">post_delay</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">sample_rate</span><span class="o">=</span><span class="mf">1e9</span><span class="p">):</span> +<div class="viewcode-block" id="segment_container.get_waveform"><a class="viewcode-back" href="../../autodoc/segment.html#segments.segments.segment_container.get_waveform">[docs]</a> <span class="k">def</span> <span class="nf">get_waveform</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">channel</span><span class="p">,</span> <span class="n">index</span> <span class="o">=</span> <span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">pre_delay</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span> <span class="n">post_delay</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">sample_rate</span><span class="o">=</span><span class="mf">1e9</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> function to get the raw data of a waveform,</span> <span class="sd"> inputs:</span> @@ -341,7 +341,7 @@ <span class="sd"> '''</span> <span class="k">return</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">channel</span><span class="p">)</span><span class="o">.</span><span class="n">get_segment</span><span class="p">(</span><span class="n">index</span><span class="p">,</span> <span class="n">pre_delay</span><span class="p">,</span> <span class="n">post_delay</span><span class="p">,</span> <span class="n">sample_rate</span><span class="p">)</span></div> -<div class="viewcode-block" id="segment_container.extend_dim"><a class="viewcode-back" href="../../intro.html#segments.segments.segment_container.extend_dim">[docs]</a> <span class="k">def</span> <span class="nf">extend_dim</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">shape</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ref</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span> +<div class="viewcode-block" id="segment_container.extend_dim"><a class="viewcode-back" href="../../autodoc/segment.html#segments.segments.segment_container.extend_dim">[docs]</a> <span class="k">def</span> <span class="nf">extend_dim</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">shape</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">ref</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> extend the dimensions of the waveform to a given shape.</span> <span class="sd"> Args:</span> @@ -359,7 +359,7 @@ <span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="s1">'render'</span> <span class="ow">and</span> <span class="bp">self</span><span class="o">.</span><span class="n">render_mode</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">_pulse_data_all</span> <span class="o">=</span> <span class="n">update_dimension</span><span class="p">(</span><span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">_pulse_data_all</span><span class="p">,</span> <span class="n">shape</span><span class="p">,</span> <span class="n">ref</span><span class="p">)</span></div> -<div class="viewcode-block" id="segment_container.enter_rendering_mode"><a class="viewcode-back" href="../../intro.html#segments.segments.segment_container.enter_rendering_mode">[docs]</a> <span class="k">def</span> <span class="nf">enter_rendering_mode</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +<div class="viewcode-block" id="segment_container.enter_rendering_mode"><a class="viewcode-back" href="../../autodoc/segment.html#segments.segments.segment_container.enter_rendering_mode">[docs]</a> <span class="k">def</span> <span class="nf">enter_rendering_mode</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> put the segments into rendering mode, which means that they cannot be changed. All segments will get their final length at this moment.</span> <span class="sd"> '''</span> @@ -371,7 +371,7 @@ <span class="k">if</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">type</span> <span class="o">==</span> <span class="s1">'render'</span><span class="p">:</span> <span class="nb">getattr</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">i</span><span class="p">)</span><span class="o">.</span><span class="n">pulse_data_all</span></div> -<div class="viewcode-block" id="segment_container.exit_rendering_mode"><a class="viewcode-back" href="../../intro.html#segments.segments.segment_container.exit_rendering_mode">[docs]</a> <span class="k">def</span> <span class="nf">exit_rendering_mode</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> +<div class="viewcode-block" id="segment_container.exit_rendering_mode"><a class="viewcode-back" href="../../autodoc/segment.html#segments.segments.segment_container.exit_rendering_mode">[docs]</a> <span class="k">def</span> <span class="nf">exit_rendering_mode</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> exit rendering mode and clear all the ram that was used for the rendering.</span> <span class="sd"> '''</span> diff --git a/docs/_build/html/_modules/segments/segments_IQ.html b/docs/_build/html/_modules/segments/segments_IQ.html index b11691db0665d21bfe083d2ca960c74056fafb33..6d04bc0073a9ff636d0f5610617ebc5a1115caf2 100644 --- a/docs/_build/html/_modules/segments/segments_IQ.html +++ b/docs/_build/html/_modules/segments/segments_IQ.html @@ -167,7 +167,7 @@ -<div class="viewcode-block" id="segment_single_IQ"><a class="viewcode-back" href="../../intro.html#segments.segments_IQ.segment_single_IQ">[docs]</a><span class="k">class</span> <span class="nc">segment_single_IQ</span><span class="p">(</span><span class="n">segment_single</span><span class="p">):</span> +<div class="viewcode-block" id="segment_single_IQ"><a class="viewcode-back" href="../../autodoc/segment_IQ.html#segments.segments_IQ.segment_single_IQ">[docs]</a><span class="k">class</span> <span class="nc">segment_single_IQ</span><span class="p">(</span><span class="n">segment_single</span><span class="p">):</span> <span class="sd">"""</span> <span class="sd"> Standard single segment for IQ purposes</span> <span class="sd"> todo --> add global phase and time shift in the data class instead of this one (cleaner and more generic).</span> @@ -186,7 +186,6 @@ <span class="bp">self</span><span class="o">.</span><span class="n">_last_edit</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> <span class="bp">self</span><span class="o">.</span><span class="n">ndim</span> <span class="o">=</span> <span class="mi">0</span> - <span class="bp">self</span><span class="o">.</span><span class="n">shape</span> <span class="o">=</span> <span class="p">[]</span> <span class="bp">self</span><span class="o">.</span><span class="n">units</span> <span class="o">=</span> <span class="p">[]</span> <span class="bp">self</span><span class="o">.</span><span class="n">names</span> <span class="o">=</span> <span class="p">[]</span> @@ -321,7 +320,7 @@ <span class="k">def</span> <span class="nf">add_numpy_IQ</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">I</span><span class="p">,</span> <span class="n">Q</span><span class="p">):</span> <span class="k">raise</span> <span class="bp">NotImplemented</span> -<div class="viewcode-block" id="segment_single_IQ.get_IQ_data"><a class="viewcode-back" href="../../intro.html#segments.segments_IQ.segment_single_IQ.get_IQ_data">[docs]</a> <span class="k">def</span> <span class="nf">get_IQ_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">I_or_Q</span><span class="p">):</span> +<div class="viewcode-block" id="segment_single_IQ.get_IQ_data"><a class="viewcode-back" href="../../autodoc/segment_IQ.html#segments.segments_IQ.segment_single_IQ.get_IQ_data">[docs]</a> <span class="k">def</span> <span class="nf">get_IQ_data</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">I_or_Q</span><span class="p">):</span> <span class="sd">'''</span> <span class="sd"> get I and Q data from the main element.</span> <span class="sd"> Args:</span> diff --git a/docs/_build/html/_modules/segments/segments_base.html b/docs/_build/html/_modules/segments/segments_base.html new file mode 100644 index 0000000000000000000000000000000000000000..80825e160811e0358a035c9cf9bc6cbe602e74d1 --- /dev/null +++ b/docs/_build/html/_modules/segments/segments_base.html @@ -0,0 +1,682 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>segments.segments_base — pulse lib 0.2 alpha documentation</title> + + + + + + + + + + + + + + + + <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../../genindex.html" /> + <link rel="search" title="Search" href="../../search.html" /> + + + <script src="../../_static/js/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search"> + + + + <a href="../../index.html" class="icon icon-home"> pulse lib + + + + </a> + + + + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <!-- Local TOC --> + <div class="local-toc"></div> + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../../index.html">pulse lib</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../../index.html">Docs</a> »</li> + + <li><a href="../index.html">Module code</a> »</li> + + <li>segments.segments_base</li> + + + <li class="wy-breadcrumbs-aside"> + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <h1>Source code for segments.segments_base</h1><div class="highlight"><pre> +<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> +<span class="kn">import</span> <span class="nn">datetime</span> + +<span class="kn">from</span> <span class="nn">pulse_lib.segments.data_handling_functions</span> <span class="k">import</span> <span class="n">loop_controller</span><span class="p">,</span> <span class="n">get_union_of_shapes</span><span class="p">,</span> <span class="n">update_dimension</span> +<span class="kn">from</span> <span class="nn">pulse_lib.segments.data_classes</span> <span class="k">import</span> <span class="n">pulse_data</span><span class="p">,</span> <span class="n">data_container</span><span class="p">,</span> <span class="n">get_effective_point_number</span> +<span class="kn">from</span> <span class="nn">pulse_lib.segments.looping</span> <span class="k">import</span> <span class="n">loop_obj</span> +<span class="kn">import</span> <span class="nn">copy</span> + +<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span> + +<span class="k">def</span> <span class="nf">last_edited</span><span class="p">(</span><span class="n">f</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> just a simpe decoter used to say that a certain wavefrom is updaded and therefore a new upload needs to be made to the awg.</span> +<span class="sd"> '''</span> + <span class="k">def</span> <span class="nf">wrapper</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">):</span> + <span class="k">if</span> <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">render_mode</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> + <span class="ne">ValueError</span><span class="p">(</span><span class="s2">"cannot alter this segment, this segment (</span><span class="si">{}</span><span class="s2">) in render mode."</span><span class="o">.</span><span class="n">format</span><span class="p">(</span><span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">name</span><span class="p">))</span> + <span class="n">args</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">_last_edit</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> + <span class="k">return</span> <span class="n">f</span><span class="p">(</span><span class="o">*</span><span class="n">args</span><span class="p">)</span> + <span class="k">return</span> <span class="n">wrapper</span> + +<div class="viewcode-block" id="segment_single"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single">[docs]</a><span class="k">class</span> <span class="nc">segment_single</span><span class="p">():</span> + <span class="sd">'''</span> +<span class="sd"> Class defining single segments for one sequence.</span> +<span class="sd"> This is at the moment rather basic. Here should be added more fuctions.</span> +<span class="sd"> '''</span> + <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">name</span><span class="p">,</span> <span class="n">segment_type</span> <span class="o">=</span> <span class="s1">'render'</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> Args:</span> +<span class="sd"> name (str): name of the segment usually the channel name</span> +<span class="sd"> segment_type (str) : type of the segment (e.g. 'render' --> to be rendered, 'virtual'--> no not render.)</span> +<span class="sd"> '''</span> + <span class="bp">self</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="n">segment_type</span> + <span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span> + <span class="bp">self</span><span class="o">.</span><span class="n">render_mode</span> <span class="o">=</span> <span class="kc">False</span> + <span class="c1"># variable specifing the laetest change to the waveforms</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_last_edit</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> + + <span class="c1"># store data in numpy looking object for easy operator access.</span> + <span class="bp">self</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">data_container</span><span class="p">(</span><span class="n">pulse_data</span><span class="p">())</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">last</span> <span class="o">=</span> <span class="kc">None</span> + <span class="bp">self</span><span class="o">.</span><span class="n">unique</span> <span class="o">=</span> <span class="kc">False</span> + + <span class="c1"># references to other channels (for virtual gates).</span> + <span class="bp">self</span><span class="o">.</span><span class="n">reference_channels</span> <span class="o">=</span> <span class="p">[]</span> + <span class="c1"># reference channels for IQ virtual channels</span> + <span class="bp">self</span><span class="o">.</span><span class="n">IQ_ref_channels</span> <span class="o">=</span> <span class="p">[]</span> + <span class="c1"># local copy of self that will be used to count up the virtual gates.</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_pulse_data_all</span> <span class="o">=</span> <span class="kc">None</span> + <span class="c1"># data caching variable. Used for looping and so on (with a decorator approach)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span> <span class="o">=</span> <span class="kc">None</span> + <span class="c1"># variable specifing the lastest time the pulse_data_all is updated</span> + <span class="bp">self</span><span class="o">.</span><span class="n">last_render</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> + +<div class="viewcode-block" id="segment_single.add_reference_channel"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.add_reference_channel">[docs]</a> <span class="k">def</span> <span class="nf">add_reference_channel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">segment_data</span><span class="p">,</span> <span class="n">multiplication_factor</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> Add channel reference, this can be done to make by making a pointer to another segment.</span> +<span class="sd"> Args:</span> +<span class="sd"> Channels_name (str): human readable name of the virtual gate.</span> +<span class="sd"> segment_data (segment_single): pointer so the segment corresponsing the the channel name</span> +<span class="sd"> multiplication_factor (float64): times how much this segment should be added to the current one.</span> +<span class="sd"> '''</span> + <span class="n">virtual_segment</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'name'</span><span class="p">:</span> <span class="n">channel_name</span><span class="p">,</span> <span class="s1">'segment'</span><span class="p">:</span> <span class="n">segment_data</span><span class="p">,</span> <span class="s1">'multiplication_factor'</span><span class="p">:</span> <span class="n">multiplication_factor</span><span class="p">}</span> + <span class="bp">self</span><span class="o">.</span><span class="n">reference_channels</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">virtual_segment</span><span class="p">)</span></div> + +<div class="viewcode-block" id="segment_single.add_IQ_ref_channel"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.add_IQ_ref_channel">[docs]</a> <span class="k">def</span> <span class="nf">add_IQ_ref_channel</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">channel_name</span><span class="p">,</span> <span class="n">pointer_to_channel</span><span class="p">,</span> <span class="n">I_or_Q_part</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> Add a reference to an IQ channel. Same principle as for the virtual one.</span> +<span class="sd"> Args:</span> +<span class="sd"> channel_name (str): human readable name of the virtual channel</span> +<span class="sd"> pointer_to_channel (*segment_single_IQ): pointer to segment_single_IQ object</span> +<span class="sd"> I_or_Q_part (str) : 'I' or 'Q' to indicate that the reference is to the I or Q part of the signal.</span> +<span class="sd"> '''</span> + <span class="n">virtual_IQ_segment</span> <span class="o">=</span> <span class="p">{</span><span class="s1">'name'</span><span class="p">:</span> <span class="n">channel_name</span><span class="p">,</span> <span class="s1">'segment'</span><span class="p">:</span> <span class="n">pointer_to_channel</span><span class="p">,</span> <span class="s1">'I/Q'</span><span class="p">:</span> <span class="n">I_or_Q_part</span><span class="p">}</span> + <span class="bp">self</span><span class="o">.</span><span class="n">IQ_ref_channels</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">virtual_IQ_segment</span><span class="p">)</span></div> + +<div class="viewcode-block" id="segment_single.reset_time"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.reset_time">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">reset_time</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">time</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">extend_only</span> <span class="o">=</span> <span class="kc">False</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> resets the time back to zero after a certain point</span> +<span class="sd"> Args: </span> +<span class="sd"> time (double) : (optional), after time to reset back to 0. Note that this is absolute time and not rescaled time.</span> +<span class="sd"> '''</span> + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">reset_time</span><span class="p">(</span><span class="n">time</span><span class="p">,</span> <span class="n">extend_only</span><span class="p">)</span></div> + +<div class="viewcode-block" id="segment_single.add_pulse"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.add_pulse">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">add_pulse</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">array</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> Add manually a pulse.</span> +<span class="sd"> Args: </span> +<span class="sd"> array (list): array with times of the pulse.</span> + +<span class="sd"> format array: </span> +<span class="sd"> [[t0, Amp0],[t1, Amp1], ... [tn, Ampn]]</span> +<span class="sd"> '''</span> + <span class="k">if</span> <span class="n">array</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">!=</span> <span class="p">[</span><span class="mf">0.</span><span class="p">,</span><span class="mf">0.</span><span class="p">]:</span> + <span class="n">array</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="n">array</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">array</span> <span class="o">=</span> <span class="p">[[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">]]</span> <span class="o">+</span> <span class="n">array</span> + + <span class="n">arr</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">asarray</span><span class="p">(</span><span class="n">array</span><span class="p">)</span> + <span class="n">arr</span><span class="p">[</span><span class="mi">1</span><span class="p">:,</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">arr</span><span class="p">[</span><span class="mi">1</span><span class="p">:,</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">add_pulse_data</span><span class="p">(</span><span class="n">arr</span><span class="p">)</span></div> + +<div class="viewcode-block" id="segment_single.add_block"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.add_block">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">add_block</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">start</span><span class="p">,</span><span class="n">stop</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> add a block pulse on top of the existing pulse.</span> +<span class="sd"> '''</span> + <span class="k">if</span> <span class="n">start</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span><span class="n">amplitude</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">]],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">double</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span><span class="n">amplitude</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">]],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">double</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">add_pulse_data</span><span class="p">(</span><span class="n">pulse</span><span class="p">)</span></div> + +<div class="viewcode-block" id="segment_single.add_ramp"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.add_ramp">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">add_ramp</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">,</span> <span class="n">keep_amplitude</span><span class="o">=</span><span class="kc">False</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> Makes a linear ramp</span> +<span class="sd"> Args:</span> +<span class="sd"> start (double) : starting time of the ramp</span> +<span class="sd"> stop (double) : stop time of the ramp</span> +<span class="sd"> amplitude : total hight of the ramp, starting from the base point</span> +<span class="sd"> keep_amplitude : when pulse is done, keep reached amplitude for time infinity</span> +<span class="sd"> '''</span> + <span class="k">if</span> <span class="n">keep_amplitude</span> <span class="o">==</span> <span class="kc">False</span><span class="p">:</span> + <span class="k">if</span> <span class="n">start</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">]],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">double</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">]],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">double</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">if</span> <span class="n">start</span> <span class="o">!=</span> <span class="mi">0</span><span class="p">:</span> + <span class="n">pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">]</span> <span class="p">],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">double</span><span class="p">)</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">([[</span><span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="mi">0</span><span class="p">],</span> <span class="p">[</span><span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> <span class="n">amplitude</span><span class="p">]</span> <span class="p">],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">double</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">add_pulse_data</span><span class="p">(</span><span class="n">pulse</span><span class="p">)</span></div> + +<div class="viewcode-block" id="segment_single.wait"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.wait">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">wait</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">wait</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> wait for x ns after the lastest wave element that was programmed.</span> +<span class="sd"> Args:</span> +<span class="sd"> wait (double) : time in ns to wait</span> +<span class="sd"> '''</span> + <span class="n">amp_0</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">my_pulse_data</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">]</span> + <span class="n">t0</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">total_time</span> + + <span class="n">pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">asarray</span><span class="p">([[</span><span class="n">t0</span><span class="p">,</span> <span class="mi">0</span><span class="p">],[</span><span class="n">wait</span><span class="o">+</span><span class="n">t0</span><span class="p">,</span> <span class="mi">0</span><span class="p">]],</span> <span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">double</span><span class="p">)</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">add_pulse_data</span><span class="p">(</span><span class="n">pulse</span><span class="p">)</span></div> + +<div class="viewcode-block" id="segment_single.add_sin"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.add_sin">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">add_sin</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">,</span> <span class="n">amp</span><span class="p">,</span> <span class="n">freq</span><span class="p">,</span> <span class="n">phase_offset</span><span class="o">=</span><span class="mi">0</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> add a sinus to the current segment, parameters should be self exlenatory.</span> +<span class="sd"> The pulse will have a relative phase (as this is needed to all IQ work).</span> +<span class="sd"> Args:</span> +<span class="sd"> start (double) : start time in ns of the pulse</span> +<span class="sd"> stop (double) : stop time in ns of the pulse</span> +<span class="sd"> amp (double) : amplitude of the pulse</span> +<span class="sd"> freq (double) : frequency of the pulse</span> +<span class="sd"> phase_offset (double) : offset in phase is needed</span> +<span class="sd"> '''</span> + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">add_sin_data</span><span class="p">(</span> + <span class="p">{</span> + <span class="s1">'type'</span> <span class="p">:</span> <span class="s1">'std'</span><span class="p">,</span> + <span class="s1">'start_time'</span> <span class="p">:</span> <span class="n">start</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> + <span class="s1">'stop_time'</span> <span class="p">:</span> <span class="n">stop</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">start_time</span><span class="p">,</span> + <span class="s1">'amplitude'</span> <span class="p">:</span> <span class="n">amp</span><span class="p">,</span> + <span class="s1">'frequency'</span> <span class="p">:</span> <span class="n">freq</span><span class="p">,</span> + <span class="s1">'phase'</span> <span class="p">:</span> <span class="n">phase_offset</span><span class="p">})</span></div> + +<div class="viewcode-block" id="segment_single.repeat"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.repeat">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">repeat</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">number</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> repeat a waveform n times.</span> +<span class="sd"> Args:</span> +<span class="sd"> number (int) : number of ties to repeat the waveform</span> +<span class="sd"> '''</span> + <span class="k">if</span> <span class="n">number</span> <span class="o"><=</span> <span class="mi">1</span><span class="p">:</span> + <span class="k">return</span> + + <span class="c1"># if repeating elemenets with double points in the start/end, we don't want them in the segement, so we will strip the first and add them later (back in the big sequence).</span> + <span class="n">my_pulse_data_copy</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">my_pulse_data</span><span class="p">)</span> + <span class="k">if</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">]</span> <span class="o"><</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">total_time</span><span class="p">:</span> + <span class="n">my_pulse_data_copy</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">my_pulse_data_copy</span><span class="p">,</span> <span class="p">[[</span><span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">total_time</span><span class="p">,</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">]]],</span> <span class="n">axis</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> + + <span class="n">front_pulse_corr</span> <span class="o">=</span> <span class="kc">None</span> + <span class="n">back_pulse_corr</span> <span class="o">=</span> <span class="kc">None</span> + <span class="c1"># check if there is twice the same starting number </span> + + <span class="k">if</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">]:</span> + <span class="n">front_pulse_corr</span> <span class="o">=</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + <span class="n">my_pulse_data_copy</span> <span class="o">=</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> + + <span class="k">if</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">]</span> <span class="o">==</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="o">-</span><span class="mi">2</span><span class="p">,</span><span class="mi">0</span><span class="p">]:</span> + <span class="n">back_pulse_corr</span> <span class="o">=</span> <span class="n">my_pulse_data_copy</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> + <span class="n">my_pulse_data_copy</span> <span class="o">=</span> <span class="n">my_pulse_data_copy</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> + + + <span class="n">pulse_data</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">([</span><span class="n">my_pulse_data_copy</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">*</span><span class="n">number</span><span class="p">,</span> <span class="n">my_pulse_data_copy</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">]])</span> + + <span class="n">sin_data</span> <span class="o">=</span> <span class="p">[]</span> + <span class="n">total_time</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">total_time</span> + <span class="n">indices</span> <span class="o">=</span> <span class="mi">0</span> + + <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">number</span><span class="p">):</span> + <span class="n">new_pulse</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">my_pulse_data_copy</span><span class="p">)</span> + + <span class="n">new_pulse</span><span class="p">[:,</span><span class="mi">0</span><span class="p">]</span> <span class="o">+=</span> <span class="n">total_time</span><span class="o">*</span><span class="n">i</span> + <span class="n">pulse_data</span><span class="p">[</span><span class="n">indices</span><span class="p">:</span><span class="n">indices</span> <span class="o">+</span> <span class="n">new_pulse</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> <span class="o">=</span> <span class="n">new_pulse</span> + <span class="n">indices</span> <span class="o">+=</span> <span class="n">new_pulse</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> + + <span class="k">for</span> <span class="n">sin_data_item</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">sin_data</span><span class="p">:</span> + <span class="n">sin_data_item_new</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="n">sin_data_item</span><span class="p">)</span> + <span class="n">sin_data_item_new</span><span class="p">[</span><span class="s1">'start_time'</span><span class="p">]</span> <span class="o">+=</span> <span class="n">total_time</span><span class="o">*</span><span class="n">i</span> + <span class="n">sin_data_item_new</span><span class="p">[</span><span class="s1">'stop_time'</span><span class="p">]</span> <span class="o">+=</span> <span class="n">total_time</span><span class="o">*</span><span class="n">i</span> + <span class="n">sin_data</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">sin_data_item_new</span><span class="p">)</span> + + <span class="k">if</span> <span class="n">front_pulse_corr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">corr_pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">([</span><span class="n">pulse_data</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">pulse_data</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">]])</span> + <span class="n">corr_pulse</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="o">=</span> <span class="n">pulse_data</span> + <span class="n">corr_pulse</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">front_pulse_corr</span> + <span class="n">pulse_data</span> <span class="o">=</span> <span class="n">corr_pulse</span> + + <span class="k">if</span> <span class="n">back_pulse_corr</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">corr_pulse</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">zeros</span><span class="p">([</span><span class="n">pulse_data</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">+</span> <span class="mi">1</span><span class="p">,</span> <span class="n">pulse_data</span><span class="o">.</span><span class="n">shape</span><span class="p">[</span><span class="mi">1</span><span class="p">]])</span> + <span class="n">corr_pulse</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">pulse_data</span> + <span class="n">back_pulse_corr</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">pulse_data</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">]</span> + <span class="n">corr_pulse</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span> <span class="o">=</span> <span class="n">back_pulse_corr</span> + <span class="n">pulse_data</span> <span class="o">=</span> <span class="n">corr_pulse</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">my_pulse_data</span> <span class="o">=</span> <span class="n">pulse_data</span> + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">sin_data</span> <span class="o">=</span> <span class="n">sin_data</span></div> + +<div class="viewcode-block" id="segment_single.add_np"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.add_np">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">add_np</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">start</span><span class="p">,</span> <span class="n">array</span><span class="p">):</span> + <span class="k">raise</span> <span class="bp">NotImplemented</span></div> + + <span class="nd">@property</span> + <span class="k">def</span> <span class="nf">shape</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">shape</span> + + <span class="k">def</span> <span class="nf">__add__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> define addition operator for segment_single</span> +<span class="sd"> '''</span> + <span class="n">new_segment</span> <span class="o">=</span> <span class="n">segment_single</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> + <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="ow">is</span> <span class="n">segment_single</span><span class="p">:</span> + <span class="n">shape1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">shape</span> + <span class="n">shape2</span> <span class="o">=</span> <span class="n">other</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">shape</span> + <span class="n">new_shape</span> <span class="o">=</span> <span class="n">get_union_of_shapes</span><span class="p">(</span><span class="n">shape1</span><span class="p">,</span> <span class="n">shape2</span><span class="p">)</span> + <span class="n">other</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">update_dimension</span><span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">new_shape</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">=</span> <span class="n">update_dimension</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">new_shape</span><span class="p">)</span> + <span class="n">new_segment</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span> + <span class="n">new_segment</span><span class="o">.</span><span class="n">data</span> <span class="o">+=</span> <span class="n">other</span><span class="o">.</span><span class="n">data</span> + + <span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="o">==</span> <span class="nb">int</span> <span class="ow">or</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="o">==</span> <span class="nb">float</span><span class="p">:</span> + <span class="n">new_segment</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span> + <span class="n">new_segment</span><span class="o">.</span><span class="n">data</span> <span class="o">+=</span> <span class="n">other</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">"Please add up segment_single type or a number "</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">new_segment</span> + + <span class="k">def</span> <span class="nf">__sub__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="fm">__add__</span><span class="p">(</span><span class="n">other</span><span class="o">*-</span><span class="mi">1</span><span class="p">)</span> + + <span class="k">def</span> <span class="nf">__mul__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> muliplication operator for segment_single</span> +<span class="sd"> '''</span> + <span class="n">new_segment</span> <span class="o">=</span> <span class="n">segment_single</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> + + <span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="ow">is</span> <span class="n">segment_single</span><span class="p">:</span> + <span class="n">shape1</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">shape</span> + <span class="n">shape2</span> <span class="o">=</span> <span class="n">other</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">shape</span> + <span class="n">new_shape</span> <span class="o">=</span> <span class="n">get_union_of_shapes</span><span class="p">(</span><span class="n">shape1</span><span class="p">,</span> <span class="n">shape2</span><span class="p">)</span> + <span class="n">other</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">update_dimension</span><span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">new_shape</span><span class="p">)</span> + <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">=</span> <span class="n">update_dimension</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">new_shape</span><span class="p">)</span> + <span class="n">new_segment</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span> + <span class="n">new_segment</span><span class="o">.</span><span class="n">data</span> <span class="o">*=</span> <span class="n">other</span><span class="o">.</span><span class="n">data</span> + + <span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="o">==</span> <span class="nb">int</span> <span class="ow">or</span> <span class="nb">type</span><span class="p">(</span><span class="n">other</span><span class="p">)</span> <span class="o">==</span> <span class="nb">float</span><span class="p">:</span> + <span class="n">new_segment</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span> + <span class="n">new_segment</span><span class="o">.</span><span class="n">data</span> <span class="o">*=</span> <span class="n">other</span> + <span class="k">else</span><span class="p">:</span> + <span class="k">raise</span> <span class="ne">TypeError</span><span class="p">(</span><span class="s2">"Please add up segment_single type or a number "</span><span class="p">)</span> + + <span class="k">return</span> <span class="n">new_segment</span> + + <span class="k">def</span> <span class="nf">__truediv__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">):</span> + <span class="k">raise</span> <span class="bp">NotImplemented</span> + + <span class="k">def</span> <span class="nf">__getitem__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">key</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> get slice or single item of this segment (note no copying, just referencing)</span> +<span class="sd"> Args:</span> +<span class="sd"> *key (int/slice object) : key of the element -- just use numpy style accessing (slicing supported)</span> +<span class="sd"> '''</span> + <span class="n">item</span> <span class="o">=</span> <span class="n">segment_single</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span> + <span class="n">item</span><span class="o">.</span><span class="n">type</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">type</span> + + <span class="n">item</span><span class="o">.</span><span class="n">render_mode</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">render_mode</span> + <span class="n">item</span><span class="o">.</span><span class="n">_last_edit</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_last_edit</span> + <span class="n">item</span><span class="o">.</span><span class="n">data</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="n">key</span><span class="p">[</span><span class="mi">0</span><span class="p">]]</span> + + <span class="n">item</span><span class="o">.</span><span class="n">reference_channels</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">reference_channels</span> + <span class="n">item</span><span class="o">.</span><span class="n">IQ_ref_channels</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">IQ_ref_channels</span> + + <span class="k">return</span> <span class="n">item</span> + +<div class="viewcode-block" id="segment_single.append"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.append">[docs]</a> <span class="nd">@last_edited</span> + <span class="k">def</span> <span class="nf">append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">time</span> <span class="o">=</span> <span class="kc">None</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> Put the other segment behind this one.</span> +<span class="sd"> Args:</span> +<span class="sd"> other (segment_single) : the segment to be appended</span> +<span class="sd"> time (double/loop_obj) : attach at the given time (if None, append at total_time of the segment)</span> + +<span class="sd"> A time reset will be done after the other segment is added.</span> +<span class="sd"> TODO: transfer of units</span> +<span class="sd"> '''</span> + <span class="n">other_loopobj</span> <span class="o">=</span> <span class="n">loop_obj</span><span class="p">()</span> + <span class="n">other_loopobj</span><span class="o">.</span><span class="n">add_data</span><span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="nb">list</span><span class="p">(</span><span class="nb">range</span><span class="p">(</span><span class="n">other</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">ndim</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span><span class="o">-</span><span class="mi">1</span><span class="p">)))</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">__append</span><span class="p">(</span><span class="n">other_loopobj</span><span class="p">,</span> <span class="n">time</span><span class="p">)</span> + + <span class="k">return</span> <span class="bp">self</span></div> + + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">__append</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">other</span><span class="p">,</span> <span class="n">time</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Put the other segment behind this one (for single segment data object)</span> +<span class="sd"> Args:</span> +<span class="sd"> other (segment_single) : the segment to be appended</span> +<span class="sd"> time (double/loop_obj) : attach at the given time (if None, append at total_time of the segment)</span> +<span class="sd"> """</span> + <span class="k">if</span> <span class="n">time</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="n">time</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">total_time</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">other</span><span class="p">,</span> <span class="n">time</span><span class="p">)</span> + +<div class="viewcode-block" id="segment_single.slice_time"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.slice_time">[docs]</a> <span class="nd">@last_edited</span> + <span class="nd">@loop_controller</span> + <span class="k">def</span> <span class="nf">slice_time</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">start_time</span><span class="p">,</span> <span class="n">stop_time</span><span class="p">):</span> + <span class="sd">"""</span> +<span class="sd"> Cuts parts out of a segment.</span> +<span class="sd"> Args:</span> +<span class="sd"> start_time (double) : effective new start time</span> +<span class="sd"> stop_time (double) : new ending time of the segment</span> + +<span class="sd"> The slice_time function allows you to cut a waveform in different sizes.</span> +<span class="sd"> This function should be handy for debugging, example usage would be, </span> +<span class="sd"> You are runnning an algorithm and want to check what the measurement outcomes are though the whole algorithm.</span> +<span class="sd"> Pratically, you want to know</span> +<span class="sd"> 0 -> 10ns (@10 ns still everything as expected?)</span> +<span class="sd"> 0 -> 20ns</span> +<span class="sd"> 0 -> ...</span> +<span class="sd"> This function would allow you to do that, e.g. by calling segment.cut_segment(0, lp.linspace(10,100,9))</span> +<span class="sd"> """</span> + <span class="bp">self</span><span class="o">.</span><span class="n">data_tmp</span><span class="o">.</span><span class="n">slice_time</span><span class="p">(</span><span class="n">start_time</span><span class="p">,</span> <span class="n">stop_time</span><span class="p">)</span></div> + + <span class="nd">@property</span> + <span class="k">def</span> <span class="nf">total_time</span><span class="p">(</span><span class="bp">self</span><span class="p">,):</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">total_time</span> + +<div class="viewcode-block" id="segment_single.get_segment"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.get_segment">[docs]</a> <span class="k">def</span> <span class="nf">get_segment</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">pre_delay</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">post_delay</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">sample_rate</span><span class="o">=</span><span class="mf">1e9</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> input:</span> +<span class="sd"> index of segment (list) : which segment to render (e.g. [0] if dimension is 1 or [2,5,10] if dimension is 3)</span> +<span class="sd"> pre_delay : number of points to push before the sequence</span> +<span class="sd"> post delay: number of points to push after the sequence.</span> +<span class="sd"> sample rate : #/s (number of samples per second)</span> + +<span class="sd"> Returns:</span> +<span class="sd"> A numpy array that contains the points for each ns</span> +<span class="sd"> points is the expected lenght.</span> +<span class="sd"> '''</span> + <span class="n">wvf</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">_generate_segment</span><span class="p">(</span><span class="n">index</span><span class="p">,</span> <span class="n">pre_delay</span><span class="p">,</span> <span class="n">post_delay</span><span class="p">,</span> <span class="n">sample_rate</span><span class="p">)</span> + <span class="k">return</span> <span class="n">wvf</span></div> + +<div class="viewcode-block" id="segment_single.v_max"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.v_max">[docs]</a> <span class="k">def</span> <span class="nf">v_max</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">sample_rate</span> <span class="o">=</span> <span class="mf">1e9</span><span class="p">):</span> + <span class="n">index</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ravel_multi_index</span><span class="p">(</span><span class="nb">tuple</span><span class="p">(</span><span class="n">index</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">flat</span><span class="p">[</span><span class="n">index</span><span class="p">]</span><span class="o">.</span><span class="n">get_vmax</span><span class="p">()</span></div> + +<div class="viewcode-block" id="segment_single.v_min"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.v_min">[docs]</a> <span class="k">def</span> <span class="nf">v_min</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">sample_rate</span> <span class="o">=</span> <span class="mf">1e9</span><span class="p">):</span> + <span class="n">index</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ravel_multi_index</span><span class="p">(</span><span class="nb">tuple</span><span class="p">(</span><span class="n">index</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span> + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">flat</span><span class="p">[</span><span class="n">index</span><span class="p">]</span><span class="o">.</span><span class="n">get_vmin</span><span class="p">()</span></div> + +<div class="viewcode-block" id="segment_single.integrate"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.integrate">[docs]</a> <span class="k">def</span> <span class="nf">integrate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">pre_delay</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">post_delay</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">sample_rate</span> <span class="o">=</span> <span class="mf">1e9</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> get integral value of the waveform (e.g. to calculate an automatic compensation)</span> +<span class="sd"> Args:</span> +<span class="sd"> index (tuple) : index of the concerning waveform</span> +<span class="sd"> pre_delay (double) : ns to delay before the pulse</span> +<span class="sd"> post_delay (double) : ns to delay after the pulse</span> +<span class="sd"> sample_rate (double) : rate at which to render the pulse</span> +<span class="sd"> returns: intergral value</span> +<span class="sd"> '''</span> + <span class="n">flat_index</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ravel_multi_index</span><span class="p">(</span><span class="nb">tuple</span><span class="p">(</span><span class="n">index</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span> + <span class="n">pulse_data_all_curr_seg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">flat</span><span class="p">[</span><span class="n">flat_index</span><span class="p">]</span> + + <span class="n">total_time</span> <span class="o">=</span> <span class="n">pulse_data_all_curr_seg</span><span class="o">.</span><span class="n">total_time</span> + <span class="k">return</span> <span class="n">pulse_data_all_curr_seg</span><span class="o">.</span><span class="n">integrate_waveform</span><span class="p">(</span><span class="n">pre_delay</span><span class="p">,</span> <span class="n">total_time</span> <span class="o">+</span> <span class="n">post_delay</span><span class="p">,</span> <span class="n">sample_rate</span><span class="p">)</span></div> + + <span class="nd">@property</span> + <span class="k">def</span> <span class="nf">pulse_data_all</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> pulse data object that contains the counted op data of all the reference channels (e.g. IQ and virtual gates).</span> +<span class="sd"> '''</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">last_edit</span> <span class="o">></span> <span class="bp">self</span><span class="o">.</span><span class="n">last_render</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">_pulse_data_all</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_pulse_data_all</span> <span class="o">=</span> <span class="n">copy</span><span class="o">.</span><span class="n">copy</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="p">)</span> + <span class="k">for</span> <span class="n">ref_chan</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">reference_channels</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_pulse_data_all</span> <span class="o">+=</span> <span class="n">ref_chan</span><span class="p">[</span><span class="s1">'segment'</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="o">*</span><span class="n">ref_chan</span><span class="p">[</span><span class="s1">'multiplication_factor'</span><span class="p">]</span> + <span class="k">for</span> <span class="n">ref_chan</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">IQ_ref_channels</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_pulse_data_all</span> <span class="o">+=</span> <span class="n">ref_chan</span><span class="p">[</span><span class="s1">'segment'</span><span class="p">]</span><span class="o">.</span><span class="n">get_IQ_data</span><span class="p">(</span><span class="n">ref_chan</span><span class="p">[</span><span class="s1">'I/Q'</span><span class="p">])</span> + + <span class="bp">self</span><span class="o">.</span><span class="n">last_render</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">last_edit</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_pulse_data_all</span> + + <span class="nd">@property</span> + <span class="k">def</span> <span class="nf">last_edit</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> + <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">reference_channels</span><span class="p">:</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_last_edit</span> <span class="o"><</span> <span class="n">i</span><span class="p">[</span><span class="s1">'segment'</span><span class="p">]</span><span class="o">.</span><span class="n">_last_edit</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_last_edit</span> <span class="o">=</span> <span class="n">i</span><span class="p">[</span><span class="s1">'segment'</span><span class="p">]</span><span class="o">.</span><span class="n">_last_edit</span> + <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">IQ_ref_channels</span><span class="p">:</span> + <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">_last_edit</span> <span class="o"><</span> <span class="n">i</span><span class="p">[</span><span class="s1">'segment'</span><span class="p">]</span><span class="o">.</span><span class="n">_last_edit</span><span class="p">:</span> + <span class="bp">self</span><span class="o">.</span><span class="n">_last_edit</span> <span class="o">=</span> <span class="n">i</span><span class="p">[</span><span class="s1">'segment'</span><span class="p">]</span><span class="o">.</span><span class="n">_last_edit</span> + + <span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">_last_edit</span> + + <span class="k">def</span> <span class="nf">_generate_segment</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">index</span><span class="p">,</span> <span class="n">pre_delay</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">post_delay</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="n">sample_rate</span> <span class="o">=</span> <span class="mf">1e9</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> generate numpy array of the segment</span> +<span class="sd"> Args:</span> +<span class="sd"> index (tuple) : index of the segement to generate</span> +<span class="sd"> pre_delay: predelay of the pulse (in ns) (e.g. for compensation of diffent coax length's)</span> +<span class="sd"> post_delay: extend the pulse for x ns</span> +<span class="sd"> sample rate (double) : sample rate of the pulse to be rendered at.</span> +<span class="sd"> '''</span> + + <span class="c1"># get object with the concerning data</span> + <span class="n">flat_index</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ravel_multi_index</span><span class="p">(</span><span class="nb">tuple</span><span class="p">(</span><span class="n">index</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span> + <span class="n">pulse_data_all_curr_seg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">flat</span><span class="p">[</span><span class="n">flat_index</span><span class="p">]</span> + + <span class="n">total_time</span> <span class="o">=</span> <span class="n">pulse_data_all_curr_seg</span><span class="o">.</span><span class="n">total_time</span> + + <span class="n">my_sequence</span> <span class="o">=</span> <span class="n">pulse_data_all_curr_seg</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="n">pre_delay</span><span class="p">,</span> <span class="n">post_delay</span><span class="p">,</span> <span class="n">sample_rate</span><span class="p">)</span> + <span class="k">return</span> <span class="n">my_sequence</span> + +<div class="viewcode-block" id="segment_single.plot_segment"><a class="viewcode-back" href="../../autodoc/segment_base.html#segments.segments_base.segment_single.plot_segment">[docs]</a> <span class="k">def</span> <span class="nf">plot_segment</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">index</span> <span class="o">=</span> <span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">render_full</span> <span class="o">=</span> <span class="kc">True</span><span class="p">):</span> + <span class="sd">'''</span> +<span class="sd"> Args:</span> +<span class="sd"> index : index of which segment to plot</span> +<span class="sd"> render full (bool) : do full render (e.g. also get data form virtual channels). Put True if you want to see the waveshape send to the AWG.</span> +<span class="sd"> '''</span> + <span class="c1"># standard 1 Gs/s</span> + <span class="n">sample_rate</span> <span class="o">=</span> <span class="mf">1e9</span> + <span class="n">sample_time_step</span> <span class="o">=</span> <span class="mi">1</span><span class="o">/</span><span class="n">sample_rate</span> + + <span class="k">if</span> <span class="n">render_full</span> <span class="o">==</span> <span class="kc">True</span><span class="p">:</span> + <span class="n">flat_index</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ravel_multi_index</span><span class="p">(</span><span class="nb">tuple</span><span class="p">(</span><span class="n">index</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span> + <span class="n">pulse_data_curr_seg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">pulse_data_all</span><span class="o">.</span><span class="n">flat</span><span class="p">[</span><span class="n">flat_index</span><span class="p">]</span> + <span class="k">else</span><span class="p">:</span> + <span class="n">flat_index</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">ravel_multi_index</span><span class="p">(</span><span class="nb">tuple</span><span class="p">(</span><span class="n">index</span><span class="p">),</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">shape</span><span class="p">)</span> + <span class="n">pulse_data_curr_seg</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">data</span><span class="o">.</span><span class="n">flat</span><span class="p">[</span><span class="n">flat_index</span><span class="p">]</span> + + <span class="n">y</span> <span class="o">=</span> <span class="n">pulse_data_curr_seg</span><span class="o">.</span><span class="n">render</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="n">sample_rate</span><span class="p">)</span> + <span class="n">x</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">linspace</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">pulse_data_curr_seg</span><span class="o">.</span><span class="n">total_time</span><span class="o">*</span><span class="n">sample_time_step</span><span class="o">-</span><span class="n">sample_time_step</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">y</span><span class="p">))</span><span class="o">*</span><span class="mf">1e9</span> + + <span class="n">plt</span><span class="o">.</span><span class="n">plot</span><span class="p">(</span><span class="n">x</span><span class="p">,</span><span class="n">y</span><span class="p">,</span> <span class="n">label</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">)</span></div></div> + <span class="c1"># plt.show()</span> + +</pre></div> + + </div> + + </div> + <footer> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019, Stephan Philips + + </p> + </div> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + + + + + <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script> + <script type="text/javascript" src="../../_static/jquery.js"></script> + <script type="text/javascript" src="../../_static/underscore.js"></script> + <script type="text/javascript" src="../../_static/doctools.js"></script> + <script type="text/javascript" src="../../_static/language_data.js"></script> + <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + + + + + <script type="text/javascript" src="../../_static/js/theme.js"></script> + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/_build/html/_sources/autodoc/base_pulse.rst.txt b/docs/_build/html/_sources/autodoc/base_pulse.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..982f8e23143611a863e3cb32d4d6d47fb616fb25 --- /dev/null +++ b/docs/_build/html/_sources/autodoc/base_pulse.rst.txt @@ -0,0 +1,2 @@ +.. automodule:: base_pulse + :members: \ No newline at end of file diff --git a/docs/_build/html/_sources/autodoc/segment.rst.txt b/docs/_build/html/_sources/autodoc/segment.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..23b84d5775c184e7f9f8b97ed533681bb19dae80 --- /dev/null +++ b/docs/_build/html/_sources/autodoc/segment.rst.txt @@ -0,0 +1,2 @@ +.. automodule:: segments.segments + :members: \ No newline at end of file diff --git a/docs/_build/html/_sources/autodoc/segment_IQ.rst.txt b/docs/_build/html/_sources/autodoc/segment_IQ.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..24b125611ecf90812f449907b9a48a98a3e86d9b --- /dev/null +++ b/docs/_build/html/_sources/autodoc/segment_IQ.rst.txt @@ -0,0 +1,3 @@ + +.. automodule:: segments.segments_IQ + :members: \ No newline at end of file diff --git a/docs/_build/html/_sources/autodoc/segment_base.rst.txt b/docs/_build/html/_sources/autodoc/segment_base.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..6d2d7c652e00f5d73e1ce4ed73abad9c063c897e --- /dev/null +++ b/docs/_build/html/_sources/autodoc/segment_base.rst.txt @@ -0,0 +1,10 @@ +.. _segment_base: + +Segment base class desription +============================= + + +.. autoclass:: segments.segments_base.segment_single + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/_build/html/_sources/channel_delays.rst.txt b/docs/_build/html/_sources/channel_delays.rst.txt new file mode 100644 index 0000000000000000000000000000000000000000..b084a87939942f17597462f075d0f645acfaf9ff --- /dev/null +++ b/docs/_build/html/_sources/channel_delays.rst.txt @@ -0,0 +1,26 @@ +.. _chan_delay: + +Channels delays +=============== + +Some signals that you send to you sample, take a different path then others. This causes a slightly different time of arrival (usually a few tens of ns). +It is possible to compenstate for these small offsets by pushing waveforms slightly forward or backward. + +Let's consider a simple example. Let's set we define in the :ref:`pulselib<pulse_lib_chan_delay>` object the following delays: + +.. code-block:: python + + pulse.add_channel_delay({ + 'chan 1': -20, + 'chan 2': -20, + 'chan 3': 20, + 'chan 4': 20, + 'chan 5': 20 + }) + +It means channel 1 and 2 need to arrive 20 ns before what we call our reference. For the other channels we want the signal to arrive 20 ns after. The image below shows how this is done: + +.. figure:: /img/channel_delays.png + +As you can see here, for channel 1 and 2, in the segment container object, the segments are artifically made a bit longer by pushing data points in front of it. +By default the value of this point will be the first value in case there was no correction. The same counts for the last data point. diff --git a/docs/_build/html/_sources/intro.rst.txt b/docs/_build/html/_sources/intro.rst.txt index 97d057948b4ed30c53730621235f40e9b088d088..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/docs/_build/html/_sources/intro.rst.txt +++ b/docs/_build/html/_sources/intro.rst.txt @@ -1,12 +0,0 @@ - -.. automodule:: base_pulse - :members: - -.. automodule:: segments.data_classes - :members: - -.. automodule:: segments.segments - :members: - -.. automodule:: segments.segments_IQ - :members: \ No newline at end of file diff --git a/docs/_build/html/_sources/struct.rst.txt b/docs/_build/html/_sources/struct.rst.txt index 12ca62721599d925bb2a4b4e9014edf0d41353ce..59053653bea39a1cb48de7235bf6dd1567f490c8 100644 --- a/docs/_build/html/_sources/struct.rst.txt +++ b/docs/_build/html/_sources/struct.rst.txt @@ -20,20 +20,20 @@ A quick overview of the relation between the different structural elements can b Segments -------- -A segment is collection of data points that forms a single waveform. You can think of this as for example, the set of pulses that does the readout on you sample. m +A segment is the collection of data points that forms a single waveform. For example, the set of pulses one would apply on one the gates for the sample to perform the readout. Note that a segment only contains the information for one channel. There are two types of segments: - - segments_base : these are segments that should be used for generating block pulses and ramps. + - :ref:`segments_base<segment_base>` : these are segments that should be used for generating block pulses and ramps. - segments_IQ : these are segments that are used to work with IQ signals of vector MW sources. -Both types can be used interchangeably. More details can be found in the tutorials (or if you feel really courageous in the source code). +Both types can be used interchangeably. More details can be found in the later chapters (or if you feel really courageous in the source code). .. _seg_con: Segment containers ------------------ -A segment container, as the name already gives away, is a container of channels. If we would think of the example before, than in this element you would have the collection of all the channels that are involved in your readout pulse. This object is generated automatically, so no need for you to specify channels each time. +A segment container, as the name already gives away, is a container of channels. For example, this could be the collection of all the channels that are involved in your readout pulse. This object is generated automatically, so no need for you to specify channels each time. There are some rules for segment containers though, - All segments in a segment container must have the same length when rendered @@ -46,5 +46,5 @@ Sequences --------- Sequences are a collection of segment containers. Basically it means just concatenate different segment containers. -One could for example make 3 segment containers, on for initialization of the qubits, one for manipulation and one for readout. -When executing the experiment, you would tell the the AWG, play initialization -> manipulation -> readout. +One could for example make a sequence of three segment containers, on that would contain also the pulse data for initialization, one for manipulation and one for readout of the qubits. +When executing the experiment, you would tell the the AWG to play this sequence of elements. diff --git a/docs/_build/html/_sources/tutorials/init_lib.rst.txt b/docs/_build/html/_sources/tutorials/init_lib.rst.txt index e0b1db7a8d589269326bd78f6395fda0d6277ef6..5c3af3b4380acf315a1a0e68fff9a36b150ba120 100644 --- a/docs/_build/html/_sources/tutorials/init_lib.rst.txt +++ b/docs/_build/html/_sources/tutorials/init_lib.rst.txt @@ -9,7 +9,8 @@ Before making a pulse, the pulse library needs to know some stuff from you. The - Translation of you sample channels names (e.g. barrier gate 1) to the physical location if the set up (e.g. AWG3 channel 4) - Virtual gates and virtual gate matrix if needed <reference needed here> - Virtual IQ channels, if you are doing IQ modulation <link explaining IQ modulation > - - Channels delay's (e.g. if not all you coaxes have the same length) + - :ref:`Channels delay's<chan_delay>` (e.g. if not all you coaxes have the same length) + - Which channel need a :ref:`DC offset compenstation<dc_offset_comp>` and what the what the allowed values are. All these properties are contained in the ``pulselib`` object. Below a complete example is worked out to explaining how to do this. The source code of the example can be found in ``tutorials/init_pulselib.py`` if you would want to execute it yourselves. @@ -28,7 +29,7 @@ Practically the things that we want to set are: 1. Which channels of the AWG are corresponding to the gates on the sample. 2. Virtual gates to move easily around in charge stability diagrams. 3. Two virtual IQ channels, one per qubit. - 4. A channel delay for the MW channel, to compensate for the time that the waveform spends in the vector signal source generator. + 4. A :ref:`channel delay<chan_delay>` for the MW channel, to compensate for the time that the waveform spends in the vector signal source generator. 5. Voltage compensation boundaries for :ref:`DC offsets<dc_offset_comp>`. Step 1 : initializing the pulse lib object and defining real gates @@ -118,9 +119,11 @@ Most of the time, you will want to make a virtual channel per qubit, as it allow At the moment markers are not added automatically, this is something that will be implemented in the next release of this library. +.. _pulse_lib_chan_delay: + Step 4 : defining channel delays ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -In our case here, we have to compensate for the fact that some signals take a longer time to get to the sample than other ones. More info on how this is practically accomplished, can be found here ``TODO``. +In our case here, we have to compensate for the fact that some signals take a longer time to get to the sample than other ones. More info on how this is practically accomplished, can be found :ref:`here<chan_delay>`. Practically, example latencies could be the following: - 20 ns for the barrier and plunger gates to get from the AWG channels into the fridge. diff --git a/docs/_build/html/_sources/tutorials/simple_pulse.rst.txt b/docs/_build/html/_sources/tutorials/simple_pulse.rst.txt index 9e5897f2ef129851f03b6277e146106975253847..c98fd74f354c8cc40ca6d397bf48ebb2f7472eda 100644 --- a/docs/_build/html/_sources/tutorials/simple_pulse.rst.txt +++ b/docs/_build/html/_sources/tutorials/simple_pulse.rst.txt @@ -60,21 +60,19 @@ In this case, we have quite a few gates available (defined in the :ref:`init of Segment operations """""""""""""""""" -A segment is the entity where you can make you pulses. On a segment you can apply an unlimited amount of operations. -When the operation changes something to the waveform, it is usually done by adding it up to what is already there. Thus when retaking the example of before, doing +A segment is the entity that is used to define pulses in function of time. Segments are usually constructed by counting up simple elements (e.g. block pulses, ramps and sinus shaped features). +The example below shows two waveforms getting counted up (just an extension of the one in the previous section). .. code-block:: python my_new_pulse_container.P1.add_block(start, stop, amp) - my_new_pulse_container.P1.add_block(start, stop, amp) - -is equivalent to doing, + my_new_pulse_container.P1.add_block(start+10, stop+10, amp) -.. code-block:: python +The resulting pulse of this operation is: - my_new_pulse_container.P1.add_block(start, stop, amp) +<< figure >> -The operations possible at this moment are: +Default operations are (can be extended if needed): - adding block shaped pulses - adding ramp's @@ -94,12 +92,22 @@ Important operators are: To get intuition what each of this operators does, it is best to try to execute (and change) some of the examples given in the beginning. -segment container operations +Segment container operations """""""""""""""""""""""""""" -This is the container that +As mentioned before, this are the containers that contain all the segments and allow you to do also some operation on all the segments at the same time. + +Operations include: + + - total_time : get maximal time in all the segments present + - append : concatenate one segment container to another one. + - slice time : redefine start and end time of all the segments present in the segment container + - reset time : define total_time in all segments as the new time zero. + +More on operation can be found in the segment container tutorial. How do virtual gates exactly work here? """"""""""""""""""""""""""""""""""""""" +As you \ No newline at end of file diff --git a/docs/_build/html/autodoc/base_pulse.html b/docs/_build/html/autodoc/base_pulse.html new file mode 100644 index 0000000000000000000000000000000000000000..c70ab8771f100f91106551ef39901168c77cf4c7 --- /dev/null +++ b/docs/_build/html/autodoc/base_pulse.html @@ -0,0 +1,301 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title><no title> — pulse lib 0.2 alpha documentation</title> + + + + + + + + + + + + + + + + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + + + <script src="../_static/js/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search"> + + + + <a href="../index.html" class="icon icon-home"> pulse lib + + + + </a> + + + + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <!-- Local TOC --> + <div class="local-toc"><ul class="simple"> +</ul> +</div> + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">pulse lib</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../index.html">Docs</a> »</li> + + <li><no title></li> + + + <li class="wy-breadcrumbs-aside"> + + + <a href="../_sources/autodoc/base_pulse.rst.txt" rel="nofollow"> View page source</a> + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <span class="target" id="module-base_pulse"></span><dl class="class"> +<dt id="base_pulse.pulselib"> +<em class="property">class </em><code class="descclassname">base_pulse.</code><code class="descname">pulselib</code><a class="reference internal" href="../_modules/base_pulse.html#pulselib"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib" title="Permalink to this definition">¶</a></dt> +<dd><p>Global class that is an organisational element in making the pulses. +The idea is that you first make individula segments, +you can than later combine them into a sequence, this sequence will be uploaded</p> +<dl class="method"> +<dt id="base_pulse.pulselib.add_IQ_virt_channels"> +<code class="descname">add_IQ_virt_channels</code><span class="sig-paren">(</span><em>IQ_virt_channels</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/base_pulse.html#pulselib.add_IQ_virt_channels"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib.add_IQ_virt_channels" title="Permalink to this definition">¶</a></dt> +<dd><p>function to define virtual IQ channels (a channel that combined the I and Q channel for MW applications): +Args:</p> +<blockquote> +<div><dl class="docutils"> +<dt>IQ_virt_channels (dict): a dictionary that needs to contain the following keys:</dt> +<dd>‘vIQ_channels’ : list of names of virtual IQ channels +‘r_IQ_channels’: list of list, where in each list the two reference channels (I and Q) are denoted (see docs for example). +‘LO_freq’(function/double) : local oscillating frequency of the source. Will be used to do automaticcally convert the freq a SSB signal.</dd> +</dl> +</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="base_pulse.pulselib.add_awgs"> +<code class="descname">add_awgs</code><span class="sig-paren">(</span><em>name</em>, <em>awg</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/base_pulse.html#pulselib.add_awgs"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib.add_awgs" title="Permalink to this definition">¶</a></dt> +<dd><p>add a awg to the library +Args:</p> +<blockquote> +<div>name (str) : name you want to give to a peculiar AWG +awg (object) : qcodes object of the concerning AWG</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="base_pulse.pulselib.add_channel_compenstation_limits"> +<code class="descname">add_channel_compenstation_limits</code><span class="sig-paren">(</span><em>limits</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/base_pulse.html#pulselib.add_channel_compenstation_limits"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib.add_channel_compenstation_limits" title="Permalink to this definition">¶</a></dt> +<dd><p>add voltage limitations per channnel that can be used to make sure that the intragral of the total voltages is 0. +Args:</p> +<blockquote> +<div>limits (dict) : dict with limits e.g. {‘B0’:(-100,500), … }</div></blockquote> +<dl class="docutils"> +<dt>Returns:</dt> +<dd>None</dd> +</dl> +</dd></dl> + +<dl class="method"> +<dt id="base_pulse.pulselib.add_channel_delay"> +<code class="descname">add_channel_delay</code><span class="sig-paren">(</span><em>delays</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/base_pulse.html#pulselib.add_channel_delay"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib.add_channel_delay" title="Permalink to this definition">¶</a></dt> +<dd><p>Adds to a channel a delay. +The delay is added by adding points in front of the first sequence/or +just after the last sequence. The first value of the sequence will be +taken as an extentsion point.</p> +<dl class="docutils"> +<dt>Args:</dt> +<dd>delays: dict, e.g. {‘P1’:20, ‘P2’:16} delay P1 with 20 ns and P2 with 16 ns</dd> +<dt>Returns:</dt> +<dd>0/Error</dd> +</dl> +</dd></dl> + +<dl class="method"> +<dt id="base_pulse.pulselib.add_virtual_gates"> +<code class="descname">add_virtual_gates</code><span class="sig-paren">(</span><em>virtual_gates</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/base_pulse.html#pulselib.add_virtual_gates"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib.add_virtual_gates" title="Permalink to this definition">¶</a></dt> +<dd><p>define virtual gates for the gate set. +Args:</p> +<blockquote> +<div><dl class="docutils"> +<dt>virtual_gates (dict): needs to have the following keys:</dt> +<dd>‘virtual_gates_names_virt’ : should constain a list with the channel names of the virtual gates +‘virtual_gates_names_real’ : should constain a list with the channel names of the read gates (should be as long as the virtual ones) +‘virtual_gate_matrix’ : numpy array representing the virtual gate matrix</dd> +</dl> +</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="base_pulse.pulselib.define_channels"> +<code class="descname">define_channels</code><span class="sig-paren">(</span><em>my_input</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/base_pulse.html#pulselib.define_channels"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib.define_channels" title="Permalink to this definition">¶</a></dt> +<dd><p>define the channels and their location +Args:</p> +<blockquote> +<div>my_input (dict): dict of the channel name (str) as key and name of the instrument (as given in add_awgs()) (str) and channel (int) as tuple (e.g. {‘chan1’ : (‘AWG1’, 1), … })</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="base_pulse.pulselib.mk_segment"> +<code class="descname">mk_segment</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/base_pulse.html#pulselib.mk_segment"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib.mk_segment" title="Permalink to this definition">¶</a></dt> +<dd><p>generate a new segment. +Returns:</p> +<blockquote> +<div>segment (segment_container) : returns a container that contains all the previously defined gates.</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="base_pulse.pulselib.mk_sequence"> +<code class="descname">mk_sequence</code><span class="sig-paren">(</span><em>seq</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/base_pulse.html#pulselib.mk_sequence"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#base_pulse.pulselib.mk_sequence" title="Permalink to this definition">¶</a></dt> +<dd><dl class="docutils"> +<dt>seq: list of list, </dt> +<dd>e.g. [ [‘name segment 1’ (str), number of times to play (int), prescale (int)] ] +prescale (default 0, see keysight manual) (not all awg’s will support this).</dd> +</dl> +</dd></dl> + +</dd></dl> + + + + </div> + + </div> + <footer> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019, Stephan Philips + + </p> + </div> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + + + + + <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + <script type="text/javascript" src="../_static/language_data.js"></script> + <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/_build/html/autodoc/segment.html b/docs/_build/html/autodoc/segment.html new file mode 100644 index 0000000000000000000000000000000000000000..bd114ae64666b979d04874827521c62715e5ee6f --- /dev/null +++ b/docs/_build/html/autodoc/segment.html @@ -0,0 +1,305 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title><no title> — pulse lib 0.2 alpha documentation</title> + + + + + + + + + + + + + + + + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + + + <script src="../_static/js/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search"> + + + + <a href="../index.html" class="icon icon-home"> pulse lib + + + + </a> + + + + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <!-- Local TOC --> + <div class="local-toc"><ul class="simple"> +</ul> +</div> + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">pulse lib</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../index.html">Docs</a> »</li> + + <li><no title></li> + + + <li class="wy-breadcrumbs-aside"> + + + <a href="../_sources/autodoc/segment.rst.txt" rel="nofollow"> View page source</a> + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <span class="target" id="module-segments.segments"></span><dl class="class"> +<dt id="segments.segments.segment_container"> +<em class="property">class </em><code class="descclassname">segments.segments.</code><code class="descname">segment_container</code><span class="sig-paren">(</span><em>real_channels</em>, <em>virtual_gates=None</em>, <em>IQ_channels=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments.html#segment_container"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments.segment_container" title="Permalink to this definition">¶</a></dt> +<dd><p>Class containing all the single segments for for a series of channels. +This is a organisational class. +Class is capable of checking wheather upload is needed. +Class is capable of termining what volatages are required for each channel. +Class returns vmin/vmax data to awg object +Class returns upload data as a numpy<double> array to awg object.</p> +<dl class="method"> +<dt id="segments.segments.segment_container.append"> +<code class="descname">append</code><span class="sig-paren">(</span><em>other</em>, <em>time=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments.html#segment_container.append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments.segment_container.append" title="Permalink to this definition">¶</a></dt> +<dd><p>append other segments the the current ones in the container. +Args:</p> +<blockquote> +<div>other (segment_container) : other segment to append</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments.segment_container.enter_rendering_mode"> +<code class="descname">enter_rendering_mode</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments.html#segment_container.enter_rendering_mode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments.segment_container.enter_rendering_mode" title="Permalink to this definition">¶</a></dt> +<dd><p>put the segments into rendering mode, which means that they cannot be changed. All segments will get their final length at this moment.</p> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments.segment_container.exit_rendering_mode"> +<code class="descname">exit_rendering_mode</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments.html#segment_container.exit_rendering_mode"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments.segment_container.exit_rendering_mode" title="Permalink to this definition">¶</a></dt> +<dd><p>exit rendering mode and clear all the ram that was used for the rendering.</p> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments.segment_container.extend_dim"> +<code class="descname">extend_dim</code><span class="sig-paren">(</span><em>shape=None</em>, <em>ref=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments.html#segment_container.extend_dim"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments.segment_container.extend_dim" title="Permalink to this definition">¶</a></dt> +<dd><p>extend the dimensions of the waveform to a given shape. +Args:</p> +<blockquote> +<div>shape (tuple) : shape of the new waveform +ref (bool) : put to True if you want to extend the dimension by using pointers instead of making full copies.</div></blockquote> +<p>If referencing is True, a pre-render will already be performed to make sure nothing is rendered double.</p> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments.segment_container.get_waveform"> +<code class="descname">get_waveform</code><span class="sig-paren">(</span><em>channel, index=[0], pre_delay=0, post_delay=0, sample_rate=1000000000.0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments.html#segment_container.get_waveform"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments.segment_container.get_waveform" title="Permalink to this definition">¶</a></dt> +<dd><p>function to get the raw data of a waveform, +inputs:</p> +<blockquote> +<div>channel (str) : channel name of the waveform you want +index (tuple) : +pre_delay (int) : extra offset in from of the waveform (start at negative time) (for a certain channel, as defined in channel delays) +post_delay (int) : time gets appended to the waveform (for a certain channel)</div></blockquote> +<dl class="docutils"> +<dt>returns:</dt> +<dd>np.ndarray[ndim=1, dtype=double] : waveform as a numpy array</dd> +</dl> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments.segment_container.reset_time"> +<code class="descname">reset_time</code><span class="sig-paren">(</span><em>extend_only=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments.html#segment_container.reset_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments.segment_container.reset_time" title="Permalink to this definition">¶</a></dt> +<dd><dl class="docutils"> +<dt>Args:</dt> +<dd>extend_only (bool) : will just extend the time in the segment and not reset it if set to true [do not use when composing wavoforms…].</dd> +</dl> +<p>Allings all segments togeter and sets the input time to 0, +e.g. , +chan1 : waveform until 70 ns +chan2 : waveform until 140ns +-> totaltime will be 140 ns, +when you now as a new pulse (e.g. at time 0, it will actually occur at 140 ns in both blocks)</p> +</dd></dl> + +<dl class="attribute"> +<dt id="segments.segments.segment_container.shape"> +<code class="descname">shape</code><a class="headerlink" href="#segments.segments.segment_container.shape" title="Permalink to this definition">¶</a></dt> +<dd><p>get combined shape of all the waveforms</p> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments.segment_container.slice_time"> +<code class="descname">slice_time</code><span class="sig-paren">(</span><em>start</em>, <em>stop</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments.html#segment_container.slice_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments.segment_container.slice_time" title="Permalink to this definition">¶</a></dt> +<dd><p>slice time in a segment container +Args:</p> +<blockquote> +<div>start (double) : start time of the slice +stop (double) : stop time of the slice</div></blockquote> +<p>The slice_time function allows you to cut all the waveforms in the segment container in different sizes. +This function should be handy for debugging, example usage would be, +You are runnning an algorithm and want to check what the measurement outcomes are though the whole algorithm. +Pratically, you want to know</p> +<blockquote> +<div>0 -> 10ns (@10 ns still everything as expected?) +0 -> 20ns +0 -> …</div></blockquote> +<p>This function would allow you to do that, e.g. by calling segment_container.cut_segment(0, lp.linspace(10,100,9))</p> +</dd></dl> + +<dl class="attribute"> +<dt id="segments.segments.segment_container.total_time"> +<code class="descname">total_time</code><a class="headerlink" href="#segments.segments.segment_container.total_time" title="Permalink to this definition">¶</a></dt> +<dd><p>get the total time that will be uploaded for this segment to the AWG +Returns:</p> +<blockquote> +<div>times (np.ndarray) : numpy array with the total time (maximum of all the channels), for all the different loops executed.</div></blockquote> +</dd></dl> + +</dd></dl> + + + + </div> + + </div> + <footer> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019, Stephan Philips + + </p> + </div> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + + + + + <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + <script type="text/javascript" src="../_static/language_data.js"></script> + <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/_build/html/autodoc/segment_IQ.html b/docs/_build/html/autodoc/segment_IQ.html new file mode 100644 index 0000000000000000000000000000000000000000..3c2802dad1799ca92692c2dc0a2b16b9cb839542 --- /dev/null +++ b/docs/_build/html/autodoc/segment_IQ.html @@ -0,0 +1,230 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title><no title> — pulse lib 0.2 alpha documentation</title> + + + + + + + + + + + + + + + + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + + + <script src="../_static/js/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search"> + + + + <a href="../index.html" class="icon icon-home"> pulse lib + + + + </a> + + + + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <!-- Local TOC --> + <div class="local-toc"><ul class="simple"> +</ul> +</div> + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">pulse lib</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../index.html">Docs</a> »</li> + + <li><no title></li> + + + <li class="wy-breadcrumbs-aside"> + + + <a href="../_sources/autodoc/segment_IQ.rst.txt" rel="nofollow"> View page source</a> + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <span class="target" id="module-segments.segments_IQ"></span><p>Class that can be used to construct IQ pulses for qubit control applications.</p> +<p>Possible pulses include: +* standard block pulse +* chirped pulse for adiabatic spin operation +* modulated pulsed.</p> +<p>As data format we will use a class to store +* type (std, chrip, mod) +* t0 +* te +* freq1 +* freq2 (opt) +* amp +* phase</p> +<dl class="class"> +<dt id="segments.segments_IQ.segment_single_IQ"> +<em class="property">class </em><code class="descclassname">segments.segments_IQ.</code><code class="descname">segment_single_IQ</code><span class="sig-paren">(</span><em>name</em>, <em>LO</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_IQ.html#segment_single_IQ"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_IQ.segment_single_IQ" title="Permalink to this definition">¶</a></dt> +<dd><p>Standard single segment for IQ purposes +todo –> add global phase and time shift in the data class instead of this one (cleaner and more generic).</p> +<dl class="method"> +<dt id="segments.segments_IQ.segment_single_IQ.get_IQ_data"> +<code class="descname">get_IQ_data</code><span class="sig-paren">(</span><em>I_or_Q</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_IQ.html#segment_single_IQ.get_IQ_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_IQ.segment_single_IQ.get_IQ_data" title="Permalink to this definition">¶</a></dt> +<dd><p>get I and Q data from the main element. +Args:</p> +<blockquote> +<div>I_or_Q (str) : ‘I’/’Q’, denoting if you want the I or the Q channel</div></blockquote> +<dl class="docutils"> +<dt>Returns:</dt> +<dd>data (np.ndarray) : array with the objects inside</dd> +</dl> +</dd></dl> + +</dd></dl> + + + + </div> + + </div> + <footer> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019, Stephan Philips + + </p> + </div> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + + + + + <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + <script type="text/javascript" src="../_static/language_data.js"></script> + <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/_build/html/autodoc/segment_base.html b/docs/_build/html/autodoc/segment_base.html new file mode 100644 index 0000000000000000000000000000000000000000..c87e56f53830df7b38cb7a0912b269c6b22dbf83 --- /dev/null +++ b/docs/_build/html/autodoc/segment_base.html @@ -0,0 +1,350 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Segment base class desription — pulse lib 0.2 alpha documentation</title> + + + + + + + + + + + + + + + + <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="../genindex.html" /> + <link rel="search" title="Search" href="../search.html" /> + + + <script src="../_static/js/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search"> + + + + <a href="../index.html" class="icon icon-home"> pulse lib + + + + </a> + + + + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="../search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <!-- Local TOC --> + <div class="local-toc"><ul> +<li><a class="reference internal" href="#">Segment base class desription</a></li> +</ul> +</div> + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="../index.html">pulse lib</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="../index.html">Docs</a> »</li> + + <li>Segment base class desription</li> + + + <li class="wy-breadcrumbs-aside"> + + + <a href="../_sources/autodoc/segment_base.rst.txt" rel="nofollow"> View page source</a> + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <div class="section" id="segment-base-class-desription"> +<span id="segment-base"></span><h1>Segment base class desription<a class="headerlink" href="#segment-base-class-desription" title="Permalink to this headline">¶</a></h1> +<dl class="class"> +<dt id="segments.segments_base.segment_single"> +<em class="property">class </em><code class="descclassname">segments.segments_base.</code><code class="descname">segment_single</code><span class="sig-paren">(</span><em>name</em>, <em>segment_type='render'</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single" title="Permalink to this definition">¶</a></dt> +<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p> +<p>Class defining single segments for one sequence. +This is at the moment rather basic. Here should be added more fuctions.</p> +<dl class="method"> +<dt id="segments.segments_base.segment_single.add_IQ_ref_channel"> +<code class="descname">add_IQ_ref_channel</code><span class="sig-paren">(</span><em>channel_name</em>, <em>pointer_to_channel</em>, <em>I_or_Q_part</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.add_IQ_ref_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.add_IQ_ref_channel" title="Permalink to this definition">¶</a></dt> +<dd><p>Add a reference to an IQ channel. Same principle as for the virtual one. +Args:</p> +<blockquote> +<div>channel_name (str): human readable name of the virtual channel +pointer_to_channel (<a href="#id1"><span class="problematic" id="id2">*</span></a>segment_single_IQ): pointer to segment_single_IQ object +I_or_Q_part (str) : ‘I’ or ‘Q’ to indicate that the reference is to the I or Q part of the signal.</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.add_block"> +<code class="descname">add_block</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.add_block"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.add_block" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.add_np"> +<code class="descname">add_np</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.add_np"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.add_np" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.add_pulse"> +<code class="descname">add_pulse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.add_pulse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.add_pulse" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.add_ramp"> +<code class="descname">add_ramp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.add_ramp"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.add_ramp" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.add_reference_channel"> +<code class="descname">add_reference_channel</code><span class="sig-paren">(</span><em>channel_name</em>, <em>segment_data</em>, <em>multiplication_factor</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.add_reference_channel"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.add_reference_channel" title="Permalink to this definition">¶</a></dt> +<dd><p>Add channel reference, this can be done to make by making a pointer to another segment. +Args:</p> +<blockquote> +<div>Channels_name (str): human readable name of the virtual gate. +segment_data (segment_single): pointer so the segment corresponsing the the channel name +multiplication_factor (float64): times how much this segment should be added to the current one.</div></blockquote> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.add_sin"> +<code class="descname">add_sin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.add_sin"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.add_sin" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.append"> +<code class="descname">append</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.append"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.append" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.get_segment"> +<code class="descname">get_segment</code><span class="sig-paren">(</span><em>index</em>, <em>pre_delay=0</em>, <em>post_delay=0</em>, <em>sample_rate=1000000000.0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.get_segment"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.get_segment" title="Permalink to this definition">¶</a></dt> +<dd><dl class="docutils"> +<dt>input:</dt> +<dd>index of segment (list) : which segment to render (e.g. [0] if dimension is 1 or [2,5,10] if dimension is 3) +pre_delay : number of points to push before the sequence +post delay: number of points to push after the sequence. +sample rate : #/s (number of samples per second)</dd> +<dt>Returns:</dt> +<dd>A numpy array that contains the points for each ns +points is the expected lenght.</dd> +</dl> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.integrate"> +<code class="descname">integrate</code><span class="sig-paren">(</span><em>index</em>, <em>pre_delay=0</em>, <em>post_delay=0</em>, <em>sample_rate=1000000000.0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.integrate"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.integrate" title="Permalink to this definition">¶</a></dt> +<dd><p>get integral value of the waveform (e.g. to calculate an automatic compensation) +Args:</p> +<blockquote> +<div>index (tuple) : index of the concerning waveform +pre_delay (double) : ns to delay before the pulse +post_delay (double) : ns to delay after the pulse +sample_rate (double) : rate at which to render the pulse</div></blockquote> +<p>returns: intergral value</p> +</dd></dl> + +<dl class="attribute"> +<dt id="segments.segments_base.segment_single.last_edit"> +<code class="descname">last_edit</code><a class="headerlink" href="#segments.segments_base.segment_single.last_edit" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.plot_segment"> +<code class="descname">plot_segment</code><span class="sig-paren">(</span><em>index=[0], render_full=True</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.plot_segment"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.plot_segment" title="Permalink to this definition">¶</a></dt> +<dd><dl class="docutils"> +<dt>Args:</dt> +<dd>index : index of which segment to plot +render full (bool) : do full render (e.g. also get data form virtual channels). Put True if you want to see the waveshape send to the AWG.</dd> +</dl> +</dd></dl> + +<dl class="attribute"> +<dt id="segments.segments_base.segment_single.pulse_data_all"> +<code class="descname">pulse_data_all</code><a class="headerlink" href="#segments.segments_base.segment_single.pulse_data_all" title="Permalink to this definition">¶</a></dt> +<dd><p>pulse data object that contains the counted op data of all the reference channels (e.g. IQ and virtual gates).</p> +</dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.repeat"> +<code class="descname">repeat</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.repeat"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.repeat" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.reset_time"> +<code class="descname">reset_time</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.reset_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.reset_time" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="attribute"> +<dt id="segments.segments_base.segment_single.shape"> +<code class="descname">shape</code><a class="headerlink" href="#segments.segments_base.segment_single.shape" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.slice_time"> +<code class="descname">slice_time</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.slice_time"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.slice_time" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="attribute"> +<dt id="segments.segments_base.segment_single.total_time"> +<code class="descname">total_time</code><a class="headerlink" href="#segments.segments_base.segment_single.total_time" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.v_max"> +<code class="descname">v_max</code><span class="sig-paren">(</span><em>index</em>, <em>sample_rate=1000000000.0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.v_max"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.v_max" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.v_min"> +<code class="descname">v_min</code><span class="sig-paren">(</span><em>index</em>, <em>sample_rate=1000000000.0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.v_min"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.v_min" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +<dl class="method"> +<dt id="segments.segments_base.segment_single.wait"> +<code class="descname">wait</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/segments/segments_base.html#segment_single.wait"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#segments.segments_base.segment_single.wait" title="Permalink to this definition">¶</a></dt> +<dd></dd></dl> + +</dd></dl> + +</div> + + + </div> + + </div> + <footer> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019, Stephan Philips + + </p> + </div> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + + + + + <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script> + <script type="text/javascript" src="../_static/jquery.js"></script> + <script type="text/javascript" src="../_static/underscore.js"></script> + <script type="text/javascript" src="../_static/doctools.js"></script> + <script type="text/javascript" src="../_static/language_data.js"></script> + <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + + + + + <script type="text/javascript" src="../_static/js/theme.js"></script> + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/_build/html/channel_delays.html b/docs/_build/html/channel_delays.html new file mode 100644 index 0000000000000000000000000000000000000000..1f235aeacce0006a573945ba8886f653c4a464a7 --- /dev/null +++ b/docs/_build/html/channel_delays.html @@ -0,0 +1,219 @@ + + +<!DOCTYPE html> +<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]--> +<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> +<head> + <meta charset="utf-8"> + + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + + <title>Channels delays — pulse lib 0.2 alpha documentation</title> + + + + + + + + + + + + + + + + <link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> + <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> + <link rel="index" title="Index" href="genindex.html" /> + <link rel="search" title="Search" href="search.html" /> + + + <script src="_static/js/modernizr.min.js"></script> + +</head> + +<body class="wy-body-for-nav"> + + + <div class="wy-grid-for-nav"> + + + <nav data-toggle="wy-nav-shift" class="wy-nav-side"> + <div class="wy-side-scroll"> + <div class="wy-side-nav-search"> + + + + <a href="index.html" class="icon icon-home"> pulse lib + + + + </a> + + + + + + + +<div role="search"> + <form id="rtd-search-form" class="wy-form" action="search.html" method="get"> + <input type="text" name="q" placeholder="Search docs" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> +</div> + + + </div> + + <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation"> + + + + + + + <!-- Local TOC --> + <div class="local-toc"><ul> +<li><a class="reference internal" href="#">Channels delays</a></li> +</ul> +</div> + + + </div> + </div> + </nav> + + <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"> + + + <nav class="wy-nav-top" aria-label="top navigation"> + + <i data-toggle="wy-nav-top" class="fa fa-bars"></i> + <a href="index.html">pulse lib</a> + + </nav> + + + <div class="wy-nav-content"> + + <div class="rst-content"> + + + + + + + + + + + + + + + + + +<div role="navigation" aria-label="breadcrumbs navigation"> + + <ul class="wy-breadcrumbs"> + + <li><a href="index.html">Docs</a> »</li> + + <li>Channels delays</li> + + + <li class="wy-breadcrumbs-aside"> + + + <a href="_sources/channel_delays.rst.txt" rel="nofollow"> View page source</a> + + + </li> + + </ul> + + + <hr/> +</div> + <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> + <div itemprop="articleBody"> + + <div class="section" id="channels-delays"> +<span id="chan-delay"></span><h1>Channels delays<a class="headerlink" href="#channels-delays" title="Permalink to this headline">¶</a></h1> +<p>Some signals that you send to you sample, take a different path then others. This causes a slightly different time of arrival (usually a few tens of ns). +It is possible to compenstate for these small offsets by pushing waveforms slightly forward or backward.</p> +<p>Let’s consider a simple example. Let’s set we define in the <a class="reference internal" href="tutorials/init_lib.html#pulse-lib-chan-delay"><span class="std std-ref">pulselib</span></a> object the following delays:</p> +<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">pulse</span><span class="o">.</span><span class="n">add_channel_delay</span><span class="p">({</span> + <span class="s1">'chan 1'</span><span class="p">:</span> <span class="o">-</span><span class="mi">20</span><span class="p">,</span> + <span class="s1">'chan 2'</span><span class="p">:</span> <span class="o">-</span><span class="mi">20</span><span class="p">,</span> + <span class="s1">'chan 3'</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> + <span class="s1">'chan 4'</span><span class="p">:</span> <span class="mi">20</span><span class="p">,</span> + <span class="s1">'chan 5'</span><span class="p">:</span> <span class="mi">20</span> +<span class="p">})</span> +</pre></div> +</div> +<p>It means channel 1 and 2 need to arrive 20 ns before what we call our reference. For the other channels we want the signal to arrive 20 ns after. The image below shows how this is done:</p> +<div class="figure"> +<img alt="_images/channel_delays.png" src="_images/channel_delays.png" /> +</div> +<p>As you can see here, for channel 1 and 2, in the segment container object, the segments are artifically made a bit longer by pushing data points in front of it. +By default the value of this point will be the first value in case there was no correction. The same counts for the last data point.</p> +</div> + + + </div> + + </div> + <footer> + + + <hr/> + + <div role="contentinfo"> + <p> + © Copyright 2019, Stephan Philips + + </p> + </div> + Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. + +</footer> + + </div> + </div> + + </section> + + </div> + + + + + + + + <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script> + <script type="text/javascript" src="_static/jquery.js"></script> + <script type="text/javascript" src="_static/underscore.js"></script> + <script type="text/javascript" src="_static/doctools.js"></script> + <script type="text/javascript" src="_static/language_data.js"></script> + <script async="async" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script> + + + + + <script type="text/javascript" src="_static/js/theme.js"></script> + + <script type="text/javascript"> + jQuery(function () { + SphinxRtdTheme.Navigation.enable(true); + }); + </script> + +</body> +</html> \ No newline at end of file diff --git a/docs/_build/html/genindex.html b/docs/_build/html/genindex.html index 4db2b29e41bbe0e49a7cce5c60f1fac11301155b..e9488b687b934eb4637563c40860a0cdbaf9bef6 100644 --- a/docs/_build/html/genindex.html +++ b/docs/_build/html/genindex.html @@ -143,8 +143,224 @@ <h1 id="index">Index</h1> <div class="genindex-jumpbox"> + <a href="#A"><strong>A</strong></a> + | <a href="#B"><strong>B</strong></a> + | <a href="#D"><strong>D</strong></a> + | <a href="#E"><strong>E</strong></a> + | <a href="#G"><strong>G</strong></a> + | <a href="#I"><strong>I</strong></a> + | <a href="#L"><strong>L</strong></a> + | <a href="#M"><strong>M</strong></a> + | <a href="#P"><strong>P</strong></a> + | <a href="#R"><strong>R</strong></a> + | <a href="#S"><strong>S</strong></a> + | <a href="#T"><strong>T</strong></a> + | <a href="#V"><strong>V</strong></a> + | <a href="#W"><strong>W</strong></a> </div> +<h2 id="A">A</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib.add_awgs">add_awgs() (base_pulse.pulselib method)</a> +</li> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.add_block">add_block() (segments.segments_base.segment_single method)</a> +</li> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib.add_channel_compenstation_limits">add_channel_compenstation_limits() (base_pulse.pulselib method)</a> +</li> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib.add_channel_delay">add_channel_delay() (base_pulse.pulselib method)</a> +</li> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.add_IQ_ref_channel">add_IQ_ref_channel() (segments.segments_base.segment_single method)</a> +</li> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib.add_IQ_virt_channels">add_IQ_virt_channels() (base_pulse.pulselib method)</a> +</li> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.add_np">add_np() (segments.segments_base.segment_single method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.add_pulse">add_pulse() (segments.segments_base.segment_single method)</a> +</li> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.add_ramp">add_ramp() (segments.segments_base.segment_single method)</a> +</li> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.add_reference_channel">add_reference_channel() (segments.segments_base.segment_single method)</a> +</li> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.add_sin">add_sin() (segments.segments_base.segment_single method)</a> +</li> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib.add_virtual_gates">add_virtual_gates() (base_pulse.pulselib method)</a> +</li> + <li><a href="autodoc/segment.html#segments.segments.segment_container.append">append() (segments.segments.segment_container method)</a> + + <ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.append">(segments.segments_base.segment_single method)</a> +</li> + </ul></li> + </ul></td> +</tr></table> + +<h2 id="B">B</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/base_pulse.html#module-base_pulse">base_pulse (module)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="D">D</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib.define_channels">define_channels() (base_pulse.pulselib method)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="E">E</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment.html#segments.segments.segment_container.enter_rendering_mode">enter_rendering_mode() (segments.segments.segment_container method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment.html#segments.segments.segment_container.exit_rendering_mode">exit_rendering_mode() (segments.segments.segment_container method)</a> +</li> + <li><a href="autodoc/segment.html#segments.segments.segment_container.extend_dim">extend_dim() (segments.segments.segment_container method)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="G">G</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_IQ.html#segments.segments_IQ.segment_single_IQ.get_IQ_data">get_IQ_data() (segments.segments_IQ.segment_single_IQ method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.get_segment">get_segment() (segments.segments_base.segment_single method)</a> +</li> + <li><a href="autodoc/segment.html#segments.segments.segment_container.get_waveform">get_waveform() (segments.segments.segment_container method)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="I">I</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.integrate">integrate() (segments.segments_base.segment_single method)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="L">L</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.last_edit">last_edit (segments.segments_base.segment_single attribute)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="M">M</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib.mk_segment">mk_segment() (base_pulse.pulselib method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib.mk_sequence">mk_sequence() (base_pulse.pulselib method)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="P">P</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.plot_segment">plot_segment() (segments.segments_base.segment_single method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.pulse_data_all">pulse_data_all (segments.segments_base.segment_single attribute)</a> +</li> + <li><a href="autodoc/base_pulse.html#base_pulse.pulselib">pulselib (class in base_pulse)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="R">R</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.repeat">repeat() (segments.segments_base.segment_single method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment.html#segments.segments.segment_container.reset_time">reset_time() (segments.segments.segment_container method)</a> + + <ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.reset_time">(segments.segments_base.segment_single method)</a> +</li> + </ul></li> + </ul></td> +</tr></table> + +<h2 id="S">S</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment.html#segments.segments.segment_container">segment_container (class in segments.segments)</a> +</li> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single">segment_single (class in segments.segments_base)</a> +</li> + <li><a href="autodoc/segment_IQ.html#segments.segments_IQ.segment_single_IQ">segment_single_IQ (class in segments.segments_IQ)</a> +</li> + <li><a href="autodoc/segment.html#module-segments.segments">segments.segments (module)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_IQ.html#module-segments.segments_IQ">segments.segments_IQ (module)</a> +</li> + <li><a href="autodoc/segment.html#segments.segments.segment_container.shape">shape (segments.segments.segment_container attribute)</a> + + <ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.shape">(segments.segments_base.segment_single attribute)</a> +</li> + </ul></li> + <li><a href="autodoc/segment.html#segments.segments.segment_container.slice_time">slice_time() (segments.segments.segment_container method)</a> + + <ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.slice_time">(segments.segments_base.segment_single method)</a> +</li> + </ul></li> + </ul></td> +</tr></table> + +<h2 id="T">T</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment.html#segments.segments.segment_container.total_time">total_time (segments.segments.segment_container attribute)</a> + + <ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.total_time">(segments.segments_base.segment_single attribute)</a> +</li> + </ul></li> + </ul></td> +</tr></table> + +<h2 id="V">V</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.v_max">v_max() (segments.segments_base.segment_single method)</a> +</li> + </ul></td> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.v_min">v_min() (segments.segments_base.segment_single method)</a> +</li> + </ul></td> +</tr></table> + +<h2 id="W">W</h2> +<table style="width: 100%" class="indextable genindextable"><tr> + <td style="width: 33%; vertical-align: top;"><ul> + <li><a href="autodoc/segment_base.html#segments.segments_base.segment_single.wait">wait() (segments.segments_base.segment_single method)</a> +</li> + </ul></td> +</tr></table> + </div> diff --git a/docs/_build/html/objects.inv b/docs/_build/html/objects.inv index 2bef25783c8cff1afc51113e998c1aec933586ac..2b507511acf27026b940803b6923020bc11e0ccb 100644 Binary files a/docs/_build/html/objects.inv and b/docs/_build/html/objects.inv differ diff --git a/docs/_build/html/py-modindex.html b/docs/_build/html/py-modindex.html index b95620c66dd5bf68e824f370464dbdafc31e5e7e..0eb15c8411108602412774b0886c07dd9d2bb789 100644 --- a/docs/_build/html/py-modindex.html +++ b/docs/_build/html/py-modindex.html @@ -154,7 +154,7 @@ <tr> <td></td> <td> - <a href="intro.html#module-base_pulse"><code class="xref">base_pulse</code></a></td><td> + <a href="autodoc/base_pulse.html#module-base_pulse"><code class="xref">base_pulse</code></a></td><td> <em></em></td></tr> <tr class="pcap"><td></td><td> </td><td></td></tr> <tr class="cap" id="cap-s"><td></td><td> @@ -168,17 +168,12 @@ <tr class="cg-1"> <td></td> <td>    - <a href="intro.html#module-segments.data_classes"><code class="xref">segments.data_classes</code></a></td><td> + <a href="autodoc/segment.html#module-segments.segments"><code class="xref">segments.segments</code></a></td><td> <em></em></td></tr> <tr class="cg-1"> <td></td> <td>    - <a href="intro.html#module-segments.segments"><code class="xref">segments.segments</code></a></td><td> - <em></em></td></tr> - <tr class="cg-1"> - <td></td> - <td>    - <a href="intro.html#module-segments.segments_IQ"><code class="xref">segments.segments_IQ</code></a></td><td> + <a href="autodoc/segment_IQ.html#module-segments.segments_IQ"><code class="xref">segments.segments_IQ</code></a></td><td> <em></em></td></tr> </table> diff --git a/docs/_build/html/searchindex.js b/docs/_build/html/searchindex.js index 6986130b1a8ba26d91c9afd0effebca82a545dc6..24deadf9f4b03fa23226936870204d282570d370 100644 --- a/docs/_build/html/searchindex.js +++ b/docs/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({docnames:["basic_things_to_know/DC_offset_s","index","intro","struct","tutorials/MW_pulse","tutorials/Pulsing_examples/ST_qubit","tutorials/Pulsing_examples/elzerman_readout","tutorials/example_PT","tutorials/example_RB","tutorials/init_lib","tutorials/looping","tutorials/reset_time_and_slicing","tutorials/sequence","tutorials/simple_pulse"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:55},filenames:["basic_things_to_know/DC_offset_s.rst","index.rst","intro.rst","struct.rst","tutorials/MW_pulse.rst","tutorials/Pulsing_examples/ST_qubit.rst","tutorials/Pulsing_examples/elzerman_readout.rst","tutorials/example_PT.rst","tutorials/example_RB.rst","tutorials/init_lib.rst","tutorials/looping.rst","tutorials/reset_time_and_slicing.rst","tutorials/sequence.rst","tutorials/simple_pulse.rst"],objects:{},objnames:{},objtypes:{},terms:{"100e":[],"10e6":[],"10mhz":5,"10n":[],"140n":[],"1d_scan":[],"1e9":9,"1ghz":5,"1khz":5,"20e3":[],"20n":[],"20u":[],"2d_scan":[],"2e9":[],"45n":9,"50n":[],"case":[9,13],"class":[1,3],"default":[3,9],"final":5,"function":[1,5],"import":[5,9,13],"int":0,"long":[],"new":[9,13],"return":0,"short":1,"static":0,"true":[],"try":[5,13],But:13,For:[0,9,13],One:3,That:9,The:[0,3,5,9,13],There:3,These:3,Will:[],about:5,abov:[],access:13,accomplish:9,accord:0,act:0,actual:[],add:[0,9,13],add_awg:9,add_block:13,add_channel_compenstation_limit:9,add_channel_delai:9,add_iq_virt_channel:9,add_puls:[],add_sequ:[],add_sin:[],add_virtual_g:9,added:9,adding:13,addit:9,adiabat:[],advanc:1,after:13,ake:[],algorithm:[],all:[0,1,3,9,13],allow:9,along:1,alreadi:[3,13],also:[1,3,5,9,13],alwai:[],amount:[0,13],amp:13,amplitud:[],ani:[1,9,13],anoth:9,anyth:[],api:1,append:[0,13],appli:[0,13],applic:[],arbitrari:[1,13],arg:[],argument:[],around:[0,9],arrai:[],articl:[],ask:13,assum:[0,5,6],atm:1,att:[],attent:1,automat:[0,1,3,9],automaticc:[],avail:13,awai:3,awg1:9,awg2:9,awg3:9,awg4:[],awg:[0,1,3,5,9],awg_channels_to_physical_loc:9,awg_iq_channel:9,awg_virtual_g:9,axi:[],back:9,band:9,barrier:9,base:1,base_level:[],base_puls:9,basic:3,becom:13,been:9,befor:[3,9,13],begin:13,below:[0,3,9,13],benchmark:[],best:13,between:[0,3,5],biast:0,bit:5,blabla:[],bladibla:[],bladiebal:[],bladiebla:[],block:[0,3,13],bool:[],both:3,bracket:9,buffer:13,build:[],cabl:9,cach:[],calcul:0,call:[9,13],can:[0,1,3,9,13],cannot:[],capabl:[],capacitor:0,carrier:9,certain:[],chan1:[],chan2:[],chan:0,chang:[0,13],channal:[],channel:[0,1,3,13],channnel:[],character:[],charg:[0,5,6,9],chassi:9,check:13,chirp:[],chrip:[],clean:1,cleaner:[],clear:[],clear_cache_on_exit:[],coax:[0,9],coaxial:[],code:[3,9],coher:[1,5],coherenli:1,collect:3,collector:[],combin:[0,1],come:[],command:1,commannd:[],comp:0,compar:5,compens:0,compenst:1,complet:9,compon:[],compos:[],concaten:3,concept:[],concern:[],connect:9,consid:13,consist:13,constain:[],construct:[6,9],contain:[0,1,9],control:[0,1,9],control_st:[],convert:[],copi:[],correct:[0,9],correspond:9,could:[3,9],count:13,coupl:5,courag:3,creat:[5,9],current:[0,9,13],cut:[],cut_seg:[],data:[1,3,13],data_class:[],data_contain:[],dc_offset_comp:[],debug:[],declar:9,defin:[3,13],define_channel:9,delai:[],denot:[],depend:5,design:1,desir:[],detail:3,develop:1,devic:0,diagon:9,diagram:[5,6,9],dict:9,dictionari:9,differ:[1,3,5],dimens:1,dimensio:[],directli:[],discret:[],doc:[],doe:[1,3,13],doing:[5,9,13],done:[0,9,13],dot:13,doubl:[],down:[0,9],dtype:[],due:[],duobl:[],dure:1,each:[0,3,13],eas:1,easi:9,easili:9,edsr:9,effect:[],element:[3,13],elzerman:13,elzerman_puls:[],empti:3,enabl:0,end:[9,13],ensur:[],enter_rendering_mod:[],entir:[],entiti:13,equival:13,error:[],essenti:[],establish:5,everyth:[],exampl:[0,3,5,13],execut:[1,3,9,13],exist:[],exit:[],exit_rendering_mod:[],expect:[],experi:[3,5,13],explain:9,explicit:[],extend:[],extend_dim:[],extend_onli:[],extents:[],extra:9,eye:9,fact:9,fals:[],fast:0,featur:[1,13],feed:9,feel:3,few:13,filter:[0,9],finish_init:[],finiz:[],first:[1,9],follow:[0,3,5,6,9,13],form:3,format:[],found:[1,3,9],frac:5,free:[],freq1:[],freq2:[],freq:[],frequenc:9,fridg:9,from:[0,1,9,13],front:[],full:1,fulli:1,fundamet:[],garbarg:[],gate:[1,5],gener:[3,9],geq:3,get:[0,1,9,13],get_effective_point_numb:[],get_iq_data:[],get_resized_waveform:[],get_vmax:[],get_vmin:[],get_waveform:[],give:3,given:[0,1,3,13],global:[],going:9,good:[],graphic:[],grasp:13,had:0,handi:[],happen:[],has:[],have:[0,3,5,6,9,13],here:9,high:[0,1,9],highlight:[],hit:0,how:[1,9],hvi:1,i_mw:[],i_or_q:[],idea:[],imag:9,implement:9,includ:1,index:1,indic:9,individula:[],infinit:0,infit:[],info:9,inform:[3,9],init:[9,13],init_pulselib:9,initi:[1,3,5],initialis:[],input:[],insid:[],instead:[],instrument:[],integr:[0,1,9],integrate_waveform:[],interchang:3,interect:[],intiti:[],intragr:[],intro:[],introduc:13,introduct:9,intuit:13,involv:3,iq_channel:[],iq_data:[],iq_virt_channel:[],item:9,just:[3,5,9,13],keep:[5,9],kei:[],keysight:[1,9],keysight_awg:9,know:9,last:13,latenc:9,later:[],learn:13,lenght:[],length:[3,9],let:[5,6,9],level:0,lib:3,librari:1,like:[5,6,13],limit:[0,9],line:9,linear:[],link:9,linspac:[],list:[],lo_freq:9,load:5,local:[],locat:[5,9],longer:9,look:[5,6],loop:1,loopobject:[],lot:1,low:[],made:[],main:9,make:[1,3,9],manag:[],mani:[],manip:[],manipul:[3,5],manual:[],map:9,marker:9,match:9,matrix:9,max:0,maxim:[0,9],maximum:[],mean:[0,3,9],measur:[],memori:[],microwav:[9,13],might:[5,9],min:[],minim:[0,9],minimum:[],mircowav:9,mix:9,mixer:[],mk_segment:13,mk_sequenc:[],mod:[],mode:[],modul:[1,9,13],moment:[9,13],more:[1,3,5,9],most:[0,9,13],move:9,multidimension:1,multipl:[],must:3,mw_gate:9,mw_gate_i:[9,13],mw_gate_q:[9,13],mw_marker:[9,13],mw_sourc:9,my_gate_nam:13,my_input:[],my_matrix:9,my_new_pulse_contain:13,my_seg:[],mysequ:[],n_point:[],n_points1:[],n_points2:[],name:[3,9],nativ:1,ndarrai:[],ndim:[],need:[0,1,3,5,6,9,13],neg:9,neutral:[],new_data:[],next:9,none:9,normal:[],note:[3,5,9],noth:[],now:[1,5,9,13],npoint:[],npoints1:[],number:[],numer:[],numpi:13,object:[1,3,13],occup:[],occur:[],off:[5,9],offset:1,ohm:9,onc:9,one:[3,9],ones:9,onli:[3,5,9],oper:[5,9],operation_you_want_to_do:13,opt:9,option:[0,1,13],organis:[],organiz:3,origin:0,oscil:[],other:[0,9],our:[6,9],out:[0,5,9,13],outcom:[],output:9,over:0,overview:[1,3],page:1,paramet:9,part:0,pass:[0,9],peculiar:[],per:9,perform:[1,6],period1:[],period2:[],period:[],perv:[],phase:[1,9],physic:9,pictur:0,place:[],plai:3,platea:13,playback:1,plot:[],plunger:[9,13],point:[3,5,6],pointer:[],posiv:[],possibl:13,post_delai:[],power:[],practic:[0,6,9],pratic:[],pre:[],pre_delai:[],prepar:[],prescal:[],prescalor:[],present:[],previou:5,previous:[],print:13,process:9,program:13,properti:9,provid:[0,1,9],puls:[0,3,5,6],pulse_data:[],pulse_lib:[9,13],pulselib:[9,13],purpos:[],put:9,pxi:1,python:9,q_mw:[],qcode:9,qtt:9,qubit:[0,1,3,6],qubit_1:[9,13],qubit_2:[9,13],quick:3,quit:[9,13],r_iq_channel:[],rabi:[],ram:[],ramp:[3,13],ramsei:[],randomis:[],rang:[0,9],rate:[],raw:[],reach:9,read:[5,9],readout:[3,5,13],real:[],real_channel:[],realli:3,recomend:[],recommend:9,ref:0,refer:9,referenc:[],regim:6,relat:3,releas:9,remov:0,render:3,repeat:13,repres:[],request:1,requir:[],reservoir:5,reset:13,reset_tim:[],restart:13,retak:13,riq_channel:9,row:13,rule:3,run:1,runn:[],same:[3,9],sampl:[0,3,6,9],sample_r:[],save:[],scan:[],schedul:[],scheme:5,screen:9,sd_awg:9,sd_p:[],search:1,sec:[],section:5,see:[0,9],seg2:[],seg3:[],seg:[],segement:[],segment:[0,1,5,9],segment_contain:13,segment_container_obj:13,segment_singl:[],segment_single_iq:[],segments_bas:3,segments_iq:3,send:0,sens:[],separ:5,seq:[],sequenc:[0,1],seri:[],set:[0,3,9],setup:[0,3],shape:13,shift:0,should:[3,9],show:13,shrink:[],sideband:1,signal:[0,1,3,9],simpl:1,simple_puls:[],simpli:[],sine:1,singl:[1,3,6],singlet:5,singlet_tiplet_qubit:[],sinu:13,size:[],slice:13,slice_tim:[],slot:9,softwar:[0,9],some:[3,9,13],someth:[9,13],sourc:[3,9],space:5,specifi:[3,9],speciti:[],speed:1,spend:9,spin:[0,1],ssb:[],stabil:[5,9],stabilt:6,standard:[],start:[1,9,13],start_sequ:[],start_tim:[],state:[5,9],station:[],std:[],step1:[],step2:[],step:1,still:[],stop:[5,13],stop_tim:[],store:[],str:[],straightforward:9,string:[],struct:[],structur:1,stuff:9,style:[],support:1,suppport:1,sure:9,sweep:[],swept:[],swing1:[],swing2:[],swing:[],symmetr:0,sympi:1,syntax:1,system:[1,5],take:9,taken:[],tell:3,termin:[],test:[],test_link:[],than:[3,9],thei:0,them:[5,13],theori:13,thi:[0,1,3,5,9,13],thing:[5,9,13],think:3,though:[3,9],three:3,through:0,thu:[9,13],time:[0,3,5,9,13],time_reset:5,time_step:[],todo:[0,9],toget:[],togeth:13,tomographi:[],toolkit:1,top:[],total:[0,5],total_tim:[],totaltim:[],track:[5,9],translat:9,trigger:9,triplet:[],trough:[],tune:6,tunnel:5,tupl:[],tutori:[3,5,9],tutoti:[],two:[3,6,13],type:[3,13],uniqu:[],unit:9,unlimit:13,until:[],updat:9,update_virtual_gate_matrix:9,upload:[1,9],usag:13,use:[0,1,13],used:[0,3,5,9,13],using:[1,9,13],usual:[9,13],v_start1:[],v_start2:[],v_start:[],valu:[],van:[],variabl:[],vb0:[9,13],vb1:[9,13],vb2:[9,13],vb3:[],vb4:[],vb5:[],vector:[3,9],veri:5,versu:[],via:[],viq_channel:9,virtual:1,virtual_g:[],virtual_gate_matrix:9,virtual_gates_names_r:9,virtual_gates_names_virt:9,vmax:[],vmin:[],volatag:[],voltag:[0,13],voltageiq:[],vp1:[9,13],vp2:[9,13],vp3:[],vp4:[],vp5:[],wai:0,wait:13,want:[5,9,13],wave:1,waveform:[1,3,9,13],wavoform:[],weakli:5,were:9,what:[1,5,13],whaterv:[],wheather:[],when:[0,1,3,5,9,13],where:[5,13],which:[1,3,9],whole:[],wide:9,word:0,work:[1,3,9],would:[0,3,9],write:[],yet:[],you:[0,3,5,9,13],your:[1,3],yourselv:9,zeeman:5,zero:[0,9,13]},titles:["Compenstating for DC offset\u2019s","Welcome to pulse lib\u2019s documentation","<no title>","Structure of the library","Tutorial : Making pulses for Microwave control.","Controlling a ST qubit","Elzerman readout","Advanced Tutorial : Programming a process tomography experiment to characterize a two qubit gate.","Advanced Tutorial : Designing pulses for a Randomised Benchmarking experiment.","Initializing the library","Tutorial : Looping variables.","Concepts : Reset time and slicing of waveforms.","Tutotial : Making from pulses a sequence","Making simple pulses for DC control of qubits."],titleterms:{advanc:[7,8],basic:13,benchmark:8,boundari:9,channel:9,character:7,compens:9,compenst:0,concept:11,construct:13,contain:[3,13],control:[4,5,13],defin:9,delai:9,design:8,detail:0,document:1,elzerman:6,exactli:13,exampl:9,experi:[7,8],from:12,gate:[7,9,13],here:13,how:13,implement:0,indic:1,initi:9,introduct:[],lib:[1,9],librari:[3,9],loop:10,make:[4,12,13],microwav:4,object:9,offset:[0,9],oper:13,overview:[],process:7,program:7,puls:[1,4,8,9,12,13],qubit:[5,7,9,13],randomis:8,readout:6,real:9,reset:11,segment:[3,13],sequenc:[3,12],setup:9,simpl:13,slice:11,step:9,structur:3,tabl:1,test:[],time:11,tomographi:7,tutori:[4,7,8,10],tutoti:12,two:[7,9],variabl:10,virtual:[9,13],voltag:9,waveform:11,welcom:1,work:13}}) \ No newline at end of file +Search.setIndex({docnames:["autodoc/base_pulse","autodoc/segment","autodoc/segment_IQ","autodoc/segment_base","basic_things_to_know/DC_offset_s","channel_delays","index","intro","struct","tutorials/MW_pulse","tutorials/Pulsing_examples/ST_qubit","tutorials/Pulsing_examples/elzerman_readout","tutorials/example_PT","tutorials/example_RB","tutorials/init_lib","tutorials/looping","tutorials/reset_time_and_slicing","tutorials/sequence","tutorials/simple_pulse"],envversion:{"sphinx.domains.c":1,"sphinx.domains.changeset":1,"sphinx.domains.cpp":1,"sphinx.domains.javascript":1,"sphinx.domains.math":2,"sphinx.domains.python":1,"sphinx.domains.rst":1,"sphinx.domains.std":1,"sphinx.ext.viewcode":1,sphinx:55},filenames:["autodoc/base_pulse.rst","autodoc/segment.rst","autodoc/segment_IQ.rst","autodoc/segment_base.rst","basic_things_to_know/DC_offset_s.rst","channel_delays.rst","index.rst","intro.rst","struct.rst","tutorials/MW_pulse.rst","tutorials/Pulsing_examples/ST_qubit.rst","tutorials/Pulsing_examples/elzerman_readout.rst","tutorials/example_PT.rst","tutorials/example_RB.rst","tutorials/init_lib.rst","tutorials/looping.rst","tutorials/reset_time_and_slicing.rst","tutorials/sequence.rst","tutorials/simple_pulse.rst"],objects:{"":{base_pulse:[0,0,0,"-"]},"base_pulse.pulselib":{add_IQ_virt_channels:[0,2,1,""],add_awgs:[0,2,1,""],add_channel_compenstation_limits:[0,2,1,""],add_channel_delay:[0,2,1,""],add_virtual_gates:[0,2,1,""],define_channels:[0,2,1,""],mk_segment:[0,2,1,""],mk_sequence:[0,2,1,""]},"segments.segments":{segment_container:[1,1,1,""]},"segments.segments.segment_container":{append:[1,2,1,""],enter_rendering_mode:[1,2,1,""],exit_rendering_mode:[1,2,1,""],extend_dim:[1,2,1,""],get_waveform:[1,2,1,""],reset_time:[1,2,1,""],shape:[1,3,1,""],slice_time:[1,2,1,""],total_time:[1,3,1,""]},"segments.segments_IQ":{segment_single_IQ:[2,1,1,""]},"segments.segments_IQ.segment_single_IQ":{get_IQ_data:[2,2,1,""]},"segments.segments_base":{segment_single:[3,1,1,""]},"segments.segments_base.segment_single":{add_IQ_ref_channel:[3,2,1,""],add_block:[3,2,1,""],add_np:[3,2,1,""],add_pulse:[3,2,1,""],add_ramp:[3,2,1,""],add_reference_channel:[3,2,1,""],add_sin:[3,2,1,""],append:[3,2,1,""],get_segment:[3,2,1,""],integrate:[3,2,1,""],last_edit:[3,3,1,""],plot_segment:[3,2,1,""],pulse_data_all:[3,3,1,""],repeat:[3,2,1,""],reset_time:[3,2,1,""],shape:[3,3,1,""],slice_time:[3,2,1,""],total_time:[3,3,1,""],v_max:[3,2,1,""],v_min:[3,2,1,""],wait:[3,2,1,""]},base_pulse:{pulselib:[0,1,1,""]},segments:{segments:[1,0,0,"-"],segments_IQ:[2,0,0,"-"]}},objnames:{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"]},objtypes:{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute"},terms:{"100e":[],"10e6":[],"10mhz":10,"10n":1,"140n":1,"1d_scan":[],"1e9":14,"1ghz":10,"1khz":10,"20e3":[],"20n":1,"20u":[],"2d_scan":[],"2e9":[],"45n":14,"50n":[],"case":[5,14,18],"class":[0,1,2,6,8],"default":[0,5,8,14,18],"final":[1,10],"function":[0,1,6,10,18],"import":[10,14,18],"int":[0,1,4],"long":0,"new":[0,1,14,18],"return":[0,1,2,3,4],"short":6,"static":4,"true":[1,3],"try":[10,18],But:18,For:[4,5,8,14,18],One:8,That:14,The:[0,1,4,5,8,10,14,18],There:8,These:8,Will:0,about:10,abov:[],access:18,accomplish:14,accord:4,act:4,actual:1,add:[0,2,3,4,14,18],add_awg:[0,14],add_block:[3,18],add_channel_compenstation_limit:[0,14],add_channel_delai:[0,5,14],add_iq_ref_channel:3,add_iq_virt_channel:[0,14],add_np:3,add_puls:3,add_ramp:3,add_reference_channel:3,add_sequ:[],add_sin:3,add_virtual_g:[0,14],added:[0,3,14],adding:[0,18],addit:14,adiabat:2,advanc:6,after:[0,3,5,18],ake:[],algorithm:1,all:[0,1,3,4,6,8,14,18],allow:[1,14,18],along:6,alreadi:[1,8],also:[3,6,8,10,14,18],alwai:[],amount:4,amp:[2,18],amplitud:[],ani:[6,14,18],anoth:[3,14,18],anyth:[],api:6,append:[1,3,4,18],appli:[4,8,18],applic:[0,2],arbitrari:[6,18],arg:[0,1,2,3],argument:[],around:[4,14],arrai:[0,1,2,3],arriv:5,articl:[],artif:5,ask:18,assum:[4,10,11],atm:6,att:[],attent:6,automat:[3,4,6,8,14],automaticc:0,automodul:[],avail:18,awai:8,awg1:[0,14],awg2:14,awg3:14,awg4:[],awg:[0,1,3,4,6,8,10,14],awg_channels_to_physical_loc:14,awg_iq_channel:14,awg_virtual_g:14,axi:[],back:14,backward:5,band:14,barrier:14,base:6,base_level:[],base_puls:[0,14],basic:[3,8],becom:18,been:14,befor:[3,5,14,18],begin:18,below:[4,5,8,14,18],benchmark:[],best:18,between:[4,8,10],biast:4,bit:[5,10],blabla:[],bladibla:[],bladiebal:[],bladiebla:[],block:[1,2,4,8,18],bool:[1,3],both:[1,8],bracket:14,buffer:18,build:[],cabl:14,cach:[],calcul:[3,4],call:[1,5,14,18],can:[0,2,3,4,5,6,8,14,18],cannot:1,capabl:1,capacitor:4,carrier:14,caus:5,certain:1,chan1:[0,1],chan2:1,chan:[4,5],chang:[1,4,18],channal:[],channel:[0,1,2,3,4,6,8,18],channel_nam:3,channels_nam:3,channnel:0,chapter:8,character:[],charg:[4,10,11,14],chassi:14,check:[1,18],chirp:2,chrip:2,clean:6,cleaner:2,clear:1,clear_cache_on_exit:[],coax:[4,14],coaxial:[],code:[8,14],coher:[6,10],coherenli:6,collect:8,collector:[],combin:[0,1,4,6],come:[],command:6,commannd:[],comp:4,compar:10,compens:[3,4],compenst:[5,6,14],complet:14,compon:[],compos:1,concaten:[8,18],concept:[],concern:[0,3],connect:14,consid:[5,18],consist:18,constain:0,construct:[2,11,14],contain:[0,1,3,4,5,6,14],control:[2,4,6,14],control_st:[],convert:0,copi:1,correct:[4,5,14],correspond:14,correspons:3,could:[8,14],count:[3,5,18],coupl:10,courag:8,creat:[10,14],current:[1,3,4,14,18],cut:1,cut_seg:1,data:[1,2,3,5,6,8,18],data_class:[],data_contain:[],dc_offset_comp:[],debug:1,declar:14,decot:[],defin:[0,1,3,5,8,18],define_channel:[0,14],delai:[0,1,3],denot:[0,2],depend:10,design:6,desir:[],detail:8,develop:6,devic:4,diagon:14,diagram:[10,11,14],dict:[0,14],dictionari:[0,14],differ:[1,5,6,8,10],dimens:[1,3,6],dimensio:[],directli:[],discret:[],doc:0,doe:[6,18],doing:[10,14],done:[3,4,5,14],dot:18,doubl:[0,1,3],down:[4,14],dtype:1,due:[],duobl:[],dure:6,each:[0,1,3,4,8,18],eas:6,easi:14,easili:14,edsr:14,effect:[],element:[0,2,8,18],elzerman:18,elzerman_puls:[],empti:8,enabl:4,end:[14,18],ensur:[],enter_rendering_mod:1,entir:[],entiti:18,equival:[],error:0,essenti:[],establish:10,everyth:1,exampl:[0,1,4,5,8,10,18],execut:[1,6,8,14,18],exist:[],exit:1,exit_rendering_mod:1,expect:[1,3],experi:[8,10,18],explain:14,explicit:[],extend:[1,18],extend_dim:1,extend_onli:1,extens:18,extents:0,extra:[1,14],eye:14,fact:14,fals:1,fast:4,featur:[6,18],feed:14,feel:8,few:[5,18],figur:18,filter:[4,14],finish_init:[],finiz:[],first:[0,5,6,14],float64:3,follow:[0,4,5,8,10,11,14,18],form:[3,8],format:2,forward:5,found:[6,8,14,18],frac:10,free:[],freq1:2,freq2:2,freq:0,frequenc:[0,14],fridg:14,from:[1,2,4,6,14,18],front:[0,5],fuction:3,full:[1,3,6],fulli:6,fundamet:[],garbarg:[],gate:[0,3,6,8,10],gener:[0,2,8,14],geq:8,get:[1,2,3,4,6,14,18],get_effective_point_numb:[],get_iq_data:2,get_resized_waveform:[],get_seg:3,get_vmax:[],get_vmin:[],get_waveform:1,give:[0,8],given:[0,1,4,6,8,18],global:[0,2],going:14,good:[],graphic:[],grasp:18,had:4,handi:1,happen:[],has:[],have:[0,4,8,10,11,14,18],here:[3,5,14],high:[4,6,14],highlight:[],hit:4,how:[3,5,6,14],human:3,hvi:6,i_mw:[],i_or_q:2,i_or_q_part:3,idea:0,imag:[5,14],implement:14,includ:[2,6,18],index:[1,3,6],indic:[3,14],individula:0,infinit:4,infit:[],info:14,inform:[8,14],init:[14,18],init_pulselib:14,initi:[6,8,10],initialis:[],input:[1,3],insid:2,instead:[1,2],instrument:0,integr:[3,4,6,14],integrate_waveform:[],interchang:8,interect:[],intergr:3,intiti:[],intragr:0,intro:[],introduc:18,introduct:14,intuit:18,involv:8,iq_channel:1,iq_data:[],iq_virt_channel:0,item:14,just:[0,1,8,10,14,18],keep:[10,14],kei:0,keysight:[0,6,14],keysight_awg:14,know:[1,14],last:[0,5,18],last_edit:3,latenc:14,later:[0,8],learn:18,lenght:3,length:[1,8,14],let:[5,10,11,14],level:4,lib:8,librari:[0,6],like:[10,11,18],limit:[0,4,14],line:14,linear:[],link:14,linspac:1,list:[0,3],lo_freq:[0,14],load:10,local:0,locat:[0,10,14],longer:[5,14],look:[10,11],loop:[1,6],loopobject:[],lot:6,low:[],made:5,main:[2,14],make:[0,1,3,6,8,14],manag:[],mani:[],manip:[],manipul:[8,10],manual:0,map:14,marker:14,match:14,matrix:[0,14],max:4,maxim:[4,14,18],maximum:1,mean:[1,4,5,8,14],measur:1,memori:[],mention:18,microwav:[14,18],might:[10,14],min:[],minim:[4,14],minimum:[],mircowav:14,mix:14,mixer:[],mk_segment:[0,18],mk_sequenc:0,mod:2,mode:1,modul:[2,6,14,18],moment:[1,3,14],more:[2,3,6,8,10,14,18],most:[4,14,18],move:14,much:3,multidimension:6,multipl:[],multiplication_factor:3,must:8,mw_gate:14,mw_gate_i:[14,18],mw_gate_q:[14,18],mw_marker:[14,18],mw_sourc:14,my_gate_nam:18,my_input:0,my_matrix:14,my_new_pulse_contain:18,my_seg:[],mysequ:[],n_point:[],n_points1:[],n_points2:[],name:[0,1,2,3,8,14],nativ:6,ndarrai:[1,2],ndim:1,need:[0,1,4,5,6,8,10,11,14,18],neg:[1,14],neutral:[],new_data:[],next:14,none:[0,1,14],normal:[],note:[8,10,14],noth:1,now:[1,6,10,14,18],npoint:[],npoints1:[],number:[0,3],numer:[],numpi:[0,1,3,18],object:[0,1,2,3,5,6,8,18],occup:[],occur:1,off:[10,14],offet:[],offset:[1,5,6],ohm:14,onc:14,one:[2,3,8,14,18],ones:[0,1,14],onli:[8,10,14],oper:[2,10,14],operation_you_want_to_do:18,opt:[2,14],option:[4,6,18],organis:[0,1],organiz:8,origin:4,oscil:0,other:[1,4,5,14],our:[5,11,14],out:[4,10,14,18],outcom:1,output:14,over:4,overview:[6,8],page:6,paramet:14,part:[3,4],pass:[4,14],path:5,peculiar:0,per:[0,3,14],perform:[1,6,8,11],period1:[],period2:[],period:[],perv:[],phase:[2,6,14],physic:14,pictur:4,place:[],plai:[0,8],platea:18,playback:6,plot:3,plot_seg:3,plunger:[14,18],point:[0,3,5,8,10,11],pointer:[1,3],pointer_to_channel:3,posiv:[],possibl:[2,5,18],post:3,post_delai:[1,3],power:[],practic:[4,11,14],pratic:1,pre:1,pre_delai:[1,3],prepar:[],prescal:0,prescalor:[],present:18,previou:[10,18],previous:0,principl:3,print:18,process:14,program:18,properti:14,provid:[4,6,14],puls:[0,1,2,3,4,5,8,10,11],pulse_data:[],pulse_data_al:3,pulse_lib:[14,18],pulselib:[0,5,14,18],purpos:2,push:[3,5],put:[1,3,14],pxi:6,python:14,q_mw:[],qcode:[0,14],qtt:14,qubit:[2,4,6,8,11],qubit_1:[14,18],qubit_2:[14,18],quick:8,quit:[14,18],r_iq_channel:0,rabi:[],ram:1,ramp:[8,18],ramsei:[],randomis:[],rang:[4,14],rate:3,rather:3,raw:1,reach:14,read:[0,10,14],readabl:3,readout:[8,10,18],real:[],real_channel:1,realli:8,recomend:[],recommend:14,redefin:18,ref:[1,4],refer:[0,3,5,14],referenc:1,regim:11,relat:8,releas:14,remov:4,render:[1,3,8],render_ful:3,repeat:[3,18],repres:0,request:6,requir:1,reservoir:10,reset:[1,18],reset_tim:[1,3],restart:18,result:18,retak:[],riq_channel:14,row:18,rule:8,run:6,runn:1,sai:[],same:[3,5,8,14,18],sampl:[3,4,5,8,11,14],sample_r:[1,3],save:[],scan:[],schedul:[],scheme:10,screen:14,sd_awg:14,sd_p:[],search:6,sec:[],second:3,section:[10,18],see:[0,3,4,5,14],seg2:[],seg3:[],seg:[],segement:[],segment:[0,1,2,4,5,6,10,14],segment_contain:[0,1,18],segment_container_obj:18,segment_data:3,segment_singl:3,segment_single_iq:[2,3],segment_typ:3,segments_bas:[3,8],segments_iq:[2,8],send:[3,4,5],sens:[],separ:10,seq:0,sequenc:[0,3,4,6],seri:1,set:[0,1,4,5,8,14],setup:[4,8],shape:[1,3,18],shift:[2,4],should:[0,1,3,8,14],show:[5,18],shrink:[],sideband:6,signal:[0,3,4,5,6,8,14],simp:[],simpl:[5,6],simple_puls:[],simpli:[],sine:6,singl:[1,2,3,6,8,11],singlet:10,singlet_tiplet_qubit:[],sinu:18,size:1,slice:[1,18],slice_tim:[1,3],slightli:5,slot:14,small:5,softwar:[4,14],some:[5,8,14,18],someth:14,sourc:[0,1,2,3,8,14],space:10,specifi:[8,14],speciti:[],speed:6,spend:14,spin:[2,4,6],ssb:0,stabil:[10,14],stabilt:11,standard:2,start:[1,6,14,18],start_sequ:[],start_tim:[],state:[10,14],station:[],std:2,step1:[],step2:[],step:6,still:1,stop:[1,10,18],stop_tim:[],store:2,str:[0,1,2,3],straightforward:14,string:[],struct:[],structur:6,stuff:14,style:[],support:[0,6],suppport:6,sure:[0,1,14],sweep:[],swept:[],swing1:[],swing2:[],swing:[],symmetr:4,sympi:6,syntax:6,system:[6,10],take:[5,14],taken:0,tell:8,ten:5,termin:1,test:[],test_link:[],than:[0,14],thei:[1,4],them:[0,10,18],theori:18,therefor:[],thi:[0,1,2,3,4,5,6,8,10,14,18],thing:[10,14,18],think:[],though:[1,8,14],three:8,through:4,thu:14,time:[0,1,2,3,4,5,8,10,14,18],time_reset:10,time_step:[],todo:[2,4,14],toget:1,togeth:18,tomographi:[],toolkit:6,top:[],total:[0,1,4,10],total_tim:[1,3,18],totaltim:1,track:[10,14],translat:14,trigger:14,triplet:[],trough:[],tune:11,tunnel:10,tupl:[0,1,3],tutori:[10,14,18],tutoti:[],two:[0,8,11,18],type:[2,8,18],uniqu:[],unit:14,unlimit:[],until:1,updad:[],updat:14,update_virtual_gate_matrix:14,upload:[0,1,6,14],usag:[1,18],use:[1,2,4,6,18],used:[0,1,2,4,8,10,14,18],using:[1,6,14,18],usual:[5,14,18],v_max:3,v_min:3,v_start1:[],v_start2:[],v_start:[],valu:[0,3,5,14],van:[],variabl:[],vb0:[14,18],vb1:[14,18],vb2:[14,18],vb3:[],vb4:[],vb5:[],vector:[8,14],veri:10,versu:[],via:[],viq_channel:[0,14],virtual:[0,3,6],virtual_g:[0,1],virtual_gate_matrix:[0,14],virtual_gates_names_r:[0,14],virtual_gates_names_virt:[0,14],vmax:1,vmin:1,volatag:1,voltag:[0,4,18],voltageiq:[],vp1:[14,18],vp2:[14,18],vp3:[],vp4:[],vp5:[],wai:4,wait:[3,18],want:[0,1,2,3,5,10,14,18],wave:6,waveform:[1,3,5,6,8,14,18],wavefrom:[],waveshap:3,wavoform:1,weakli:10,were:14,what:[1,5,6,10,14,18],whaterv:[],wheather:1,when:[1,4,6,8,10,14],where:[0,10,18],which:[1,3,6,8,14],whole:1,wide:14,word:4,work:[6,8,14],would:[1,4,8,14],write:[],yet:[],you:[0,1,2,3,4,5,8,10,14,18],your:[6,8],yourselv:14,zeeman:10,zero:[4,14,18]},titles:["<no title>","<no title>","<no title>","Segment base class desription","Compenstating for DC offset\u2019s","Channels delays","Welcome to pulse lib\u2019s documentation","<no title>","Structure of the library","Tutorial : Making pulses for Microwave control.","Controlling a ST qubit","Elzerman readout","Advanced Tutorial : Programming a process tomography experiment to characterize a two qubit gate.","Advanced Tutorial : Designing pulses for a Randomised Benchmarking experiment.","Initializing the library","Tutorial : Looping variables.","Concepts : Reset time and slicing of waveforms.","Tutotial : Making from pulses a sequence","Making simple pulses for DC control of qubits."],titleterms:{"class":3,advanc:[12,13],base:3,basic:18,benchmark:13,boundari:14,channel:[5,14],character:12,compens:14,compenst:4,concept:16,construct:18,contain:[8,18],control:[9,10,18],defin:14,delai:[5,14],design:13,desript:3,detail:4,document:6,elzerman:11,exactli:18,exampl:14,experi:[12,13],from:17,gate:[12,14,18],here:18,how:18,implement:4,indic:6,initi:14,introduct:[],lib:[6,14],librari:[8,14],loop:15,make:[9,17,18],microwav:9,object:14,offset:[4,14],oper:18,overview:[],process:12,program:12,puls:[6,9,13,14,17,18],qubit:[10,12,14,18],randomis:13,readout:11,real:14,reset:16,segment:[3,8,18],sequenc:[8,17],setup:14,simpl:18,slice:16,step:14,structur:8,tabl:6,test:[],time:16,tomographi:12,tutori:[9,12,13,15],tutoti:17,two:[12,14],variabl:15,virtual:[14,18],voltag:14,waveform:16,welcom:6,work:18}}) \ No newline at end of file diff --git a/docs/_build/html/struct.html b/docs/_build/html/struct.html index 9294fc74e1e1db711168ba4e6f8cd5f346e0ade1..b5f783fd9568fab14ca805c94df87120c82202b2 100644 --- a/docs/_build/html/struct.html +++ b/docs/_build/html/struct.html @@ -166,21 +166,21 @@ </div> <div class="section" id="segments"> <span id="seg"></span><h2>Segments<a class="headerlink" href="#segments" title="Permalink to this headline">¶</a></h2> -<p>A segment is collection of data points that forms a single waveform. You can think of this as for example, the set of pulses that does the readout on you sample. m +<p>A segment is the collection of data points that forms a single waveform. For example, the set of pulses one would apply on one the gates for the sample to perform the readout. Note that a segment only contains the information for one channel.</p> <dl class="docutils"> <dt>There are two types of segments:</dt> <dd><ul class="first last simple"> -<li>segments_base : these are segments that should be used for generating block pulses and ramps.</li> +<li><a class="reference internal" href="autodoc/segment_base.html#segment-base"><span class="std std-ref">segments_base</span></a> : these are segments that should be used for generating block pulses and ramps.</li> <li>segments_IQ : these are segments that are used to work with IQ signals of vector MW sources.</li> </ul> </dd> </dl> -<p>Both types can be used interchangeably. More details can be found in the tutorials (or if you feel really courageous in the source code).</p> +<p>Both types can be used interchangeably. More details can be found in the later chapters (or if you feel really courageous in the source code).</p> </div> <div class="section" id="segment-containers"> <span id="seg-con"></span><h2>Segment containers<a class="headerlink" href="#segment-containers" title="Permalink to this headline">¶</a></h2> -<p>A segment container, as the name already gives away, is a container of channels. If we would think of the example before, than in this element you would have the collection of all the channels that are involved in your readout pulse. This object is generated automatically, so no need for you to specify channels each time.</p> +<p>A segment container, as the name already gives away, is a container of channels. For example, this could be the collection of all the channels that are involved in your readout pulse. This object is generated automatically, so no need for you to specify channels each time.</p> <dl class="docutils"> <dt>There are some rules for segment containers though,</dt> <dd><ul class="first last simple"> @@ -194,8 +194,8 @@ Note that a segment only contains the information for one channel.</p> <div class="section" id="sequences"> <span id="seq"></span><h2>Sequences<a class="headerlink" href="#sequences" title="Permalink to this headline">¶</a></h2> <p>Sequences are a collection of segment containers. Basically it means just concatenate different segment containers.</p> -<p>One could for example make 3 segment containers, on for initialization of the qubits, one for manipulation and one for readout. -When executing the experiment, you would tell the the AWG, play initialization -> manipulation -> readout.</p> +<p>One could for example make a sequence of three segment containers, on that would contain also the pulse data for initialization, one for manipulation and one for readout of the qubits. +When executing the experiment, you would tell the the AWG to play this sequence of elements.</p> </div> </div> diff --git a/docs/_build/html/tutorials/init_lib.html b/docs/_build/html/tutorials/init_lib.html index e181dd923ace7043434a4da3f69f2a95de6279a7..d7b18ca75ee86f0b1cb1d1f079a8859289ceeec5 100644 --- a/docs/_build/html/tutorials/init_lib.html +++ b/docs/_build/html/tutorials/init_lib.html @@ -162,7 +162,8 @@ <li>Translation of you sample channels names (e.g. barrier gate 1) to the physical location if the set up (e.g. AWG3 channel 4)</li> <li>Virtual gates and virtual gate matrix if needed <reference needed here></li> <li>Virtual IQ channels, if you are doing IQ modulation <link explaining IQ modulation ></li> -<li>Channels delay’s (e.g. if not all you coaxes have the same length)</li> +<li><a class="reference internal" href="../channel_delays.html#chan-delay"><span class="std std-ref">Channels delay’s</span></a> (e.g. if not all you coaxes have the same length)</li> +<li>Which channel need a <a class="reference internal" href="../basic_things_to_know/DC_offset_s.html#dc-offset-comp"><span class="std std-ref">DC offset compenstation</span></a> and what the what the allowed values are.</li> </ul> </div></blockquote> <p>All these properties are contained in the <code class="docutils literal notranslate"><span class="pre">pulselib</span></code> object. Below a complete example is worked out to explaining how to do this. @@ -184,7 +185,7 @@ The source code of the example can be found in <code class="docutils literal not <li>Which channels of the AWG are corresponding to the gates on the sample.</li> <li>Virtual gates to move easily around in charge stability diagrams.</li> <li>Two virtual IQ channels, one per qubit.</li> -<li>A channel delay for the MW channel, to compensate for the time that the waveform spends in the vector signal source generator.</li> +<li>A <a class="reference internal" href="../channel_delays.html#chan-delay"><span class="std std-ref">channel delay</span></a> for the MW channel, to compensate for the time that the waveform spends in the vector signal source generator.</li> <li>Voltage compensation boundaries for <a class="reference internal" href="../basic_things_to_know/DC_offset_s.html#dc-offset-comp"><span class="std std-ref">DC offsets</span></a>.</li> </ol> </dd> @@ -265,8 +266,8 @@ An example how to practically work with virtual gates can be found here [TODO].< <p>At the moment markers are not added automatically, this is something that will be implemented in the next release of this library.</p> </div> <div class="section" id="step-4-defining-channel-delays"> -<h3>Step 4 : defining channel delays<a class="headerlink" href="#step-4-defining-channel-delays" title="Permalink to this headline">¶</a></h3> -<p>In our case here, we have to compensate for the fact that some signals take a longer time to get to the sample than other ones. More info on how this is practically accomplished, can be found here <code class="docutils literal notranslate"><span class="pre">TODO</span></code>. +<span id="pulse-lib-chan-delay"></span><h3>Step 4 : defining channel delays<a class="headerlink" href="#step-4-defining-channel-delays" title="Permalink to this headline">¶</a></h3> +<p>In our case here, we have to compensate for the fact that some signals take a longer time to get to the sample than other ones. More info on how this is practically accomplished, can be found <a class="reference internal" href="../channel_delays.html#chan-delay"><span class="std std-ref">here</span></a>. Practically, example latencies could be the following:</p> <blockquote> <div><ul class="simple"> diff --git a/docs/_build/html/tutorials/simple_pulse.html b/docs/_build/html/tutorials/simple_pulse.html index 27c1ebe0c856b8b3599c12c003bbbba8de263d14..54d0bc3423016a3b480d91a1c0194883e7d6fe03 100644 --- a/docs/_build/html/tutorials/simple_pulse.html +++ b/docs/_build/html/tutorials/simple_pulse.html @@ -82,7 +82,7 @@ <li><a class="reference internal" href="#pulse-construction-basics">Pulse construction basics</a><ul> <li><a class="reference internal" href="#making-a-segment-container">Making a segment container</a></li> <li><a class="reference internal" href="#segment-operations">Segment operations</a></li> -<li><a class="reference internal" href="#segment-container-operations">segment container operations</a></li> +<li><a class="reference internal" href="#segment-container-operations">Segment container operations</a></li> <li><a class="reference internal" href="#how-do-virtual-gates-exactly-work-here">How do virtual gates exactly work here?</a></li> </ul> </li> @@ -197,17 +197,15 @@ From this object we can now access all the channels. For example, if we want to </div> <div class="section" id="segment-operations"> <h3>Segment operations<a class="headerlink" href="#segment-operations" title="Permalink to this headline">¶</a></h3> -<p>A segment is the entity where you can make you pulses. On a segment you can apply an unlimited amount of operations. -When the operation changes something to the waveform, it is usually done by adding it up to what is already there. Thus when retaking the example of before, doing</p> -<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">my_new_pulse_container</span><span class="o">.</span><span class="n">P1</span><span class="o">.</span><span class="n">add_block</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">,</span> <span class="n">amp</span><span class="p">)</span> -<span class="n">my_new_pulse_container</span><span class="o">.</span><span class="n">P1</span><span class="o">.</span><span class="n">add_block</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">,</span> <span class="n">amp</span><span class="p">)</span> -</pre></div> -</div> -<p>is equivalent to doing,</p> +<p>A segment is the entity that is used to define pulses in function of time. Segments are usually constructed by counting up simple elements (e.g. block pulses, ramps and sinus shaped features). +The example below shows two waveforms getting counted up (just an extension of the one in the previous section).</p> <div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">my_new_pulse_container</span><span class="o">.</span><span class="n">P1</span><span class="o">.</span><span class="n">add_block</span><span class="p">(</span><span class="n">start</span><span class="p">,</span> <span class="n">stop</span><span class="p">,</span> <span class="n">amp</span><span class="p">)</span> +<span class="n">my_new_pulse_container</span><span class="o">.</span><span class="n">P1</span><span class="o">.</span><span class="n">add_block</span><span class="p">(</span><span class="n">start</span><span class="o">+</span><span class="mi">10</span><span class="p">,</span> <span class="n">stop</span><span class="o">+</span><span class="mi">10</span><span class="p">,</span> <span class="n">amp</span><span class="p">)</span> </pre></div> </div> -<p>The operations possible at this moment are:</p> +<p>The resulting pulse of this operation is:</p> +<p><< figure >></p> +<p>Default operations are (can be extended if needed):</p> <blockquote> <div><ul class="simple"> <li>adding block shaped pulses</li> @@ -231,11 +229,22 @@ When the operation changes something to the waveform, it is usually done by addi <p>To get intuition what each of this operators does, it is best to try to execute (and change) some of the examples given in the beginning.</p> </div> <div class="section" id="segment-container-operations"> -<h3>segment container operations<a class="headerlink" href="#segment-container-operations" title="Permalink to this headline">¶</a></h3> -<p>This is the container that</p> +<h3>Segment container operations<a class="headerlink" href="#segment-container-operations" title="Permalink to this headline">¶</a></h3> +<p>As mentioned before, this are the containers that contain all the segments and allow you to do also some operation on all the segments at the same time.</p> +<p>Operations include:</p> +<blockquote> +<div><ul class="simple"> +<li>total_time : get maximal time in all the segments present</li> +<li>append : concatenate one segment container to another one.</li> +<li>slice time : redefine start and end time of all the segments present in the segment container</li> +<li>reset time : define total_time in all segments as the new time zero.</li> +</ul> +</div></blockquote> +<p>More on operation can be found in the segment container tutorial.</p> </div> <div class="section" id="how-do-virtual-gates-exactly-work-here"> <h3>How do virtual gates exactly work here?<a class="headerlink" href="#how-do-virtual-gates-exactly-work-here" title="Permalink to this headline">¶</a></h3> +<p>As you</p> </div> </div> </div> diff --git a/docs/autodoc/base_pulse.rst b/docs/autodoc/base_pulse.rst new file mode 100644 index 0000000000000000000000000000000000000000..982f8e23143611a863e3cb32d4d6d47fb616fb25 --- /dev/null +++ b/docs/autodoc/base_pulse.rst @@ -0,0 +1,2 @@ +.. automodule:: base_pulse + :members: \ No newline at end of file diff --git a/docs/autodoc/segment.rst b/docs/autodoc/segment.rst new file mode 100644 index 0000000000000000000000000000000000000000..23b84d5775c184e7f9f8b97ed533681bb19dae80 --- /dev/null +++ b/docs/autodoc/segment.rst @@ -0,0 +1,2 @@ +.. automodule:: segments.segments + :members: \ No newline at end of file diff --git a/docs/autodoc/segment_IQ.rst b/docs/autodoc/segment_IQ.rst new file mode 100644 index 0000000000000000000000000000000000000000..24b125611ecf90812f449907b9a48a98a3e86d9b --- /dev/null +++ b/docs/autodoc/segment_IQ.rst @@ -0,0 +1,3 @@ + +.. automodule:: segments.segments_IQ + :members: \ No newline at end of file diff --git a/docs/autodoc/segment_base.rst b/docs/autodoc/segment_base.rst new file mode 100644 index 0000000000000000000000000000000000000000..6d2d7c652e00f5d73e1ce4ed73abad9c063c897e --- /dev/null +++ b/docs/autodoc/segment_base.rst @@ -0,0 +1,10 @@ +.. _segment_base: + +Segment base class desription +============================= + + +.. autoclass:: segments.segments_base.segment_single + :members: + :undoc-members: + :show-inheritance: \ No newline at end of file diff --git a/docs/channel_delays.rst b/docs/channel_delays.rst new file mode 100644 index 0000000000000000000000000000000000000000..b084a87939942f17597462f075d0f645acfaf9ff --- /dev/null +++ b/docs/channel_delays.rst @@ -0,0 +1,26 @@ +.. _chan_delay: + +Channels delays +=============== + +Some signals that you send to you sample, take a different path then others. This causes a slightly different time of arrival (usually a few tens of ns). +It is possible to compenstate for these small offsets by pushing waveforms slightly forward or backward. + +Let's consider a simple example. Let's set we define in the :ref:`pulselib<pulse_lib_chan_delay>` object the following delays: + +.. code-block:: python + + pulse.add_channel_delay({ + 'chan 1': -20, + 'chan 2': -20, + 'chan 3': 20, + 'chan 4': 20, + 'chan 5': 20 + }) + +It means channel 1 and 2 need to arrive 20 ns before what we call our reference. For the other channels we want the signal to arrive 20 ns after. The image below shows how this is done: + +.. figure:: /img/channel_delays.png + +As you can see here, for channel 1 and 2, in the segment container object, the segments are artifically made a bit longer by pushing data points in front of it. +By default the value of this point will be the first value in case there was no correction. The same counts for the last data point. diff --git a/docs/conf.py b/docs/conf.py index 31530650d1afc8f348565b5c8b6a3571c4db09d8..79f41933d6a3f7e9b3bd40f1f6454320927cb785 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -178,4 +178,4 @@ epub_title = project epub_exclude_files = ['search.html'] -# -- Extension configuration ------------------------------------------------- +# -- Extension configuration ------------------------------------------------- \ No newline at end of file diff --git a/docs/img/channel_delays.png b/docs/img/channel_delays.png new file mode 100644 index 0000000000000000000000000000000000000000..63f13cdc97dd471adff1ff89e642e0cfd3d3ef56 Binary files /dev/null and b/docs/img/channel_delays.png differ diff --git a/docs/intro.rst b/docs/intro.rst index 97d057948b4ed30c53730621235f40e9b088d088..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 --- a/docs/intro.rst +++ b/docs/intro.rst @@ -1,12 +0,0 @@ - -.. automodule:: base_pulse - :members: - -.. automodule:: segments.data_classes - :members: - -.. automodule:: segments.segments - :members: - -.. automodule:: segments.segments_IQ - :members: \ No newline at end of file diff --git a/docs/struct.rst b/docs/struct.rst index 12ca62721599d925bb2a4b4e9014edf0d41353ce..59053653bea39a1cb48de7235bf6dd1567f490c8 100644 --- a/docs/struct.rst +++ b/docs/struct.rst @@ -20,20 +20,20 @@ A quick overview of the relation between the different structural elements can b Segments -------- -A segment is collection of data points that forms a single waveform. You can think of this as for example, the set of pulses that does the readout on you sample. m +A segment is the collection of data points that forms a single waveform. For example, the set of pulses one would apply on one the gates for the sample to perform the readout. Note that a segment only contains the information for one channel. There are two types of segments: - - segments_base : these are segments that should be used for generating block pulses and ramps. + - :ref:`segments_base<segment_base>` : these are segments that should be used for generating block pulses and ramps. - segments_IQ : these are segments that are used to work with IQ signals of vector MW sources. -Both types can be used interchangeably. More details can be found in the tutorials (or if you feel really courageous in the source code). +Both types can be used interchangeably. More details can be found in the later chapters (or if you feel really courageous in the source code). .. _seg_con: Segment containers ------------------ -A segment container, as the name already gives away, is a container of channels. If we would think of the example before, than in this element you would have the collection of all the channels that are involved in your readout pulse. This object is generated automatically, so no need for you to specify channels each time. +A segment container, as the name already gives away, is a container of channels. For example, this could be the collection of all the channels that are involved in your readout pulse. This object is generated automatically, so no need for you to specify channels each time. There are some rules for segment containers though, - All segments in a segment container must have the same length when rendered @@ -46,5 +46,5 @@ Sequences --------- Sequences are a collection of segment containers. Basically it means just concatenate different segment containers. -One could for example make 3 segment containers, on for initialization of the qubits, one for manipulation and one for readout. -When executing the experiment, you would tell the the AWG, play initialization -> manipulation -> readout. +One could for example make a sequence of three segment containers, on that would contain also the pulse data for initialization, one for manipulation and one for readout of the qubits. +When executing the experiment, you would tell the the AWG to play this sequence of elements. diff --git a/docs/tutorials/init_lib.rst b/docs/tutorials/init_lib.rst index e0b1db7a8d589269326bd78f6395fda0d6277ef6..5c3af3b4380acf315a1a0e68fff9a36b150ba120 100644 --- a/docs/tutorials/init_lib.rst +++ b/docs/tutorials/init_lib.rst @@ -9,7 +9,8 @@ Before making a pulse, the pulse library needs to know some stuff from you. The - Translation of you sample channels names (e.g. barrier gate 1) to the physical location if the set up (e.g. AWG3 channel 4) - Virtual gates and virtual gate matrix if needed <reference needed here> - Virtual IQ channels, if you are doing IQ modulation <link explaining IQ modulation > - - Channels delay's (e.g. if not all you coaxes have the same length) + - :ref:`Channels delay's<chan_delay>` (e.g. if not all you coaxes have the same length) + - Which channel need a :ref:`DC offset compenstation<dc_offset_comp>` and what the what the allowed values are. All these properties are contained in the ``pulselib`` object. Below a complete example is worked out to explaining how to do this. The source code of the example can be found in ``tutorials/init_pulselib.py`` if you would want to execute it yourselves. @@ -28,7 +29,7 @@ Practically the things that we want to set are: 1. Which channels of the AWG are corresponding to the gates on the sample. 2. Virtual gates to move easily around in charge stability diagrams. 3. Two virtual IQ channels, one per qubit. - 4. A channel delay for the MW channel, to compensate for the time that the waveform spends in the vector signal source generator. + 4. A :ref:`channel delay<chan_delay>` for the MW channel, to compensate for the time that the waveform spends in the vector signal source generator. 5. Voltage compensation boundaries for :ref:`DC offsets<dc_offset_comp>`. Step 1 : initializing the pulse lib object and defining real gates @@ -118,9 +119,11 @@ Most of the time, you will want to make a virtual channel per qubit, as it allow At the moment markers are not added automatically, this is something that will be implemented in the next release of this library. +.. _pulse_lib_chan_delay: + Step 4 : defining channel delays ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -In our case here, we have to compensate for the fact that some signals take a longer time to get to the sample than other ones. More info on how this is practically accomplished, can be found here ``TODO``. +In our case here, we have to compensate for the fact that some signals take a longer time to get to the sample than other ones. More info on how this is practically accomplished, can be found :ref:`here<chan_delay>`. Practically, example latencies could be the following: - 20 ns for the barrier and plunger gates to get from the AWG channels into the fridge. diff --git a/docs/tutorials/simple_pulse.rst b/docs/tutorials/simple_pulse.rst index 9e5897f2ef129851f03b6277e146106975253847..c98fd74f354c8cc40ca6d397bf48ebb2f7472eda 100644 --- a/docs/tutorials/simple_pulse.rst +++ b/docs/tutorials/simple_pulse.rst @@ -60,21 +60,19 @@ In this case, we have quite a few gates available (defined in the :ref:`init of Segment operations """""""""""""""""" -A segment is the entity where you can make you pulses. On a segment you can apply an unlimited amount of operations. -When the operation changes something to the waveform, it is usually done by adding it up to what is already there. Thus when retaking the example of before, doing +A segment is the entity that is used to define pulses in function of time. Segments are usually constructed by counting up simple elements (e.g. block pulses, ramps and sinus shaped features). +The example below shows two waveforms getting counted up (just an extension of the one in the previous section). .. code-block:: python my_new_pulse_container.P1.add_block(start, stop, amp) - my_new_pulse_container.P1.add_block(start, stop, amp) - -is equivalent to doing, + my_new_pulse_container.P1.add_block(start+10, stop+10, amp) -.. code-block:: python +The resulting pulse of this operation is: - my_new_pulse_container.P1.add_block(start, stop, amp) +<< figure >> -The operations possible at this moment are: +Default operations are (can be extended if needed): - adding block shaped pulses - adding ramp's @@ -94,12 +92,22 @@ Important operators are: To get intuition what each of this operators does, it is best to try to execute (and change) some of the examples given in the beginning. -segment container operations +Segment container operations """""""""""""""""""""""""""" -This is the container that +As mentioned before, this are the containers that contain all the segments and allow you to do also some operation on all the segments at the same time. + +Operations include: + + - total_time : get maximal time in all the segments present + - append : concatenate one segment container to another one. + - slice time : redefine start and end time of all the segments present in the segment container + - reset time : define total_time in all segments as the new time zero. + +More on operation can be found in the segment container tutorial. How do virtual gates exactly work here? """"""""""""""""""""""""""""""""""""""" +As you \ No newline at end of file