diff --git a/mrmustard/lab_dev/circuit_components.py b/mrmustard/lab_dev/circuit_components.py index b44060ccf..b2cdc4f18 100644 --- a/mrmustard/lab_dev/circuit_components.py +++ b/mrmustard/lab_dev/circuit_components.py @@ -526,16 +526,15 @@ def to_bargmann(self) -> CircuitComponent: .. code-block:: >>> from mrmustard.lab_dev import Dgate - >>> from mrmustard.physics.representations import Bargmann + >>> from mrmustard.physics.ansatz import PolyExpAnsatz >>> d = Dgate([1], x=0.1, y=0.1) >>> d_fock = d.to_fock(shape=3) >>> d_bargmann = d_fock.to_bargmann() - >>> assert d_bargmann.name == d.name >>> assert d_bargmann.wires == d.wires - >>> assert isinstance(d_bargmann.representation, Bargmann) + >>> assert isinstance(d_bargmann.ansatz, PolyExpAnsatz) """ if isinstance(self.ansatz, PolyExpAnsatz): return self diff --git a/mrmustard/lab_dev/states/base.py b/mrmustard/lab_dev/states/base.py index db96a9186..263ec4270 100644 --- a/mrmustard/lab_dev/states/base.py +++ b/mrmustard/lab_dev/states/base.py @@ -184,7 +184,7 @@ def from_bargmann( .. code-block:: - >>> from mrmustard.physics.representations import Bargmann + >>> from mrmustard.physics.ansatz import PolyExpAnsatz >>> from mrmustard.physics.triples import coherent_state_Abc >>> from mrmustard.lab_dev.states.base import Ket @@ -193,7 +193,7 @@ def from_bargmann( >>> coh = Ket.from_bargmann(modes, triple) >>> assert coh.modes == modes - >>> assert coh.representation == Bargmann(*triple) + >>> assert coh.ansatz == PolyExpAnsatz(*triple) >>> assert isinstance(coh, Ket) Args: diff --git a/mrmustard/physics/ansatz/polyexp_ansatz.py b/mrmustard/physics/ansatz/polyexp_ansatz.py index 835798626..f1c2c3445 100644 --- a/mrmustard/physics/ansatz/polyexp_ansatz.py +++ b/mrmustard/physics/ansatz/polyexp_ansatz.py @@ -72,14 +72,14 @@ class PolyExpAnsatz(Ansatz): .. code-block :: - >>> from mrmustard.physics.representations import Bargmann + >>> from mrmustard.physics.representations import PolyExpAnsatz >>> from mrmustard.physics.triples import displacement_gate_Abc, vacuum_state_Abc >>> # bargmann representation of one-mode vacuum - >>> rep_vac = Bargmann(*vacuum_state_Abc(1)) + >>> rep_vac = PolyExpAnsatz(*vacuum_state_Abc(1)) >>> # bargmann representation of one-mode dgate with gamma=1+0j - >>> rep_dgate = Bargmann(*displacement_gate_Abc(1)) + >>> rep_dgate = PolyExpAnsatz(*displacement_gate_Abc(1)) The inner product is defined as the contraction of two Bargmann objects across marked indices. Indices are marked using ``__getitem__``. Once the indices are marked for contraction, they are