Skip to content

Commit

Permalink
Update mrmustard/lab_dev/wires.py
Browse files Browse the repository at this point in the history
Co-authored-by: Filippo Miatto <[email protected]>
  • Loading branch information
SamFerracin and ziofil authored Jan 31, 2024
1 parent 5fee163 commit b53d211
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions mrmustard/lab_dev/wires.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ class Wires:
>>> assert w.output.ket.ids == w.ids[4:6]
>>> assert w.input.ket.ids == w.ids[6:]
To access the index of a su set of wires in standard order (i.e. skipping over wires not belonging to the subset),
one can use the ``indices`` attribute:
.. code-block::
>>> w = Wires(modes_in_ket = [0,1], modes_out_ket = [0,1])
>>> assert w.indices == [0,1,2,3]
>>> assert w.input.indices == [2,3]
>>>
Note that subsets return new ``Wires`` objects with the same ids as the original object.
Args:
Expand Down

0 comments on commit b53d211

Please sign in to comment.