Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorials for lab_dev and physics #392

Open
wants to merge 92 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
5937525
added func
SamFerracin Apr 15, 2024
be61862
done
SamFerracin Apr 16, 2024
046af14
done
SamFerracin Apr 16, 2024
ee13a6c
test trace out
SamFerracin Apr 16, 2024
1ff349c
tests
SamFerracin Apr 16, 2024
7934dae
more progress
SamFerracin Apr 17, 2024
4316359
tests
SamFerracin Apr 17, 2024
7fdfd39
done
SamFerracin Apr 17, 2024
56e4467
done
SamFerracin Apr 17, 2024
59019a0
ugh
SamFerracin Apr 17, 2024
375d260
Merge branch 'develop' of https://github.com/XanaduAI/MrMustard into …
SamFerracin Apr 17, 2024
91a9678
done
SamFerracin Apr 17, 2024
55df8d1
Merge branch 'develop' of https://github.com/XanaduAI/MrMustard into …
SamFerracin Apr 19, 2024
decc3d0
need to fix things
SamFerracin Apr 19, 2024
7b642a1
Merge branch 'develop' into exp-val
ziofil Apr 19, 2024
d133ecc
Update mrmustard/lab_dev/states/base.py
Apr 22, 2024
f479998
Update mrmustard/lab_dev/states/base.py
Apr 22, 2024
90161ef
some progress
SamFerracin Apr 22, 2024
6e7de41
etsts pass
SamFerracin Apr 22, 2024
a3ab903
done?
SamFerracin Apr 22, 2024
8e80056
Update mrmustard/lab_dev/states/base.py
Apr 22, 2024
6198a17
Update mrmustard/lab_dev/states/base.py
Apr 22, 2024
397d251
bl
SamFerracin Apr 22, 2024
665bc82
odc
SamFerracin Apr 22, 2024
076f2f0
done
SamFerracin Apr 25, 2024
2a4b1c7
ll
SamFerracin Apr 25, 2024
0eeb99f
bug
SamFerracin Apr 25, 2024
cc38e05
Update mrmustard/lab_dev/states/base.py
Apr 25, 2024
36b66eb
Update mrmustard/lab_dev/states/base.py
Apr 25, 2024
d25e6bb
Update mrmustard/lab_dev/states/base.py
Apr 25, 2024
66a90de
Update mrmustard/lab_dev/states/base.py
Apr 25, 2024
9513299
Merge branch 'exp-val' of https://github.com/XanaduAI/MrMustard into …
SamFerracin Apr 25, 2024
b073f0a
Merge branch 'develop' of https://github.com/XanaduAI/MrMustard into …
SamFerracin Apr 25, 2024
d31eaa8
ds
SamFerracin Apr 25, 2024
562295e
revert
SamFerracin Apr 25, 2024
a78ea14
cr
SamFerracin Apr 26, 2024
010b732
gaussian integrals
SamFerracin Apr 26, 2024
7dc4088
more
SamFerracin Apr 26, 2024
f6b1cf5
Merge branch 'exp-val' of https://github.com/XanaduAI/MrMustard into …
SamFerracin Apr 26, 2024
c673986
..
SamFerracin Apr 29, 2024
a5fe7a3
..
SamFerracin Apr 29, 2024
09aa175
..
SamFerracin Apr 29, 2024
013abdb
..
SamFerracin Apr 29, 2024
e45ccd8
..
SamFerracin Apr 29, 2024
bc01a51
progress
SamFerracin Apr 29, 2024
e52d85f
yuan
SamFerracin May 3, 2024
9122fc0
progress
SamFerracin May 3, 2024
f8a6357
add docs for init physics
sylviemonet May 3, 2024
9815b93
add more docs
sylviemonet May 3, 2024
02a9249
add docs
sylviemonet May 3, 2024
3b2c366
add anstaz docs
sylviemonet May 3, 2024
fc95c68
Merge branch 'develop' into tutorials
sylviemonet May 3, 2024
f254561
bargmann theory docs
sylviemonet May 3, 2024
e5bd587
test acs|| diagram
sylviemonet May 6, 2024
110f959
converters doc
sylviemonet May 6, 2024
b6e6c08
moved phys funcs
sylviemonet May 7, 2024
a220c98
oops
sylviemonet May 7, 2024
e3b8822
add diagram and fix codefactor
sylviemonet May 7, 2024
0ab8fd3
fix code block converters
sylviemonet May 7, 2024
a25f9db
s
SamFerracin May 7, 2024
5d2e3d3
docs in converters
sylviemonet May 7, 2024
c020208
fix the structure
sylviemonet May 7, 2024
a7cb003
fix the structure again
sylviemonet May 7, 2024
6660ea4
big changes in structure in physics
sylviemonet May 7, 2024
fd4cdda
try again
sylviemonet May 7, 2024
387c0c3
try to fix errors with math
sylviemonet May 7, 2024
190a526
states
SamFerracin May 7, 2024
9d79fb7
Merge branch 'tutorials' of https://github.com/XanaduAI/MrMustard int…
SamFerracin May 7, 2024
5626f27
bargmann docs
sylviemonet May 7, 2024
e8fbe74
bargmamnn docs
sylviemonet May 7, 2024
a0be9ab
fix bugs in cc
sylviemonet May 7, 2024
d6b3dd7
julia
SamFerracin May 7, 2024
51238fa
Merge branch 'tutorials' of https://github.com/XanaduAI/MrMustard int…
SamFerracin May 7, 2024
e46d9a9
the docs in bargmann
sylviemonet May 7, 2024
0acd882
fix diagrams
sylviemonet May 7, 2024
39089af
bargmann docs goooo
sylviemonet May 7, 2024
17f9b31
fix diagrams
sylviemonet May 7, 2024
9c339a2
add docs in fock
sylviemonet May 7, 2024
1fbc022
add the docs for ansatze
sylviemonet May 8, 2024
5d54544
gaussian integral docs
sylviemonet May 8, 2024
42f5273
progress
SamFerracin May 9, 2024
d7a5a67
fix bugs in docs
sylviemonet May 9, 2024
d887eaa
add comments
sylviemonet May 9, 2024
7122176
Merge branch 'tutorials' of https://github.com/XanaduAI/MrMustard int…
SamFerracin May 9, 2024
c9e9189
oops
SamFerracin May 10, 2024
2586020
Merge branch 'develop' into tutorials
sylviemonet May 13, 2024
0c02cee
Merge branch 'develop' into tutorials
sylviemonet May 15, 2024
ea7333e
Update mrmustard/lab_dev/circuit_components.py
sylviemonet May 15, 2024
f4889f8
fix bugs from kasper's comments
sylviemonet May 15, 2024
fea110a
fix codefactor
sylviemonet May 15, 2024
da55f30
blacked
sylviemonet May 15, 2024
248bc1b
Merge branch 'develop' into tutorials
sylviemonet May 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
converters doc
  • Loading branch information
sylviemonet committed May 6, 2024
commit 110f959e89a91d9cfbe2a934b8e57657466541e0
22 changes: 0 additions & 22 deletions doc/code/physics/converters.rst
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
The converters between different representations
==========================================

Though MrMustard runs internally only with Fock and Bargmann representations, it supports different representations in the initialization and the result part.

The conversions exist:

* From Bargmann representation to Fock representation (for all quantum objects);
* From Bargmann representation to phase space representation (for only quantum states);
* From phase space representation to Bargmann representation (for only quantum states);

From Bargmann representation to Fock representation conversion is realized by using the ``hermite_renormalized`` function, which can be considered as a Map gate as well.

---------------
----| BargmannToFock|----
---------------

If there is a single-mode pure state :math:`|\psi\rangle`, which can be denoted as

--------------------
|:math:`|\psi\rangle`|----
--------------------


.. currentmodule:: mrmustard.physics.converters

.. automodapi:: mrmustard.physics.converters
Expand Down
43 changes: 43 additions & 0 deletions mrmustard/physics/converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,49 @@

"""
This module contains the functions to convert between different representations.

Though MrMustard runs internally only with Fock and Bargmann representations, it supports different representations in the initialization and the result part.

The conversions exist:

* From Bargmann representation to Fock representation (for all quantum objects);
* From Bargmann representation to phase space representation (for only quantum states);
* From phase space representation to Bargmann representation (for only quantum states);

The first one is the function ``to_fock``, while the other two conversions have been encapsuled into the CircuitComponent object ``DsMap`` and ``BtoQMap`` in order to compute the representation change on each wire.

Some examples:
1. From Bargmann representation to Fock representation conversion is realized by using the ``hermite_renormalized`` function, which can be considered as a Map gate as well.

---------------
----| BargmannToFock|----
---------------

If there is a single-mode pure state :math:`|\psi\rangle`, which can be denoted as

--------------------
|:math:`|\psi\rangle`|----
--------------------

2. From Bargmann representation to phase space representation, the Map on the ket wire can be illustrated as

--------
in_ket----| BtoQMap|---- out_ket
--------

If there is a 4-mode mixed state, wanna convert the first mode into phase space representation:

-------------------- ---------------
| |----out_bra_1 ----|BtoQMap.adjoint|----
| |----out_bra_2 ---------------
| |----out_bra_3
|:math:`|\psi\rangle`|----out_bra_4 ------------
| |----out_ket_1 ----|BtoQMap.dual|----
| |----out_ket_2 ------------
| |----out_ket_3
| |----out_ket_4
--------------------

"""

from typing import Iterable, Union, Optional
Expand Down
Loading