Skip to content

Commit b4da42a

Browse files
Merge pull request #49 from tqsd/docs-update
Update docs
2 parents 7ffed57 + a432cab commit b4da42a

5 files changed

Lines changed: 23 additions & 18 deletions

File tree

1.04 KB
Binary file not shown.
77 Bytes
Binary file not shown.

docs/_build/components/host.html

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,10 @@ <h1>Host<a class="headerlink" href="#host" title="Permalink to this headline">¶
536536
<dd><p>Gets the received classical messages sorted with the sequence number.</p>
537537
<dl class="field-list simple">
538538
<dt class="field-odd">Returns</dt>
539-
<dd class="field-odd"><p>Sorted array of classical messages.</p>
539+
<dd class="field-odd"><p>Sorted list of classical messages.</p>
540540
</dd>
541541
<dt class="field-even">Return type</dt>
542-
<dd class="field-even"><p>Array</p>
542+
<dd class="field-even"><p>(list)</p>
543543
</dd>
544544
</dl>
545545
</dd></dl>
@@ -563,13 +563,21 @@ <h1>Host<a class="headerlink" href="#host" title="Permalink to this headline">¶
563563
<dt class="field-odd">Returns</dt>
564564
<dd class="field-odd"><p>The delay per tick for the queue processor.</p>
565565
</dd>
566+
<dt class="field-even">Return type</dt>
567+
<dd class="field-even"><p>(float)</p>
568+
</dd>
566569
</dl>
567570
</dd></dl>
568571

569572
<dl class="py method">
570573
<dt id="qunetsim.components.host.Host.empty_classical">
571574
<code class="sig-name descname">empty_classical</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">reset_seq_nums</span><span class="o">=</span><span class="default_value">False</span></em><span class="sig-paren">)</span><a class="headerlink" href="#qunetsim.components.host.Host.empty_classical" title="Permalink to this definition"></a></dt>
572575
<dd><p>Empty the classical message buffers.</p>
576+
<dl class="field-list simple">
577+
<dt class="field-odd">Parameters</dt>
578+
<dd class="field-odd"><p><strong>reset_seq_nums</strong> (<em>bool</em>) – if all sequence number should also be reset.</p>
579+
</dd>
580+
</dl>
573581
</dd></dl>
574582

575583
<dl class="py method">
@@ -952,10 +960,10 @@ <h1>Host<a class="headerlink" href="#host" title="Permalink to this headline">¶
952960
:type receiver_id: str</p>
953961
<dl class="field-list simple">
954962
<dt class="field-odd">Returns</dt>
955-
<dd class="field-odd"><p>a two element array of the status of the removals.</p>
963+
<dd class="field-odd"><p>a two element list of the status of the removals.</p>
956964
</dd>
957965
<dt class="field-even">Return type</dt>
958-
<dd class="field-even"><p>list</p>
966+
<dd class="field-even"><p>(list)</p>
959967
</dd>
960968
</dl>
961969
</dd></dl>
@@ -1091,14 +1099,10 @@ <h1>Host<a class="headerlink" href="#host" title="Permalink to this headline">¶
10911099
</ul>
10921100
</dd>
10931101
<dt class="field-even">Returns</dt>
1094-
<dd class="field-even"><p><dl class="simple">
1095-
<dt>Qubit which belongs to the host and is part of the</dt><dd><p>GHZ state and ID which all Qubits will have.</p>
1096-
</dd>
1097-
</dl>
1098-
</p>
1102+
<dd class="field-even"><p>Qubit ID of the shared GHZ and ACK status</p>
10991103
</dd>
11001104
<dt class="field-odd">Return type</dt>
1101-
<dd class="field-odd"><p>Q_id, <a class="reference internal" href="../objects/qubit.html#qunetsim.objects.qubit.Qubit" title="qunetsim.objects.qubit.Qubit">Qubit</a></p>
1105+
<dd class="field-odd"><p>(str, bool)</p>
11021106
</dd>
11031107
</dl>
11041108
</dd></dl>

docs/_build/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

qunetsim/components/host.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,16 @@ def classical(self):
8888
Gets the received classical messages sorted with the sequence number.
8989
9090
Returns:
91-
Array: Sorted array of classical messages.
91+
(list): Sorted list of classical messages.
9292
"""
9393
return sorted(self._classical_messages.get_all(), key=lambda x: x.seq_num, reverse=True)
9494

9595
def empty_classical(self, reset_seq_nums=False):
9696
"""
9797
Empty the classical message buffers.
98+
99+
Args:
100+
reset_seq_nums (bool): if all sequence number should also be reset.
98101
"""
99102
if reset_seq_nums:
100103
self.reset_sequence_numbers()
@@ -120,7 +123,7 @@ def delay(self):
120123
Get the delay of the queue processor.
121124
122125
Returns:
123-
The delay per tick for the queue processor.
126+
(float): The delay per tick for the queue processor.
124127
"""
125128
return self._delay
126129

@@ -131,7 +134,6 @@ def delay(self, delay):
131134
132135
Args:
133136
delay (float): The delay per tick for the queue processor.
134-
135137
"""
136138
if not (isinstance(delay, int) or isinstance(delay, float)):
137139
raise Exception('delay should be a number')
@@ -636,7 +638,7 @@ def remove_connection(self, receiver_id):
636638
receiver_id (str): The ID of the connection to remove
637639
638640
Returns:
639-
list: a two element array of the status of the removals.
641+
(list): a two element list of the status of the removals.
640642
"""
641643
c = self.remove_c_connection(receiver_id)
642644
q = self.remove_q_connection(receiver_id)
@@ -882,8 +884,7 @@ def send_ghz(self, receiver_list, q_id=None, await_ack=False, no_ack=False, dist
882884
distribute (bool): If the sender should keep part of the GHZ state, or just
883885
distribute one
884886
Returns:
885-
Q_id, Qubit: Qubit which belongs to the host and is part of the
886-
GHZ state and ID which all Qubits will have.
887+
(str, bool): Qubit ID of the shared GHZ and ACK status
887888
"""
888889
own_qubit = Qubit(self, q_id=q_id)
889890
q_id = own_qubit.id
@@ -928,7 +929,6 @@ def send_ghz(self, receiver_list, q_id=None, await_ack=False, no_ack=False, dist
928929
if self.await_ack(seq_num, receiver_id) is False:
929930
ret = False
930931
return q_id, ret
931-
932932
return q_id
933933

934934
def get_ghz(self, host_id, q_id=None, wait=0):
@@ -959,6 +959,7 @@ def send_teleport(self, receiver_id, q, await_ack=False, no_ack=False, payload=N
959959
no_ack (bool): If this message should not use any ACK and sequencing.
960960
payload:
961961
generate_epr_if_none: Generate an EPR pair with receiver if one doesn't exist
962+
962963
Returns:
963964
(bool) If await_ack=True, return the status of the ACK
964965
"""

0 commit comments

Comments
 (0)