Skip to content

Commit

Permalink
Remove base patch (#71)
Browse files Browse the repository at this point in the history
Merge after #69 

This deletes the QEDbase patch which is no longer necessary as the
relevant PR in QEDbase was merged.
Unfortunately, there seems to be a somewhat strange interaction of
doubly defined typenames and `@reexport`, creating an issue in QEDbase's
documentation building. This means that I had to remove some `@extref`
statements for now that can be readded later, when QEDbase is ready.
  • Loading branch information
AntonReinhard authored Oct 23, 2024
1 parent fc1483b commit ea741b3
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 196 deletions.
24 changes: 16 additions & 8 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,46 +4,54 @@ stages:
- run_integration_test
- verify-unit-test-deps

.untit_test_template:
.unit_test_template:
stage: unit-test
script:
- apt update && apt install -y git
- git clone --depth 1 -b dev https://github.com/QEDjl-project/QuantumElectrodynamics.jl.git /QEDjl
- >
if [[ $CI_COMMIT_BRANCH == "main" || $CI_COMMIT_REF_NAME == "main" || $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_REF_NAME == "dev" ]]; then
# set name of the commit message from CI_COMMIT_MESSAGE to NO_MESSAGE, that the script does not read accidentally custom packages from the commit message of a merge commit
julia --project=. /QEDjl/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml NO_MESSAGE
else
julia --project=. /QEDjl/.ci/SetupDevEnv/src/SetupDevEnv.jl ${CI_PROJECT_DIR}/Project.toml
fi
- julia --project=. -e 'import Pkg; Pkg.instantiate()'
- julia --project=. -e 'import Pkg; Pkg.test(; coverage = true)'
interruptible: true
tags:
- cpuonly

unit_tests_releases:
extends: .untit_test_template
extends: .unit_test_template
parallel:
matrix:
- JULIA_VERSION: ["1.10", "1.11", "rc"]
image: julia:$JULIA_VERSION

unit_tests_nightly:
extends: .untit_test_template
extends: .unit_test_template
# use the same baseimage like the official julia images
image: debian:bookworm-slim
variables:
# path where julia tar bal should be downloaded
JULIA_DONWLOAD: /julia/download
JULIA_DOWNLOAD: /julia/download
# path where julia should be extracted
JULIA_EXTRACT: /julia/extract
before_script:
- apt update && apt install -y wget
- mkdir -p $JULIA_DONWLOAD
- mkdir -p $JULIA_DOWNLOAD
- mkdir -p $JULIA_EXTRACT
- >
if [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/arm64" ]]; then
wget https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linux-aarch64.tar.gz -O $JULIA_DONWLOAD/julia-nightly.tar.gz
wget https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linux-aarch64.tar.gz -O $JULIA_DOWNLOAD/julia-nightly.tar.gz
elif [[ $CI_RUNNER_EXECUTABLE_ARCH == "linux/amd64" ]]; then
wget https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz -O $JULIA_DONWLOAD/julia-nightly.tar.gz
wget https://julialangnightlies-s3.julialang.org/bin/linux/x86_64/julia-latest-linux-x86_64.tar.gz -O $JULIA_DOWNLOAD/julia-nightly.tar.gz
else
echo "unknown runner architecture -> $CI_RUNNER_EXECUTABLE_ARCH"
exit 1
fi
- tar -xf $JULIA_DONWLOAD/julia-nightly.tar.gz -C $JULIA_EXTRACT
- tar -xf $JULIA_DOWNLOAD/julia-nightly.tar.gz -C $JULIA_EXTRACT
# we need to search for the julia base folder name, because the second part of the name is the git commit hash
# e.g. julia-b0c6781676f
- JULIA_EXTRACT_FOLDER=${JULIA_EXTRACT}/$(ls $JULIA_EXTRACT | grep -m1 julia)
Expand Down
1 change: 0 additions & 1 deletion docs/src/library/lorentzboosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ BetaVector
BetaX
BetaY
BetaZ
AbstractCoordinateTransformation
```
2 changes: 0 additions & 2 deletions src/QEDcore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ using SimpleTraits

@reexport using QEDbase

include("patch_QEDbase.jl")

include("algebraic_objects/dirac_tensors/types.jl")
include("algebraic_objects/dirac_tensors/multiplication.jl")

Expand Down
6 changes: 3 additions & 3 deletions src/lorentz_boost/boost_parameter/boost_axis/beta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ end

BetaX(beta::T) where {T<:Real} = BetaX{T}(beta)

function _transform(boost_param::BetaX, p::M) where {M<:AbstractFourMomentum}
function QEDbase._transform(boost_param::BetaX, p::M) where {M<:AbstractFourMomentum}
en = getE(p)
px = getX(p)

Expand Down Expand Up @@ -187,7 +187,7 @@ end

BetaY(beta::T) where {T} = BetaY{T}(beta)

function _transform(boost_param::BetaY, p::M) where {M<:AbstractFourMomentum}
function QEDbase._transform(boost_param::BetaY, p::M) where {M<:AbstractFourMomentum}
en = getE(p)
py = getY(p)

Expand Down Expand Up @@ -269,7 +269,7 @@ struct BetaZ{T<:Real} <: AbstractAxisBeta{T}
end

BetaZ(beta::T) where {T} = BetaZ{T}(beta)
function _transform(boost_param::BetaZ, p::M) where {M<:AbstractFourMomentum}
function QEDbase._transform(boost_param::BetaZ, p::M) where {M<:AbstractFourMomentum}
en = getE(p)
pz = getZ(p)

Expand Down
2 changes: 1 addition & 1 deletion src/lorentz_boost/boost_parameter/boost_axis/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Subtypes of `AbstractAxisBoostParameter{T}` are used to define specific boost tr
This abstract type is meant to be extended by concrete types to represent boosts along different Cartesian axes.
"""
abstract type AbstractAxisBoostParameter{T} <: AbstractBoostParameter end
abstract type AbstractAxisBoostParameter{T} <: QEDbase.AbstractBoostParameter end

function (::Type{BP})(boost_val::Real) where {T<:Real,BP<:AbstractAxisBoostParameter{T}}
return BP(T(boost_val))
Expand Down
4 changes: 3 additions & 1 deletion src/lorentz_boost/boost_parameter/boost_vector/beta.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ function _three_vector_square(beta_vec::BetaVector)
return bx^2 + by^2 + bz^2
end

@inline function _transform(beta_vec::BetaVector, p::M) where {M<:AbstractFourMomentum}
@inline function QEDbase._transform(
beta_vec::BetaVector, p::M
) where {M<:AbstractFourMomentum}
b2 = _three_vector_square(beta_vec)
if b2 == one(b2)
return p
Expand Down
6 changes: 3 additions & 3 deletions src/lorentz_boost/boost_parameter/boost_vector/types.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""
AbstractBoostVector <: AbstractBoostParameter
AbstractBoostVector <: QEDbase.AbstractBoostParameter
An abstract base type representing vector-like boost parameters, used to model Lorentz boosts
in any spatial dimension.
`AbstractBoostVector` extends [`AbstractBoostParameter`](@ref) and provides the framework for
`AbstractBoostVector` extends `QEDbase.AbstractBoostParameter` and provides the framework for
describing boosts that act in multiple spatial dimensions simultaneously, typically in
three-dimensional space. This type is designed to support vector representations of
velocities (in units of the speed of light) associated with Lorentz transformations in
Expand All @@ -21,4 +21,4 @@ For example:
- [`BetaVector{T}`](@ref): A concrete subtype representing a boost vector with velocity components ``\\beta_x``, ``\\beta_y``, and ``\\beta_z`` (in units of the speed of light).
"""
abstract type AbstractBoostVector <: AbstractBoostParameter end
abstract type AbstractBoostVector <: QEDbase.AbstractBoostParameter end
13 changes: 6 additions & 7 deletions src/lorentz_boost/types.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@

"""
Boost{V<:AbstractBoostParameter} <: AbstractLorentzBoost
Boost{V<:QEDbase.AbstractBoostParameter} <: QEDbase.AbstractLorentzBoost
A concrete type representing a Lorentz boost transformation, parameterized by a boost
parameter `V`. The boost parameter can be either axis-specific or vector-like, depending
on the subtype of [`AbstractBoostParameter`](@ref) used. The `Boost` type is used to perform
on the subtype of `QEDbase.AbstractBoostParameter` used. The `Boost` type is used to perform
Lorentz boosts on four-vectors (such as four-momentum or four-position) between different
inertial frames in special relativity.
Expand Down Expand Up @@ -69,13 +68,13 @@ four-vector will not change the invariant quantity.
## See Also
* [`AbstractBoostParameter`](@ref): Base type for specific kinds of boost parameters.
* `QEDbase.AbstractBoostParameter`: Base type for specific kinds of boost parameters.
* [`BetaX`](@ref): Boost parameter for the x-axis.
* [`BetaY`](@ref): Boost parameter for the y-axis.
* [`BetaZ`](@ref): Boost parameter for the z-axis.
* [`BetaVector`](@ref): Vector of boost parameters for boosts in multiple spatial directions.
"""
struct Boost{T<:AbstractBoostParameter} <: AbstractLorentzBoost
struct Boost{T<:QEDbase.AbstractBoostParameter} <: QEDbase.AbstractLorentzBoost
param::T
end
boost_type(::Boost{T}) where {T} = T
Expand All @@ -85,8 +84,8 @@ Base.eltype(boost::Boost) = eltype(boost.param)
Boost(x::Real) = Boost(BetaX(x))
Boost(x::Real, y::Real, z::Real) = Boost(BetaVector(x, y, z))

function _transform(boost::Boost, p::AbstractFourMomentum)
return _transform(boost.param, p)
function QEDbase._transform(boost::Boost, p::AbstractFourMomentum)
return QEDbase._transform(boost.param, p)
end

function Base.inv(boost::Boost)
Expand Down
170 changes: 0 additions & 170 deletions src/patch_QEDbase.jl

This file was deleted.

0 comments on commit ea741b3

Please sign in to comment.