Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cianlm/symbolicquantumfieldtheory.jl
Symbolic QFT in Julia
https://github.com/cianlm/symbolicquantumfieldtheory.jl
julia particle-physics physics qft quantum science symbolic
Last synced: about 1 month ago
JSON representation
Symbolic QFT in Julia
- Host: GitHub
- URL: https://github.com/cianlm/symbolicquantumfieldtheory.jl
- Owner: CianLM
- License: gpl-2.0
- Created: 2022-11-19T13:43:11.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-18T02:33:15.000Z (4 months ago)
- Last Synced: 2024-09-18T06:05:30.957Z (4 months ago)
- Topics: julia, particle-physics, physics, qft, quantum, science, symbolic
- Language: Julia
- Homepage:
- Size: 121 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SymbolicQuantumFieldTheory.jl
[![Build Status](https://github.com/CianLM/QFT.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/CianLM/QFT.jl/actions/workflows/CI.yml?query=branch%3Amain)
## Symbolic Quantum Field Theory in Julia
This package is in active development and is not production ready. Feel free to reach out with suggestions/issues.
Documentation is under construction. See `test.ipynb` for LaTeX printing and more example usage.
## Basic Syntax
```julia
using QFT
using Symbolics
@operator ScalarField a
@syms p q
```
where `a` is the name of the operator and `p` and `q` are the momenta.We can use these objects with
```julia
comm(a(p),a(q)')
normalorder(a(p) * a(q)')
a(p)'^2 * a(q)' * vacuum()
ℋ = E(q) * a(q)' * a(q)
integrate(ℋ * a(p)', q)
```
which returns $2\pi * E(p) a_p^\dagger \ket{0}$ in a Jupyter notebook and `2π*E(p)a_p^†|0⟩` otherwise.## Defining a Custom Commutation Relation
We can define a custom commutation relation between operators in a field using a natural syntax with the `@comm` macro.
*Note*. To do this we need to
```julia
import QFT.comm
```
as the `comm` function will be overloaded with your custom relation.Then,
```julia
@field YourField
@operators YourField b c
@comm [b(p), c(q)'] = f(p,q)
```
for any `f(p,q)`.
This defines the commutation relation such that the commutator is now given by
```julia
@syms k l
comm(b(k), c(l)') # returns f(k,l)
```
where Julia has replaced `p` and `q` with `k` and `l` appropriately. Multiple indices are also supported with `@comm [b(p,q), c(r,s)'] = f(p,q,r,s)`.