Repository navigation
Releases: JuliaGNI/GeometricBrackets.jl
Release list
v0.3.0
GeometricBrackets v0.3.0
A PoissonTensor now wraps a rank-3 array instead of building one from a bracket, and
PoissonOperator follows that tensor's own stencil. Both break callers, so this is 0.3.0.
Breaking Changes
PoissonTensorwraps a rank-3 array. It is aDiscreteBracketaround an
AbstractArray{DT, 3}whose extents agree and whose axes are1:N; a wrappedGridTensor
carries the grid. The fieldsnx,nvandfare gone, and its parameters are{DT, TT}—
TTis the array's type. Non-cubic extents throw aDimensionMismatch, offset axes an
ArgumentError.PoissonTensor{DT, Arakawa{DT}}no longer forms, so
PoissonTensor{Float64, Arakawa{Float64}}throws aTypeError.
PoissonTensor(DT, nx, nv, f)still builds the tensor of a bracket on annx × nvgrid.PoissonOperatorsums over the stencil of its tensor, not a fixed 3 × 3 loop.- MultiIndexArrays is a dependency again, for the
GridTensoraPoissonTensorwraps.
Added
poisson_apply!(Pc, b, û, c)writes the product ofpoisson_applyintoPcand returns it,
for everyDiscreteBracket. OnlyArakawawritesPcdirectly and allocates nothing on
Vectors, so a time step can call it repeatedly; any other bracket copies and allocates.Pc
takes any element type the result converts to, as withmul!. A wrong length throws a
DimensionMismatch, and forArakawaaPcsharing memory withûorcanArgumentError.poisson_matrix,poisson_applyandpoisson_derivativeon aPoissonTensor.
poisson_matrixgives the bracket's matrix at a stateû,poisson_derivativethe tensor
itself, which is constant, andpoisson_applyis matrix-free.
Changed
[compat] CairoMakieis"0.15", from"0.12, 0.13, 0.14, 0.15": only 0.15 is tested and
0.12 fails to precompile on Julia 1.13.[compat] StaticArraysis"1.9.13", from"1", the
floor SimpleSolvers 0.14.1 already requires.Pkg.test()no longer runs the doctests.test/quality/doctests.jlis the groupdoctests;
Pkg.test(test_args = ["doctests"])runs it, and CI keeps the Doctests job as their runner.
Fixed
PoissonOperator(tensor, h)has the element typepromote_type(eltype(tensor), eltype(h)).
In 0.2.0 aFloat32tensor with aFloat64Hamiltonian rounded its values, and aFloat64tensor
with a complex one madeMatrix(po)throwInexactError.- The docs no longer say every bracket is skew-symmetrised. A
ConstantBracketbuilt from a
given matrix and aPoissonTensorare antisymmetric only if what they are given is. This fixes
K7, and thejacobi_residualdocstring now says its cyclic sum is the Jacobiator only for an
antisymmetric matrix.
Merged pull requests:
- CI: coverage from Julia 1 on ubuntu, save the cache only from a job that succeeds (#34) (@michakraus)
- Move the doctests into their own test group (#35) (@michakraus)
- Move the top-level test files that mirror no source file (#36) (@michakraus)
- PoissonTensor wraps a rank-3 tensor, and PoissonOperator follows its stencil (#37) (@michakraus)
- Restrict the CairoMakie compat bound to 0.15 (#38) (@michakraus)
- Say which brackets are skew-symmetrised, and add a PoissonTensor row (#39) (@michakraus)
- Add poisson_apply! for Arakawa, the in-place form of poisson_apply (#40) (@michakraus)
- Raise the StaticArrays compat floor to 1.9.13 (#41) (@michakraus)
v0.2.0
GeometricBrackets v0.2.0
The two PoissonTensor checks under Breaking Changes reject input that 0.1.2 accepts, so this release is 0.2.0. A package that builds a PoissonTensor from an Arakawa of another element type has to change that call before it allows 0.2.
Breaking Changes
PoissonTensor(DT, nx, nv, f)throws aDimensionMismatchwhenfis anArakawaon a grid other thannx × nv. Before, it built the tensor, and its entries were wrong with no error: theArakawawrapped its offsets on its own grid, not on the grid of the tensor.PoissonTensor(DT, nx, nv, f)throws anArgumentErrorwhenfis anArakawawhose element type is notDT. Before,PoissonTensor(Float32, …, Arakawa{Float64})gaveFloat64entries, and aPoissonOperatoron it was anAbstractMatrix{Float32}withFloat64entries.
Changed
- The floors rise to GeometricBase 0.15.0, CompactBasisFunctions 0.4.2, QuadratureRules 0.2.2, SimpleSolvers 0.14.1 and SimpleSplines 0.3.1, because GeometricBase 0.15 declares its stubs public and requires Julia 1.11.
- The test suite mirrors
src/, uses the groupscoreandslow, and has its environment intest/Project.toml; a newtest/quality/doctests.jlruns the doctests. The test count is unchanged. test/Project.tomlanddocs/Project.tomlno longer repeat a[compat]bound ofProject.toml.- Unused bindings in the tests and a keyword spelling in
src/integrators.jlare cleaned up; no behaviour changes.
Merged pull requests:
- Migrate the test suite to SafeTestsets groups (part M11) (#22) (@michakraus)
- Check the Arakawa grid and element type in the PoissonTensor constructor (#23) (@michakraus)
- Update SimpleSolvers requirement to 0.14.0 in /docs (#24) (@dependabot[bot])
- Update CompactBasisFunctions requirement to 0.4.1 in /docs (#25) (@dependabot[bot])
- Update Documenter requirement to 1.19.0 in /test (#27) (@dependabot[bot])
- Update Aqua requirement to 0.8.18 in /test (#28) (@dependabot[bot])
- Keep the SymPy == true comparison, suppress lint (#29) (@michakraus)
- Remove the compat entries that test and docs share with the root (#30) (@michakraus)
- Clear the remaining fatou findings in src (#31) (@michakraus)
- Delete three unused test bindings (fatou part R7) (#32) (@michakraus)
- Raise the floors to GeometricBase 0.15.0 and set version 0.2.0 (#33) (@michakraus)
v0.1.2
GeometricBrackets v0.1.2
This patch release changes and removes API because 0.1.1 was released the same day,
and no package outside this repository depends on these names in a registered release.
Fixed
Arakawa(nx, nv, hx, hv) accepts spacings of any Real types; the element type is
that of inv(hx) * inv(hv) / 12. In 0.1.1 integer spacings threw InexactError and
mixed types a MethodError.
Changed
PoissonTensorandPoissonOperatorindexing off the grid throwsBoundsError
(wasAssertionErrorfrom@assert, which may be compiled out). Both the
CartesianIndexand the linear-index methods ofPoissonTensorcheck;
PoissonOperatorusescheckbounds.PoissonOperator(tensor, h)throwsDimensionMismatchwhenlength(h)is not
nx * nv.Array(pt)materialises aPoissonTensor, andMatrix(po)aPoissonOperator
(it is anAbstractMatrix). The twoBase.materializemethods are removed,
becauseBase.materializeis not public Base API. Note for callers:
Base.materialize(x)now falls back to Base's identity and returns the lazy
object itself rather than an error._apply_P_h!and_apply_P_ϕ!are no longer exported (leading-underscore
internals; reach them asGeometricBrackets._apply_P_h!or by explicitusing GeometricBrackets: _apply_P_h!). This also removes the name clash with
ReducedBasisMethods, which exports the same names in its released versions.
PoissonTensorandPoissonOperatorstay exported and now have docstrings, shown
on the library page._apply_P_h!throwsDimensionMismatchunlessPf,fandhhave length
nx * ny, the number of grid nodes, andArgumentErrorif any input has
non-1-based indexing. It checked only that the three lengths were equal, so its
@inboundsloop read and wrote past the end of equally short vectors. The
tests cover the length checks of_apply_P_h!and_apply_P_ϕ!.poisson_apply(::Arakawa, û, c)evaluateshx·hv·[c, û]with_apply_P_h!;
same values to rounding, about two orders of magnitude faster at n = 64 and n = 256,
allocating only its output.size(::PoissonTensor)infers a concreteNTuple{3, Int};PoissonOperator
indexing no longer allocates a neighbour vector per entry.
Removed
- Dependencies
OffsetArraysandMultiIndexArrays. The Arakawa sign tables are
one plainArray{Int,4}(their sum, the only way they were read); the 3 × 3
periodic stencil ofPoissonOperatorand the linear-to-Cartesian conversion are
written in the package withCartesianIndices, so no non-public name of another
package is used. - The uncalled helpers
inc,decand the collision stencils_apply_C!,
_apply_Cρ!,_apply_Cρ²!,_apply_Δᵥ!(never exported, no caller, no test).
Corrections to the 0.1.1 entry
PoissonTensor/PoissonOperatorare not a "weak form":PoissonOperator * gis
the bracket at the grid nodes with nohx·hvquadrature weight.PoissonTensor
holdsTwith[g, h]_I = Σ_{J,K} T[I,J,K] g_J h_K.- The Jacobi band "0.50–0.74 over 40 random states" is one sample; the
state-independent figure isstructure_constant_residual(poisson_derivative(b, û)) == 0.5on n × n grids, n = 5..8, now asserted in the tests. - "a test on a 5 × 3 grid pins every index bound" overstated the coverage in 0.1.1;
the tests now cover every index check of both types.
Tests added: real-typed spacings, _apply_P_ϕ! against _apply_P_h!, the 0.5
structure-constant residual, Array(pt) contracted against the independent Jacobian,
and the BoundsError/DimensionMismatch cases.
Merged pull requests:
- Address the review findings of #19 (patch release 0.1.2) (#21) (@michakraus)
v0.1.1
GeometricBrackets v0.1.1
Added — the grid-based Arakawa bracket, a DiscreteBracket on a finite-difference grid
Moved in from ReducedBasisMethods' src/gridbased/. Three files arrive:
src/arakawa.jl—Arakawa(nx, nv, hx, hv), Arakawa's discretisation of the canonical
bracket on a doubly periodicnx × nvgrid. It is aDiscreteBracketin Lie-Poisson form,
P(f)_{JK} = hx·hv·Σ_I f_I A(I,J,K), linear in the grid state:poisson_applycontracts the
3 × 3 stencil and assembles no matrix, andpoisson_derivativeis the constant tensor
hx·hv·A. The assembled matrix satisfiesP == -P'bit for bit. The Jacobi identity does
not hold:jacobi_residualis of order one and flat under refinement, 0.50–0.74 over 40
random states on grids of 5 to 8 nodes a side. Called asarakawa(I, J, K), it returns the
stencil coefficient that one passes toPoissonTensoras itsf. The constructor refuses a
grid with fewer than 3 nodes in a direction, where the two neighbours of a node coincide.src/poisson_tensors.jl—PoissonTensor, anN × N × Ntensor discretising the weak
form ofg[f,h]on annx × nvphase-space grid, andPoissonOperator, the weak form of
f ↦ [f,h]for a fixed Hamiltonian. Both index lazily through a stencil, so neither
materialises untilBase.materializeis called.src/bracket_operators.jl—_apply_P_h!and_apply_P_ϕ!, the same bracket applied
matrix-free to a vector, plus the Lenard-Bernstein-style collision stencils_apply_C!,
_apply_Cρ!,_apply_Cρ²!and_apply_Δᵥ!that shared the file.
The bodies in poisson_tensors.jl and bracket_operators.jl are byte-identical to their
source, except the three index assertions of PoissonTensor, which test
I in CartesianIndices((nx, nv)) where the source called a pirated Base.isvalid.
New dependencies: OffsetArrays, for the Arakawa sign tables, and MultiIndexArrays 0.1.1
(JuliaGNI/MultiIndexArrays.jl#2), which owns multiindex and _stencil_indices. Its
linearindex bounds the second component by nv, where the ReducedBasisMethods copy
checked i ≤ nv; a test on a 5 × 3 grid pins every index bound.
No type piracy: Aqua's check is clean, and the two Base.materialize overloads dispatch on
the package's own types.
Merged pull requests:
- Make Arakawa a DiscreteBracket (#19) (@michakraus)
v0.1.0
GeometricBrackets v0.1.0
Initial release
First registered release. GeometricBrackets provides structure-preserving discretisations of
the Poisson, metric and metriplectic brackets of Hamiltonian partial differential equations:
discrete function spaces, brackets with a common poisson_matrix / jacobi_residual interface,
discrete Hamiltonians and Casimirs, geometric integrators, and diagnostics.
The package was developed in the open against main and never carried a released version before
this one, so this release is everything in the changelog. Its section runs to some 1600 lines —
well past what a comment holds — so it is indexed here and reproduced in full at
CHANGELOG.md.
What this release contains
- Added —
pinvinverts the torus derivative on the modes that have one - Changed — the package is renamed to GeometricBrackets
- Changed — the export list says which names are the interface
- Fixed — a conditional whose branches were identical
- Changed — the memoised tables say they are the cache
- Added — a testset for the one-axis
TensorSplineSpace - Added — an Aqua baseline, which this package had never had
- Fixed —
CollisionBracketis now frame-covariant on a mapped domain - Added —
PulledBack, mapped domain pullback onto the parameter space - Added —
PolarSplineSpace, aDiscreteSpaceon a parameter square with a pole - Changed —
CollisionBrackettakes any planar spline space - Fixed — the
[sources]comments promised a retirement a version bump does not earn - Changed —
scripts/check.jldrops its two failure-list accessors - Fixed — the SimpleSplines compat bound, after its 0.1.0 release
- Changed — the Julia floor is 1.11, which is what
[sources]has always required - Fixed —
scripts/resolvesSimpleSolversfrom the registry - Added —
MetriplecticFlow, andAbstractFlowunder both kinds of flow - Added —
CollisionBracket, the §5.2 collision-like bracket, collapsed - Added —
MetricBracket, the symmetric half of a metriplectic structure - Added —
TensorSplineSpace, a tensor-productDiscreteSpace - Added —
verify_metric_collapse.jl - Fixed — section 7 measured its denominator bound on too small a set
- Fixed — the Julia/Python agreement table read as a live claim
- Tracks the reshaped SimpleSplines
- Added — Nambu's Liouville criterion, as section 7 of
verify_kdv_nambu.jl - Added —
verify_zeitlin_three_bracket.jl - Fixed — checks in the fable scripts that could not fail
- Added — a driver for the fable scripts
- Added — an adversarial re-check of the structure-function bracket
- Added — an adversarial re-check of the matrix structure-function bracket
- Added — shared verification machinery for the fable branch
- Added — Vlasov–Poisson on a bounded domain as Lie-Poisson on
u(N)* - Added — semidirect-product brackets via pointwise flat coordinates
- Added — the structure-function bracket on
T^{2n} - Added — the matrix structure-function bracket on
gl(N) - Added — multi-field structure functions, and derivative dependence
- Added — the four-bracket manuscript
- Changed —
scripts/check.jllearned the convergence idiom - Fixed — a relative
[sources]path does not compose - The mixed two-field formulation
K0is no longer densifiedkernel_operator- The linear solver for the mixed system is a correctness constraint
- Requires SimpleSolvers 0.13
- Changed — the KdV sign convention is now the textbook one
- Added — a spectral parameter for the Miura chart
- Changed —
LagrangeSpacestores its tabulation sparsely - Removed — the local
LapackLU - Fixed
- Added — documentation
- The RK4 question
- Added — the initial feature set
- The Newton residual tolerance
- Performance
Merged pull requests:
- Verify the three-bracket mechanism on the Zeitlin truncation (#1) (@michakraus)
- Verification scripts from the fable-brackets investigation (#2) (@michakraus)
- Update to the reshaped SimpleSplines (#3) (@michakraus)
- Add Nambu's Liouville criterion to verify_kdv_nambu.jl (#4) (@michakraus)
- Add the metric-bracket half: MetricBracket, CollisionBracket, TensorSplineSpace and MetriplecticFlow (#5) (@michakraus)
- Measure section 7's denominator bound on the right set (#6) (@michakraus)
- Follow SimpleSplines 0.1.0 in the compat bound (#7) (@michakraus)
- Drop the check harness's dead failure accessors (#8) (@michakraus)
- Say registered, not released, in [sources] (#9) (@michakraus)
- CompatHelper: bump compat for SimpleSplines to 0.2, (keep existing compat) (#10) (@github-actions[bot])
- CompatHelper: bump compat for SimpleSolvers to 0.14, (keep existing compat) (#11) (@github-actions[bot])
- CompatHelper: bump compat for CompactBasisFunctions to 0.4, (keep existing compat) (#12) (@github-actions[bot])
- Add the polar discrete space and the mapped-domain pullback (#13) (@michakraus)
- Read the physical frame in CollisionBracket (#14) (@michakraus)
- Close the metric-bracket review follow-ups: exports, shared generics, an Aqua baseline and the CHANGELOG fold (#16) (@michakraus)
- Add a pseudoinverse for the torus derivative (#17) (@michakraus)