-
-
Notifications
You must be signed in to change notification settings - Fork 721
Implement vertex operators #40545
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
base: develop
Are you sure you want to change the base?
Implement vertex operators #40545
Conversation
Vertex operators
|
Documentation preview for this PR (built with commit 44039aa; changes) is ready! 🎉 |
tscrim
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will probably have more on my second pass, but this is coming together.
|
|
||
| lazy_import('sage.algebras.yangian', 'Yangian') | ||
|
|
||
| import sage.algebras.vertex_operators_catalog as vertex_operators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| import sage.algebras.vertex_operators_catalog as vertex_operators | |
| lazy_import("sage.algebras", "vertex_operators_catalog", "vertex_operators") |
so it is not imported at startup.
| from sage.misc.lazy_import import lazy_import | ||
|
|
||
| lazy_import('sage.algebras.vertex_operators', 'BosonicFockSpace') | ||
| lazy_import('sage.algebras.vertex_operators', 'CreationOperator') | ||
| lazy_import('sage.algebras.vertex_operators', 'AnnihilationOperator') | ||
|
|
||
| del lazy_import # We remove the object from here so it doesn't appear under tab completion |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| from sage.misc.lazy_import import lazy_import | |
| lazy_import('sage.algebras.vertex_operators', 'BosonicFockSpace') | |
| lazy_import('sage.algebras.vertex_operators', 'CreationOperator') | |
| lazy_import('sage.algebras.vertex_operators', 'AnnihilationOperator') | |
| del lazy_import # We remove the object from here so it doesn't appear under tab completion | |
| from sage.algebras.vertex_operators import (BosonicFockSpace, CreationOperator, AnnihilationOperator) |
If we lazily import the catalog, then we don't have to lazily import here.
| from sage.structure.unique_representation import UniqueRepresentation | ||
|
|
||
|
|
||
| class FermionicFockSpace(CombinatorialFreeModule): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class can be replaced by
Ind = cartesian_product((Partitions(), ZZ))
CombinatorialFreeModule(R, Ind, bracket=['|', '>'])| if isinstance(sym_basis, str): | ||
| b = getattr(Sym, sym_basis, None) | ||
| if b is None or b() not in Sym.realizations(): | ||
| raise ValueError("Unknown symmetric function basis") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| raise ValueError("Unknown symmetric function basis") | |
| raise ValueError("unknown symmetric function basis") |
We follow Python's conventions.
| raise ValueError("Unknown symmetric function basis") | ||
| return LaurentPolynomialRing(b(), names=(name,)) | ||
| if sym_basis.base_ring() is not R: | ||
| raise ValueError("") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No error message here.
| self.pos = HalfVertexOperator(pos) | ||
| self.neg = HalfVertexOperator(neg) | ||
| if fockspace is None: | ||
| fockspace = BosonicFockSpace() | ||
|
|
||
| self.cutoff = cutoff | ||
| self.dcharge = dcharge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| self.pos = HalfVertexOperator(pos) | |
| self.neg = HalfVertexOperator(neg) | |
| if fockspace is None: | |
| fockspace = BosonicFockSpace() | |
| self.cutoff = cutoff | |
| self.dcharge = dcharge | |
| self._pos = HalfVertexOperator(pos) | |
| self._neg = HalfVertexOperator(neg) | |
| if fockspace is None: | |
| fockspace = BosonicFockSpace() | |
| self._cutoff = cutoff | |
| self._dcharge = dcharge |
| bra[1], self.fockspace.zero()).monomial_coefficients().get(Partition(bra[0]), self.fockspace.zero())) | ||
| return F if cutoff is None else self._approximate(F, cutoff) | ||
|
|
||
| def _approximate(self, family, cutoff): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be a method of this class but a function.
|
|
||
| # op is a scalar | ||
| if op in R.base_ring(): | ||
| return op*f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| return op*f | |
| return op * f |
PEP8
| raise ValueError | ||
| for i in range(len(mon) - 1, -1, -1): | ||
| x = self.vertex_ops[i].act_on(mon[i], x) | ||
| if x == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if x == 0: | |
| if not x: |
| res[m] = c | ||
| return res | ||
|
|
||
| def vacuum_expectation(self, cutoff=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to move up to the base class.
This PR adds classes which implement the vertex operators relating to the classical boson-fermion correspondence.
Part of #40241
cc: @tscrim
📝 Checklist