Skip to content

Commit e338b04

Browse files
committed
speed up matrix coefficient computation and add some more docs
1 parent 29a1fea commit e338b04

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

src/sage/algebras/vertex_operators.py

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from sage.combinat.sf.sf import SymmetricFunctions
2828
from sage.data_structures.stream import Stream_function, Stream_cauchy_compose
2929
from sage.functions.other import factorial
30-
from sage.misc.cachefunc import cached_function
30+
from sage.misc.cachefunc import cached_function, cached_method
3131
from sage.misc.misc_c import prod
3232
from sage.rings.infinity import PlusInfinity
3333
from sage.rings.integer_ring import ZZ
@@ -37,6 +37,7 @@
3737
from sage.sets.non_negative_integers import NonNegativeIntegers
3838
from sage.structure.sage_object import SageObject
3939

40+
4041
class FermionicFockSpace(CombinatorialFreeModule):
4142
r"""
4243
A model of the Fermionic Fock space `\mathcal{H}_F`. As a vector space, `\mathcal{H}_F`
@@ -61,9 +62,14 @@ def _repr_term(self, m):
6162
def BosonicFockSpace(names=('w',)):
6263
return LaurentPolynomialRing(SymmetricFunctions(QQ).s(), names=names)
6364

65+
6466
def BFMap():
6567
r"""
66-
68+
Returns a map that compute the image of an element of the Fermionic Fock space
69+
under the Boson-Fermion correspondence. The basis element `|\lambda, n \rangle`
70+
gets mapped to `w^ns_\lambda`, where `w` is the charge variable and `s_\lambda`
71+
is the Schur function corresponding to `\lambda`.
72+
6773
TESTS::
6874
6975
sage: from sage.algebras.vertex_operators import *
@@ -76,7 +82,8 @@ def BFMap():
7682
B = BosonicFockSpace()
7783
w = B.gen()
7884
s = B.base_ring()
79-
return F.module_morphism(on_basis=lambda b: w**(b[1])*s(b[0]), codomain = B)
85+
return F.module_morphism(on_basis=lambda b: w**(b[1])*s(b[0]), codomain=B)
86+
8087

8188
class Current(Action):
8289
r"""
@@ -247,6 +254,7 @@ def __init__(self, pos, neg, cutoff=lambda x: max(x.degree(), 1), dcharge=1, foc
247254
# def act_on_fock_space_element(self, x):
248255
# return self.spectral(lambda n: self.act_by_mode(n,x), valuation = -1)
249256

257+
@cached_method
250258
def act_by_mode(self, i, x):
251259
r"""
252260
Action of the ``i``'th Fourier mode of ``self`` on element ``x`` of
@@ -349,8 +357,7 @@ def get_monomial_coefficient(self, mon, x):
349357

350358
def matrix_coefficient(self, bra, ket, cutoff=4):
351359
r"""
352-
Approximate the matrix coefficient <bra|X|ket>, where X is the vertex operator
353-
represented by ``self``
360+
Approximate the matrix coefficient `\langle` ``bra`` `|` ``self`` `|` ``ket`` `\rangle`.
354361
355362
INPUT:
356363
@@ -380,7 +387,9 @@ def matrix_coefficient(self, bra, ket, cutoff=4):
380387
return res
381388

382389
def vacuum_expectation(self, cutoff=4):
383-
"""
390+
r"""
391+
Computes the matrix coefficient `\langle \varnothing | X | \varnothing \rangle`
392+
384393
EXAMPLES::
385394
386395
sage: from sage.algebras.vertex_operators import *
@@ -393,14 +402,23 @@ def vacuum_expectation(self, cutoff=4):
393402
sage: P = ProductOfVertexOperators([Cre, Ann])
394403
sage: P.vacuum_expectation()
395404
{(-4, 4): 1, (-3, 3): 1, (-2, 2): 1, (-1, 1): 1}
405+
406+
This verifies that, letting `\psi(z), \psi^*(w)` denote the fermionic fields,
407+
the matrix coefficient of their product is given by `\langle \varnothing | \psi^*(w)\psi^(z)|\varnothing\rangle = \frac{w}{w-z}`
396408
"""
397409
return self.matrix_coefficient(([], 0), ([], 0), cutoff)
398410

399411

400412
class CreationOperator(VertexOperator):
401413
r"""
402-
The generating series for (bosonic) creation operators.
403-
414+
The image under the boson-fermion correspond of the fermionic field `\psi^*(z)`.
415+
416+
Explicitly, the action on the bosonic fock space is given by the series
417+
418+
.. MATH::
419+
420+
\exp \left( \sum_{j \geq 1} x_j z^j \right) \exp\left(\sum_{j \geq 1} (-dx_j/j)z^{-j}\right)wz^{Q}
421+
404422
EXAMPLES::
405423
406424
sage: from sage.algebras.vertex_operators import *
@@ -459,11 +477,17 @@ def _repr_(self):
459477

460478
class AnnihilationOperator(VertexOperator):
461479
r"""
462-
The generating series for (bosonic) annihilation operators.
463-
480+
The image under the boson-fermion correspond of the fermionic field `\psi^*(z)`.
481+
482+
Explicitly, the action on the bosonic fock space is given by the series
483+
484+
.. MATH::
485+
486+
\exp \left( \sum_{j \geq 1} -x_j z^j \right) \exp\left(\sum_{j \geq 1} (dx_j/j)z^{-j}\right)z^{-Q}w^{-1}
487+
464488
.. WARNING::
465489
466-
Following the literature, the operator corresponding to the coefficient of
490+
Following the literature, the operator corresponding to the coefficient of
467491
`z^i` is `\psi_{-i}`, **not** `\psi_i`.
468492
469493
EXAMPLES::
@@ -514,11 +538,11 @@ def _get_operator(self, i, cutoff, c):
514538
op += self.pos[j + i + c - 1]*self.neg[j]
515539
return op
516540

517-
def act_by_clifford_gen(self,i, x):
541+
def act_by_clifford_gen(self, i, x):
518542
"""
519-
Action of the coefficient of z^{-i} on Fock space element ``x``.
543+
Action of the coefficient of `z^{-i}` on Fock space element ``x``.
520544
"""
521545
return self.act_by_mode(-i, x)
522-
546+
523547
def _repr_(self):
524548
return f"The annihilation vertex operator acting on {self.fockspace}"

0 commit comments

Comments
 (0)