refactor: Creation of composite nodes

This commit is contained in:
jstoobysmith 2024-10-22 07:11:44 +00:00
parent 8fa8a51367
commit ccb9623bd6
6 changed files with 43 additions and 70 deletions

View file

@ -223,7 +223,6 @@ def termNodeSyntax (T : Term) : TermElabM Term := do
mkIdent ``Fermion.Color.down, mkIdent ``Fermion.Color.down, T]
| _ =>
return Syntax.mkApp (mkIdent ``TensorTree.twoNode) #[T]
| 3, 1 => return Syntax.mkApp (mkIdent ``TensorTree.threeNode) #[T]
| 1, 2 => return Syntax.mkApp (mkIdent ``TensorTree.constVecNode) #[T]
| 2, 2 =>
match ← isDefEq type (← stringToType
@ -233,16 +232,6 @@ def termNodeSyntax (T : Term) : TermElabM Term := do
mkIdent ``Fermion.complexLorentzTensor, mkIdent ``Fermion.Color.down,
mkIdent ``Fermion.Color.down, T]
| _ => return Syntax.mkApp (mkIdent ``TensorTree.constTwoNode) #[T]
| 3, 2 =>
/- Specific types. -/
match ← isDefEq type (← stringToType
"𝟙_ (Rep SL(2, )) ⟶ Lorentz.complexContr ⊗ Fermion.leftHanded ⊗ Fermion.rightHanded") with
| true =>
return Syntax.mkApp (mkIdent ``TensorTree.constThreeNodeE) #[
mkIdent ``Fermion.complexLorentzTensor, mkIdent ``Fermion.Color.up,
mkIdent ``Fermion.Color.upL, mkIdent ``Fermion.Color.upR, T]
| _ =>
return Syntax.mkApp (mkIdent ``TensorTree.constThreeNode) #[T]
| _, _ => throwError "Could not create terminal node syntax (termNodeSyntax). "
/-- Adjusts a list `List ` by subtracting from each natrual number the number