Skip to content

juanmargalef/xCPS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xCPS: Covariant Phase Space for xAct

License: GPL xAct

xCPS is a Mathematica package that implements the Covariant Phase Space (CPS) formalism for field theories within the xAct tensor algebra suite.

Features

For a given a Lagrangian, xCPS can compute:

  • Equations of Motion (EOM)

  • Symplectic currents

  • Symmetry verification for arbitrary field transformations

  • Noether charges associated with symmetries

The package handles generic Lagrangians of the form $L(\text{tensors})$, including higher-derivative theories such as $f(\text{Riemann})$ gravity and beyond.

Additional Utilities

Two powerful tools for general tensor calculations might be useful for the general public:

  • Divergence detection: Determine whether an expression can be written as $\nabla_a V^a$

  • Potential extraction: Extract the "potential" tensor $T^{bc}$ from expressions of the form $\nabla_a T^{bc}$

Installation

xCPS is included by default in xAct 1.3 and later versions. For prior versions, please refer to Section A.1 of xCPS_doc.nb for manual installation instructions.

Documentation

A complete tutorial with theoretical background and detailed examples is included in the documentation notebook xCPS_doc.nb which includes, among other things, the following examples:

  • Scalar field theories (Klein-Gordon and generic Lagrangians that depend on the scalar field and its derivatives)

  • Electromagnetism (Maxwell theory)

  • General Relativity and $f(R)$ gravity

  • Boundary terms and corner contributions

Citation

If xCPS contributes to your research, please cite:

The Package

J. Margalef-Bentabol, "xCPS: an xAct package for covariant phase space, Noether symmetries and Noether charges." arXiv preprint (forthcoming). GitHub: juanmargalef/xCPS

Theoretical Foundation

J. Margalef-Bentabol and E. J. S. Villaseñor, "Geometric formulation of the covariant phase space methods with boundaries," Phys. Rev. D 103, 025011 (2021). arXiv:2008.01842

Quick Example

(* Load the package *)
<< xAct`xCPS`
$PrePrint = ScreenDollarIndices;

(* Setup manifold and metric *)
DefManifold[M, 4, {a, b, c, d, e, f, i}];
DefMetric[-1, g[-a, -b], LCDer];

(*********************************)
(* Example 1: General Relativity *)
(*********************************)

(* Einstein-Hilbert Lagrangian *)
LGR = RicciScalarLCDer[] Sqrt[-Determinant[g][]];

(* Equations of Motion → Einstein equations *)
EOM[g, LCDer][LGR] // ContractMetric // Simplification

(* Symplectic Current *)
SymplecticCurrent[g, LCDer][LGR] // ContractMetric // Simplification

(******************************************)
(* Example 2: Generic Scalar Field Theory *)
(******************************************)

(* Define scalar field and its covariant derivative (as an independent tensor) *)
DefTensor[phi[], M, PrintAs -> "\[Phi]"];
Implode[LCDer[-a]@phi[]]

(* Generic scalar function depending on φ and ∇φ *)
DefScalarFunction[LScalar1, {phi,LCDerphi}, PrintAs -> "\!\(\*SubscriptBox[\(L\), \(1\)]\)"];

(* Generic scalar Lagrangian *)
L = Sqrt[-Detg[]] LScalar1[phi,LCDerphi];

(* First variation with respect to φ *)
FirstVariation[phi, LCDer][L]

(* Symplectic Current *)
SymplecticCurrent[phi, LCDer][L]

Support

For questions, bug reports, or feature requests:

  • GitHub Issues: Open an issue for bug reports or feature requests

  • xAct Community: Join discussions on the xAct Google Group

  • Send me an email (info in the xCPS_doc.nb file)

License

This project is licensed under the GNU General Public License v2.0. See the LICENSE file for full details.


Keywords: Covariant Phase Space, Field Theory, General Relativity, Symplectic Geometry, Noether Charges, xAct, Mathematica, Tensor Calculus

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors