
{
	"cells" : 
	[
		
		{
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				
				{
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "\\section*{Gamma matrix algebra (Clifford algebras)}\n\nCadabra can do gamma matrix algebra in an arbitrary number of dimensions. The example below shows how to work out \nthe particular gamma matrix contraction\n\\begin{equation*}\n\\Gamma_{s r} \\Gamma_{r l} \\Gamma_{k m} \\Gamma_{m s}\\,,\n\\end{equation*}\nwhich is not impossible to do by hand, but certainly much nicer with Cadabra. As always, we first need to declare\nthe symbols we are going to use. "
				}
			],
			"hidden" : true,
			"source" : "\\section*{Gamma matrix algebra (Clifford algebras)}\n\nCadabra can do gamma matrix algebra in an arbitrary number of dimensions. The example below shows how to work out \nthe particular gamma matrix contraction\n\\begin{equation*}\n\\Gamma_{s r} \\Gamma_{r l} \\Gamma_{k m} \\Gamma_{m s}\\,,\n\\end{equation*}\nwhich is not impossible to do by hand, but certainly much nicer with Cadabra. As always, we first need to declare\nthe symbols we are going to use. "
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				
				{
					"cell_origin" : "server",
					"cell_type" : "latex_view",
					"source" : "\\begin{dmath*}{}\\text{Attached property Indices(position=free) to~}(s, r, l, k, m, n).\\end{dmath*}"
				},
				
				{
					"cell_origin" : "server",
					"cell_type" : "latex_view",
					"source" : "\\begin{dmath*}{}\\text{Attached property Integer to~}(s, r, l, k, m, n).\\end{dmath*}"
				},
				
				{
					"cell_origin" : "server",
					"cell_type" : "latex_view",
					"source" : "\\begin{dmath*}{}\\text{Attached property GammaMatrix to~}{\\Gamma}_(\\#).\\end{dmath*}"
				},
				
				{
					"cell_origin" : "server",
					"cell_type" : "latex_view",
					"source" : "\\begin{dmath*}{}\\text{Attached property KroneckerDelta to~}{\\delta}_(mn).\\end{dmath*}"
				}
			],
			"source" : "{s,r,l,k,m,n}::Indices(vector);\n{s,r,l,k,m,n}::Integer(0..d-1);\n\\Gamma_{#}::GammaMatrix(metric=\\delta);\n\\delta_{m n}::KroneckerDelta;"
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				
				{
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "After every step in which we work out the product of two generalised gamma matrices, we need a number of algorithms\nto simplify the result. We will use the mechanism of defining a \\verb|post_process| function, which gets called after\nevery Cadabra function call. Note how every algorithm that is called in here acts on the same expression; you do not have to \ndo things like \\verb|ex = sort_product(ex)|."
				}
			],
			"hidden" : true,
			"source" : "After every step in which we work out the product of two generalised gamma matrices, we need a number of algorithms\nto simplify the result. We will use the mechanism of defining a \\verb|post_process| function, which gets called after\nevery Cadabra function call. Note how every algorithm that is called in here acts on the same expression; you do not have to \ndo things like \\verb|ex = sort_product(ex)|."
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "input",
			"source" : "def post_process(ex):\n\tsort_product(ex)\n\teliminate_kronecker(ex)\n\tcanonicalise(ex)\n\tcollect_terms(ex)"
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				
				{
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "The expression which we want to simplify reads"
				}
			],
			"hidden" : true,
			"source" : "The expression which we want to simplify reads"
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				
				{
					"cell_origin" : "server",
					"cell_type" : "latex_view",
					"source" : "\\begin{dmath*}{}-\\Gamma_{m r} \\Gamma_{l m} \\Gamma_{k s} \\Gamma_{r s}\\end{dmath*}"
				}
			],
			"source" : "ex:=\\Gamma_{s r} \\Gamma_{r l} \\Gamma_{k m} \\Gamma_{m s};"
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				
				{
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "We need to join and distribute three times to merge all four generalised gamma matrices, so"
				}
			],
			"hidden" : true,
			"source" : "We need to join and distribute three times to merge all four generalised gamma matrices, so"
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				
				{
					"cell_origin" : "server",
					"cell_type" : "latex_view",
					"source" : "\\begin{dmath*}{}\\Gamma_{k l} \\left(-18d+8(d d)+12-(d d d)\\right)+\\delta_{k l} \\left(-3+6d-4(d d)+(d d d)\\right)\\end{dmath*}"
				}
			],
			"source" : "for i in range(3):\n\tjoin_gamma(_)\n\tdistribute(_)\nfactor_in(_, $d$);"
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "input",
			"cells" : 
			[
				
				{
					"cell_origin" : "server",
					"cell_type" : "latex_view",
					"source" : "\\begin{dmath*}{}\\Gamma_{k l} \\left(-18d+8d^{2}+12-d^{3}\\right)+\\delta_{k l} \\left(-3+6d-4d^{2}+d^{3}\\right)\\end{dmath*}"
				}
			],
			"source" : "collect_factors(ex);"
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "latex",
			"cells" : 
			[
				
				{
					"cell_origin" : "client",
					"cell_type" : "latex_view",
					"source" : "That's the answer we wanted to compute, much easier than by hand."
				}
			],
			"hidden" : true,
			"source" : "That's the answer we wanted to compute, much easier than by hand."
		},
		
		{
			"cell_origin" : "client",
			"cell_type" : "input",
			"source" : ""
		}
	],
	"description" : "Cadabra JSON notebook format",
	"version" : 1.0
}

