Skip to content

Commit

Permalink
FIX: make Pluto notebooks run (#159)
Browse files Browse the repository at this point in the history
* typo grouppedchains on chains, resultsdir
* update ThreeBodyDecay
* make model0 run:
  - no plot savings
  - define amplitude and intensity
* update sorting
* rerun eulerangles
* update wigner angle matching
  • Loading branch information
mmikhasenko authored Sep 2, 2022
1 parent ed533f4 commit 4ad21b4
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 191 deletions.
16 changes: 11 additions & 5 deletions julia/Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.7.3"
julia_version = "1.7.2"
manifest_format = "2.0"

[[deps.AbstractPlutoDingetjes]]
Expand Down Expand Up @@ -219,7 +219,7 @@ uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.6"

[[deps.Downloads]]
deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"

[[deps.EarCut_jll]]
Expand Down Expand Up @@ -758,6 +758,12 @@ git-tree-sha1 = "670e559e5c8e191ded66fa9ea89c97f10376bb4c"
uuid = "7f904dfe-b85e-4ff6-b463-dae2292396a8"
version = "0.7.38"

[[deps.Polynomials]]
deps = ["LinearAlgebra", "RecipesBase"]
git-tree-sha1 = "3010a6dd6ad4c7384d2f38c58fa8172797d879c1"
uuid = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
version = "3.2.0"

[[deps.PooledArrays]]
deps = ["DataAPI", "Future"]
git-tree-sha1 = "a6062fe4063cdafe78f4a0a81cfffb89721b30e7"
Expand Down Expand Up @@ -979,12 +985,12 @@ uuid = "ac1d9e8a-700a-412c-b207-f0111f4b6c0d"
version = "0.1.10"

[[deps.ThreeBodyDecay]]
deps = ["Cuba", "Parameters", "PartialWaveFunctions", "QuadGK", "RecipesBase", "StaticArrays"]
git-tree-sha1 = "95d22c3558927a4a2e4e5d17678cd5e13e34c99f"
deps = ["Cuba", "Parameters", "PartialWaveFunctions", "Polynomials", "QuadGK", "RecipesBase", "StaticArrays"]
git-tree-sha1 = "10deca7f7fd64ea77fb85afba12bfcf865b4915b"
repo-rev = "master"
repo-url = "https://github.com/mmikhasenko/ThreeBodyDecay.jl"
uuid = "e6563dab-9ca1-5843-bde3-2ccf38d63843"
version = "0.5.1"
version = "0.6.0"

[[deps.Transducers]]
deps = ["Adapt", "ArgCheck", "BangBang", "Baselet", "CompositionsBase", "DefineSingletons", "Distributed", "InitialValues", "Logging", "Markdown", "MicroCollections", "Requires", "Setfield", "SplittablesBase", "Tables"]
Expand Down
9 changes: 4 additions & 5 deletions julia/notebooks/canonicalwignerangle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using InteractiveUtils

# ╔═╡ 82366e00-987a-11ec-2631-455a8bb3ff96
begin
cd(@__DIR__)
cd(joinpath(@__DIR__, ".."))
using Pkg
Pkg.activate(".")
Pkg.instantiate()
Expand All @@ -18,11 +18,10 @@ begin
using Parameters
#
using ThreeBodyDecay
using PartialWaveFunctions
end

# ╔═╡ fd9ea193-f54b-4ef4-98a5-e00279f48002
const ms = ThreeBodyMasses(m1=0.938, m2=0.140, m3=0.493, m0=2.28)
const ms = ThreeBodyMasses(0.938, 0.140, 0.493, m0=2.28)

# ╔═╡ fcc14f24-d230-4f79-92bb-85a783ea75c5
begin
Expand Down Expand Up @@ -71,7 +70,7 @@ plot(layout=grid(1, 2), size=(700, 250),
# ╔═╡ 8af8de89-9f26-4052-8391-f2733788be5a
function ξΛ(σs)
θp = -acos(-cosθ31(σs, ms²)) # - (π-θ)
θΛ = acos(-cosθhat12(σs, ms²)) # π-θ
θΛ = acos(-cosζ12_for0(σs, ms²)) # π-θ
α = acos(cosαΛ(σs))
return θp + θΛ + α
end
Expand All @@ -82,7 +81,7 @@ plot(ms, ξΛ, colorbar=true)
# ╔═╡ e142916e-b305-46c6-8ba3-44c7caeccff8
function ξΔ(σs)
θp = acos(cosθ12(σs, ms²)) # just θ
θΔ = -acos(-cosθhat31(σs, ms²)) # -(π-θ)
θΔ = -acos(-cosζ31_for0(σs, ms²)) # -(π-θ)
α = acos(cosαΔ(σs))
return θp + θΔ - α
end
Expand Down
161 changes: 77 additions & 84 deletions julia/notebooks/eulerangles.jl
Original file line number Diff line number Diff line change
@@ -1,64 +1,59 @@
### A Pluto.jl notebook ###
# v0.18.0
# v0.19.11

using Markdown
using InteractiveUtils

# ╔═╡ b56fc9a7-fa03-47d6-b22e-0097be7155d3
# ╠═╡ show_logs = false
begin
cd(joinpath(@__DIR__,".."))
using Pkg
Pkg.activate(".")
Pkg.instantiate()
#
using Plots
using RecipesBase
#
using LinearAlgebra
using Parameters
#
using ThreeBodyDecay
end

# ╔═╡ 4f00e2b5-6097-4577-b669-eafe4cbf1852
using PlutoUI

# ╔═╡ d5d6b8bf-1321-464d-80bb-be1cc1b1ed8d
with_terminal() do
Pkg.status()
cd(joinpath(@__DIR__, ".."))
using Pkg
Pkg.activate(".")
Pkg.instantiate()
#
using Plots
using RecipesBase
#
using LinearAlgebra
using Parameters
#
using ThreeBodyDecay
end

# ╔═╡ d65ed080-9654-11ec-0a8e-e530b9164a8c
Rz(p,θ) = [p[1]*cos(θ)-p[2]*sin(θ), p[2]*cos(θ)+p[1]*sin(θ), p[3]]
Rz(p, θ) = [p[1] * cos(θ) - p[2] * sin(θ), p[2] * cos(θ) + p[1] * sin(θ), p[3]]

# ╔═╡ 9beb287e-91ee-4a01-b803-5686576cf087
Ry(p,cθ,sθ) = [p[1]*+p[3]*sθ, p[2], p[3]*-p[1]*sθ]
Ry(p, cθ, sθ) = [p[1] *+ p[3] * sθ, p[2], p[3] *- p[1] * sθ]

# ╔═╡ 55cf2a64-dd00-461a-ab93-cad2ef71fbb0
Ry(p,θ) = [p[1]*cos(θ)+p[3]*sin(θ), p[2], p[3]*cos(θ)-p[1]*sin(θ)]
Ry(p, θ) = [p[1] * cos(θ) + p[3] * sin(θ), p[2], p[3] * cos(θ) - p[1] * sin(θ)]

# ╔═╡ f341c6fd-4b7a-4497-acf8-f343a95e9521
begin
Rz(θ) = x->Rz(x,θ)
Ry(θ) = x->Ry(x,θ)
Rz(θ) = x -> Rz(x, θ)
Ry(θ) = x -> Ry(x, θ)
end

# ╔═╡ 4a5e2b92-37fc-494b-8c00-d8a339ce7bcb
const ms = ThreeBodyMasses(m1=0.938272046, m2=0.13957018, m3=0.493677, m0=2.28646)
const ms = ThreeBodyMasses(0.938272046, 0.13957018, 0.493677; m0=2.28646)

# ╔═╡ 570f8ee0-7c75-4c93-bc3a-debab0b81874
const ms² = ms^2

# ╔═╡ 1a0a3c20-0990-4a7d-8395-941bf34ac9e3
function constructinvariants(σs)
p₁ = sqrt(Kallen(ms.m0^2,ms[1]^2,σs[1])) / (2ms.m0)
p₂ = sqrt(Kallen(ms.m0^2,ms[2]^2,σs[2])) / (2ms.m0)
p₃ = sqrt(Kallen(ms.m0^2,ms[3]^2,σs[3])) / (2ms.m0)
#
p1 = [0,0,p₁]
p2 = (c=cosζ(wr(1,2,0),σs,ms²); Ry([0,0,p₂], c, -sqrt(1-c^2)))
p3 = (c=cosζ(wr(3,1,0),σs,ms²); Ry([0,0,p₃], c, sqrt(1-c^2)))
return (; p1, p2, p3)
p₁ = sqrt(Kallen(ms.m0^2, ms[1]^2, σs[1])) / (2ms.m0)
p₂ = sqrt(Kallen(ms.m0^2, ms[2]^2, σs[2])) / (2ms.m0)
p₃ = sqrt(Kallen(ms.m0^2, ms[3]^2, σs[3])) / (2ms.m0)
#
p1 = [0, 0, p₁]
p2 = (c = cosζ(wr(1, 2, 0), σs, ms²);
Ry([0, 0, p₂], c, -sqrt(1 - c^2)))
p3 = (c = cosζ(wr(3, 1, 0), σs, ms²);
Ry([0, 0, p₃], c, sqrt(1 - c^2)))
return (; p1, p2, p3)
end

# ╔═╡ 34de7c63-83db-4247-b904-1eaa5822af18
Expand All @@ -67,12 +62,12 @@ md"""
"""

# ╔═╡ 9a793648-ae8f-465d-9a55-0735a16fd1db
function alteulerangles(p1′,p2′,p3′)
ϕp = atan(p1′[2],p1′[1])
θp = acos(p1′[3]/norm(p1′))
χ = atan((p1′ × p3′)[3], -(p1′ × p3′ × p1′)[3] / norm(p1′))
#
(; ϕp, θp, χ)
function alteulerangles(p1′, p2′, p3′)
ϕp = atan(p1′[2], p1′[1])
θp = acos(p1′[3] / norm(p1′))
χ = atan((p1′×p3′)[3], -(p1′×p3′×p1′)[3] / norm(p1′))
#
(; ϕp, θp, χ)
end

# ╔═╡ 89d46224-82a3-4b53-b17e-4fb7ba702202
Expand All @@ -82,20 +77,20 @@ md"""

# ╔═╡ 6fbb3423-090b-4e11-912c-902ccb6ab43a
function checkconsistency(σs; ϕ1, θ1, ϕ23)
(; p1, p2, p3) = constructinvariants(σs)
p1′ = p1 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
p2′ = p2 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
p3′ = p3 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
(; ϕp, θp, χ) = alteulerangles(p1′,p2′,p3′)
#
(ϕ1 ϕp) * 100 + (θ1 θp) * 10 + (ϕ23 χ)
(; p1, p2, p3) = constructinvariants(σs)
p1′ = p1 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
p2′ = p2 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
p3′ = p3 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
(; ϕp, θp, χ) = alteulerangles(p1′, p2′, p3′)
#
(ϕ1 ϕp) * 100 + (θ1 θp) * 10 + (ϕ23 χ)
end

# ╔═╡ f66d17ab-3022-4fe4-83de-8604cf8f69fb
σsv = flatDalitzPlotSample(ms; Nev = 10_000)
σsv = flatDalitzPlotSample(ms; Nev=10_000)

# ╔═╡ c916fcc4-f570-4358-8030-7ca8de594d8b
prod(checkconsistency.(σsv; ϕ1=-0.3, θ1=π-0.1, ϕ23=-0.4) .== 111)
prod(checkconsistency.(σsv; ϕ1=-0.3, θ1=π - 0.1, ϕ23=-0.4) .== 111)

# ╔═╡ 069f91af-0f1c-45d0-bc29-2f3da4506232
md"""
Expand All @@ -104,64 +99,63 @@ md"""

# ╔═╡ 3e2a95ce-b7e9-419a-85eb-c025847ae8ae
function rotatedfv(σs; ϕ1, θ1, ϕ23)
(; p1, p2, p3) = constructinvariants(σs)
p1′ = p1 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
p2′ = p2 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
p3′ = p3 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
return (p1′,p2′,p3′)
(; p1, p2, p3) = constructinvariants(σs)
p1′ = p1 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
p2′ = p2 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
p3′ = p3 |> Rz(ϕ23) |> Ry(θ1) |> Rz(ϕ1)
return (p1′, p2′, p3′)
end

# ╔═╡ ec44a76a-0079-4e76-b9f0-b60b649445c9
σs0 = Invariants(ms,
σ1 = 0.7980703453578917,
σ2 = 3.6486261122281745)
σ1=0.7980703453578917,
σ2=3.6486261122281745)

# ╔═╡ b017b80b-44f0-4cb7-bf9c-c8511fd976cf
with_terminal() do
println.(rotatedfv(σs0; ϕ1=-0.3, θ1=π-0.1, ϕ23=-0.4))
println.(rotatedfv(σs0; ϕ1=-0.3, θ1=π - 0.1, ϕ23=-0.4))
end

# ╔═╡ 30b38727-cf5b-46f5-8aaf-7b5b7dc0d3a9
p1,p2,p3 = constructinvariants(σs0)
p1, p2, p3 = constructinvariants(σs0)

# ╔═╡ 47f54ed9-5f87-4e21-a309-62eddfaeb2e6
begin
p4p = [0. , 0. , 0.68416827, 1.16122377]
p4pi = [-0.28022697, 0. , -0.1556354 , 0.34961317]
p4k = [ 0.28022697, 0. , -0.52853287, 0.77562306]
p4p = [0.0, 0.0, 0.68416827, 1.16122377]
p4pi = [-0.28022697, 0.0, -0.1556354, 0.34961317]
p4k = [0.28022697, 0.0, -0.52853287, 0.77562306]
end

# ╔═╡ 0485c5fd-1ee2-4d57-a222-ca31044b1b63
begin
# Lambda
pk_theta_r= 1.06382395
pk_theta_p= -1.33775751

# Delta
ppi_theta_r= -0.487513
ppi_theta_p= 1.11390452
#
kpi_theta_k= 1.82134117
#
# m2ppi: 1.92475412
# m2pk: 3.64862611
# m2kpi: 0.79807035
# Lambda
pk_theta_r = 1.06382395
pk_theta_p = -1.33775751

# Delta
ppi_theta_r = -0.487513
ppi_theta_p = 1.11390452
#
kpi_theta_k = 1.82134117
#
# m2ppi: 1.92475412
# m2pk: 3.64862611
# m2kpi: 0.79807035
end

# ╔═╡ a588bcfd-fe75-44f7-ac58-88f7039e7584
begin
kpi_theta_k acos(cosθ23(σs0,ms²)),
#
pk_theta_p --acos(cosθ31(σs0,ms²))),
pk_theta_r π-acos(cosζ(wr(1,2,0),σs0,ms²)),
#
ppi_theta_p acos(cosθ12(σs0,ms²)),
ppi_theta_r --acos(cosζ(wr(3,1,0),σs0,ms²)))
kpi_theta_k acos(cosθ23(σs0, ms²)),
#
pk_theta_p - - acos(cosθ31(σs0, ms²))),
pk_theta_r π - acos(cosζ(wr(1, 2, 0), σs0, ms²)),
#
ppi_theta_p acos(cosθ12(σs0, ms²)),
ppi_theta_r - - acos(cosζ(wr(3, 1, 0), σs0, ms²)))
end

# ╔═╡ Cell order:
# ╠═b56fc9a7-fa03-47d6-b22e-0097be7155d3
# ╠═d5d6b8bf-1321-464d-80bb-be1cc1b1ed8d
# ╠═d65ed080-9654-11ec-0a8e-e530b9164a8c
# ╠═9beb287e-91ee-4a01-b803-5686576cf087
# ╠═55cf2a64-dd00-461a-ab93-cad2ef71fbb0
Expand All @@ -178,7 +172,6 @@ end
# ╟─069f91af-0f1c-45d0-bc29-2f3da4506232
# ╠═3e2a95ce-b7e9-419a-85eb-c025847ae8ae
# ╠═ec44a76a-0079-4e76-b9f0-b60b649445c9
# ╠═4f00e2b5-6097-4577-b669-eafe4cbf1852
# ╠═b017b80b-44f0-4cb7-bf9c-c8511fd976cf
# ╠═30b38727-cf5b-46f5-8aaf-7b5b7dc0d3a9
# ╠═47f54ed9-5f87-4e21-a309-62eddfaeb2e6
Expand Down
Loading

0 comments on commit 4ad21b4

Please sign in to comment.