docs: Docs for Wick contractions

This commit is contained in:
jstoobysmith 2025-02-07 06:58:41 +00:00
parent ce9668a3cd
commit c9607c459f
13 changed files with 123 additions and 64 deletions

View file

@ -24,15 +24,19 @@ open HepLean.Fin
-/
/-- Given a Wick contraction `φsΛ` associated to a list `φs`,
a position `i : Fin φs.lengthsucc`, an element `φ`, and an optional uncontracted element
`j : Option (φsΛ.uncontracted)` of `φsΛ`.
The Wick contraction `φsΛ.insertAndContract φ i j` is defined to be the Wick contraction
associated with `(φs.insertIdx i φ)` formed by 'inserting' `φ` into `φs` after the first `i`
elements and contracting `φ` optionally with `j`.
/-- Given a Wick contraction `φsΛ` for a list `φs` of `𝓕.FieldOp`,
a `𝓕.FieldOp` `φ`, an `i ≤ φs.length` and a `j` which is either `none` or
some element of `φsΛ.uncontracted`, the new Wick contraction
`φsΛ.insertAndContract φ i j` is defined by inserting `φ` into `φs` after
the first `i`-elements and moving the values representing the contracted pairs in `φsΛ`
accordingly.
If `j` is not `none`, but rather `some j`, to this contraction is added the contraction
of `φ` (at position `i`) with the new position of `j` after `φ` is added.
The notation `φsΛ ↩Λ φ i j` is used to denote `φsΛ.insertAndContract φ i j`. Thus,
`φsΛ ↩Λ φ i none` indicates the case when we insert `φ` into `φs` but do not contract it. -/
In other words, `φsΛ.insertAndContract φ i j` is formed by adding `φ` to `φs` at position `i`,
and contracting `φ` with the field orginally at position `j` if `j` is not none.
The notation `φsΛ ↩Λ φ i j` is used to denote `φsΛ.insertAndContract φ i j`. -/
def insertAndContract {φs : List 𝓕.FieldOp} (φ : 𝓕.FieldOp) (φsΛ : WickContraction φs.length)
(i : Fin φs.length.succ) (j : Option φsΛ.uncontracted) :
WickContraction (φs.insertIdx i φ).length :=