Skip to content

Bosonic statistics second quantization#1

Open
BrunoQNF wants to merge 19 commits into
mainfrom
bosonic-statistics
Open

Bosonic statistics second quantization#1
BrunoQNF wants to merge 19 commits into
mainfrom
bosonic-statistics

Conversation

@BrunoQNF

@BrunoQNF BrunoQNF commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Refactor SecondQuantization module + add bosonic symbolic algebra tools

Summary

  • Splits SecondQuantization.m (511 lines) into six focused sub-modules under Kernel/SecondQuantization/, improving maintainability and making individual components easier to load, test, and extend.
  • Adds new public API for symbolic bosonic algebraBosonicNormalOrder, BosonicBCHTerms, BosonicZassenhausTerms, BosonicBCHExact, BosonicRelations, BosonVEV, and BosonicMatrixElement — all exported from the SecondQuantization context.
  • Adds two exploratory notebooks (BosonicNormalOrder.nb, BosonicBCH_Zassenhaus.nb) demonstrating the new tools.

Module split

The old SecondQuantization.m is replaced by:

File Responsibility
Utils.m $FockSize, SetFockSpaceSize, FieldVariables, OrderVariables, G1Correlation, G2Coherence
States.m FockState, CoherentState, ThermalState, CatState
Operators.m AnnihilationOperator, DisplacementOperator, SqueezeOperator, QuadratureOperators, BeamSplitterOperator, PhaseShiftOperator
PhaseSpaceRepresentations.m WignerRepresentation, HusimiQRepresentation, WignerFunction, HusimiQFunction
BlasiakFormula.m Internal BlasiakNormalOrder / MultiModeBlasiakOrder engine
BosonicAlgebra.m All new symbolic bosonic algebra exports (see below)

New symbolic algebra API

  • BosonicRelations[vars] — constructs the canonical bosonic commutation relations for a given list of mode operators.
  • BosonicNormalOrder[expr, vars] — brings an operator expression into normal order; supports Method -> "GrobnerBasis" (default, via NonCommutativePolynomialReduce) or Method -> "Blasiak" (Blasiak combinatorial engine for pure bosonic polynomial moments), and "Scalars" -> syms.
  • BosonicBCHTerms[X, Y, n] / BosonicZassenhausTerms[X, Y, n] — BCH / Zassenhaus expansions to n th term reduced with bosonic algebra.
  • BosonicBCHExact[X, Y] — closed-form exact BCH cases for exponentials.
  • BosonVEV[expr, vars] / BosonicMatrixElement[{m, n}, op] — vacuum expectation values and Fock matrix elements.

Notes

  • NCA compatibility update for Mathematica v15 is included.

BrunoQNF and others added 19 commits May 11, 2026 19:32
Following WFR implementations in a wrapper way for bosonic commutations relations
Separating the context in files. Added bosonic symbolic algebra functions. Added a loader file to ensure SecondQuantization context loads properly.
Context was seperated in different files
States.m: Adding label to states for circuit display. PhaseSpaceRepresentations.m: Adding symbolic Wigner and HusimiQ.
Closed form for some cases where the bosonic algebra closes
Improvement in FieldVariables for handling different formal symbol variables (not limited to same label). Ease of use of the infinity parameter for DisplacementOperator, both signatures use different ordering as default. In BosonicAlgebra.m added BosonicVEV for vacuum expectation values, and BosonicMatrixElement for the m,n element of Displacement and Squeeze operators.
@BrunoQNF BrunoQNF marked this pull request as ready for review June 10, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants